/* ==========================================================================
   PHOSPHOR DARKROOM — 3-Theme Stylesheet (CRT '96 | OFFICE | TURBO '96)
   ========================================================================== */

:root,
[data-theme="crt"] {
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Consolas", "Cascadia Mono", "Courier New", monospace;

  --bg-app: #0b1116;
  --bg-panel: #131c24;
  --bg-panel-alt: #18232d;
  --bg-surface: #0e161d;
  --bg-input: #0a1015;
  --bg-canvas: #070b0f;

  --border: #273847;
  --border-hi: #3a5266;

  --text-main: #e6f2ec;
  --text-muted: #8ea6b5;
  --text-dim: #627a8a;

  --accent: #39ff88;
  --accent-bg: rgba(57, 255, 136, 0.12);
  --accent-text: #06180d;
  --accent-2: #ffb84d;
  --danger: #ff5c6c;
  --danger-bg: rgba(255, 92, 108, 0.14);
  --info: #4cc9f0;

  --bevel-btn: inset 1px 1px 0 rgba(255, 255, 255, 0.14), inset -1px -1px 0 rgba(0, 0, 0, 0.45);
  --bevel-inset: inset 1px 1px 0 rgba(0, 0, 0, 0.55), inset -1px -1px 0 rgba(255, 255, 255, 0.08);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.45);
  --radius: 4px;
  --radius-lg: 6px;
  --scanline-opacity: 0.08;
}

[data-theme="office"] {
  --font-ui: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", monospace;

  --bg-app: #eef2f6;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f6f8fb;
  --bg-surface: #f8fafc;
  --bg-input: #ffffff;
  --bg-canvas: #dde4ec;

  --border: #d0d9e4;
  --border-hi: #b5c4d6;

  --text-main: #182433;
  --text-muted: #526378;
  --text-dim: #79899c;

  --accent: #1d4ed8;
  --accent-bg: rgba(29, 78, 216, 0.09);
  --accent-text: #ffffff;
  --accent-2: #b45309;
  --danger: #c81e1e;
  --danger-bg: rgba(200, 30, 30, 0.08);
  --info: #0369a1;

  --bevel-btn: 0 1px 2px rgba(15, 23, 42, 0.06);
  --bevel-inset: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 3px 12px rgba(15, 23, 42, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --scanline-opacity: 0;
}

[data-theme="turbo"] {
  --font-ui: "Consolas", "Cascadia Mono", "Courier New", monospace;
  --font-mono: "Consolas", "Cascadia Mono", "Courier New", monospace;

  --bg-app: #020804;
  --bg-panel: #041208;
  --bg-panel-alt: #061b0c;
  --bg-surface: #030e06;
  --bg-input: #010602;
  --bg-canvas: #010402;

  --border: #0e6b32;
  --border-hi: #00ff66;

  --text-main: #7affaa;
  --text-muted: #35c46c;
  --text-dim: #1d7a42;

  --accent: #00ff66;
  --accent-bg: rgba(0, 255, 102, 0.14);
  --accent-text: #011407;
  --accent-2: #ffb000;
  --danger: #ff3355;
  --danger-bg: rgba(255, 51, 85, 0.16);
  --info: #00f0ff;

  --bevel-btn: inset 2px 2px 0 rgba(0, 255, 102, 0.35), inset -2px -2px 0 rgba(0, 20, 8, 0.9);
  --bevel-inset: inset 2px 2px 0 rgba(0, 0, 0, 0.85), inset -1px -1px 0 rgba(0, 255, 102, 0.25);
  --shadow-card: 0 0 18px rgba(0, 255, 102, 0.14);
  --radius: 0px;
  --radius-lg: 0px;
  --scanline-opacity: 0.24;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13.5px;
  overflow: hidden;
}

[data-theme="turbo"] body { text-shadow: 0 0 5px rgba(0, 255, 102, 0.4); }

.crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--scanline-opacity);
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, rgba(0, 0, 0, 0.55) 3px, transparent 4px);
}

[data-theme="turbo"] .crt-scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.62) 100%);
}

body.no-scanlines .crt-scanlines { opacity: 0 !important; }

/* TOPBAR */
.topbar {
  height: 54px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  user-select: none;
}

.brand-cluster { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text);
  font-family: var(--font-mono); font-weight: 900; font-size: 11.5px;
  display: grid; place-items: center; box-shadow: var(--bevel-btn); flex-shrink: 0;
}
.brand-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ver-badge { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border); }
.brand-sub { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }

.telemetry-cluster { display: flex; align-items: center; gap: 8px; }
.proof-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; background: var(--accent-bg); border: 1px solid var(--accent);
  color: var(--accent); font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
[data-theme="office"] .proof-pill { background: #ecfdf5; border-color: #10b981; color: #047857; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }

.lcd-strip { display: flex; gap: 5px; }
.lcd-cell {
  background: var(--bg-input); border: 1px solid var(--border); box-shadow: var(--bevel-inset);
  border-radius: var(--radius); padding: 2px 7px; display: flex; flex-direction: column; align-items: center; min-width: 54px;
}
.lcd-lbl { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-dim); }
.lcd-val { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
[data-theme="office"] .lcd-val { color: var(--text-main); }

.controls-cluster { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.theme-switch { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border-hi); border-radius: var(--radius); padding: 2px; gap: 2px; }
.theme-btn { border: none; background: transparent; color: var(--text-muted); font-family: var(--font-ui); font-size: 11px; font-weight: 700; padding: 4px 7px; border-radius: calc(var(--radius) - 1px); cursor: pointer; white-space: nowrap; }
.theme-btn.active { background: var(--accent); color: var(--accent-text); box-shadow: var(--bevel-btn); }

.icon-btn { width: 30px; height: 30px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-panel-alt); color: var(--text-main); cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.icon-btn.muted { opacity: 0.65; }
[data-theme="office"] #btnScanlines { display: none; }

.hdr-btn { height: 31px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border); font-family: var(--font-ui); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: var(--bevel-btn); }
.hdr-btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hdr-btn.secondary { background: var(--bg-panel-alt); color: var(--text-main); }

/* SHELL & SIDEBAR */
.app-shell { display: flex; height: calc(100vh - 54px - 44px); overflow: hidden; }
.sidebar { width: 232px; background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 10px 8px; gap: 9px; overflow-y: auto; flex-shrink: 0; }
.nav-section-lbl { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.7px; color: var(--text-dim); padding: 2px 6px 4px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tool-nav { display: flex; flex-direction: column; gap: 4px; }
.tool-tab { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 9px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--text-main); cursor: pointer; }
.tool-tab:hover { background: var(--bg-panel-alt); border-color: var(--border); }
.tool-tab.active { background: var(--accent-bg); border-color: var(--accent); box-shadow: var(--bevel-btn); }
.tab-ico { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.tab-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tab-name { font-weight: 700; font-size: 12.5px; }
.tool-tab.active .tab-name { color: var(--accent); }
.tab-desc { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); }
.tab-badge.warn { background: var(--accent-2); color: #1a1100; }

/* LOADED PHOTO QUEUE */
.loaded-files-panel { border-top: 1px solid var(--border); padding-top: 8px; }
.photo-queue { display: flex; flex-direction: column; gap: 5px; max-height: 165px; overflow-y: auto; }
.queue-item {
  display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: var(--radius);
  background: var(--bg-surface); border: 1px solid var(--border); cursor: pointer; width: 100%; text-align: left; color: var(--text-main);
}
.queue-item.active { border-color: var(--accent); background: var(--accent-bg); }
.queue-thumb { width: 32px; height: 26px; object-fit: cover; border-radius: 2px; background: #000; flex-shrink: 0; }
.queue-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.queue-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); }

.link-mini { background: none; border: none; font-size: 10.5px; font-weight: 700; cursor: pointer; padding: 0; color: var(--text-muted); }
.link-mini.danger { color: var(--danger); }
.link-mini:hover { text-decoration: underline; }

.help-bay { margin-top: auto; }
.bay-btn { width: 100%; padding: 6px 8px; border-radius: var(--radius); border: 1px solid var(--border-hi); background: var(--bg-panel-alt); color: var(--text-main); font-size: 11px; font-weight: 700; cursor: pointer; }
.help-btn { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.feedback-bay, .direct-bay { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 9px; font-size: 11px; }
.direct-bay { border-style: dashed; border-color: var(--border-hi); }
.bay-header { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-weight: 800; font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.bay-tag { background: var(--accent-bg); color: var(--accent); padding: 1px 5px; border-radius: 3px; font-size: 9px; }
[data-theme="office"] .bay-tag { background: #ecfdf5; color: #047857; }
.bay-copy { margin: 0 0 6px; color: var(--text-muted); line-height: 1.35; }
.sister-links { display: flex; justify-content: center; gap: 5px; font-size: 10.5px; color: var(--text-dim); flex-wrap: wrap; }
.sister-links a { color: var(--text-muted); text-decoration: none; }
.sister-links a:hover { color: var(--accent); text-decoration: underline; }

/* WORKBENCH & EMPTY STAGE */
.workbench { flex: 1; position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-app); }
[hidden] { display: none !important; }

.drop-overlay { position: absolute; inset: 10px; z-index: 60; background: rgba(10, 18, 24, 0.88); border: 3px dashed var(--accent); border-radius: var(--radius-lg); display: grid; place-items: center; }
[data-theme="office"] .drop-overlay { background: rgba(255, 255, 255, 0.92); }
.drop-overlay-box { text-align: center; }
.drop-ico { font-size: 46px; }
.drop-title { font-size: 20px; font-weight: 800; color: var(--accent); }
.drop-sub { color: var(--text-muted); }

.empty-stage { flex: 1; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.vault-card { max-width: 650px; width: 100%; background: var(--bg-panel); border: 2px dashed var(--border-hi); border-radius: var(--radius-lg); padding: 34px 30px; text-align: center; box-shadow: var(--shadow-card); }
.vault-icon { font-size: 44px; margin-bottom: 8px; }
.vault-title { margin: 0 0 10px; font-size: 23px; font-weight: 800; }
.vault-sub { margin: 0 auto 20px; max-width: 520px; color: var(--text-muted); line-height: 1.5; font-size: 14px; }
.vault-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.vault-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.v-pill { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted); }
.vault-theme-hint { font-size: 12px; color: var(--text-dim); padding-top: 12px; border-top: 1px solid var(--border); }

/* BUTTONS & INPUTS */
.cta-btn { padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border-hi); font-family: var(--font-ui); font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--bevel-btn); }
.cta-btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.cta-btn.secondary { background: var(--bg-panel-alt); color: var(--text-main); }
.cta-btn.small { padding: 7px 11px; font-size: 12px; }
.cta-btn.full, .tb-btn.full { width: 100%; }
.cta-btn:disabled, .tb-btn:disabled { opacity: 0.42; cursor: not-allowed; }

.tb-btn { height: 28px; padding: 0 9px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-main); font-family: var(--font-ui); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--bevel-btn); }
.tb-btn.accent { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tb-btn:hover:not(:disabled) { border-color: var(--accent); }
.tb-sep { width: 1px; height: 18px; background: var(--border-hi); margin: 0 3px; }
.tb-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.field-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.slider-lbl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
.slider-lbl > span { display: inline; }
.slider-lbl strong { float: right; font-family: var(--font-mono); color: var(--accent); }
.text-input { width: 100%; padding: 7px 9px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-input); color: var(--text-main); font-family: var(--font-ui); font-size: 12.5px; }
.range-input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.check-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; }
.tiny-note { margin: 0; font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.studio-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ACTIVE DARKROOM SPLIT WORKSPACE */
.darkroom-workspace { flex: 1; display: flex; overflow: hidden; }
.inspector-col { width: 320px; background: var(--bg-panel); border-right: 1px solid var(--border); padding: 14px; overflow-y: auto; flex-shrink: 0; }
.inspector-pane { display: flex; flex-direction: column; gap: 11px; }
.pane-head h3 { margin: 0 0 4px; font-size: 15.5px; }
.pane-sub { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* EXIF TABLE & BANNER */
.exif-banner { padding: 9px 10px; border-radius: var(--radius); border: 1px solid var(--accent-2); background: rgba(255, 184, 77, 0.12); color: var(--accent-2); font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.exif-banner.clean { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
[data-theme="office"] .exif-banner.clean { background: #ecfdf5; border-color: #10b981; color: #047857; }
.exif-table { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; }
.exif-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 3px; background: var(--bg-surface); border: 1px solid var(--border); font-size: 11.5px; }
.exif-row.gps { border-color: var(--danger); background: var(--danger-bg); }
.exif-k { color: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; }
.exif-v { font-family: var(--font-mono); font-weight: 700; text-align: right; word-break: break-word; }
.pane-actions { display: flex; flex-direction: column; gap: 7px; }
.audit-readout { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent); min-height: 16px; }
[data-theme="office"] .audit-readout { color: #047857; }

/* COMPRESS BOX */
.custom-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.size-compare-box { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); }
.sc-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sc-lbl { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); }
.sc-val { font-family: var(--font-mono); font-size: 13px; font-weight: 800; }
.sc-val.accent { color: var(--info); }
.sc-val.good { color: var(--accent); }
.sc-val.warn { color: var(--accent-2); }
.sc-arrow { color: var(--text-dim); font-size: 16px; }

.retro-size-note {
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-2);
  background: rgba(255, 184, 77, 0.11);
  color: var(--text-main);
  font-size: 11.5px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* CROP & RETRO CONTROLS */
.btn-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.btn-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.crop-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-pill { padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; cursor: pointer; }
.mini-pill.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 700; }

.preset-chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.retro-chip { padding: 7px 6px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-main); font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; cursor: pointer; text-align: center; }
.retro-chip:hover { border-color: var(--accent); }
.retro-chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* STAGE & BEFORE/AFTER SPLIT COMPARISON SLIDER */
.stage-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.stage-toolbar { background: var(--bg-panel-alt); border-bottom: 1px solid var(--border); padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-meta-pill { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--bg-input); border: 1px solid var(--border); padding: 4px 9px; border-radius: 999px; }

.canvas-stage-wrap {
  flex: 1;
  background: var(--bg-canvas);
  background-image: linear-gradient(45deg, rgba(128,128,128,0.06) 25%, transparent 25%), linear-gradient(-45deg, rgba(128,128,128,0.06) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(128,128,128,0.06) 75%), linear-gradient(-45deg, transparent 75%, rgba(128,128,128,0.06) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 20px;
}

.compare-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-hi);
  user-select: none;
  max-width: 100%;
}

.compare-stage canvas { display: block; max-width: 100%; max-height: calc(100vh - 200px); width: auto; height: auto; }
.orig-clip-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; clip-path: inset(0 50% 0 0); }
.orig-clip-layer canvas { width: 100%; height: 100%; }

.split-tag {
  position: absolute; top: 10px; z-index: 10; pointer-events: none;
  font-family: var(--font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  padding: 3px 7px; border-radius: 3px; background: rgba(0, 0, 0, 0.72); color: #fff; border: 1px solid rgba(255,255,255,0.22);
}
.split-tag.left { left: 10px; }
.split-tag.right { right: 10px; color: var(--accent); border-color: var(--accent); }

.split-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent); cursor: ew-resize; z-index: 15;
}
.split-knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 900; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); border: 2px solid #fff;
}

/* CROP OVERLAY */
.crop-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.48); z-index: 25; }
.crop-rect {
  position: absolute; border: 2px dashed #39ff88;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); cursor: move;
}
.crop-handle { position: absolute; width: 14px; height: 14px; background: #39ff88; border: 2px solid #04180d; border-radius: 2px; }
.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* STATUSBAR */
.statusbar { height: 44px; background: var(--bg-panel); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; gap: 10px; }
.status-left { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-led { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.status-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.export-name-wrap { display: flex; align-items: center; gap: 6px; }
.export-lbl { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.export-input { height: 30px; width: 205px; padding: 0 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-input); color: var(--text-main); font-family: var(--font-mono); font-size: 12px; }
.export-btn { height: 32px; padding: 0 15px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font-family: var(--font-ui); font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: var(--bevel-btn); white-space: nowrap; }
.export-btn:disabled { opacity: 0.42; cursor: not-allowed; }

/* MODALS & TOAST */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.65); display: grid; place-items: center; padding: 20px; }
.modal-window { width: 100%; max-width: 540px; max-height: 88vh; background: var(--bg-panel); border: 1px solid var(--border-hi); border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; overflow: hidden; }
.modal-window.wide { max-width: 680px; }
.modal-titlebar { background: var(--bg-panel-alt); border-bottom: 1px solid var(--border); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 800; }
.modal-close { background: none; border: 1px solid var(--border); border-radius: 3px; color: var(--text-main); width: 24px; height: 24px; cursor: pointer; }
.modal-body { padding: 16px; overflow-y: auto; line-height: 1.5; }
.proof-list { margin: 10px 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; color: var(--text-muted); }
.proof-list code, .help-section code { background: var(--bg-input); padding: 1px 4px; border-radius: 3px; font-family: var(--font-mono); color: var(--accent); }
.help-guide-body { display: flex; flex-direction: column; gap: 10px; }
.help-section { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.help-section h3 { margin: 0 0 5px; font-size: 13.5px; color: var(--accent); }
[data-theme="office"] .help-section h3 { color: #1e3a5f; }
.help-section p { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.form-grid { display: flex; flex-direction: column; gap: 9px; margin: 10px 0; }
.modal-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.toast { position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%); z-index: 300; background: var(--bg-panel); border: 1px solid var(--accent); color: var(--text-main); padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }

@media (max-width: 1380px) { .brand-sub { display: none; } }
@media (max-width: 1160px) { .lcd-strip { display: none; } }
@media (max-width: 960px) {
  .proof-pill { display: none; }
  .sidebar { width: 192px; }
  .inspector-col { width: 270px; }
}
