/* Visual previews for objects placed on the white panel canvas */

/* ── Design tokens (professional UI kit) ── */
.panel-canvas {
  --ui-bg: #ffffff;
  --ui-surface: #f8fafc;
  --ui-surface-muted: #f1f5f9;
  --ui-border: #e2e8f0;
  --ui-border-strong: #cbd5e1;
  --ui-text: #0f172a;
  --ui-text-secondary: #475569;
  --ui-text-muted: #94a3b8;
  --ui-accent: #0071e3;
  --ui-accent-deep: #0060c7;
  --ui-accent-soft: rgba(0, 113, 227, 0.1);
  --ui-success: #34c759;
  --ui-danger: #ef4444;
  --ui-warning-bg: #fffbeb;
  --ui-warning-border: #fde68a;
  --ui-warning-text: #92400e;
  --ui-radius-sm: 6px;
  --ui-radius: 10px;
  --ui-radius-lg: 12px;
  --ui-radius-full: 999px;
  --ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --ui-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --ui-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --ui-shadow-inset: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.panel-object .obj-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.35;
  color: var(--ui-text);
  pointer-events: none;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.panel-object[data-text-align="left"] .obj-inner {
  justify-content: flex-start;
  text-align: left;
}

.panel-object[data-text-align="center"] .obj-inner {
  justify-content: center;
  text-align: center;
}

.panel-object[data-text-align="right"] .obj-inner {
  justify-content: flex-end;
  text-align: right;
}

.panel-object[data-text-align="center"][data-type="text-area"] .obj-inner,
.panel-object[data-text-align="right"][data-type="text-area"] .obj-inner {
  align-items: flex-start;
}

.panel-object[data-text-align="center"][data-type="group-box"] .group-title {
  left: 50%;
  transform: translateX(-50%);
}

.panel-object[data-text-align="right"][data-type="group-box"] .group-title {
  left: auto;
  right: 12px;
}

.panel-object[data-text-align="center"][data-type="card"] .card-title {
  text-align: center;
}

.panel-object[data-text-align="right"][data-type="card"] .card-title {
  text-align: right;
}

/* ── Text ── */
.panel-object[data-type="label"] .obj-inner {
  justify-content: flex-start;
  padding: 0 4px;
  font-weight: 500;
}

.panel-object[data-type="title"] .text-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-object[data-type="subtitle"] .text-subtitle {
  font-size: 17px;
  font-weight: 600;
}

.panel-object[data-type="caption"] .text-caption {
  font-size: 12px;
  color: var(--ui-text-muted);
  letter-spacing: 0.01em;
}

.panel-object[data-type="link"] .text-link,
.panel-object[data-type="link-button"] .link-btn-text {
  color: var(--ui-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.panel-object[data-type="link"] .text-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.panel-object[data-type="label"] .obj-inner > span,
.panel-object[data-type="title"] .text-title,
.panel-object[data-type="subtitle"] .text-subtitle,
.panel-object[data-type="caption"] .text-caption,
.panel-object[data-type="link"] .text-link,
.panel-object[data-type="link-button"] .link-btn-text {
  pointer-events: auto;
}

.panel-object.selected[data-type="label"],
.panel-object.selected[data-type="title"],
.panel-object.selected[data-type="subtitle"],
.panel-object.selected[data-type="caption"],
.panel-object.selected[data-type="link"],
.panel-object.selected[data-type="link-button"] {
  cursor: text;
}

/* ── Buttons ── */
.panel-object[data-type="button"] .obj-inner,
.panel-object[data-type="fab"] .obj-inner {
  background: linear-gradient(180deg, #0a84ff 0%, var(--ui-accent) 100%);
  color: #fff;
  border-radius: var(--ui-radius);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--ui-shadow-sm), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.panel-object[data-type="button"].platform-android .obj-inner {
  background: linear-gradient(180deg, #7c6bdc 0%, #6750a4 100%);
  border-radius: var(--ui-radius-full);
  text-transform: none;
  font-size: 14px;
  letter-spacing: 0.01em;
  box-shadow: var(--ui-shadow-md);
}

.panel-object[data-type="button"].platform-windows .obj-inner {
  background: linear-gradient(180deg, #0078d4 0%, #0067c0 100%);
  border-radius: var(--ui-radius-sm);
  box-shadow: var(--ui-shadow-sm);
}

/* ── Windows Forms (classic .NET) ── */
.panel-object.platform-winforms .obj-inner {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
}

.panel-object[data-type="button"].platform-winforms .obj-inner {
  background: linear-gradient(180deg, #fefefe 0%, #e1e1e1 100%);
  color: #000;
  border: 1px solid #707070;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 #fff;
}

.panel-object[data-type="text-field"].platform-winforms .obj-inner,
.panel-object[data-type="secure-field"].platform-winforms .obj-inner,
.panel-object[data-type="number-field"].platform-winforms .obj-inner,
.panel-object[data-type="search-field"].platform-winforms .obj-inner,
.panel-object[data-type="text-area"].platform-winforms .obj-inner,
.panel-object[data-type="picker"].platform-winforms .obj-inner,
.panel-object[data-type="date-picker"].platform-winforms .obj-inner {
  background: #fff;
  border: 1px solid #7a7a7a;
  border-radius: 0;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.08);
  color: #000;
}

.panel-object[data-type="group-box"].platform-winforms .group-frame {
  border: 1px solid #c0c0c0;
  border-radius: 0;
  background: #f0f0f0;
}

.panel-object[data-type="tab-control"].platform-winforms .tab-control-tab {
  border: 1px solid #c0c0c0;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #fefefe 0%, #e8e8e8 100%);
  color: #000;
}

.panel-object[data-type="tab-control"].platform-winforms .tab-control-tab.active {
  background: #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.panel-object[data-type="tab-control"].platform-winforms .tab-control-well {
  background: #f0f0f0;
  border: 1px solid #c0c0c0;
}

.panel-object[data-type="list"].platform-winforms .list-inner,
.panel-object[data-type="table"].platform-winforms .table-inner {
  border: 1px solid #7a7a7a;
  background: #fff;
  border-radius: 0;
}

.panel-object[data-type="checkbox"].platform-winforms .check-box,
.panel-object[data-type="radio"].platform-winforms .radio-circle {
  border-radius: 0;
  border-color: #707070;
}

.panel-object[data-type="menu-bar"].platform-winforms .menu-bar-inner,
.panel-object[data-type="toolbar"].platform-winforms .toolbar-inner {
  background: #f0f0f0;
  border: 1px solid #c0c0c0;
  color: #000;
}

.panel-object[data-type="status-bar"].platform-winforms .obj-inner {
  background: #f0f0f0;
  border-top: 1px solid #c0c0c0;
  color: #000;
  justify-content: flex-start;
  padding: 0 8px;
}

.panel-object[data-type="status-bar"].platform-winforms .status-text,
.panel-object[data-type="status-bar"].platform-winforms .status-item {
  font-size: 11px;
  font-weight: 400;
}

.panel-object[data-type="icon-button"] .obj-inner {
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="icon-button"] .icon-glyph {
  font-size: 17px;
  color: var(--ui-accent);
}

.panel-object[data-type="link-button"] .obj-inner {
  background: transparent;
  justify-content: flex-start;
  padding-left: 4px;
}

.panel-object[data-type="fab"] .obj-inner {
  border-radius: 50%;
  padding: 0;
  box-shadow: var(--ui-shadow-md), 0 2px 8px rgba(0, 113, 227, 0.35);
}

.panel-object[data-type="fab"] .fab-glyph {
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

/* ── Input fields ── */
.panel-object[data-type="text-field"] .obj-inner,
.panel-object[data-type="secure-field"] .obj-inner,
.panel-object[data-type="number-field"] .obj-inner,
.panel-object[data-type="search-field"] .obj-inner,
.panel-object[data-type="picker"] .obj-inner,
.panel-object[data-type="date-picker"] .obj-inner,
.panel-object[data-type="time-picker"] .obj-inner,
.panel-object[data-type="color-picker"] .obj-inner {
  justify-content: flex-start;
  padding: 0 12px;
  gap: 8px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-text-muted);
  box-shadow: var(--ui-shadow-inset);
  font-size: 15px;
}

.panel-object[data-type="picker"] .obj-inner,
.panel-object[data-type="date-picker"] .obj-inner,
.panel-object[data-type="time-picker"] .obj-inner,
.panel-object[data-type="color-picker"] .obj-inner {
  justify-content: space-between;
}

.panel-object[data-type="text-field"].platform-android .obj-inner,
.panel-object[data-type="secure-field"].platform-android .obj-inner,
.panel-object[data-type="search-field"].platform-android .obj-inner {
  border-radius: 4px;
  border-color: #79747e;
  background: #fff;
}

.panel-object[data-type="text-field"].platform-windows .obj-inner,
.panel-object[data-type="secure-field"].platform-windows .obj-inner {
  border-radius: 4px;
  background: #fff;
}

/* ── Web / HTML platform styling ── */
.panel-object.platform-web .obj-inner {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.panel-object[data-type="button"].platform-web .obj-inner {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: var(--ui-radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #1d4ed8;
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="link"].platform-web .text-link,
.panel-object[data-type="link-button"].platform-web .link-btn-text {
  color: #2563eb;
  text-decoration: underline;
}

.panel-object[data-type="icon-button"].platform-web .obj-inner {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.panel-object[data-type="fab"].platform-web .obj-inner {
  background: #2563eb;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.panel-object[data-type="text-field"].platform-web .obj-inner,
.panel-object[data-type="secure-field"].platform-web .obj-inner,
.panel-object[data-type="number-field"].platform-web .obj-inner,
.panel-object[data-type="search-field"].platform-web .obj-inner,
.panel-object[data-type="text-area"].platform-web .obj-inner,
.panel-object[data-type="picker"].platform-web .obj-inner,
.panel-object[data-type="date-picker"].platform-web .obj-inner,
.panel-object[data-type="time-picker"].platform-web .obj-inner {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
}

.panel-object[data-type="checkbox"].platform-web .check-box {
  border-color: #2563eb;
  border-radius: 3px;
}

.panel-object[data-type="radio"].platform-web .radio-circle {
  border-color: #2563eb;
}

.panel-object[data-type="toggle"].platform-web .switch-track.on {
  background: #2563eb;
}

.panel-object[data-type="slider"].platform-web .slider-fill {
  background: #2563eb;
}

.panel-object[data-type="segmented-control"].platform-web .seg-item.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.panel-object[data-type="nav-bar"].platform-web .obj-inner {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  font-weight: 600;
}

.panel-object[data-type="nav-bar"].platform-web .nav-back {
  color: #2563eb;
}

.panel-object[data-type="sidebar"].platform-web .obj-inner {
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
}

.panel-object[data-type="card"].platform-web .obj-inner {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.panel-object[data-type="group-box"].platform-web .group-frame {
  border-color: #d1d5db;
  border-radius: 6px;
}

.panel-object[data-type="alert"].platform-web .obj-inner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  color: #92400e;
}

.panel-object[data-type="chip"].platform-web .obj-inner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
}

.panel-object[data-type="tab-control"].platform-web .tab-control-inner {
  border-color: #e5e7eb;
}

.panel-object[data-type="tab-control"].platform-web .tab-control-tab.active {
  border-color: #2563eb;
  color: #2563eb;
}

.panel-object[data-type="tab-bar"].platform-web .obj-inner {
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.panel-object[data-type="secure-field"] .secure-dots {
  letter-spacing: 2px;
  color: #1a1a1a;
}

.panel-object[data-type="search-field"] .search-icon {
  font-size: 16px;
  color: #8e8e93;
}

.panel-object[data-type="text-area"] .obj-inner {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px 12px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-text-muted);
  font-size: 14px;
  box-shadow: var(--ui-shadow-inset);
}

.panel-object[data-type="color-picker"] .color-swatch {
  width: 22px;
  height: 22px;
  background: var(--ui-accent);
  border-radius: var(--ui-radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--ui-shadow-xs);
  flex-shrink: 0;
}

.panel-object[data-type="picker"] .picker-arrow {
  font-size: 9px;
  color: var(--ui-text-muted);
  opacity: 0.8;
}

/* ── iOS wheel picker ── */
.panel-object[data-type="wheel-picker"] .obj-inner,
.panel-object[data-type="date-picker"].platform-ios .obj-inner,
.panel-object[data-type="time-picker"].platform-ios .obj-inner {
  padding: 0;
  overflow: hidden;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  color: #1a1a1a;
  box-shadow: none;
}

.wheel-picker {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.wheel-picker-multi {
  gap: 0;
}

.wheel-picker-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 1;
}

.wheel-picker-column {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.wheel-picker-item {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.15;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  cursor: context-menu;
}

.wheel-picker-item-selected {
  font-size: 20px;
  font-weight: 400;
  color: #000;
}

.wheel-picker-item-near {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.45);
}

.wheel-picker-item-far {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.22);
}

.panel-canvas.fidelity-platform-native .panel-object[data-type="wheel-picker"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="date-picker"].platform-ios .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="time-picker"].platform-ios .obj-inner {
  background: #fff !important;
  border-color: #c7c7cc !important;
}

.palette-item-icon.icon-wheel-picker {
  border: 1px solid #8b92a8;
  border-radius: 3px;
  overflow: hidden;
}

.palette-item-icon.icon-wheel-picker::before,
.palette-item-icon.icon-wheel-picker::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1px;
  background: #8b92a8;
}

.palette-item-icon.icon-wheel-picker::before {
  top: 7px;
  box-shadow: 0 4px 0 #8b92a8, 0 8px 0 #8b92a8;
}

.palette-item-icon.icon-wheel-picker::after {
  bottom: 7px;
  opacity: 0.35;
}

/* ── Toggle ── */
.panel-object[data-type="toggle"] .obj-inner {
  justify-content: flex-end;
  padding-right: 4px;
}

.panel-object[data-type="toggle"] .switch-track {
  width: 51px;
  height: 31px;
  background: #e2e8f0;
  border-radius: var(--ui-radius-full);
  position: relative;
  box-shadow: var(--ui-shadow-inset);
}

.panel-object[data-type="toggle"] .switch-track.on {
  background: var(--ui-success);
}

.panel-object[data-type="toggle"] .switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.panel-object[data-type="toggle"] .switch-track.on .switch-thumb {
  left: 22px;
}

/* ── Checkbox / Radio ── */
.panel-object[data-type="checkbox"] .obj-inner,
.panel-object[data-type="radio"] .obj-inner {
  justify-content: flex-start;
  gap: 8px;
  padding-left: 4px;
}

.panel-object[data-type="checkbox"] .check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ui-accent);
  border-radius: 5px;
  flex-shrink: 0;
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="radio"] .radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ui-accent);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-xs);
}

/* ── Slider ── */
.panel-object[data-type="slider"] .obj-inner {
  padding: 0 8px;
}

.panel-object[data-type="slider"] .slider-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: var(--ui-radius-full);
  position: relative;
}

.panel-object[data-type="slider"] .slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--ui-accent);
  border-radius: var(--ui-radius-full);
}

.panel-object[data-type="slider"] .slider-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* ── Stepper ── */
.panel-object[data-type="stepper"] .obj-inner {
  justify-content: space-between;
  padding: 0 6px;
  background: var(--ui-surface-muted);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="stepper"] .stepper-btn {
  width: 30px;
  text-align: center;
  font-size: 18px;
  color: var(--ui-accent);
  font-weight: 500;
}

.panel-object[data-type="stepper"] .stepper-val {
  font-weight: 600;
  color: var(--ui-text);
  font-variant-numeric: tabular-nums;
}

/* ── Segmented control ── */
.panel-object[data-type="segmented-control"] .obj-inner {
  padding: 3px;
  background: var(--ui-surface-muted);
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
}

.panel-object[data-type="segmented-control"] .seg-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ui-text-secondary);
  border-radius: 7px;
  font-weight: 500;
}

.panel-object[data-type="segmented-control"] .seg-item.active {
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-sm);
  color: var(--ui-text);
  font-weight: 600;
}

/* ── Rating ── */
.panel-object[data-type="rating"] .stars {
  color: #f59e0b;
  font-size: 17px;
  letter-spacing: 3px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.panel-object[data-type="segmented-control"] .seg-control {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ── Media ── */
.panel-object[data-type="image"] .obj-inner {
  background: linear-gradient(145deg, var(--ui-surface) 0%, var(--ui-surface-muted) 100%);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text-muted);
  font-size: 12px;
  overflow: hidden;
}

.panel-object[data-type="camera"] .obj-inner {
  background: linear-gradient(145deg, var(--ui-surface) 0%, var(--ui-surface-muted) 100%);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text-muted);
  font-size: 12px;
  overflow: hidden;
}

.panel-object[data-type="image"] .media-image-display,
.panel-object[data-type="camera"] .media-image-display {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.panel-object[data-type="image"] .media-image-pick,
.panel-object[data-type="camera"] .media-image-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  cursor: pointer;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

.panel-object[data-type="image"] .media-image-pick-icon,
.panel-object[data-type="camera"] .media-image-pick-icon,
.panel-object[data-type="camera"] .camera-placeholder .media-image-pick-icon {
  font-size: 28px;
  line-height: 1;
}

.panel-object[data-type="image"] .media-image-pick-text,
.panel-object[data-type="camera"] .media-image-pick-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-accent);
}

.panel-object[data-type="logo"] .obj-inner {
  gap: 8px;
  padding: 0 14px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  color: var(--ui-text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="logo"] .logo-mark {
  font-size: 17px;
  color: var(--ui-accent);
  line-height: 1;
  flex-shrink: 0;
}

.panel-object[data-type="camera"] .camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  text-align: center;
}

.panel-object[data-type="image"] .media-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.preview-mode .panel-object[data-type="image"] .obj-inner,
body.preview-mode .panel-object[data-type="camera"] .obj-inner,
body.preview-mode-web-live .panel-object[data-type="image"] .obj-inner,
body.preview-mode-web-live .panel-object[data-type="camera"] .obj-inner,
.panel-object[data-type="image"] .obj-inner:has(.media-image-pick),
.panel-object[data-type="camera"] .obj-inner:has(.media-image-pick) {
  pointer-events: auto;
}

.panel-object[data-type="image"] .media-image-pick,
.panel-object[data-type="camera"] .media-image-pick {
  pointer-events: auto;
}

.panel-object[data-type="logo"] .logo-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-object[data-type="logo"].platform-web .obj-inner {
  background: #fff;
  border-color: #d1d5db;
}

.panel-object[data-type="logo"].platform-web .logo-mark {
  color: #2563eb;
}

.panel-object[data-type="icon"] .icon-glyph.large {
  font-size: 22px;
  color: var(--ui-accent);
}

.panel-object[data-type="avatar"] .obj-inner {
  background: linear-gradient(135deg, #0a84ff 0%, #5856d6 100%);
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="video"] .obj-inner {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--ui-radius-lg);
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--ui-shadow-md);
}

.panel-object[data-type="video"] .video-player {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.panel-object[data-type="video"] .video-frame-strip.hidden {
  display: none;
}

.panel-object[data-type="video"] .video-frame-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}

.panel-object[data-type="video"] .video-preview-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-object[data-type="video"] .video-frames-hint {
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
  padding: 2px 6px;
  flex-shrink: 0;
}

.panel-object[data-type="video"] .video-player-frames-only .video-controls .video-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.panel-object[data-type="video"] .video-element {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  background: #000;
}

.panel-object[data-type="video"] .video-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.panel-object[data-type="video"] .video-ctrl-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
  min-width: 32px;
  height: 28px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}

.panel-object[data-type="video"] .video-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.panel-object[data-type="video"] .video-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.panel-object[data-type="video"] .video-play {
  color: #fff;
  font-size: 22px;
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.panel-object[data-type="video"] .video-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

/* ── Layout ── */
.panel-object[data-type="separator"] .obj-inner,
.panel-object[data-type="divider-vertical"] .obj-inner {
  padding: 0;
}

.panel-object[data-type="separator"] .sep-line {
  width: 100%;
  height: 1px;
  background: var(--ui-border);
}

.panel-object[data-type="divider-vertical"] .sep-line.vertical {
  width: 1px;
  height: 100%;
  background: var(--ui-border);
}

.panel-object[data-type="spacer"] .spacer-box {
  width: 100%;
  height: 100%;
  border: 1px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 5px,
    rgba(148, 163, 184, 0.06) 5px,
    rgba(148, 163, 184, 0.06) 10px
  );
}

.panel-object[data-type="group-box"] .obj-inner {
  overflow: visible;
}

.panel-object[data-type="group-box"] .group-frame,
.panel-object[data-type="card"] .card-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  position: relative;
  background: var(--ui-surface);
}

.panel-object[data-type="group-box"] .group-frame {
  overflow: visible;
  pointer-events: none;
}

.panel-object[data-type="group-box"] .group-title {
  pointer-events: auto;
}

.panel-object[data-type="group-box"] .group-body {
  pointer-events: none;
}

.panel-object[data-type="card"] .card-frame {
  overflow: hidden;
}

.panel-object[data-type="group-box"] .group-title {
  position: absolute;
  top: 6px;
  left: 12px;
  z-index: 2;
  background: var(--ui-bg);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-object[data-type="card"] .card-frame {
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-md);
  border-color: var(--ui-border);
}

.panel-object[data-type="card"] .card-title {
  display: block;
  padding: 12px 14px 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ui-text);
}

.panel-object[data-type="card"] .card-body {
  flex: 1;
  margin: 0 14px 14px;
  background: var(--ui-surface-muted);
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  min-height: 40%;
}

.panel-object[data-type="group-box"] .group-body {
  position: absolute;
  inset: 24px 8px 8px;
  overflow: hidden;
}

.panel-object[data-type="group-box"] .group-body-active {
  outline: 1px dashed rgba(0, 122, 204, 0.55);
  outline-offset: -1px;
  background: rgba(0, 122, 204, 0.04);
  border-radius: 4px;
}

/* ── Feedback ── */
.panel-object[data-type="progress"] .obj-inner {
  padding: 0 4px;
}

.panel-object[data-type="progress"] .progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--ui-radius-full);
  overflow: hidden;
}

.panel-object[data-type="progress"] .progress-fill {
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, var(--ui-accent-deep), var(--ui-accent));
  border-radius: var(--ui-radius-full);
}

.panel-object[data-type="progress-circle"] .spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--ui-accent);
  border-radius: 50%;
}

.panel-object[data-type="gauge"] .obj-inner {
  flex-direction: column;
  gap: 4px;
}

.panel-object[data-type="gauge"] .gauge-arc {
  width: 80px;
  height: 40px;
  border: 6px solid #e2e8f0;
  border-bottom: none;
  border-radius: 80px 80px 0 0;
  border-top-color: var(--ui-accent);
  border-left-color: var(--ui-accent);
}

.panel-object[data-type="gauge"] .gauge-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-text);
  font-variant-numeric: tabular-nums;
}

.panel-object[data-type="badge"] .obj-inner {
  background: var(--ui-danger);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="chip"] .obj-inner {
  background: var(--ui-surface-muted);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-full);
  padding: 0 14px;
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="chip"] .chip-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-text-secondary);
}

.panel-object[data-type="alert"] .obj-inner {
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  background: var(--ui-warning-bg);
  border: 1px solid var(--ui-warning-border);
  border-radius: var(--ui-radius);
  font-size: 13px;
  color: var(--ui-warning-text);
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="alert"] .alert-icon {
  width: 20px;
  height: 20px;
  background: #f59e0b;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Navigation ── */
.panel-object[data-type="tab-bar"] .tab-bar-inner,
.panel-object[data-type="toolbar"] .toolbar-inner,
.panel-object[data-type="menu-bar"] .menu-bar-inner,
.panel-object[data-type="status-bar"] .status-bar-inner {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
}

.panel-object[data-type="tab-bar"] .obj-inner {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--ui-border);
  padding: 0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.panel-object[data-type="tab-bar"] .tab-item {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--ui-text-muted);
  padding: 5px 0;
  font-weight: 500;
}

.panel-object[data-type="tab-bar"] .tab-item.active {
  color: var(--ui-accent);
  font-weight: 700;
}

.panel-object[data-type="tab-control"] .obj-inner {
  padding: 0;
  background: var(--ui-surface-muted);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  overflow: hidden;
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="tab-control"] .tab-control-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--ui-surface-muted);
}

.panel-object[data-type="tab-control"] .tab-control-well {
  display: flex;
  width: 100%;
  height: 28px;
  min-height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ui-surface);
}

.panel-object[data-type="tab-control"] .tab-control--top .tab-control-well {
  align-items: flex-end;
  border-bottom: 1px solid var(--ui-border);
}

.panel-object[data-type="tab-control"] .tab-control--bottom .tab-control-well {
  align-items: flex-start;
  border-top: 1px solid var(--ui-border);
}

.panel-object[data-type="tab-control"] .tab-control-body {
  flex: 1;
  min-height: 0;
  background: var(--ui-bg);
}

.panel-object[data-type="tab-control"] .tab-control-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border-right: 1px solid var(--ui-border);
  color: var(--ui-text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.panel-object[data-type="tab-control"] .tab-control-tab.active {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-weight: 600;
}

.panel-object[data-type="tab-control"] .tab-control--top .tab-control-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ui-accent);
}

.panel-object[data-type="tab-control"] .tab-control--bottom .tab-control-tab.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ui-accent);
}

.panel-object[data-type="tab-control"] .tab-control-body-active {
  outline: 1px dashed rgba(0, 113, 227, 0.45);
  outline-offset: -1px;
  background: var(--ui-surface);
}

.panel-object.tab-host-hidden {
  display: none !important;
}

.panel-object[data-type="tab-control"] .tab-control-label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-object[data-type="tab-control"] .tab-control-close {
  font-size: 12px;
  line-height: 1;
  color: var(--ui-text-secondary);
  opacity: 0.55;
}

.panel-object[data-type="nav-bar"] .obj-inner {
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--ui-border);
  position: relative;
  backdrop-filter: blur(12px);
}

.panel-object[data-type="nav-bar"] .nav-back {
  position: absolute;
  left: 12px;
  font-size: 22px;
  color: var(--ui-accent);
  font-weight: 400;
}

.panel-object[data-type="nav-bar"] .nav-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.panel-object[data-type="toolbar"] .obj-inner {
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  justify-content: flex-start;
  padding: 0 10px;
  gap: 4px;
}

.panel-object[data-type="toolbar"] .toolbar-item {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-secondary);
}

.panel-object[data-type="menu-bar"] .menu-top-item,
.panel-object[data-type="toolbar"].platform-web .menu-top-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.panel-object[data-type="menu-bar"] .menu-top-item.has-dropdown .menu-item::after,
.panel-object[data-type="toolbar"].platform-web .menu-top-item.has-dropdown .menu-item::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}

.panel-object[data-type="menu-bar"] .menu-top-item.is-open .menu-item,
.panel-object[data-type="menu-bar"] .menu-top-item.has-dropdown:hover .menu-item,
.panel-object[data-type="toolbar"].platform-web .menu-top-item.is-open .menu-item,
.panel-object[data-type="toolbar"].platform-web .menu-top-item.has-dropdown:hover .menu-item {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  border-radius: 4px;
}

.panel-object[data-type="menu-bar"] .menu-dropdown,
.panel-object[data-type="toolbar"].platform-web .menu-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 180px;
  padding: 4px 0;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-md);
  z-index: 50;
}

.panel-object[data-type="menu-bar"] .menu-dropdown.hidden,
.panel-object[data-type="toolbar"].platform-web .menu-dropdown.hidden {
  display: none;
}

.panel-object[data-type="menu-bar"] .menu-dropdown-item,
.panel-object[data-type="toolbar"].platform-web .menu-dropdown-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  text-align: left;
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ui-text);
  cursor: pointer;
}

.panel-object[data-type="menu-bar"] .menu-dropdown-item:hover,
.panel-object[data-type="toolbar"].platform-web .menu-dropdown-item:hover {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.panel-object[data-type="menu-bar"].platform-winforms .menu-dropdown {
  background: #fff;
  border-color: #c0c0c0;
  border-radius: 0;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.18);
}

.panel-object[data-type="menu-bar"].platform-winforms .menu-dropdown-item {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  color: #000;
}

.panel-object[data-type="menu-bar"].platform-winforms .menu-dropdown-item:hover {
  background: #0078d7;
  color: #fff;
}

body:not(.preview-mode) .panel-object[data-type="menu-bar"] .menu-top-item,
body:not(.preview-mode) .panel-object[data-type="menu-bar"] .menu-dropdown-item,
body:not(.preview-mode) .panel-object[data-type="toolbar"].platform-web .menu-top-item,
body:not(.preview-mode) .panel-object[data-type="toolbar"].platform-web .menu-dropdown-item {
  pointer-events: auto;
  cursor: pointer;
}

body.preview-mode .panel-object[data-type="menu-bar"] .menu-top-item,
body.preview-mode .panel-object[data-type="menu-bar"] .menu-dropdown-item,
body.preview-mode .panel-object[data-type="toolbar"].platform-web .menu-top-item,
body.preview-mode .panel-object[data-type="toolbar"].platform-web .menu-dropdown-item {
  pointer-events: auto;
  cursor: pointer;
}

.panel-object[data-type="menu-bar"] .obj-inner,
.panel-object[data-type="toolbar"].platform-web .obj-inner {
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  justify-content: flex-start;
  padding: 0 10px;
  overflow: visible;
}

.panel-object[data-type="menu-bar"].menu-dropdown-open,
.panel-object[data-type="toolbar"].platform-web.menu-dropdown-open {
  overflow: visible;
}

.panel-object[data-type="menu-bar"] .menu-item,
.panel-object[data-type="toolbar"].platform-web .menu-item {
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-text-secondary);
}

.panel-object[data-type="status-bar"] .obj-inner {
  background: var(--ui-bg);
  justify-content: space-between;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-object[data-type="status-bar"] .status-icons {
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--ui-text);
}

.panel-object[data-type="status-bar"].platform-web .obj-inner {
  justify-content: flex-start;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ui-text-secondary);
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
}

.panel-object[data-type="status-bar"].platform-web .status-text,
.panel-object[data-type="status-bar"].platform-web .status-item {
  font-weight: 500;
  color: var(--ui-text-secondary);
}

.panel-object[data-type="status-bar"] .status-bar-inner {
  gap: 16px;
}

.panel-object[data-type="status-bar"] .status-item {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  white-space: nowrap;
}

.panel-object[data-type="status-bar"] .status-item-end {
  margin-left: auto;
}

body.device-landscape .panel-object[data-type="status-bar"] .obj-inner {
  flex-direction: row;
  justify-content: space-between;
  padding: 0 16px;
  writing-mode: horizontal-tb;
}

.panel-object[data-type="sidebar"] .sidebar-inner {
  width: 100%;
  height: 100%;
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-border);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.panel-object[data-type="sidebar"] .sidebar-item {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ui-text-secondary);
  font-weight: 500;
  border-left: 3px solid transparent;
}

.panel-object[data-type="sidebar"] .sidebar-item.active {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-weight: 600;
  border-left-color: var(--ui-accent);
}

/* ── Data ── */
.panel-object[data-type="list"] .list-inner,
.panel-object[data-type="table"] .table-inner {
  width: 100%;
  height: 100%;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="list"] .list-row {
  padding: 11px 16px;
  font-size: 14px;
  color: var(--ui-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-object[data-type="list"] .list-row-chevron {
  color: var(--ui-text-muted);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.panel-object[data-type="list"] .list-row.has-nav-link .list-row-chevron {
  color: var(--ui-accent);
}

.panel-object[data-type="list"] .list-row.bordered {
  border-bottom: 1px solid var(--ui-border);
}

.panel-object[data-type="table"] .table-header {
  background: var(--ui-surface-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ui-text-secondary);
  border-bottom: 1px solid var(--ui-border);
}

.panel-object[data-type="table"] .table-header span,
.panel-object[data-type="table"] .table-row span {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  border-right: 1px solid var(--ui-border);
}

.panel-object[data-type="table"] .table-row {
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text-secondary);
}

.panel-object[data-type="grid"] .grid-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 10px;
}

.panel-object[data-type="grid"] .grid-cell {
  background: var(--ui-surface-muted);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-xs);
}

.panel-object[data-type="table"] .table-header,
.panel-object[data-type="table"] .table-row {
  display: flex;
}

/* ── Advanced ── */
.panel-object[data-type="web-view"] .obj-inner {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="web-view"] .webview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ui-surface);
  padding: 7px 12px;
  border-bottom: 1px solid var(--ui-border);
  font-size: 11px;
  color: var(--ui-text-muted);
}

.panel-object[data-type="web-view"] .webview-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="web-view"] {
  touch-action: auto;
  cursor: default;
}

body.preview-mode .panel-object[data-type="web-view"] .obj-inner,
body.preview-mode .panel-object[data-type="web-view"] .webview-bar,
body.preview-mode .panel-object[data-type="web-view"] .webview-body,
body.preview-mode .panel-object[data-type="web-view"] .webview-iframe,
body.preview-mode .panel-object[data-type="web-view"] .webview-open-external,
body.preview-mode .panel-object[data-type="web-view"] .webview-live-window,
body.preview-mode .panel-object[data-type="web-view"] .webview-pop-out,
body.preview-mode .panel-object[data-type="web-view"] .webview-blocked,
body.preview-mode-web-live .panel-object[data-type="web-view"] .obj-inner,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-bar,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-body,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-iframe,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-open-external,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-live-window,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-pop-out,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-blocked {
  pointer-events: auto;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-open-external,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-open-external {
  flex-shrink: 0;
  border: 1px solid #c7c7cc;
  border-radius: 4px;
  background: #fff;
  color: #007aff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-open-external:hover,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-open-external:hover {
  background: #eef4ff;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-live-window,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-live-window {
  flex-shrink: 0;
  border: 1px solid #34c759;
  border-radius: 4px;
  background: #f0fff4;
  color: #248a3d;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-live-window:hover,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-live-window:hover {
  background: #dfffe8;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-pop-out,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-pop-out {
  flex-shrink: 0;
  border: 1px solid #c7c7cc;
  border-radius: 4px;
  background: #fff;
  color: #636366;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-pop-out:hover,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-pop-out:hover {
  background: #f2f2f7;
}

.panel-object[data-type="web-view"].webview-live-active .webview-body-live {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel-object[data-type="web-view"].webview-live-active .webview-iframe-stage {
  flex: 1;
  min-height: 120px;
}

.panel-object[data-type="web-view"].webview-live-active .webview-iframe {
  min-height: 120px;
}

.panel-object[data-type="web-view"].webview-live-active .webview-embed-hint {
  display: none;
}

.webview-blocked {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  text-align: center;
  min-height: 120px;
}

.webview-blocked p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #636366;
  max-width: 220px;
}

body.preview-mode .panel-object[data-type="web-view"] .webview-embed-hint,
body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-embed-hint {
  margin: 0;
  padding: 6px 10px;
  font-size: 10px;
  line-height: 1.35;
  color: #8e8e93;
  background: #f9f9fb;
  border-top: 1px solid #e5e5ea;
  flex-shrink: 0;
}

.panel-object[data-type="web-view"] .webview-body {
  flex: 1;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-object[data-type="web-view"] .webview-body-live .webview-iframe-stage {
  flex: 1;
  min-height: 80px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.panel-object[data-type="web-view"] .webview-body-live .webview-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: none;
}

.panel-object[data-type="map"] .obj-inner {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid #bbf7d0;
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  background: var(--ui-bg);
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="map"] .map-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ui-surface);
  padding: 7px 12px;
  border-bottom: 1px solid var(--ui-border);
  font-size: 11px;
  color: var(--ui-text-muted);
}

.panel-object[data-type="map"] .map-location {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-object[data-type="map"] .map-body {
  flex: 1;
  background: #e5e3df;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-object[data-type="map"] .map-body-live .map-iframe-stage {
  flex: 1;
  min-height: 80px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.panel-object[data-type="map"] .map-body-live .map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #e5e3df;
  pointer-events: none;
}

.panel-object[data-type="map"].map-live-active .map-body-live {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel-object[data-type="map"].map-live-active .map-embed-hint {
  display: none;
}

body.preview-mode .panel-object[data-type="map"],
body.preview-mode-web-live .panel-object[data-type="map"] {
  touch-action: auto;
  cursor: default;
}

body.preview-mode .panel-object[data-type="map"] .obj-inner,
body.preview-mode .panel-object[data-type="map"] .map-bar,
body.preview-mode .panel-object[data-type="map"] .map-body,
body.preview-mode .panel-object[data-type="map"] .map-iframe,
body.preview-mode .panel-object[data-type="map"] .map-reload,
body.preview-mode .panel-object[data-type="map"] .map-pop-out,
body.preview-mode .panel-object[data-type="map"] .map-open-external,
body.preview-mode-web-live .panel-object[data-type="map"] .obj-inner,
body.preview-mode-web-live .panel-object[data-type="map"] .map-bar,
body.preview-mode-web-live .panel-object[data-type="map"] .map-body,
body.preview-mode-web-live .panel-object[data-type="map"] .map-iframe,
body.preview-mode-web-live .panel-object[data-type="map"] .map-reload,
body.preview-mode-web-live .panel-object[data-type="map"] .map-pop-out,
body.preview-mode-web-live .panel-object[data-type="map"] .map-open-external {
  pointer-events: auto;
}

body.preview-mode .panel-object[data-type="map"] .map-reload,
body.preview-mode-web-live .panel-object[data-type="map"] .map-reload {
  flex-shrink: 0;
  border: 1px solid #34c759;
  border-radius: 4px;
  background: #f0fff4;
  color: #248a3d;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="map"] .map-pop-out,
body.preview-mode-web-live .panel-object[data-type="map"] .map-pop-out {
  flex-shrink: 0;
  border: 1px solid #c7c7cc;
  border-radius: 4px;
  background: #fff;
  color: #636366;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="map"] .map-open-external,
body.preview-mode-web-live .panel-object[data-type="map"] .map-open-external {
  flex-shrink: 0;
  border: 1px solid #c7c7cc;
  border-radius: 4px;
  background: #fff;
  color: #007aff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

body.preview-mode .panel-object[data-type="map"] .map-embed-hint,
body.preview-mode-web-live .panel-object[data-type="map"] .map-embed-hint {
  margin: 0;
  padding: 6px 10px;
  font-size: 10px;
  line-height: 1.35;
  color: #8e8e93;
  background: #f9f9fb;
  border-top: 1px solid #e5e5ea;
  flex-shrink: 0;
}

body.preview-mode .panel-object[data-type="map"] .map-iframe-stage,
body.preview-mode-web-live .panel-object[data-type="map"] .map-iframe-stage {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

body.preview-mode .panel-object[data-type="map"] .map-iframe,
body.preview-mode-web-live .panel-object[data-type="map"] .map-iframe {
  pointer-events: auto;
}

.panel-object[data-type="map"] .map-label {
  font-size: 12px;
  color: var(--ui-text-secondary);
  font-weight: 600;
}

.panel-object[data-type="chart"] .obj-inner {
  flex-direction: column;
  gap: 8px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  padding: 14px;
  box-shadow: var(--ui-shadow-sm);
}

.panel-object[data-type="map"] .map-pin {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.panel-object[data-type="chart"] .chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  width: 100%;
}

.panel-object[data-type="chart"] .chart-bars span {
  flex: 1;
  background: linear-gradient(180deg, #38bdf8 0%, var(--ui-accent) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 8px;
}

.panel-object[data-type="chart"] .chart-label {
  font-size: 12px;
  color: var(--ui-text-secondary);
  font-weight: 600;
}

/* Allow right-click on individual navigation sub-items in design mode */
body:not(.preview-mode) .panel-object[data-type="tab-bar"] .tab-item,
body:not(.preview-mode) .panel-object[data-type="tab-control"] .tab-control-tab,
body:not(.preview-mode) .panel-object[data-type="sidebar"] .sidebar-item,
body:not(.preview-mode) .panel-object[data-type="toolbar"] .toolbar-item,
body:not(.preview-mode) .panel-object[data-type="status-bar"] .status-item,
body:not(.preview-mode) .panel-object[data-type="menu-bar"] .menu-item,
body:not(.preview-mode) .panel-object[data-type="segmented-control"] .seg-item,
body:not(.preview-mode) .panel-object[data-type="list"] .list-row {
  pointer-events: auto;
  cursor: context-menu;
}

/* Preview mode — tab bar tabs must receive clicks for page navigation */
body.preview-mode .panel-object[data-type="tab-bar"] .obj-inner,
body.preview-mode .panel-object[data-type="tab-bar"] .tab-item {
  pointer-events: auto;
}

body.preview-mode .panel-object[data-type="tab-bar"] .tab-item {
  cursor: pointer;
}

body.preview-mode .panel-object[data-type="list"] .obj-inner,
body.preview-mode .panel-object[data-type="list"] .list-row,
body.preview-mode .panel-object[data-type="sidebar"] .obj-inner,
body.preview-mode .panel-object[data-type="sidebar"] .sidebar-item {
  pointer-events: auto;
}

body.preview-mode .panel-object[data-type="list"] .list-row.has-nav-link,
body.preview-mode .panel-object[data-type="sidebar"] .sidebar-item.has-nav-link {
  cursor: pointer;
}

body.preview-mode .panel-object[data-type="list"] .list-row.has-nav-link:hover,
body.preview-mode .panel-object[data-type="sidebar"] .sidebar-item.has-nav-link:hover {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

body.preview-mode .panel-object[data-type="tab-bar"] .tab-item.has-tab-link:hover,
body.preview-mode .panel-object[data-type="tab-bar"] .tab-item.active:hover {
  color: var(--ui-accent);
}

body:not(.preview-mode) .panel-object[data-type="tab-bar"] .tab-item:hover,
body:not(.preview-mode) .panel-object[data-type="tab-control"] .tab-control-tab:hover,
body:not(.preview-mode) .panel-object[data-type="sidebar"] .sidebar-item:hover,
body:not(.preview-mode) .panel-object[data-type="toolbar"] .toolbar-item:hover,
body:not(.preview-mode) .panel-object[data-type="status-bar"] .status-item:hover,
body:not(.preview-mode) .panel-object[data-type="menu-bar"] .menu-item:hover,
body:not(.preview-mode) .panel-object[data-type="segmented-control"] .seg-item:hover,
body:not(.preview-mode) .panel-object[data-type="list"] .list-row:hover {
  outline: 1px dashed rgba(0, 122, 255, 0.45);
  outline-offset: -1px;
}

/* ══════════════════════════════════════
   Palette icon mini-previews
   ══════════════════════════════════════ */

.palette-item-icon {
  position: relative;
}

.palette-item-icon.icon-label::after {
  content: "";
  position: absolute;
  top: 6px; left: 4px;
  width: 16px; height: 2px;
  background: #8b92a8;
  box-shadow: 0 5px 0 #8b92a8;
}

.palette-item-icon.icon-title::after {
  content: "";
  position: absolute;
  top: 5px; left: 3px;
  width: 20px; height: 3px;
  background: #8b92a8;
}

.palette-item-icon.icon-subtitle::after {
  content: "";
  position: absolute;
  top: 7px; left: 4px;
  width: 18px; height: 2px;
  background: #8b92a8;
}

.palette-item-icon.icon-caption::after {
  content: "";
  position: absolute;
  top: 9px; left: 4px;
  width: 14px; height: 1px;
  background: #8b92a8;
}

.palette-item-icon.icon-link::after {
  content: "";
  position: absolute;
  top: 9px; left: 4px;
  width: 16px; height: 1px;
  background: #5b8def;
}

.palette-item-icon.icon-button { background: #5b8def; border-radius: 4px; }
.palette-item-icon.icon-icon-button { border: 1px solid #8b92a8; border-radius: 4px; }
.palette-item-icon.icon-link-button::after { content: "↗"; position: absolute; top: 3px; left: 7px; font-size: 11px; color: #5b8def; }
.palette-item-icon.icon-fab { background: #5b8def; border-radius: 50%; }

.palette-item-icon.icon-text-field,
.palette-item-icon.icon-secure-field,
.palette-item-icon.icon-number-field,
.palette-item-icon.icon-search-field,
.palette-item-icon.icon-picker,
.palette-item-icon.icon-date-picker,
.palette-item-icon.icon-time-picker,
.palette-item-icon.icon-color-picker {
  border: 1px solid #8b92a8;
  border-radius: 3px;
}

.palette-item-icon.icon-text-area { border: 1px solid #8b92a8; border-radius: 3px; height: 24px; }

.palette-item-icon.icon-toggle::after {
  content: "";
  position: absolute;
  top: 5px; left: 4px;
  width: 18px; height: 10px;
  background: #34c759;
  border-radius: 5px;
}

.palette-item-icon.icon-checkbox { border: 2px solid #5b8def; border-radius: 2px; background: transparent; }
.palette-item-icon.icon-radio { border: 2px solid #5b8def; border-radius: 50%; background: transparent; }

.palette-item-icon.icon-slider::after {
  content: "";
  position: absolute;
  top: 9px; left: 3px;
  width: 20px; height: 2px;
  background: #5b8def;
}

.palette-item-icon.icon-stepper { border: 1px solid #8b92a8; border-radius: 3px; }
.palette-item-icon.icon-stepper::after { content: "±"; position: absolute; top: 2px; left: 6px; font-size: 10px; color: #8b92a8; }

.palette-item-icon.icon-segmented { border: 1px solid #8b92a8; border-radius: 3px; }
.palette-item-icon.icon-segmented::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 12px;
  background: #5b8def;
  border-radius: 2px;
}

.palette-item-icon.icon-rating::after { content: "★"; position: absolute; top: 2px; left: 5px; font-size: 12px; color: #ff9500; }

.palette-item-icon.icon-separator::after {
  content: "";
  position: absolute;
  top: 9px; left: 2px;
  width: 22px; height: 1px;
  background: #8b92a8;
}

.palette-item-icon.icon-divider-v::after {
  content: "";
  position: absolute;
  top: 2px; left: 13px;
  width: 1px; height: 20px;
  background: #8b92a8;
}

.palette-item-icon.icon-spacer { border: 1px dashed #8b92a8; border-radius: 2px; }
.palette-item-icon.icon-group-box { border: 1px solid #8b92a8; border-radius: 3px; }
.palette-item-icon.icon-card { border: 1px solid #8b92a8; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.palette-item-icon.icon-image { border: 1px dashed #8b92a8; }
.palette-item-icon.icon-camera {
  border: 1px dashed #8b92a8;
  border-radius: 8px;
}
.palette-item-icon.icon-camera::after {
  content: "📷";
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 14px;
  line-height: 1;
}
.palette-item-icon.icon-logo {
  border: 1px dashed #8b92a8;
  border-radius: 3px;
}
.palette-item-icon.icon-logo::after {
  content: "◆";
  position: absolute;
  top: 4px;
  left: 7px;
  font-size: 11px;
  color: #5b8def;
}
.palette-item-icon.icon-icon::after { content: "★"; position: absolute; top: 2px; left: 7px; font-size: 12px; color: #5b8def; }
.palette-item-icon.icon-avatar { background: #5b8def; border-radius: 50%; }
.palette-item-icon.icon-video { background: #333; border-radius: 3px; }
.palette-item-icon.icon-video::after { content: "▶"; position: absolute; top: 3px; left: 8px; font-size: 10px; color: #fff; }

.palette-item-icon.icon-progress::after {
  content: "";
  position: absolute;
  top: 9px; left: 3px;
  width: 14px; height: 2px;
  background: #5b8def;
}

.palette-item-icon.icon-progress-circle { border: 2px solid #5b8def; border-top-color: transparent; border-radius: 50%; }
.palette-item-icon.icon-gauge::after {
  content: "";
  position: absolute;
  top: 8px; left: 5px;
  width: 16px; height: 8px;
  border: 2px solid #5b8def;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.palette-item-icon.icon-badge { background: #e05c5c; border-radius: 50%; }
.palette-item-icon.icon-chip { background: #8b92a8; border-radius: 8px; }
.palette-item-icon.icon-alert { background: #ffc107; border-radius: 3px; }

.palette-item-icon.icon-tab-bar { border-top: 2px solid #8b92a8; }
.palette-item-icon.icon-tab-control {
  background: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-top: 2px solid #007acc;
  box-shadow: inset 0 -8px 0 -6px #f2f2f2;
}
.palette-item-icon.icon-nav-bar { border-bottom: 2px solid #8b92a8; }
.palette-item-icon.icon-toolbar { border-bottom: 1px solid #8b92a8; background: #242836; }
.palette-item-icon.icon-menu-bar { border-bottom: 1px solid #8b92a8; }
.palette-item-icon.icon-status-bar { border-bottom: 1px solid #8b92a8; }
.palette-item-icon.icon-sidebar { border-right: 2px solid #8b92a8; background: #242836; }

.palette-item-icon.icon-list::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 2px;
  background: #8b92a8;
  box-shadow: 0 6px 0 #8b92a8, 0 12px 0 #8b92a8;
}

.palette-item-icon.icon-table {
  border: 1px solid #8b92a8;
  border-radius: 2px;
}
.palette-item-icon.icon-table::after {
  content: "";
  position: absolute;
  top: 8px; left: 2px;
  width: 22px; height: 1px;
  background: #8b92a8;
}

.palette-item-icon.icon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  background: transparent;
}
.palette-item-icon.icon-grid::before,
.palette-item-icon.icon-grid::after {
  content: "";
  background: #8b92a8;
  border-radius: 1px;
}
.palette-item-icon.icon-grid::before {
  grid-column: 1;
  grid-row: 1;
}
.palette-item-icon.icon-grid::after {
  position: static;
  width: auto;
  height: auto;
}

.palette-item-icon.icon-web-view { border: 1px solid #8b92a8; border-radius: 2px; }
.palette-item-icon.icon-map { background: #3a5a3a; border-radius: 3px; }
.palette-item-icon.icon-chart::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 4px;
  width: 4px; height: 8px;
  background: #5b8def;
  box-shadow: 6px -4px 0 #5b8def, 12px -2px 0 #5b8def;
}

/* ── Live web preview (Web target + Preview mode) ── */
body.preview-mode-web-live .panel-canvas {
  background: #fff;
}

body.preview-mode-web-live .panel-object .obj-inner {
  pointer-events: auto;
}

body.preview-mode-web-live .live-input,
body.preview-mode-web-live .live-textarea {
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  color: #111827;
  background: #fff;
}

body.preview-mode-web-live .live-textarea {
  resize: none;
}

body.preview-mode-web-live .panel-object[data-type="search-field"] .obj-inner {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

body.preview-mode-web-live .live-input-search {
  flex: 1;
  min-width: 0;
  height: auto;
  min-height: 0;
}

body.preview-mode-web-live .live-btn {
  width: 100%;
  height: 100%;
  cursor: pointer;
  font: inherit;
}

body.preview-mode-web-live .live-link-btn {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

body.preview-mode-web-live .live-link {
  cursor: pointer;
  text-decoration: underline;
}

body.preview-mode-web-live .live-check,
body.preview-mode-web-live .live-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font: inherit;
}

body.preview-mode-web-live .panel-object[data-type="web-view"] .webview-body,
body.preview-mode .panel-object[data-type="web-view"] .webview-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

body.preview-mode-web-live .webview-iframe-stage,
body.preview-mode .panel-object[data-type="web-view"] .webview-iframe-stage {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.preview-mode-web-live .webview-iframe,
body.preview-mode .panel-object[data-type="web-view"] .webview-iframe {
  flex: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  min-height: 120px;
  pointer-events: auto;
}

/* ── Rendering fidelity modes ── */

.panel-canvas.fidelity-functional {
  --ui-accent: #6b7280;
  --ui-accent-deep: #4b5563;
  --ui-accent-soft: rgba(107, 114, 128, 0.12);
  --ui-bg: #fafafa;
  --ui-surface: #f3f4f6;
  --ui-surface-muted: #e5e7eb;
  --ui-border: #d1d5db;
  --ui-border-strong: #9ca3af;
  --ui-text: #374151;
  --ui-text-secondary: #6b7280;
  --ui-text-muted: #9ca3af;
}

.panel-canvas.fidelity-functional .panel-object:not([data-render-as="native"]) .obj-inner {
  background: #f3f4f6 !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 1px dashed #9ca3af !important;
  border-radius: 4px !important;
  color: var(--ui-text) !important;
}

.panel-canvas.fidelity-functional .panel-object[data-type="label"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="title"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="subtitle"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="caption"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="link"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="link-button"] .obj-inner {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.panel-canvas.fidelity-functional .panel-object[data-type="image"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="camera"] .obj-inner,
.panel-canvas.fidelity-functional .panel-object[data-type="logo"] .obj-inner {
  background: repeating-linear-gradient(
    -45deg,
    #f9fafb,
    #f9fafb 6px,
    #e5e7eb 6px,
    #e5e7eb 12px
  ) !important;
}

.panel-canvas.fidelity-platform-native {
  --ui-shadow-xs: none;
  --ui-shadow-sm: none;
  --ui-shadow-md: none;
  --ui-shadow-inset: none;
}

.device-frame.mobile .panel-canvas.fidelity-platform-native {
  --ui-accent: #007aff;
  --ui-accent-deep: #005ecb;
}

.device-frame.tablet .panel-canvas.fidelity-platform-native {
  --ui-accent: #007aff;
  --ui-accent-deep: #005ecb;
}

.device-frame.desktop .panel-canvas.fidelity-platform-native {
  --ui-accent: #0078d4;
  --ui-accent-deep: #106ebe;
}

.device-frame.browser .panel-canvas.fidelity-platform-native {
  --ui-accent: #2563eb;
  --ui-accent-deep: #1d4ed8;
}

.panel-canvas.fidelity-platform-native .panel-object .obj-inner {
  background-image: none !important;
  box-shadow: none !important;
}

.panel-canvas.fidelity-platform-native .panel-object[data-type="button"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="primary-button"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="destructive-button"] .obj-inner {
  background: var(--ui-accent) !important;
  border: 1px solid var(--ui-accent-deep) !important;
}

.panel-canvas.fidelity-platform-native .panel-object[data-type="secondary-button"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="text-field"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="secure-field"] .obj-inner,
.panel-canvas.fidelity-platform-native .panel-object[data-type="search-field"] .obj-inner {
  background: var(--ui-bg) !important;
  border: 1px solid var(--ui-border-strong) !important;
}
