/* Filevion — cool paper, registry blue, stamp green. System type, native feel. */
:root {
  --paper: #f4f6f9;
  --paper-2: #eaeef4;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-sunk: #f0f3f7;
  --ink: #18202b;
  --ink-2: #4a5566;
  --ink-3: #6b7687;
  --line: rgba(24, 32, 43, 0.1);
  --line-strong: rgba(24, 32, 43, 0.18);
  --blue: #2f56d9;
  --blue-ink: #2147c4;
  --blue-soft: rgba(47, 86, 217, 0.1);
  --green: #17845a;
  --green-soft: rgba(23, 132, 90, 0.11);
  --amber: #a86400;
  --amber-soft: rgba(184, 110, 0, 0.12);
  --red: #c8352e;
  --red-soft: rgba(200, 53, 46, 0.1);
  --shadow-1: 0 1px 2px rgba(20, 30, 50, 0.06), 0 2px 8px rgba(20, 30, 50, 0.05);
  --shadow-2: 0 2px 6px rgba(20, 30, 50, 0.06), 0 18px 48px rgba(20, 30, 50, 0.14);
  --sidebar: rgba(236, 240, 246, 0.72);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #15181e;
  --paper-2: #1b1f27;
  --surface: rgba(32, 36, 45, 0.78);
  --surface-solid: #20242d;
  --surface-sunk: #191d24;
  --ink: #e9edf3;
  --ink-2: #b4bdcb;
  --ink-3: #8a94a5;
  --line: rgba(233, 237, 243, 0.09);
  --line-strong: rgba(233, 237, 243, 0.17);
  --blue: #6d8ff5;
  --blue-ink: #8ea8fa;
  --blue-soft: rgba(109, 143, 245, 0.16);
  --green: #43c08b;
  --green-soft: rgba(67, 192, 139, 0.14);
  --amber: #e7a540;
  --amber-soft: rgba(231, 165, 64, 0.14);
  --red: #f07167;
  --red-soft: rgba(240, 113, 103, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
  --sidebar: rgba(27, 31, 39, 0.72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-round); letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { display: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--blue); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.noscript { max-width: 40rem; margin: 3rem auto; padding: 1.5rem; line-height: 1.6; }
.noscript h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px 14px; background: var(--sidebar); border-right: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 6px; font: 650 17px/1 var(--font-round); letter-spacing: -0.01em; }
.side-nav, .side-foot { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; cursor: pointer; color: var(--ink-2); font-size: 14px;
}
.side-link:hover { background: var(--line); color: var(--ink); }
a.side-link { text-decoration: none; }
.side-link[aria-current="page"] { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }
.side-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px 10px; }
.side-heading h2 { font: 600 12px/1 var(--font); color: var(--ink-3); letter-spacing: 0; }
.ws-list { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ws-item { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 6px 6px 6px 10px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.ws-item:hover { background: var(--line); }
.ws-item[aria-current="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1); }
.ws-item .ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; }
.ws-item .ws-meter { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ws-item .icon-btn { width: 26px; height: 26px; opacity: 0; }
.ws-item:hover .icon-btn, .ws-item:focus-within .icon-btn { opacity: 1; }
.theme-switch { display: flex; gap: 2px; padding: 3px; margin: 8px 6px 0; border-radius: 10px; background: var(--line); width: max-content; }
.theme-switch button { border: 0; background: transparent; width: 32px; height: 26px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.theme-switch button[aria-checked="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1); }

.main { min-width: 0; display: flex; flex-direction: column; padding: 0 clamp(16px, 3vw, 40px); outline: none; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 0 14px; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.titles { flex: 1; min-width: 0; }
.title-input { width: 100%; border: 0; background: transparent; font: 680 26px/1.2 var(--font-round); letter-spacing: -0.02em; padding: 2px 6px; margin-left: -6px; border-radius: 8px; }
.title-input.small { font-size: 18px; }
.title-input:hover { background: var(--line); }
.title-input:focus { background: var(--surface-solid); outline: 2px solid var(--blue-soft); }
.title-input::placeholder { color: var(--ink-3); }
.subtitle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); }
.inline-input { flex: 1; max-width: 380px; border: 0; background: transparent; padding: 2px 6px; border-radius: 6px; color: var(--ink-2); }
.inline-input:hover { background: var(--line); }
.inline-input:focus { background: var(--surface-solid); outline: 2px solid var(--blue-soft); }
.top-actions { display: flex; gap: 8px; }
.only-mobile { display: none !important; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 6px 13px;
  border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--ink);
  font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(20, 30, 50, 0.04);
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--blue); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(33, 71, 196, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .btn.primary { background: #3d63e6; }
.btn.primary:hover { background: var(--blue-ink); }
.btn.success { background: var(--green); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .btn.success { color: #08251a; }
:root[data-theme="dark"] .btn.primary { color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--blue-ink); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { color: var(--red); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { background: var(--line); color: var(--ink); }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.input, select.input, textarea {
  width: 100%; min-height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-solid);
  padding: 6px 10px; font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.55; padding: 10px 12px; }
.input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); width: 16px; height: 16px; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
kbd { display: inline-block; min-width: 24px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-solid); font: 12px/1.4 var(--font); text-align: center; }

/* ---------- journey ---------- */
.journey { list-style: none; display: flex; margin: 6px 0 22px; padding: 0; gap: 0; counter-reset: s; }
.journey li { flex: 1; display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-3); position: relative; padding-right: 10px; }
.journey li::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--line-strong); margin-left: 4px; }
.journey li:last-child { flex: none; }
.journey li:last-child::after { display: none; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; border: 1.5px solid var(--line-strong); background: var(--surface-solid); font-variant-numeric: tabular-nums; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.journey li[data-state="done"] { color: var(--ink-2); }
.journey li[data-state="done"] .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.journey li[data-state="done"]::after { background: var(--green); }
.journey li[data-state="current"] { color: var(--ink); font-weight: 600; }
.journey li[data-state="current"] .step-num { border-color: var(--blue); color: var(--blue-ink); box-shadow: 0 0 0 4px var(--blue-soft); }

/* ---------- slot tickets ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.ticket {
  --tear: calc(100% - 212px);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 212px; min-height: 236px;
  background: var(--surface-solid); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  border: 1px solid var(--line); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.ticket.enter { animation: ticket-in 0.42s var(--ease) both; }
.ticket:hover { box-shadow: var(--shadow-2); }
.ticket::before, .ticket::after { content: ""; position: absolute; left: var(--tear); width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); z-index: 2; }
.ticket::before { top: -11px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -11px; clip-path: inset(0 0 50% 0); }
.ticket.dragover { box-shadow: 0 0 0 3px var(--blue), var(--shadow-2); }
.ticket-main { padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ticket-head { display: flex; align-items: center; gap: 10px; }
.slot-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); flex: none; }
.slot-icon svg { width: 19px; height: 19px; }
.ticket-name { flex: 1; min-width: 0; }
.ticket-name h3 { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-name .opt { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.empty { color: var(--ink-3); border-style: dashed; background: transparent; }
.ticket-file { flex: 1; display: flex; gap: 12px; align-items: stretch; min-height: 96px; }
.drop {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; flex-direction: column; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 14px; color: var(--ink-3); font-size: 13.5px;
  cursor: pointer; background: transparent; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.drop:hover, .drop:focus-visible { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }
.drop svg { width: 22px; height: 22px; }
.drop b { color: var(--ink); font-weight: 600; }
.thumb { width: 96px; height: 112px; border-radius: 10px; overflow: hidden; background: var(--surface-sunk) repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); flex: none; display: grid; place-items: center; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .pdf-glyph { display: grid; place-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; }
.thumb .pdf-glyph svg { width: 30px; height: 30px; }
.thumb .badge { position: absolute; bottom: 5px; left: 5px; font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 6px; background: rgba(15, 20, 30, 0.72); color: #fff; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.file-meta .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta .facts { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.file-meta .arrow { color: var(--ink-3); }
.file-meta .out { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.file-meta .actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.stub {
  position: relative; padding: 16px 16px 14px 18px; border-left: 2px dashed var(--line-strong);
  display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--surface-sunk), transparent 70%);
  border-radius: 0 var(--r-lg) var(--r-lg) 0; overflow: hidden;
}
.stub-title { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; line-height: 1.35; }
.checks li svg { width: 16px; height: 16px; margin-top: 1px; stroke-width: 2.2; }
.checks .pass svg { color: var(--green); }
.checks .fail svg { color: var(--red); }
.checks .warn svg { color: var(--amber); }
.checks .info svg, .checks .pending svg { color: var(--ink-3); }
.checks .val { display: block; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.checks .fail .val { color: var(--red); }
.stub .stub-action { margin-top: auto; }
.stamp + .stub-action { margin-top: 0; }
.stub .status-pill { align-self: flex-start; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stub .stub-action .btn { width: 100%; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill[data-status="missing"] { background: var(--surface-sunk); color: var(--ink-3); }
.status-pill[data-status="needs_attention"] { background: var(--amber-soft); color: var(--amber); }
.status-pill[data-status="processing"] { background: var(--blue-soft); color: var(--blue-ink); }
.status-pill[data-status="processing"]::before { animation: pulse 1s infinite; }
.status-pill[data-status="passed"] { background: var(--green-soft); color: var(--green); }
.status-pill[data-status="not_checked"] { background: var(--surface-sunk); color: var(--ink-2); }
.status-pill[data-status="error"] { background: var(--red-soft); color: var(--red); }

/* The stamp: the one bold moment */
.stamp {
  align-self: flex-end; margin: auto 4px -2px 0; transform: rotate(-9deg); pointer-events: none;
  border: 2.5px solid var(--green); color: var(--green); border-radius: 10px; padding: 4px 10px 5px; text-align: center;
  font: 760 12.5px/1.15 var(--font-round); letter-spacing: 0.02em; opacity: 0.88;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 25%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
}
.stamp small { display: block; font-weight: 600; font-size: 10.5px; letter-spacing: 0; opacity: 0.85; }
.stamp.fresh { animation: stamp 0.5s var(--spring) both; }

.progress-line { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-line span { display: block; height: 100%; width: 40%; background: var(--blue); border-radius: 3px; animation: indeterminate 1.1s var(--ease) infinite; }
.error-box { font-size: 13px; padding: 9px 11px; border-radius: 10px; background: var(--red-soft); color: var(--red); }
.error-box .hint { display: block; color: var(--ink-2); margin-top: 2px; }
.notice-box { font-size: 13px; padding: 9px 11px; border-radius: 10px; background: var(--amber-soft); color: var(--ink-2); }
.add-slot-row { display: flex; justify-content: center; padding: 18px 0 8px; }

/* empty state */
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-2); }
.empty > svg { width: 42px; height: 42px; color: var(--blue); stroke-width: 1.3; }
.empty h3 { font-size: 20px; color: var(--ink); }
.empty p { max-width: 52ch; }
.empty .row { justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.small-empty { padding: 40px 16px; }
.small-empty svg { width: 30px; height: 30px; color: var(--ink-3); }

/* pack bar */
.packbar {
  position: sticky; bottom: 14px; margin: 18px 0 18px; display: flex; align-items: center; gap: 16px;
  padding: 12px 14px 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-2); overflow: hidden;
}
.pack-progress { position: absolute; left: 0; top: 0; right: 0; height: 3px; background: transparent; }
.pack-progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.5s var(--ease); }
.pack-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pack-info strong { font-size: 14.5px; }
.pack-info span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sheets ---------- */
dialog.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--surface-solid); border-radius: 20px; box-shadow: var(--shadow-2);
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); display: none; flex-direction: column; overflow: hidden;
}
dialog.sheet[open] { display: flex; animation: sheet-in 0.28s var(--ease); }
dialog.sheet.wide { width: min(1080px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(14, 20, 32, 0.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 0.2s ease; }
dialog.inspector { margin: 12px 12px 12px auto; height: calc(100vh - 24px); max-height: none; width: min(560px, calc(100vw - 24px)); }
dialog.inspector[open] { animation: slide-in 0.32s var(--ease); }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.sheet-head > div:first-child, .sheet-head h2 { flex: 1; min-width: 0; }
.sheet-head p { margin-top: 3px; max-width: 70ch; }
.insp-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sheet-body { padding: 18px 22px 24px; overflow: auto; flex: 1; }
.sheet-foot { display: flex; align-items: center; gap: 14px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-foot .check-inline:first-child { margin-right: auto; }
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.prose p + p { margin-top: 10px; }

/* inspector sections */
.section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 0; }
.section:last-child { border-bottom: 0; }
.section > h3 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field { min-width: 0; }
.field .help { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-sunk); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; font-size: 13px; font-weight: 550; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1); }
.dims { display: flex; align-items: center; gap: 6px; }
.dims .input { text-align: center; }
.dims span { color: var(--ink-3); }
.with-unit { position: relative; }
.with-unit .input { padding-right: 36px; }
.with-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--ink-3); pointer-events: none; }

.compare { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-sunk) repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line); aspect-ratio: 4 / 3; user-select: none; touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare .after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare .after-wrap img { image-rendering: auto; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
.compare .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); }
.compare .tag { position: absolute; top: 8px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: rgba(15, 20, 30, 0.72); color: #fff; }
.compare .tag.l { left: 8px; }
.compare .tag.r { right: 8px; }
.compare input[type="range"] { position: absolute; inset: 0; opacity: 0; cursor: ew-resize; height: 100%; margin: 0; }
.actual-size { display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: 14px; background: var(--surface-sunk); border: 1px solid var(--line); overflow: auto; }
.actual-size img { max-width: none; image-rendering: auto; box-shadow: var(--shadow-1); }

.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: plan; }
.plan li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); counter-increment: plan; }
.plan li::before { content: counter(plan); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: var(--blue-soft); color: var(--blue-ink); }
.plan b { display: block; font-size: 14px; }
.plan span { font-size: 13px; color: var(--ink-3); }
.plan .choice { margin-top: 8px; }
.notes { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-sunk); border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 3px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1); }
.check-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.check-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.check-table tr:last-child td { border-bottom: 0; }
.check-table td:first-child { width: 22px; }
.check-table td:first-child svg { width: 16px; height: 16px; stroke-width: 2.2; margin-top: 2px; }
.check-table .pass svg { color: var(--green); }
.check-table .fail svg { color: var(--red); }
.check-table .warn svg { color: var(--amber); }
.check-table .exp { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.check-table .act { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.check-table .fail .act { color: var(--red); font-weight: 600; }
.check-table .adv { font-size: 11.5px; color: var(--amber); font-weight: 600; }
.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface-sunk); font-size: 13px; }
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .input { min-height: 28px; padding: 3px 8px; font-size: 13px; }
.advanced summary { cursor: pointer; font-size: 13.5px; color: var(--blue-ink); font-weight: 600; padding: 4px 0; }
.advanced[open] summary { margin-bottom: 10px; }
.sticky-actions { position: sticky; bottom: -24px; background: linear-gradient(transparent, var(--surface-solid) 30%); padding: 18px 0 4px; margin-top: 4px; display: flex; gap: 8px; }
.sticky-actions .btn.primary { flex: 1; }

/* reader */
.reader-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; }
.reader-input { display: flex; flex-direction: column; gap: 12px; }
.highlighted { white-space: pre-wrap; font-size: 14px; line-height: 1.75; padding: 12px 14px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); max-height: 260px; overflow: auto; }
.highlighted mark { background: var(--hl, var(--blue-soft)); color: inherit; border-radius: 4px; padding: 1px 2px; box-shadow: inset 0 -2px 0 var(--hl-line, var(--blue)); }
.highlighted mark.slotname { font-weight: 650; }
.highlighted mark.low { box-shadow: inset 0 -2px 0 var(--amber); background: var(--amber-soft); }
.reader-output { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reader-summary { font-weight: 600; }
.rslot { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-solid); display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--hl-line, var(--blue)); }
.rslot-head { display: flex; align-items: center; gap: 8px; }
.rslot-head .input { font-weight: 600; }
.rslot-head select.input { width: auto; }
.rrules { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rrule { font-size: 13px; padding: 7px 9px; border-radius: 10px; background: var(--surface-sunk); display: flex; flex-direction: column; gap: 2px; }
.rrule b { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.rrule .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.rrule .src { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrule .note { font-size: 11.5px; color: var(--ink-3); }
.conf { font-size: 11px; font-weight: 650; padding: 0 6px; border-radius: 6px; }
.conf.high { color: var(--green); background: var(--green-soft); }
.conf.medium { color: var(--blue-ink); background: var(--blue-soft); }
.conf.low { color: var(--amber); background: var(--amber-soft); }
.questions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.questions li { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.questions .row { flex-wrap: wrap; gap: 6px; }
.include-toggle { margin-left: auto; }

/* crop */
.crop-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 0; flex: 1; min-height: 0; }
.crop-stage { position: relative; background: #0f131a; min-height: 380px; height: min(64vh, 620px); touch-action: none; cursor: grab; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-side { padding: 18px; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); overflow: auto; }
.crop-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-sunk); margin-bottom: 6px; }
.crop-preview-wrap canvas { max-width: 100%; border-radius: 6px; box-shadow: var(--shadow-1); background: #fff; }

/* recipes */
.view { flex: 1; }
.recipes-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin: 10px 0 18px; }
.recipes-head p { max-width: 62ch; margin-top: 4px; }
.list-title { margin: 22px 0 10px; font-size: 14px; color: var(--ink-2); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.recipe { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-1); }
.recipe h4 { margin: 0; font: 650 15.5px/1.3 var(--font-round); }
.recipe p { font-size: 13px; color: var(--ink-3); }
.recipe .row { margin-top: auto; gap: 6px; flex-wrap: wrap; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; align-items: center; }
.keys dd { margin: 0; color: var(--ink-2); }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 96px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 380px; padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); font-size: 14px; animation: toast-in 0.3s var(--spring); }
.toast svg { margin-top: 2px; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.info svg { color: var(--blue); }
.toast .hint { display: block; color: var(--ink-3); font-size: 13px; }
.toast.out { animation: toast-out 0.22s ease forwards; }

@keyframes ticket-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-22deg) scale(1.8); } 60% { opacity: 1; transform: rotate(-7deg) scale(0.94); } 100% { transform: rotate(-9deg) scale(1); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .reader-body { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid !important; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.28s var(--ease); box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--paper) 92%, transparent); }
  .sidebar.open { transform: none; }
  .topbar { flex-wrap: wrap; padding-top: max(14px, env(safe-area-inset-top)); gap: 10px; }
  .titles { flex-basis: calc(100% - 50px); }
  .title-input { font-size: 22px; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; }
  .journey .step-label { display: none; }
  .journey li[data-state="current"] .step-label { display: inline; }
  .crop-body { grid-template-columns: 1fr; }
  .crop-stage { height: 50vh; min-height: 280px; }
  .crop-side { border-left: 0; border-top: 1px solid var(--line); }
  .crop-preview-wrap { display: none; }
}
@media (max-width: 620px) {
  .main { padding: 0 12px; }
  .ticket { grid-template-columns: 1fr; --tear: 0; }
  .ticket::before, .ticket::after { display: none; }
  .stub { border-left: 0; border-top: 2px dashed var(--line-strong); border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .topbar { position: static; }
  .packbar { bottom: max(8px, env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px 12px; padding: 12px; }
  .packbar .pack-info { flex-basis: 100%; }
  .packbar .btn { flex: 1; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  dialog.sheet, dialog.sheet.wide { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  dialog.inspector { width: 100vw; max-width: 100vw; height: 94vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  dialog.sheet[open], dialog.inspector[open] { animation: rise 0.32s var(--ease); }
  .toasts { left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); bottom: auto; }
  .toast { max-width: none; }
  .file-list li { grid-template-columns: 1fr 90px auto; }
  .sheet-body { padding: 16px; }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .progress-line span { width: 100%; animation: none; opacity: 0.5; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(24, 32, 43, 0.3); --line-strong: rgba(24, 32, 43, 0.5); --ink-3: #4a5566; }
}
@media print { .sidebar, .packbar, .topbar .top-actions { display: none; } }

/* reader slot colours */
.hl-0 { --hl: rgba(47, 86, 217, 0.12); --hl-line: #2f56d9; }
.hl-1 { --hl: rgba(23, 132, 90, 0.13); --hl-line: #17845a; }
.hl-2 { --hl: rgba(142, 68, 196, 0.12); --hl-line: #8e44c4; }
.hl-3 { --hl: rgba(196, 92, 20, 0.12); --hl-line: #c45c14; }
.hl-4 { --hl: rgba(18, 140, 160, 0.13); --hl-line: #128ca0; }
.hl-5 { --hl: rgba(190, 40, 100, 0.11); --hl-line: #be2864; }
:root[data-theme="dark"] .hl-0 { --hl-line: #6d8ff5; } :root[data-theme="dark"] .hl-1 { --hl-line: #43c08b; }
:root[data-theme="dark"] .hl-2 { --hl-line: #b57ee6; } :root[data-theme="dark"] .hl-3 { --hl-line: #ee8f4c; }
:root[data-theme="dark"] .hl-4 { --hl-line: #4cc6d8; } :root[data-theme="dark"] .hl-5 { --hl-line: #ee6fa1; }
.mt { margin-top: 12px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pair .compare { aspect-ratio: 3 / 4; }
.pair figcaption { font-size: 12px; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }

/* hero / empty state */
.hero { padding: 48px 20px 36px; }
.hero-mark { filter: drop-shadow(0 10px 24px rgba(39, 71, 199, 0.28)); margin-bottom: 4px; }
.hero h3 { font-size: 26px; letter-spacing: -0.02em; }
.hero-steps { list-style: none; counter-reset: hs; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 26px 0 6px; padding: 0; width: min(100%, 900px); text-align: left; }
.hero-steps li { counter-increment: hs; position: relative; padding: 14px 14px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-3); }
.hero-steps li::before { content: counter(hs); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--blue-soft); color: var(--blue-ink); margin-bottom: 4px; }
.hero-steps li:last-child::before { background: var(--green-soft); color: var(--green); }
.hero-steps b { color: var(--ink); font-size: 14px; }
@media (max-width: 860px) { .hero-steps { grid-template-columns: 1fr 1fr; } .hero-steps li:last-child { grid-column: 1 / -1; } }

/* caption */
.caption-box { padding: 10px 12px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); }

/* tour */
.tour { position: fixed; inset: 0; z-index: 2000; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(12, 18, 30, 0.55); outline: 2px solid rgba(255, 255, 255, 0.9); transition: all 0.28s var(--ease); pointer-events: none; }
.tour-pop { position: fixed; background: var(--surface-solid); color: var(--ink); border-radius: 16px; padding: 16px 16px 12px; box-shadow: var(--shadow-2); transition: top 0.28s var(--ease), left 0.28s var(--ease); animation: sheet-in 0.25s var(--ease); }
.tour-pop h3 { font-size: 17px; margin: 2px 0 6px; }
.tour-pop p { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.tour-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* views & motion */
.view-in { animation: view-in 0.32s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.topbar-min .titles, .topbar-min .top-actions { display: none; }
.topbar-min { padding-bottom: 0; }
.thumb img { animation: pop-in 0.4s var(--spring) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.86); } }
.packbar.celebrate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--green) 22%, transparent) 50%, transparent 80%); animation: sweep 1.1s var(--ease) both; pointer-events: none; }
.packbar.celebrate #downloadPack { animation: nudge 0.6s var(--spring) 0.5s both; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes nudge { 40% { transform: scale(1.06); } }
#view-workspace.drop-all { outline: 2px dashed var(--blue); outline-offset: 6px; border-radius: 18px; background: var(--blue-soft); }
.drop-tip { margin-top: 6px; }

/* PDF Studio */
.presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 4px 0 10px; }
.presets button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 12px 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s; }
.presets button:hover { border-color: var(--line-strong); }
.presets button:active { transform: scale(0.98); }
.presets button svg { width: 20px; height: 20px; color: var(--blue-ink); margin-bottom: 4px; }
.presets button b { font-size: 14px; }
.presets button span { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.presets button[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.drop.big { min-height: 220px; margin-top: 14px; }
.pdf-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; padding-right: 2px; border-left: 4px solid var(--fc); }
.file-chip .icon-btn { width: 22px; height: 22px; }
.pdf-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0 12px; }
.pdf-toolbar > .muted { margin-right: 6px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 4px 2px 20px; }
.pages.split-mode { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.page { --fc: #2f56d9; position: relative; background: var(--surface-solid); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: 8px; cursor: pointer; transition: transform .16s var(--ease), box-shadow .16s, border-color .16s; animation: pop-in .35s var(--ease) both; border-top: 3px solid var(--fc); }
.page:hover { box-shadow: var(--shadow-2); }
.page.selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft), var(--shadow-1); }
.page.dragging { opacity: .4; }
.page.over { transform: translateX(6px); border-color: var(--blue); }
.page-img { aspect-ratio: 1 / 1.3; display: grid; place-items: center; background: var(--surface-sunk); border-radius: 6px; overflow: hidden; }
.page-rot { transition: transform .3s var(--ease); display: grid; place-items: center; width: 100%; height: 100%; }
.page-img img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 3px rgba(0,0,0,.15); background: #fff; }
.noprev svg { width: 34px; height: 34px; color: var(--ink-3); }
.page-foot { display: flex; align-items: center; gap: 6px; padding: 6px 2px 0; }
.page-no { font-weight: 700; font-size: 12px; min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-sunk); font-variant-numeric: tabular-nums; }
.page-actions { margin-left: auto; display: flex; opacity: 0; transition: opacity .15s; }
.page:hover .page-actions, .page:focus-within .page-actions { opacity: 1; }
.page-actions .icon-btn { width: 26px; height: 26px; }
.page .tick { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; transform: scale(0); transition: transform .2s var(--spring); }
.page .tick svg { width: 14px; height: 14px; stroke-width: 3; }
.page.selected .tick { transform: scale(1); }
.page[style*="--file:1"] { --fc: #17845a; } .page[style*="--file:2"] { --fc: #8e44c4; } .page[style*="--file:3"] { --fc: #c45c14; } .page[style*="--file:4"] { --fc: #128ca0; } .page[style*="--file:5"] { --fc: #be2864; }
.file-chip[style*="--file:0"] { --fc: #2f56d9; } .file-chip[style*="--file:1"] { --fc: #17845a; } .file-chip[style*="--file:2"] { --fc: #8e44c4; } .file-chip[style*="--file:3"] { --fc: #c45c14; } .file-chip[style*="--file:4"] { --fc: #128ca0; } .file-chip[style*="--file:5"] { --fc: #be2864; }
.split-mode { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cut { display: none; }
.split-mode .cut { display: grid; place-items: center; position: relative; z-index: 2; width: 30px; height: 30px; margin: auto -23px auto -23px; border-radius: 50%; border: 1.5px dashed var(--line-strong); background: var(--surface-solid); cursor: pointer; font-size: 14px; color: var(--ink-3); justify-self: center; grid-column: auto; }
.split-mode { display: flex; flex-wrap: wrap; gap: 16px; }
.split-mode .page { width: 150px; }
.split-mode .cut.on { background: var(--amber); color: #fff; border: 0; }
.split-mode .cut.on + .page { margin-left: 18px; box-shadow: -10px 0 0 -6px var(--amber), var(--shadow-1); }
.pdf-out { flex-wrap: wrap; }
.pdf-out select.input { width: auto; }
.pdf-name { width: 170px; }
.btn.working { position: relative; color: transparent !important; }
.btn.working::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .presets { grid-template-columns: 1fr 1fr; } .pages { grid-template-columns: repeat(2, 1fr); } .split-mode .page { width: calc(50% - 30px); } .pdf-name { flex: 1; } }

/* Smart Sort */
.sort-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sort-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 190px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); animation: pop-in .3s var(--ease) both; }
.sort-main { display: flex; flex-direction: column; min-width: 0; }
.sort-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
@media (max-width: 620px) { .sort-list li { grid-template-columns: 34px 1fr; } .sort-list select { grid-column: 1 / -1; } }

/* Guide */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; padding-bottom: 30px; }
.guide-grid article { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-1); }
.guide-grid h3 { font-size: 16px; margin-bottom: 8px; }
.guide-grid ol, .guide-grid ul { margin: 0 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.guide-grid ul.plain { list-style: none; padding-left: 0; }
.guide-grid code { font-size: 12.5px; background: var(--surface-sunk); padding: 1px 5px; border-radius: 5px; }
.page-foot .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12px; }
.file-chip { border-left: 0; box-shadow: inset 4px 0 0 var(--fc); padding-left: 12px; }
@media (max-width: 620px) {
  .pdf-out { position: static; margin-top: 8px; }
  .presets button span { display: none; }
}

/* Privacy Center */
.where { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; }
.where.local { background: var(--green-soft); }
.where.remote { background: var(--amber-soft); }
.where svg { width: 28px; height: 28px; flex: none; }
.where.local svg { color: var(--green); } .where.remote svg { color: var(--amber); }
.where b { display: block; font-size: 15px; }
.where span { font-size: 13.5px; color: var(--ink-2); }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--surface-solid); margin-bottom: 14px; }
.pc-card h3 { margin-bottom: 10px; }
.pc-flow, .pc-never { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: var(--ink-2); }
.pc-flow li::marker { color: var(--blue); font-weight: 700; }
.pc-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.pc-row:first-of-type { border-top: 0; }
.pc-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pc-row select.input { width: auto; }
.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch span:first-of-type { position: absolute; inset: 0; border-radius: 13px; background: var(--line-strong); transition: background .2s; }
.switch span:first-of-type::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--spring); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.danger-row b { color: var(--red); }
.privacy-link { position: relative; }
.where-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.where-dot.remote { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
@media (max-width: 860px) { .pc-grid { grid-template-columns: 1fr; } .pc-row { flex-wrap: wrap; } }

/* hidden data panel */
.hidden-data { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hidden-data li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--surface-sunk); font-size: 13.5px; }
.hidden-data .sev { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); align-self: center; }
.hidden-data .high .sev { background: var(--red); } .hidden-data .medium .sev { background: var(--amber); }
.hidden-data .why { display: block; color: var(--ink-3); font-size: 12.5px; }
.hidden-data .det { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clean-note { margin-top: 8px; font-size: 13px; color: var(--green); display: flex; gap: 6px; align-items: center; }
.clean-note svg { width: 16px; height: 16px; }
.chip.warn { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.priv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wm-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.wm-row .input { flex: 1; }

/* redactor */
.redact-stage { position: relative; background: #0f131a; height: min(64vh, 620px); min-height: 320px; cursor: crosshair; touch-action: none; }
.redact-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.redact-tip { margin-right: auto; max-width: 420px; }
.page .badge-redact { position: absolute; left: 14px; top: 14px; font-size: 11px; font-weight: 700; background: #111; color: #fff; padding: 2px 7px; border-radius: 6px; }

.wm-inline { display: inline-flex; gap: 6px; align-items: center; }
.wm-inline .input { width: 220px; min-height: 30px; padding: 3px 8px; font-size: 13px; }

/* lessons */
.lessons-wrap { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-1); margin-bottom: 8px; }
.lessons-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 12px; }
.lessons-head h3 { font-size: 17px; }
.lesson-progress { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.lp-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.lp-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .5s var(--ease); }
.lessons { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.lesson { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface-sunk); border: 1px solid var(--line); }
.lesson-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; font-size: 13px; }
.lesson.done .lesson-n { background: var(--green); color: #fff; }
.lesson.done .lesson-n svg { width: 16px; height: 16px; stroke-width: 2.6; }
.lesson-body b { font-size: 14.5px; }
.lesson-body details { margin-top: 4px; font-size: 13px; }
.lesson-body summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; }
.lesson-body ol { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }

/* explainer video */
.video-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-1); margin-bottom: 14px; }
.video-wrap video { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #0d1424; display: block; }
.video-side h3 { font-size: 17px; margin: 4px 0 6px; }
.video-chapters { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.video-chapters button { border: 0; background: var(--blue-soft); color: var(--blue-ink); font: 600 12.5px var(--font); padding: 2px 8px; border-radius: 6px; margin-right: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .video-wrap { grid-template-columns: 1fr; } }

/* ---------- live protections & permanent removal ---------- */
.pc-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pc-checks li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pc-checks li:first-child { border-top: 0; padding-top: 2px; }
.pc-checks li > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pc-checks li.on > svg { color: var(--green); } .pc-checks li.off > svg { color: var(--amber); } .pc-checks li.na > svg { color: var(--ink-3); }
.pc-checks li div { flex: 1; min-width: 0; }
.pc-checks li b { display: block; font-size: 14px; }
.pc-checks li span { display: block; font-size: 13px; color: var(--ink-2); }
.pc-checks li em { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; flex: none; }
.pc-checks li.on em { background: var(--green-soft); color: var(--green); }
.pc-checks li.off em { background: var(--amber-soft); color: var(--amber); }
.pc-checks li.na em { background: var(--surface-sunk); color: var(--ink-3); }
dialog.erase-sheet { width: min(520px, calc(100vw - 24px)); }
.erase-list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.erase-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-sunk); }
.erase-list li svg { width: 22px; height: 22px; flex: none; color: var(--ink-2); }
.erase-list b { display: block; font-size: 14px; }
.erase-list span { font-size: 13px; color: var(--ink-2); }
.erase-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn.danger-solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.danger-solid:hover { filter: brightness(1.06); }
.btn.danger-solid svg { color: #fff; }
.receipt { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; margin-bottom: 12px; }
.receipt.ok { background: var(--green-soft); } .receipt.warn { background: var(--amber-soft); }
.receipt > svg { width: 30px; height: 30px; flex: none; }
.receipt.ok > svg { color: var(--green); } .receipt.warn > svg { color: var(--amber); }
.receipt b { display: block; font-size: 16px; } .receipt span { font-size: 13px; color: var(--ink-2); }
.receipt-list { list-style: none; margin: 0 0 10px; padding: 0; }
.receipt-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px dashed var(--line-strong); font-size: 14px; }
.receipt-list li span { color: var(--ink-2); }
.receipt-list b.good { color: var(--green); } .receipt-list b.bad { color: var(--red); }
