/* ==========================================================================
   Cropper — editorial dark theme
   ========================================================================== */

:root {
  /* Neutral grays — Capture One / Lightroom inspired */
  --bg-0: #0c0c0d;          /* deepest */
  --bg-1: #131315;          /* surface */
  --bg-2: #1a1a1d;          /* raised */
  --bg-3: #232327;          /* hover */
  --bg-4: #2c2c31;          /* border */
  --bg-5: #3a3a40;          /* strong border */

  --fg-0: #f4f4f5;          /* primary */
  --fg-1: #c8c8cc;          /* secondary */
  --fg-2: #8e8e94;          /* tertiary */
  --fg-3: #5c5c63;          /* quaternary */
  --fg-4: #3e3e44;          /* disabled */

  --accent: #22d3ee;        /* cyan */
  --accent-dim: #0e7490;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --accent-border: rgba(34, 211, 238, 0.35);

  --danger: #f43f5e;
  --warning: #f59e0b;
  --success: #10b981;

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);

  --topbar-h: 56px;
  --toolbar-h: 64px;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --font-serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

input, select { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--fg-0); }

/* ==========================================================================
   App shell
   ========================================================================== */

.app {
  display: grid;
  grid-template-rows: var(--topbar-h) auto 1fr;
  height: 100vh;
  width: 100vw;
}

.app[data-toolbar-pos="left"] {
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: 280px 1fr;
}
.app[data-toolbar-pos="left"] .topbar { grid-column: 1 / -1; }
.app[data-toolbar-pos="left"] .toolbar { grid-row: 2 / 3; }
.app[data-toolbar-pos="left"] .canvas { grid-row: 2 / 3; }

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--bg-4);
  height: var(--topbar-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  background: var(--bg-0);
}
.brand-mark::before { inset: 5px 0 0 5px; }
.brand-mark::after  { inset: 0 5px 5px 0; }
.brand-mark span {
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--bg-0);
  border-radius: 1px;
}
.brand-name { font-family: var(--font-serif); font-size: 17px; font-weight: 400; letter-spacing: 0; }
.brand-divider { width: 1px; height: 16px; background: var(--bg-4); }
.brand-session {
  color: var(--fg-2);
  font-size: 12px;
  font-family: var(--font-mono);
}

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--fg-1);
  transition: background 100ms, color 100ms;
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg-0); }
.icon-btn:active { background: var(--bg-4); }
.icon-btn[data-active="true"] { background: var(--accent-soft); color: var(--accent); }

.btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-1);
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  transition: background 100ms, border-color 100ms, color 100ms;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); color: var(--fg-0); border-color: var(--bg-5); }
.btn:active { background: var(--bg-4); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--fg-0);
  color: var(--bg-0);
  border-color: var(--fg-0);
  font-weight: 600;
}
.btn-primary:hover { background: #fff; color: var(--bg-0); border-color: #fff; }
.btn-accent {
  background: var(--accent);
  color: #062c33;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-accent:hover { background: #5ee0f0; border-color: #5ee0f0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--bg-4); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(244,63,94,0.1); border-color: rgba(244,63,94,0.3); color: var(--danger); }

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  background: var(--bg-3);
  border: 1px solid var(--bg-5);
  border-radius: 3px;
  color: var(--fg-2);
  line-height: 1.4;
}

/* ==========================================================================
   Toolbar (top)
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 18px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--bg-4);
  height: var(--toolbar-h);
  overflow-x: auto;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 100%;
  position: relative;
}
.tool-group + .tool-group::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 28px;
  background: var(--bg-4);
}
.tool-group:first-of-type { padding-left: 0; }

.tool-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-right: 10px;
  font-family: var(--font-mono);
}

/* segmented control for ratios + resolutions */
.segment {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.segment button {
  height: 26px;
  padding: 0 10px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-2);
  font-family: var(--font-mono);
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
}
.segment button:hover { color: var(--fg-0); }
.segment button[data-active="true"] {
  background: var(--bg-4);
  color: var(--fg-0);
  box-shadow: inset 0 0 0 1px var(--bg-5);
}

.ratio-glyph {
  display: inline-block;
  border: 1.2px solid currentColor;
  opacity: 0.7;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ==========================================================================
   Toolbar (left rail variant)
   ========================================================================== */

.app[data-toolbar-pos="left"] .toolbar {
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  width: 280px;
  padding: 16px;
  border-right: 1px solid var(--bg-4);
  border-bottom: none;
  overflow-y: auto;
  gap: 18px;
}
.app[data-toolbar-pos="left"] .tool-group {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 8px;
  height: auto;
}
.app[data-toolbar-pos="left"] .tool-group + .tool-group::before {
  display: none;
}
.app[data-toolbar-pos="left"] .tool-group {
  border-top: 1px solid var(--bg-4);
  padding-top: 16px;
}
.app[data-toolbar-pos="left"] .tool-group:first-of-type {
  border-top: none;
  padding-top: 0;
}
.app[data-toolbar-pos="left"] .tool-label {
  margin-right: 0;
  margin-bottom: 2px;
}
.app[data-toolbar-pos="left"] .segment {
  flex-wrap: wrap;
}
.app[data-toolbar-pos="left"] .segment button {
  flex: 1 1 auto;
  min-width: 56px;
  justify-content: center;
}

/* ==========================================================================
   Canvas (main content area)
   ========================================================================== */

.canvas {
  background: var(--bg-0);
  overflow-y: auto;
  position: relative;
}

.canvas-inner {
  padding: 24px 28px 80px;
  max-width: 1800px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.005em;
}
.section-title em { font-style: italic; color: var(--fg-2); }
.section-meta {
  color: var(--fg-2);
  font-size: 12px;
  font-family: var(--font-mono);
}
.section-meta strong { color: var(--fg-0); font-weight: 500; }

/* ==========================================================================
   Drop zone
   ========================================================================== */

.dropzone {
  margin: 60px auto;
  max-width: 720px;
  border: 1.5px dashed var(--bg-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
  padding: 80px 40px;
  text-align: center;
  transition: border-color 150ms, background 150ms;
}
.dropzone[data-drag="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-0) 70%);
}
.dropzone-glyph {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  display: grid;
  place-items: center;
  color: var(--fg-1);
}
.dropzone h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.dropzone h2 em { font-style: italic; color: var(--fg-2); }
.dropzone p {
  margin: 0 0 24px;
  color: var(--fg-2);
  font-size: 13px;
}
.dropzone-actions { display: flex; gap: 8px; justify-content: center; }
.dropzone-hint {
  margin-top: 24px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  display: flex;
  gap: 16px;
  justify-content: center;
}
.dropzone-hint span { display: inline-flex; align-items: center; gap: 5px; }

/* ==========================================================================
   Thumbnail grid
   ========================================================================== */

.grid {
  display: grid;
  gap: 16px;
}
.grid[data-density="compact"] { gap: 10px; }

.thumb {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
}
.thumb:hover { border-color: var(--bg-5); }
.thumb-canvas {
  width: 100%;
  display: block;
  background: #000;
  position: relative;
  overflow: hidden;
}
.thumb-canvas img {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* dim outside crop */
.thumb-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.thumb-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  -webkit-mask: var(--mask);
          mask: var(--mask);
}
.thumb-frame {
  position: absolute;
  border: 1.5px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  pointer-events: none;
}
.thumb-frame::before, .thumb-frame::after,
.thumb-frame > i:nth-child(1), .thumb-frame > i:nth-child(2) {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.25);
}
.thumb-frame::before { inset: 33.33% 0 33.33% 0; }
.thumb-frame::after  { inset: 0 33.33% 0 33.33%; }
.thumb-frame > i {
  display: block;
  background: transparent;
}

.thumb-meta {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--fg-1);
  background: var(--bg-1);
  border-top: 1px solid var(--bg-4);
  gap: 8px;
  min-width: 0;
}
.thumb-idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  flex-shrink: 0;
}
.thumb-name {
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.thumb-dim { color: var(--fg-3); font-family: var(--font-mono); font-size: 10.5px; flex-shrink: 0; }

.thumb-status {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg-1);
}
.thumb-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 100px;
  background: var(--fg-2);
}
.thumb-status[data-status="cropped"] .dot { background: var(--accent); }
.thumb-status[data-status="cropped"] { color: var(--accent); }
.thumb-status[data-status="default"] .dot { background: var(--fg-3); }

.thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms;
}
.thumb:hover .thumb-actions { opacity: 1; }
.thumb-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg-1);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 100ms, color 100ms;
}
.thumb-action:hover { background: rgba(0,0,0,0.85); color: var(--fg-0); }
.thumb-action:disabled { opacity: 0.35; cursor: not-allowed; }
.thumb-action:disabled:hover { background: rgba(0,0,0,0.6); color: var(--fg-1); }
.thumb-action.danger:hover { color: var(--danger); }

.thumb-index {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.5);
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
  display: none;
}

/* add card */
.add-card {
  border: 1.5px dashed var(--bg-5);
  border-radius: var(--radius-md);
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--fg-2);
  transition: all 120ms;
  cursor: pointer;
  min-height: 200px;
}
.add-card:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}
.add-card-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* ==========================================================================
   Preview / fullscreen
   ========================================================================== */

.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: fade-in 200ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.preview-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--bg-4);
  background: rgba(12,12,13,0.7);
  flex-shrink: 0;
}
.preview-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
  display: flex;
  gap: 12px;
  align-items: center;
}
.preview-title strong { color: var(--fg-0); font-weight: 500; }
.preview-counter {
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-2);
  border-radius: 100px;
  border: 1px solid var(--bg-4);
}

.preview-stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.preview-canvas {
  position: relative;
  background: #000;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.preview-canvas img {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
}
.preview-mode-tag {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--bg-4);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.preview-mode-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 100px;
  background: var(--accent);
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 100px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--bg-4);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  color: var(--fg-1);
  transition: background 120ms, color 120ms;
}
.preview-nav:hover { background: rgba(0,0,0,0.85); color: var(--fg-0); }
.preview-nav-prev { left: 20px; }
.preview-nav-next { right: 20px; }

.preview-bottombar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--bg-4);
  background: rgba(12,12,13,0.7);
  padding: 0 20px;
  position: relative;
}
.preview-bottombar-left,
.preview-bottombar-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}
.preview-bottombar-left { left: 20px; }
.preview-bottombar-right { right: 20px; }

.preview-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.preview-hint .kbd { background: var(--bg-2); }

/* ==========================================================================
   Crop frame (interactive — preview mode)
   ========================================================================== */

.crop-frame {
  position: absolute;
  border: 1.5px solid #fff;
  cursor: move;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
}
.crop-frame[data-thirds="true"]::before,
.crop-frame[data-thirds="true"]::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
}
.crop-frame[data-thirds="true"]::before {
  left: 0; right: 0; top: 33.33%; bottom: 33.33%;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  background: transparent;
}
.crop-frame[data-thirds="true"]::after {
  top: 0; bottom: 0; left: 33.33%; right: 33.33%;
  border-left: 1px solid rgba(255,255,255,0.4);
  border-right: 1px solid rgba(255,255,255,0.4);
  background: transparent;
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1.5px solid var(--bg-0);
  border-radius: 2px;
}
.crop-handle.tl { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.tr { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.br { bottom: -7px; right: -7px; cursor: nwse-resize; }

.crop-edge {
  position: absolute;
  background: transparent;
}
.crop-edge.t { top: -4px; left: 14px; right: 14px; height: 8px; cursor: ns-resize; }
.crop-edge.b { bottom: -4px; left: 14px; right: 14px; height: 8px; cursor: ns-resize; }
.crop-edge.l { left: -4px; top: 14px; bottom: 14px; width: 8px; cursor: ew-resize; }
.crop-edge.r { right: -4px; top: 14px; bottom: 14px; width: 8px; cursor: ew-resize; }

.crop-info {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  padding: 3px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-0);
  pointer-events: none;
}

/* ==========================================================================
   Export sheet
   ========================================================================== */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: center;
  animation: fade-in 150ms ease;
}
.sheet {
  width: 480px;
  max-width: 90vw;
  background: var(--bg-1);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: sheet-in 200ms ease;
}
@keyframes sheet-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.005em;
}
.sheet-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sheet-row { display: flex; flex-direction: column; gap: 8px; }
.sheet-row-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.sheet-input {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-sm);
  color: var(--fg-0);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color 100ms;
}
.sheet-input:focus { border-color: var(--accent-border); }

.sheet-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-4);
}
.sheet-summary-item { display: flex; flex-direction: column; gap: 3px; }
.sheet-summary-key {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.sheet-summary-val {
  font-size: 13px;
  color: var(--fg-0);
  font-weight: 500;
}

.sheet-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--bg-4);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-0);
}

.progress {
  height: 4px;
  border-radius: 100px;
  background: var(--bg-3);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 200ms;
}

/* ==========================================================================
   Slider (used inline)
   ========================================================================== */

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-3);
  border-radius: 100px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--fg-0);
  border-radius: 100px;
  cursor: pointer;
  border: 2px solid var(--bg-1);
}
.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--fg-0);
  border-radius: 100px;
  cursor: pointer;
  border: 2px solid var(--bg-1);
}

/* ==========================================================================
   Format selector + filename
   ========================================================================== */

.fmt-selector { display: flex; gap: 4px; }
.fmt-pill {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  color: var(--fg-2);
  cursor: pointer;
  transition: all 100ms;
}
.fmt-pill:hover { color: var(--fg-0); border-color: var(--bg-5); }
.fmt-pill[data-active="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-wrap {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--fg-0);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease;
  font-family: var(--font-mono);
}
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast .dot {
  width: 6px;
  height: 6px;
  border-radius: 100px;
  background: var(--accent);
}

/* ==========================================================================
   Misc
   ========================================================================== */

.divider-v { width: 1px; height: 20px; background: var(--bg-4); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 100px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

.no-select { user-select: none; -webkit-user-select: none; }

/* status badge in topbar */
.session-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-1);
}
.session-stat strong { color: var(--fg-0); font-weight: 500; }
.session-stat.output-stat strong { font-family: var(--font-mono); }
.session-stat.output-stat { background: var(--bg-2); }
.session-stat.output-stat .accent { color: var(--accent); }
.session-stat .accent { color: var(--accent); font-weight: 500; }
