/* main.css — Layout, toolbar, panels, buttons */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:     #0e0e1a;
  --bg-panel:    #14141f;
  --bg-panel2:   #1a1a2e;
  --border:      rgba(255,255,255,0.08);
  --text:        #d8d8e8;
  --text-dim:    rgba(255,255,255,0.38);
  --accent:      #4d8bff;
  --accent-dim:  rgba(77,139,255,0.15);
  --toolbar-h:   44px;
  --panel-left:  196px;
  --panel-minimap: 78px;
  --panel-right: 280px;
  --radius:      5px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-deep);
}

/* ── Toolbar ─────────────────────────────────────────────────── */

.toolbar {
  height: var(--toolbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toolbar-right {
  margin-left: auto;
}

.toolbar-label {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-right: 2px;
}

.toolbar-hint {
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  margin-right: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.tool-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tool-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.tool-btn:active { background: rgba(255,255,255,0.18); }

.accent-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.accent-btn:hover  { background: #5a97ff; border-color: #5a97ff; }
.accent-btn:active { background: #3d78e8; }

/* Entity-type button colours */
.tower-btn   { border-left: 3px solid #ff5555; }
.enemies-btn { border-left: 3px solid #ff5555; }
.block-btn { border-left: 3px solid #f8de00; }
.push-btn  { border-left: 3px solid #ff8800; }
.gate-btn  { border-left: 3px solid #00c8ff; }
.pipe-btn     { border-left: 3px solid #44cc44; }
.collider-btn { border-left: 3px solid #888888; }
.extra-btn    { border-left: 3px solid #9933ff; }

.push-submenu-item { border-left: 3px solid #ff8800; }

/* ── 3-column layout ──────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--panel-left) var(--panel-minimap) minmax(0, 1fr) var(--panel-right);
  height: calc(100vh - var(--toolbar-h));
  overflow: hidden;
}

/* ── Mini map panel ──────────────────────────────────────────── */

.panel-minimap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.minimap-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minimap-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.minimap-item:hover  { background: rgba(255,255,255,0.07); }
.minimap-item.active {
  background: var(--accent-dim);
  border-color: rgba(77,139,255,0.5);
}

.minimap-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  align-self: stretch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.minimap-item.active .minimap-label { color: var(--accent); }

.minimap-canvas {
  display: block;
  border-radius: 2px;
}

/* ── Side panels ─────────────────────────────────────────────── */

.panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-right {
  border-right: none;
  border-left: 1px solid var(--border);
}

/* Left column: levels (top) and library (bottom) each take ~half the height */
.panel.panel-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.left-new-project {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.new-project-btn { width: 100%; }

.left-split-top {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-split-top > .panel-title {
  flex-shrink: 0;
}

.left-split-top .add-level-footer {
  flex-shrink: 0;
}

.left-split-bottom {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  padding: 8px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Canvas ───────────────────────────────────────────────────── */

.canvas-wrapper {
  position: relative;
  overflow: hidden;
  background: #0e0e1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

#main-canvas {
  display: block;
}

/* ── Level tabs ───────────────────────────────────────────────── */

.level-tabs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.level-tab {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s;
  overflow: hidden;
}
.level-tab:hover    { background: rgba(255,255,255,0.08); }
.level-tab.active   { background: var(--accent-dim); border-color: rgba(77,139,255,0.35); }

.tab-label {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  user-select: none;
}

.tab-delete {
  padding: 4px 7px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.1s;
}
.tab-delete:hover { color: #ff6666; }

.tab-io-row {
  display: flex;
  gap: 6px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border);
}

.tab-io-btn {
  flex: 1;
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition: background 0.1s, border-color 0.1s;
}

.tab-io-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(77,139,255,0.35);
  color: var(--accent);
}

/* Drag-to-reorder states */
.level-tab.dragging  { opacity: 0.4; }
.level-tab.drag-over { border-top: 2px solid var(--accent); }

/* Inline rename input */
.tab-rename-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  min-width: 0;
}

.add-level-footer {
  flex-shrink: 0;
  padding: 6px;
  border-top: 1px solid var(--border);
}

/* ── Library section ──────────────────────────────────────────── */

.library-section {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 6px;
  flex-shrink: 0;
}

/* panel-title inside library-header loses its bottom border since
   the header row is the separator */
.library-header .panel-title {
  border-bottom: none;
  flex: 1;
}

.library-refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.library-refresh-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }

.library-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.library-state {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 2px;
}

.library-entry {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 4px 4px 6px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: background 0.1s;
}
.library-entry:hover { background: rgba(255,255,255,0.07); }

.library-entry.library-entry-selected {
  background: rgba(120, 180, 255, 0.12);
  border-color: rgba(120, 180, 255, 0.35);
}

.library-entry-info {
  flex: 1;
  min-width: 0;
}

.library-entry-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-entry-date {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}

.library-load-btn {
  padding: 3px 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.library-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.library-delete-btn:hover { color: #ff6666; background: rgba(220,50,50,0.12); }

.library-save-row {
  display: flex;
  gap: 5px;
  padding: 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.library-save-input {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  padding: 3px 7px;
  height: 26px;
  outline: none;
  transition: border-color 0.1s;
}
.library-save-input:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); }
.library-save-input::placeholder { color: var(--text-dim); }

.add-level-btn {
  width: 100%;
  padding: 7px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.add-level-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.pp-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(140, 185, 255, 0.8);
  text-transform: uppercase;
  text-align: center;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(77, 139, 255, 0.25);
  flex-shrink: 0;
}

.pp-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  flex: 0 0 auto;
  min-height: 0;
}

.pp-mob-wrap {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(77, 139, 255, 0.15);
  flex-shrink: 0;
}

.pp-mob-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
}

.pp-mob-label {
  flex: 0 0 52px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(140, 185, 255, 0.75);
  padding-top: 5px;
  line-height: 1.2;
}

.pp-mob-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px 4px;
  min-width: 0;
}

.pp-mob-grid .pp-field label {
  flex: 0 0 22px;
  font-size: 8px;
}

.pp-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp-col-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(140, 185, 255, 0.5);
  border-bottom: 1px solid rgba(77, 139, 255, 0.18);
  padding-bottom: 2px;
  margin-bottom: 1px;
}

.pp-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.pp-field label {
  flex: 0 0 38px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(140, 185, 255, 0.65);
  white-space: nowrap;
}

.pp-field input[type="number"],
.pp-field select {
  flex: 1;
  min-width: 0;
  height: 20px;
  font-size: 11px;
  padding: 1px 4px;
}

/* WIP fields — grayed out, not interactive */
.pp-wip {
  opacity: 0.32;
  pointer-events: none;
}

.pp-wip-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(140, 185, 255, 0.7);
  background: rgba(77, 139, 255, 0.12);
  border: 1px solid rgba(77, 139, 255, 0.25);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 18px;
}

.pp-field input[type="number"],
.pp-field select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(77, 139, 255, 0.3);
  border-radius: 4px;
  color: #d8d8e8;
  font-size: 12px;
  padding: 3px 6px;
  height: 24px;
  outline: none;
  width: 100%;
  transition: border-color 0.1s;
}

.pp-field select {
  cursor: pointer;
  appearance: auto;
}

.pp-field input[type="number"]:focus,
.pp-field select:focus {
  border-color: #4d8bff;
  background: rgba(0, 0, 0, 0.6);
}

/* ── Import modal ─────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg-panel2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 22px 24px;
  width: min(600px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.import-textarea {
  width: 100%;
  height: 260px;
  background: #0c0c18;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: #b0ffb0;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 10px;
  resize: vertical;
  outline: none;
}
.import-textarea:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Toolbar submenus ─────────────────────────────────────────── */

.tab-wrap {
  position: relative;
}

.submenu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 130px;
  background: var(--bg-panel2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  overflow: hidden;
}
.submenu.open { display: flex; }

.submenu-item {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s;
}
.submenu-item:last-child { border-bottom: none; }
.submenu-item:hover { background: rgba(255,255,255,0.08); }

#tab-tower            .submenu-item { border-left: 3px solid #ff5555; }
#tab-enemies          .submenu-item { border-left: 3px solid #ff5555; }
#tab-destroyableBlock .submenu-item { border-left: 3px solid #f8de00; }
#tab-multiplierGate   .submenu-item { border-left: 3px solid #00c8ff; }
#tab-pipe             .submenu-item { border-left: 3px solid #44cc44; }

/* ── Toast ────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2a2a3e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Size Picker ─────────────────────────────────────────────────────────── */
.size-picker-row { align-items: center; }
.size-btn-group  { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.size-btn {
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-family: monospace;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.size-btn:hover  { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }
.size-btn.active { background: #4488ff; border-color: #4488ff; color: #fff; }

.size-custom-label {
  font-size: 11px;
  font-family: monospace;
  color: rgba(255,255,255,0.45);
  font-style: italic;
  padding: 0 2px;
}

/* ─── Colour Swatches ─────────────────────────────────────────────────────── */
.color-swatch-row  { align-items: center; }
.color-swatch-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
  outline: none;
}
.color-swatch:hover  { transform: scale(1.2); }
.color-swatch.active { border-color: #ffffff; }

.tab-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.level-props {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.lp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lp-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lp-number {
  width: 56px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  padding: 2px 5px;
  text-align: right;
  outline: none;
}
.lp-number:focus { border-color: var(--accent); }

.lp-radio-group {
  display: flex;
  gap: 8px;
  font-size: 12px;
}
.lp-radio-group label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

/* ─── Disabled size buttons ───────────────────────────────────────────────── */

.size-btn:disabled,
.size-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Bottom-left tab toggle (Library ↔ Preview) ─────────────────── */

.bottom-tabbed {
  border-top: 1px solid var(--border);
}

.bottom-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.bottom-tab-btn {
  flex: 1;
  padding: 7px 8px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.bottom-tab-btn:last-child  { border-right: none; }
.bottom-tab-btn:hover       { background: rgba(255,255,255,0.05); color: var(--text); }
.bottom-tab-btn.active      { background: var(--accent-dim); color: var(--accent); }

.bottom-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The library-section already styles the library pane; we only need to
   neutralise its own top border since .bottom-tabs draws the separator. */
.bottom-tab-pane.library-section { border-top: none; }

/* ── Preview pane ───────────────────────────────────────────────── */

.preview-section {
  background: #0a0a14;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-shortcut-hint {
  font-size: 10px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  flex-shrink: 0;
}

.preview-status {
  font-size: 10px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-frame-wrap {
  flex: 0 0 auto;          /* don't stretch — let iframe's aspect ratio drive height */
  min-height: 0;
  position: relative;
  background: #000;
}

.preview-iframe {
  width: 100%;
  aspect-ratio: 9 / 16;    /* iPhone portrait; width unchanged, height = width × 16/9 */
  height: auto;
  border: none;
  display: block;
  background: #000;
}

.preview-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  pointer-events: none;
}

.preview-spinner-dot {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: preview-spin 0.85s linear infinite;
}

@keyframes preview-spin {
  to { transform: rotate(360deg); }
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--text-dim);
  background: #0a0a14;
}

.preview-empty-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}

.preview-empty-body {
  font-size: 11px;
  line-height: 1.5;
  max-width: 240px;
}

/* ── Preview Fields (Luna Playground-style overrides) ───────────── */

.preview-fields {
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.preview-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.preview-field-label {
  color: var(--text-dim);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.preview-field-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.preview-field-input:hover { border-color: rgba(255,255,255,0.2); }
.preview-field-input:focus { border-color: var(--accent); }

.preview-field-input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
