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

.panel-object .obj-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  pointer-events: none;
  position: relative;
}

/* ── 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: #8e8e93;
}

.panel-object[data-type="link"] .text-link,
.panel-object[data-type="link-button"] .link-btn-text {
  color: #007aff;
  text-decoration: underline;
  font-size: 14px;
}

.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: #007aff;
  color: #fff;
  border-radius: 8px;
  font-weight: 500;
  padding: 0 12px;
}

.panel-object[data-type="button"].platform-android .obj-inner {
  background: #6750a4;
  border-radius: 20px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.panel-object[data-type="button"].platform-windows .obj-inner {
  background: #0067c0;
  border-radius: 4px;
}

/* ── 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: space-between;
  padding: 0 8px;
}

.panel-object[data-type="icon-button"] .obj-inner {
  background: #f5f5f7;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
}

.panel-object[data-type="icon-button"] .icon-glyph {
  font-size: 18px;
}

.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: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.panel-object[data-type="fab"] .fab-glyph {
  font-size: 28px;
  font-weight: 300;
  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 10px;
  gap: 8px;
  background: #f5f5f7;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  color: #8e8e93;
}

.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: #2563eb;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid #1d4ed8;
}

.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: 8px 10px;
  background: #f5f5f7;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  color: #8e8e93;
  font-size: 13px;
}

.panel-object[data-type="color-picker"] .color-swatch {
  width: 24px;
  height: 24px;
  background: #007aff;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.panel-object[data-type="picker"] .picker-arrow {
  font-size: 10px;
  color: #8e8e93;
}

/* ── 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: #e9e9ea;
  border-radius: 16px;
  position: relative;
}

.panel-object[data-type="toggle"] .switch-track.on {
  background: #34c759;
}

.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 1px 3px rgba(0, 0, 0, 0.2);
}

.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 #007aff;
  border-radius: 4px;
  flex-shrink: 0;
}

.panel-object[data-type="radio"] .radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid #007aff;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.panel-object[data-type="slider"] .slider-track {
  width: 100%;
  height: 4px;
  background: #e9e9ea;
  border-radius: 2px;
  position: relative;
}

.panel-object[data-type="slider"] .slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: #007aff;
  border-radius: 2px;
}

.panel-object[data-type="slider"] .slider-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* ── Stepper ── */
.panel-object[data-type="stepper"] .obj-inner {
  justify-content: space-between;
  padding: 0 4px;
  background: #f5f5f7;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
}

.panel-object[data-type="stepper"] .stepper-btn {
  width: 28px;
  text-align: center;
  font-size: 18px;
  color: #007aff;
}

.panel-object[data-type="stepper"] .stepper-val {
  font-weight: 500;
  color: #1a1a1a;
}

/* ── Segmented control ── */
.panel-object[data-type="segmented-control"] .obj-inner {
  padding: 2px;
  background: #e9e9ea;
  border-radius: 8px;
}

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

.panel-object[data-type="segmented-control"] .seg-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #1a1a1a;
  border-radius: 6px;
}

.panel-object[data-type="segmented-control"] .seg-item.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  font-weight: 500;
}

/* ── Rating ── */
.panel-object[data-type="rating"] .stars {
  color: #ff9500;
  font-size: 18px;
  letter-spacing: 2px;
}

/* ── Media ── */
.panel-object[data-type="image"] .obj-inner {
  background: #e5e5ea;
  border: 1px dashed #c7c7cc;
  border-radius: 8px;
  color: #8e8e93;
  font-size: 12px;
}

.panel-object[data-type="logo"] .obj-inner {
  gap: 8px;
  padding: 0 12px;
  background: #f5f5f7;
  border: 1px dashed #c7c7cc;
  border-radius: 8px;
  color: #8e8e93;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-object[data-type="logo"] .logo-mark {
  font-size: 18px;
  color: #007aff;
  line-height: 1;
  flex-shrink: 0;
}

.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: 24px;
  color: #007aff;
}

.panel-object[data-type="avatar"] .obj-inner {
  background: #007aff;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.panel-object[data-type="video"] .obj-inner {
  background: #1a1a1a;
  border-radius: 8px;
  flex-direction: column;
  gap: 4px;
}

.panel-object[data-type="video"] .video-play {
  color: #fff;
  font-size: 24px;
  opacity: 0.9;
}

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

/* ── 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: #c7c7cc;
}

.panel-object[data-type="divider-vertical"] .sep-line.vertical {
  width: 1px;
  height: 100%;
  background: #c7c7cc;
}

.panel-object[data-type="spacer"] .spacer-box {
  width: 100%;
  height: 100%;
  border: 1px dashed #d1d1d6;
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.03) 4px,
    rgba(0, 0, 0, 0.03) 8px
  );
}

.panel-object[data-type="group-box"] .group-frame,
.panel-object[data-type="card"] .card-frame {
  width: 100%;
  height: 100%;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  position: relative;
  background: #fafafa;
}

.panel-object[data-type="group-box"] .group-title {
  position: absolute;
  top: -8px;
  left: 10px;
  background: #fff;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
}

.panel-object[data-type="card"] .card-frame {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel-object[data-type="card"] .card-title {
  display: block;
  padding: 10px 12px 6px;
  font-weight: 600;
  font-size: 15px;
}

.panel-object[data-type="card"] .card-body {
  flex: 1;
  margin: 0 12px 12px;
  background: #f5f5f7;
  border-radius: 4px;
  min-height: 40%;
}

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

.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: 4px;
  background: #e9e9ea;
  border-radius: 2px;
  overflow: hidden;
}

.panel-object[data-type="progress"] .progress-fill {
  width: 60%;
  height: 100%;
  background: #007aff;
  border-radius: 2px;
}

.panel-object[data-type="progress-circle"] .spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid #e9e9ea;
  border-top-color: #007aff;
  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 #e9e9ea;
  border-bottom: none;
  border-radius: 80px 80px 0 0;
  border-top-color: #007aff;
  border-left-color: #007aff;
}

.panel-object[data-type="gauge"] .gauge-label {
  font-size: 13px;
  font-weight: 600;
}

.panel-object[data-type="badge"] .obj-inner {
  background: #ff3b30;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.panel-object[data-type="chip"] .obj-inner {
  background: #e9e9ea;
  border-radius: 16px;
  padding: 0 12px;
}

.panel-object[data-type="chip"] .chip-text {
  font-size: 13px;
}

.panel-object[data-type="alert"] .obj-inner {
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  font-size: 13px;
}

.panel-object[data-type="alert"] .alert-icon {
  width: 20px;
  height: 20px;
  background: #ffc107;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  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 {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
}

.panel-object[data-type="tab-bar"] .obj-inner {
  background: #f9f9f9;
  border-top: 1px solid #c7c7cc;
  padding: 0;
}

.panel-object[data-type="tab-bar"] .tab-item {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #8e8e93;
  padding: 4px 0;
}

.panel-object[data-type="tab-bar"] .tab-item.active {
  color: #007aff;
  font-weight: 600;
}

.panel-object[data-type="tab-control"] .obj-inner {
  padding: 0;
  background: #e8e8e8;
  border: 1px solid #c8c8c8;
  overflow: hidden;
}

.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: #e8e8e8;
}

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

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

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

.panel-object[data-type="tab-control"] .tab-control-body {
  flex: 1;
  min-height: 0;
  background: #f2f2f2;
}

.panel-object[data-type="tab-control"] .tab-control-body-active {
  outline: 1px dashed rgba(0, 122, 204, 0.55);
  outline-offset: -1px;
  background: #fafafa;
}

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

.panel-object[data-type="tab-control"] .tab-control-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px;
  background: #dcdcdc;
  border-right: 1px solid #c0c0c0;
  color: #1a1a1a;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.panel-object[data-type="tab-control"] .tab-control-tab.active {
  background: #f2f2f2;
  color: #000000;
}

.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: #007acc;
}

.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: #007acc;
}

.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: #1a1a1a;
  opacity: 0.55;
}

.panel-object[data-type="nav-bar"] .obj-inner {
  justify-content: center;
  background: #f9f9f9;
  border-bottom: 1px solid #c7c7cc;
  position: relative;
}

.panel-object[data-type="nav-bar"] .nav-back {
  position: absolute;
  left: 12px;
  font-size: 24px;
  color: #007aff;
  font-weight: 300;
}

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

.panel-object[data-type="toolbar"] .obj-inner {
  background: #f5f5f7;
  border-bottom: 1px solid #c7c7cc;
  justify-content: flex-start;
  padding: 0 8px;
  gap: 4px;
}

.panel-object[data-type="toolbar"] .toolbar-item {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 4px;
}

.panel-object[data-type="menu-bar"] .obj-inner {
  background: #f5f5f7;
  border-bottom: 1px solid #c7c7cc;
  justify-content: flex-start;
  padding: 0 8px;
}

.panel-object[data-type="menu-bar"] .menu-item {
  padding: 2px 10px;
  font-size: 13px;
}

.panel-object[data-type="status-bar"] .obj-inner {
  background: #fff;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
}

.panel-object[data-type="status-bar"] .status-icons {
  font-size: 8px;
  letter-spacing: 2px;
  color: #1a1a1a;
}

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: #f5f5f7;
  border-right: 1px solid #c7c7cc;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.panel-object[data-type="sidebar"] .sidebar-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #666;
}

.panel-object[data-type="sidebar"] .sidebar-item.active {
  background: rgba(0, 122, 255, 0.12);
  color: #007aff;
  font-weight: 500;
}

/* ── Data ── */
.panel-object[data-type="list"] .list-inner,
.panel-object[data-type="table"] .table-inner {
  width: 100%;
  height: 100%;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.panel-object[data-type="list"] .list-row {
  padding: 10px 14px;
  font-size: 14px;
}

.panel-object[data-type="list"] .list-row.bordered {
  border-bottom: 1px solid #e9e9ea;
}

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

.panel-object[data-type="table"] .table-header {
  background: #f5f5f7;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #c7c7cc;
}

.panel-object[data-type="table"] .table-header span,
.panel-object[data-type="table"] .table-row span {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  border-right: 1px solid #e9e9ea;
}

.panel-object[data-type="table"] .table-row {
  border-bottom: 1px solid #e9e9ea;
  color: #8e8e93;
}

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

.panel-object[data-type="grid"] .grid-cell {
  background: #e5e5ea;
  border-radius: 8px;
}

/* ── Advanced ── */
.panel-object[data-type="web-view"] .obj-inner {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.panel-object[data-type="web-view"] .webview-bar {
  background: #f5f5f7;
  padding: 6px 10px;
  border-bottom: 1px solid #c7c7cc;
  font-size: 11px;
  color: #8e8e93;
}

.panel-object[data-type="web-view"] .webview-body {
  flex: 1;
  background: #fafafa;
}

.panel-object[data-type="map"] .obj-inner {
  background: #e8f4e8;
  border-radius: 8px;
  flex-direction: column;
  gap: 4px;
}

.panel-object[data-type="map"] .map-pin {
  font-size: 28px;
}

.panel-object[data-type="map"] .map-label {
  font-size: 12px;
  color: #666;
}

.panel-object[data-type="chart"] .obj-inner {
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  padding: 12px;
}

.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: #007aff;
  border-radius: 3px 3px 0 0;
  min-height: 8px;
}

.panel-object[data-type="chart"] .chart-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

/* 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="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;
}

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="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-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;
}
