:root {
  color-scheme: light;
  --bg: #f5f4f8;
  --surface: #ffffff;
  --surface-2: #edeaf4;
  --ink: #1a1625;
  --muted: #78728a;
  --line: #dbd7e7;
  --teal: #8b5cf6;
  --blue: #4f46e5;
  --amber: #d97706;
  --red: #e11d48;
  --green: #059669;
  --shadow: 0 18px 42px rgba(139, 92, 246, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0b14;
  --surface: #14111f;
  --surface-2: #1d182e;
  --ink: #f3f0f7;
  --muted: #a29cb3;
  --line: #2b2440;
  --teal: #a855f7;
  --blue: #6366f1;
  --amber: #f59e0b;
  --red: #f43f5e;
  --green: #10b981;
  --shadow: 0 18px 42px rgba(9, 5, 18, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
form { margin: 0; }

.app-shell { min-height: 100vh; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 950; letter-spacing: 0; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18)); }
.top-nav { display: flex; align-items: center; gap: 18px; }
.top-nav a {
  height: 52px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}
.top-nav a.active { border-color: var(--teal); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.theme-icon {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sound-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--teal) 52%, var(--line));
  color: var(--teal);
  background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 12%, var(--surface)), var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 8%, transparent), 0 6px 18px color-mix(in srgb, var(--teal) 8%, transparent);
}
.sound-toggle[aria-pressed="false"] {
  color: var(--muted);
}
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: 0; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.bottom-nav { display: none; }

.btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 830;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary { border-color: var(--teal); background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 92%, #ffffff), var(--teal)); color: #fff; }
.btn.ghost { background: var(--surface-2); }
.btn.small { height: 30px; padding: 0 9px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn.active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.btn.danger { border-color: color-mix(in srgb, var(--red) 62%, var(--line)); color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.btn.disabled, .btn:disabled { opacity: 0.55; pointer-events: none; cursor: default; }

label { display: grid; gap: 7px; color: var(--muted); font-weight: 760; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
.muted { color: var(--muted); }

.credit-pill {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}
.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.flash { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 760; }
.flash.error { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.flash.success { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); color: var(--green); }

.download-home {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
  padding-bottom: 8vh;
}
.home-stack {
  width: min(760px, 100%);
  display: grid;
  gap: 18px;
}
.download-card {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: center;
}
.home-logo { width: 118px; height: 118px; justify-self: center; object-fit: contain; filter: drop-shadow(0 16px 20px rgba(0,0,0,0.22)); }
.download-card h1 { margin: 0 0 10px; font-size: clamp(36px, 6vw, 58px); letter-spacing: 0; line-height: 1; }
.download-card p { margin: 0; color: var(--muted); font-size: 13px; }
.download-form { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; }
.tool-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}
.tool-links a { border-bottom: 1px solid color-mix(in srgb, var(--teal) 42%, transparent); }
.ocr-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 12%, var(--surface)), var(--surface) 58%),
    var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.eyebrow {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 920;
  text-transform: uppercase;
  letter-spacing: 0;
}
.ocr-spotlight h2 { margin: 0; font-size: clamp(22px, 4vw, 32px); line-height: 1.06; letter-spacing: 0; }
.ocr-spotlight p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.ocr-spotlight-actions { display: grid; gap: 8px; min-width: 170px; }

.seo-landing {
  min-height: calc(100vh - 112px);
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(820px, 100%);
  margin: 0 auto;
}
.seo-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.seo-hero h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.02; letter-spacing: 0; }
.seo-hero p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.seo-form { width: 100%; }
.seo-note { margin: 0; text-align: center; font-size: 13px; }
.seo-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.progress-page { min-height: calc(100vh - 110px); display: grid; place-items: center; }
.progress-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.progress-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.progress-head h1 { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: 0; }
.progress-head p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.progress-head span { color: var(--muted); font-weight: 850; }
.progress-bar { height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--teal); transition: width 240ms ease; }
.step-list { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.step-list li { color: var(--muted); font-weight: 740; }
.step-list li::before { content: "- "; }
.step-list li.done { color: var(--ink); }
.step-list li.done::before { content: "ok "; color: var(--teal); }
.error-text { min-height: 20px; margin: 0; color: var(--red); overflow-wrap: anywhere; }

.card, .form-card, .metric, .pack, .job-list, .ocr-drop, .summary-panel, .progress-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-card { max-width: 460px; padding: 18px; }
.form-card form { display: grid; gap: 13px; }
.auth-divider, .auth-switch { margin: 12px 0 0; text-align: center; font-size: 13px; }
.auth-divider { margin-bottom: 12px; }
.security-form { display: grid; gap: 13px; }
.inline-form { display: flex; gap: 11px; align-items: end; }
.grow { flex: 1; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-row.admin-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { padding: 16px; }
.metric small { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 32px; margin: 4px 0; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { padding: 14px; margin-bottom: 14px; }
.card-head, .section-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.card-head h2, .section-head h2 { margin: 0; font-size: 18px; }
.list-row, .job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.list-row:first-of-type, .job-row:first-of-type { border-top: 0; }
.list-row strong, .list-row small, .job-row strong, .job-row small { display: block; overflow-wrap: anywhere; }
.list-row small, .job-row small { color: var(--muted); margin-top: 3px; }
.row-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.table { display: grid; gap: 1px; }
.table-head, .table-row { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 70px 140px; gap: 10px; align-items: center; }
.table-head { color: var(--muted); font-size: 12px; font-weight: 900; padding: 8px 0; }
.table-row { padding: 11px 0; border-top: 1px solid var(--line); }
.table-row strong, .table-row small { display: block; overflow-wrap: anywhere; }
.table-row small { color: var(--muted); margin-top: 3px; }
.status { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.status.done, .status.ready { color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.status.failed, .status.needs_reauth, .status.blocked { color: var(--red); background: color-mix(in srgb, var(--red) 12%, var(--surface)); }
.status.running, .status.queued, .status.staged, .status.downloading, .status.staging, .status.detecting, .status.auto_ocr_queued, .status.auto_ocr_running, .status.partial, .status.cleaning, .status.typesetting, .status.packaging, .status.submitting { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.positive { color: var(--green); font-weight: 900; }
.negative { color: var(--red); font-weight: 900; }
.result-text { width: 100%; min-height: 420px; resize: vertical; line-height: 1.55; }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pack { padding: 14px; box-shadow: none; display: grid; gap: 8px; }
.pack span { color: var(--muted); }

.ocr-upload-page { min-height: 380px; display: grid; place-items: start center; padding-top: 20px; }
.ocr-drop {
  width: min(760px, 100%);
  display: grid;
  gap: 13px;
  padding: 24px;
  border-style: dashed;
  text-align: center;
}
.ocr-drop label { text-align: left; }
.ocr-drop p { margin: 0; color: var(--muted); font-size: 13px; }
.chapter-queue-form textarea { min-height: 130px; resize: vertical; }
.chapter-queue-list { display: grid; }
.chapter-queue-row .status { white-space: normal; line-height: 1.35; }
.upload-progress {
  display: grid;
  gap: 8px;
  text-align: left;
}
.upload-progress[hidden] { display: none; }
.upload-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.upload-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.upload-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width .18s ease;
}
.job-list { padding: 14px; margin-top: 14px; }

.ocr-progress { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.progress-main, .summary-panel { padding: 16px; box-shadow: none; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb-card {
  position: relative;
  min-height: 122px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.thumb-card img { width: 100%; height: 94px; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.thumb-card span { position: absolute; top: 6px; left: 6px; padding: 2px 5px; border-radius: 5px; background: var(--surface); font-size: 11px; font-weight: 900; }
.thumb-card strong { color: var(--muted); font-size: 11px; text-align: center; }
.thumb-card.done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.thumb-card.failed, .thumb-card.blocked { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.thumb-card.running, .thumb-card.queued { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); }
.summary-panel { position: sticky; top: 68px; display: grid; gap: 12px; }
.summary-panel h2 { margin: 0; font-size: 18px; }
.summary-panel p { margin: 0; color: var(--muted); line-height: 1.45; }
.live-lines { display: grid; gap: 8px; min-height: 180px; align-content: start; }
.live-lines p { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.tab-btn { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 850; padding: 0 10px; cursor: pointer; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 6px rgba(0,0,0,0.08); }

.workspace-main { max-width: none; padding: 12px; }
.workspace-main .page-head { display: none; }
.ws-shell {
  height: calc(100vh - 76px);
  min-height: 620px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ws-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ws-page-tabs { display: flex; gap: 5px; overflow-x: auto; min-width: 0; padding-bottom: 1px; }
.page-tab { flex: 0 0 auto; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-weight: 850; cursor: pointer; }
.page-tab.active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.ws-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.ws-zoom-controls { display: inline-flex; align-items: center; gap: 6px; }
.ws-zoom-controls span { min-width: 46px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ws-body { min-height: 0; display: grid; grid-template-columns: minmax(330px, 52%) minmax(330px, 1fr); }
.ws-viewer, .ws-editor { min-height: 0; display: grid; background: var(--surface-2); }
.ws-viewer { grid-template-rows: minmax(0, 1fr) 40px; border-right: 1px solid var(--line); }
.ws-stage { min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 10px; background: #30343a; }
:root[data-theme="dark"] .ws-stage { background: #090c10; }
.ws-page { --ws-page-width: 600px; max-width: 600px; position: relative; display: inline-block; background: #fff; box-shadow: 0 16px 38px rgba(0,0,0,0.28); }
.ws-page.drawing { cursor: crosshair; }
.ws-page.drawing-text { cursor: crosshair; }
.ws-page.drawing-angled { cursor: crosshair; }
.ws-page.drawing-polygon { cursor: crosshair; }
.ws-page.fit-width { width: min(var(--ws-page-width), 100%); max-width: 600px; height: auto; }
.ws-page.fit-height { height: 100%; width: fit-content; max-width: 100%; }
.ws-image { display: block; width: 100%; height: auto; }
.ws-page.fit-height .ws-image { height: 100%; width: auto; max-width: none; }
.ws-box-layer { position: absolute; inset: 0; pointer-events: none; }
.ws-bubble-parent { display: none; position: absolute; pointer-events: none; z-index: 1; }
.ws-bubble-box-fallback { border: 2px dashed color-mix(in srgb, var(--teal) 82%, white); background: color-mix(in srgb, var(--teal) 8%, transparent); border-radius: 4px; box-shadow: 0 0 0 2px rgba(255,255,255,0.65); }
.ws-bubble-polygon { overflow: visible; }
.ws-bubble-polygon polygon { fill: color-mix(in srgb, var(--teal) 8%, transparent); stroke: color-mix(in srgb, var(--teal) 88%, white); stroke-width: 2px; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px rgba(255,255,255,0.75)); }
.ws-bubble-parent.active { display: block; }
.ws-box { position: absolute; pointer-events: auto; border: 2px solid var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border-radius: 2px; cursor: pointer; padding: 0; z-index: 2; }
.ws-box.review { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.ws-box.active { border-color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); box-shadow: 0 0 0 2px rgba(255,255,255,0.75); }
.ws-resize { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; border-radius: 999px; background: var(--red); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.ws-box.active .ws-resize { display: block; }
.ws-polygon-handle { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.ws-footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 5px 9px; background: var(--surface); border-top: 1px solid var(--line); }
.ws-footer strong { min-width: 88px; text-align: center; font-variant-numeric: tabular-nums; }
.ws-editor { grid-template-rows: auto minmax(0, 1fr) 32px; background: var(--surface); }
.ws-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.ws-panel { min-height: 0; overflow: auto; }
.ws-line-head, .ws-line { display: grid; grid-template-columns: 54px minmax(0, 1fr) 58px; gap: 8px; align-items: start; }
.ws-line-head { position: sticky; top: 0; z-index: 1; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 900; }
.ws-lines { display: grid; }
.ws-line { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ws-line:hover, .ws-line.active { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.ws-line.review .ws-line-score { color: var(--amber); }
.ws-line-no { color: var(--muted); font-variant-numeric: tabular-nums; }
.ws-line-text { min-width: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.ws-line-text:focus { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--blue) 65%, transparent); }
.ws-line-score { color: var(--green); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 850; }
.ws-empty { padding: 14px; }
.ws-translation-panel { padding: 12px; display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; gap: 10px; }
.translation-tools { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.translation-tools label { flex: 1 1 160px; color: var(--muted); font-size: 12px; font-weight: 850; }
.translation-tools select { margin-top: 5px; }
.premium-note { min-height: 18px; font-size: 12px; }
.translation-risk-card {
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 7px;
  padding: 10px;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface-2));
  display: grid;
  gap: 8px;
}
.translation-risk-card[hidden] { display: none; }
.translation-risk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.translation-risk-head strong { color: var(--ink); }
.translation-risk-list { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.translation-risk-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}
.translation-risk-item.high { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.translation-risk-item.medium { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.translation-risk-item small { grid-column: 1 / -1; color: var(--muted); line-height: 1.35; }
.risk-badge { border-radius: 999px; padding: 2px 6px; font-size: 10px; font-weight: 900; background: var(--amber); color: #1d1400; }
.translation-risk-item.high .risk-badge { background: var(--red); color: white; }
.translation-lines {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.translation-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 40px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.translation-line:hover, .translation-line.active { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.translation-line-no { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 850; }
.translation-line-text { min-width: 0; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.translation-line-text:focus { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--blue) 65%, transparent); }
.ws-clean-typeset-panel { padding: 12px; display: grid; align-content: start; gap: 12px; }
.clean-typeset-submit-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.clean-typeset-submit-card strong, .clean-typeset-submit-card small { display: block; }
.clean-typeset-submit-card small { margin-top: 3px; color: var(--muted); }
.clean-typeset-progress-bar { background: var(--surface-2); border: 1px solid var(--line); }
.clean-typeset-step-list { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: var(--surface-2); }
.ws-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.ws-editor-foot strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.cleanTypeset-shell {
  height: calc(100vh - 76px);
  min-height: 620px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cleanTypeset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.cleanTypeset-body { min-height: 0; display: grid; grid-template-columns: minmax(330px, 58%) minmax(320px, 1fr); }
.cleanTypeset-viewer { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 40px; border-right: 1px solid var(--line); background: var(--surface-2); }
.cleanTypeset-stage { min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 10px; background: #30343a; }
:root[data-theme="dark"] .cleanTypeset-stage { background: #090c10; }
.cleanTypeset-page { --clean-typeset-page-width: 96%; position: relative; width: var(--clean-typeset-page-width); background: #fff; box-shadow: 0 16px 38px rgba(0,0,0,0.28); }
.cleanTypeset-image { display: block; width: 100%; height: auto; }
.cleanTypeset-box-layer { position: absolute; inset: 0; pointer-events: none; }
.cleanTypeset-box {
  position: absolute;
  pointer-events: auto;
  border: 2px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-radius: 3px;
  cursor: pointer;
}
.cleanTypeset-box.active { border-color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); box-shadow: 0 0 0 2px rgba(255,255,255,0.75); }
.cleanTypeset-footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 5px 9px; background: var(--surface); border-top: 1px solid var(--line); }
.cleanTypeset-editor { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); }
.cleanTypeset-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.cleanTypeset-editor-head h2 { margin: 0; font-size: 16px; }
.cleanTypeset-lines { min-height: 0; overflow: auto; display: grid; align-content: start; }
.cleanTypeset-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cleanTypeset-row:hover, .cleanTypeset-row.active { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.cleanTypeset-row span { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 850; }
.cleanTypeset-row strong, .cleanTypeset-row small { display: block; overflow-wrap: anywhere; }
.cleanTypeset-row small { margin-top: 4px; color: var(--muted); }
.cleanTypeset-drawer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 10px; background: var(--surface-2); }
.cleanTypeset-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cleanTypeset-drawer-head strong { overflow-wrap: anywhere; }
.cleanTypeset-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cleanTypeset-controls label { font-size: 12px; }
.cleanTypeset-controls .cleanTypeset-text-control { grid-column: 1 / -1; }
.cleanTypeset-controls textarea { width: 100%; resize: vertical; min-height: 58px; font: inherit; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.variant-card { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 6px; background: var(--surface); cursor: pointer; }
.variant-card img { width: 100%; height: 86px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); }
.variant-card small { color: var(--muted); font-size: 11px; }
.manualWatermark-modal[hidden] { display: none; }
.manualWatermark-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.58);
}
.manualWatermark-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.manualWatermark-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.manualWatermark-head h2 { margin: 0 0 4px; font-size: 18px; }
.manualWatermark-head p { margin: 0; color: var(--muted); }
.manualWatermark-choice { padding: 16px; display: grid; gap: 14px; }
.manualWatermark-editor { min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.manualWatermark-side { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
.manualWatermark-side label { display: grid; gap: 6px; font-size: 12px; font-weight: 850; color: var(--muted); }
.manualWatermark-side input[type="file"] { width: 100%; }
.manualWatermark-pages { display: flex; flex-wrap: wrap; gap: 5px; }
.manualWatermark-stage { min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 14px; background: #252a31; }
:root[data-theme="dark"] .manualWatermark-stage { background: #070a0f; }
.manualWatermark-page { position: relative; width: min(860px, 100%); background: #fff; box-shadow: 0 16px 38px rgba(0,0,0,0.3); touch-action: none; }
.manualWatermark-page > img { display: block; width: 100%; height: auto; }
.manualWatermark-overlays { position: absolute; inset: 0; pointer-events: none; }
.manualWatermark-overlay { position: absolute; cursor: move; touch-action: none; user-select: none; border: 2px dashed var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); pointer-events: auto; }
.manualWatermark-overlay.active { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.manualWatermark-overlay[hidden] { display: none; }
.manualWatermark-overlay img { display: block; width: 100%; height: auto; pointer-events: none; }
.manualWatermark-resize { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: var(--red); box-shadow: 0 1px 6px rgba(0,0,0,0.35); cursor: nwse-resize; }
.manualWatermark-overlay.active .manualWatermark-resize { background: var(--teal); }

.admin-card { margin-bottom: 0; }
.settings-form { display: grid; gap: 11px; }
.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  padding: 8px 0;
}
.check-row input { width: 18px; height: 18px; padding: 0; accent-color: var(--teal); box-shadow: none; }
.bot-state-list { display: grid; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bot-state-list h3 { margin: 0 0 4px; font-size: 15px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin-table { display: grid; }
.admin-table-head, .admin-table-row { display: grid; grid-template-columns: minmax(220px, 1fr) 90px 190px 130px 110px; gap: 10px; align-items: center; }
.admin-table-head { color: var(--muted); font-size: 12px; font-weight: 900; padding-bottom: 8px; }
.admin-table-row { padding: 10px 0; border-top: 1px solid var(--line); }
.admin-table-row strong, .admin-table-row small { display: block; overflow-wrap: anywhere; }
.admin-table-row small { color: var(--muted); }
.role-form { display: flex; justify-content: flex-start; }
.reauth-summary-card { margin-bottom: 18px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reauth-layout { align-items: start; }
.reauth-control-card, .reauth-browser-card { min-width: 0; }
.reauth-status-box { display: grid; gap: 2px; margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.reauth-status-box small, .reauth-jobs small, .mini-row small { overflow-wrap: anywhere; color: var(--muted); }
.reauth-jobs { display: grid; gap: 10px; margin-top: 16px; }
.card-head.slim { margin-bottom: 0; }
.card-head.slim h3 { margin: 0; }
.list-row.compact { grid-template-columns: 1fr; padding: 8px 0; }
.small-note { font-size: 12px; line-height: 1.5; }
.error-text { color: var(--red); }
.reauth-screen-wrap { position: relative; min-height: 420px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #050807; }
.reauth-novnc-frame { display: block; width: 100%; height: min(72vh, 760px); min-height: 520px; border: 1px solid var(--line); border-radius: 9px; background: #050807; }
.reauth-fallback-head { margin-top: 16px; }
.reauth-screen-wrap img { display: block; width: 100%; height: auto; min-height: 420px; object-fit: contain; cursor: crosshair; user-select: none; }
.reauth-screen-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: var(--muted); text-align: center; background: color-mix(in srgb, #000 62%, transparent); }
.small-check { display: inline-flex; grid-template-columns: none; align-items: center; gap: 6px; padding: 0; font-size: 12px; }
.small-check input { width: 16px; height: 16px; }
[hidden] { display: none !important; }

@media (max-width: 860px) {
  body { padding-bottom: 58px; }
  .app-header { height: 48px; grid-template-columns: 1fr auto; padding: 0 12px; }
  .brand-logo { width: 31px; height: 31px; }
  .brand strong { font-size: 14px; }
  .top-nav { display: none; }
  .header-actions .credit-pill { display: none; }
  .header-actions form { display: none; }
  .theme-icon { height: 30px; padding: 0 8px; }
  .main { padding: 14px; }
  .page-head h1 { font-size: 24px; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    height: 56px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a { display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 850; }
  .bottom-nav a.active { color: var(--teal); }
  .download-home { min-height: calc(100vh - 120px); align-items: start; padding-top: 8vh; padding-bottom: 22px; }
  .download-form { grid-template-columns: 1fr; }
  .home-stack { gap: 14px; }
  .ocr-spotlight { grid-template-columns: 1fr; padding: 14px; }
  .ocr-spotlight-actions { grid-template-columns: 1fr; min-width: 0; }
  .seo-landing { min-height: calc(100vh - 128px); align-content: start; padding-top: 7vh; }
  .seo-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 16px; }
  .seo-actions { display: grid; grid-template-columns: 1fr; }
  .progress-page { min-height: calc(100vh - 128px); place-items: start center; padding-top: 14vh; }
  .progress-card { padding: 16px; box-shadow: none; }
  .progress-head { display: grid; }
  .metric-row, .metric-row.admin-metrics, .grid-two, .packs, .ocr-progress { grid-template-columns: 1fr; }
  .reauth-screen-wrap, .reauth-screen-wrap img { min-height: 260px; }
  .reauth-novnc-frame { min-height: 360px; height: 58vh; }
  .inline-form { display: grid; }
  .table-head { display: none; }
  .table-row, .job-row, .list-row { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .thumb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-main { padding: 0; }
  .ws-shell { height: calc(100vh - 104px); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .ws-toolbar { align-items: stretch; display: grid; grid-template-columns: 1fr; gap: 6px; padding: 6px; }
  .ws-tools { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .ws-tools .btn, .ws-zoom-controls { flex: 0 0 auto; }
  .ws-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45%) minmax(0, 55%); }
  .ws-viewer { border-right: 0; border-bottom: 1px solid var(--line); grid-template-rows: minmax(0, 1fr) 34px; }
  .ws-stage { padding: 7px; align-items: start; }
  .ws-footer { gap: 6px; padding: 4px 6px; }
  .ws-footer .btn { height: 28px; padding: 0 8px; }
  .ws-editor-head { padding: 6px; }
  .ws-line-head, .ws-line { grid-template-columns: 38px minmax(0, 1fr) 46px; gap: 6px; }
  .ws-line { padding: 8px 8px; }
  .cleanTypeset-shell { height: calc(100vh - 104px); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .cleanTypeset-toolbar { align-items: stretch; display: grid; grid-template-columns: 1fr; gap: 6px; padding: 6px; }
  .cleanTypeset-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45%) minmax(0, 55%); }
  .cleanTypeset-viewer { border-right: 0; border-bottom: 1px solid var(--line); grid-template-rows: minmax(0, 1fr) 34px; }
  .cleanTypeset-stage { padding: 7px; }
  .cleanTypeset-controls { grid-template-columns: 1fr; }
  .ws-editor-foot { min-height: 32px; }
  .admin-table-head { display: none; }
  .admin-table-row { grid-template-columns: 1fr; }
}

/* Colorful responsive OCR workspace refresh. Scoped to the live OCR review app so
   upload, account, admin, and Clean & Typeset review pages keep their existing UI. */
.workspace-main {
  max-width: none;
  min-height: calc(100vh - 52px);
  padding: 0;
  background: #0d1117;
}
.workspace-main .page-head { display: none; }
.ws-shell {
  --ocr-bg-deep: #0d0b14;
  --ocr-bg-surface: #14111f;
  --ocr-bg-panel: #1d182e;
  --ocr-bg-canvas: #09070e;
  --ocr-bg-active: rgba(168, 85, 247, 0.12);
  --ocr-primary: #a855f7;
  --ocr-primary-strong: #c084fc;
  --ocr-primary-hover: #8b5cf6;
  --ocr-text: #f3f0f7;
  --ocr-muted: #a29cb3;
  --ocr-border: #2b2440;
  --ocr-danger: #f43f5e;
  --ocr-warning: #f59e0b;
  --ocr-box: #f472b6;
  height: calc(100dvh - 52px);
  min-height: 620px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--ocr-bg-surface);
  color: var(--ocr-text);
  box-shadow: none;
}
.ws-shell ::selection { background: rgba(16, 185, 129, 0.35); }
.ws-shell .btn.small {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--ocr-border);
  border-radius: 7px;
  background: var(--ocr-bg-panel);
  color: var(--ocr-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.ws-shell .btn.small:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ocr-primary) 34%, var(--ocr-border));
  background: color-mix(in srgb, var(--ocr-bg-panel) 78%, var(--ocr-primary));
  transform: translateY(-1px);
}
.ws-shell .btn.small.active {
  border-color: var(--ocr-primary);
  background: linear-gradient(180deg, var(--ocr-primary-strong), var(--ocr-primary-hover));
  color: #ffffff;
  font-weight: 900;
}
.ws-shell .btn.small.primary {
  border-color: var(--ocr-primary);
  background: linear-gradient(180deg, var(--ocr-primary-strong), var(--ocr-primary));
  color: #06130f;
  font-weight: 900;
}
.ws-shell .btn.small.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #6ee7b7, var(--ocr-primary-hover));
  color: #05100c;
}
.ws-shell .btn.small.danger {
  border-color: color-mix(in srgb, var(--ocr-danger) 46%, var(--ocr-border));
  color: var(--ocr-danger);
  background: rgba(248, 81, 73, 0.06);
}
.ws-shell .btn.small.danger:hover:not(:disabled) {
  border-color: var(--ocr-danger);
  background: rgba(248, 81, 73, 0.16);
  color: #ff9a93;
}
/* Raw Nest OCR workspace toolbar compact screenshot layout. */
.ws-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 12px 20px 9px;
  border-bottom: 1px solid var(--ocr-border);
  background: var(--ocr-bg-surface);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02);
}
.ws-tool-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.ws-tools,
.ws-primary-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}
.ws-primary-tools { flex: 1 1 auto; }
.ws-btn-icon {
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}
.ws-btn-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}
.ws-typeset-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ws-typeset-actions[hidden] { display: none; }
.ws-typeset-actions-label {
  display: block;
  margin-bottom: 7px;
  color: #b5aebf;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ws-typeset-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.ws-typeset-language-button {
  width: 100%;
  min-width: 0;
  border-color: rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  white-space: normal;
}
.ws-page-jump {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--ocr-border);
  border-radius: 8px;
  background: var(--ocr-bg-deep);
}
.ws-page-jump-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ocr-text);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.ws-page-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 29px;
  border: 1px solid var(--ocr-border);
  border-radius: 6px;
  background: var(--ocr-bg-panel);
  color: var(--ocr-text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.ws-page-arrow:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ocr-primary) 55%, var(--ocr-border));
  color: var(--ocr-primary-strong);
}
.ws-page-arrow:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.ws-page-tabs {
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 1px;
  scrollbar-width: thin;
}
.page-tab {
  flex: 0 0 auto;
  width: 34px;
  height: 29px;
  border: 1px solid var(--ocr-border);
  border-radius: 6px;
  background: var(--ocr-bg-panel);
  color: var(--ocr-muted);
  font-size: 12px;
  font-weight: 900;
}
.page-tab:hover {
  border-color: color-mix(in srgb, var(--ocr-primary) 55%, var(--ocr-border));
  color: var(--ocr-primary-strong);
}
.page-tab.active {
  border-color: var(--ocr-primary);
  background: linear-gradient(180deg, var(--ocr-primary-strong), var(--ocr-primary-hover));
  color: #ffffff;
}
.ws-hotkey-hint {
  flex: 0 0 auto;
  color: var(--ocr-muted);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.ws-hotkey-hint kbd {
  margin: 0 3px;
  padding: 2px 6px;
  border: 1px solid rgba(240, 246, 252, 0.18);
  border-radius: 5px;
  background: var(--ocr-bg-panel);
  color: var(--ocr-text);
  font: inherit;
  font-weight: 850;
}
.ws-hotkey-divider {
  margin: 0 4px;
  color: color-mix(in srgb, var(--ocr-muted) 70%, transparent);
}
.ws-zoom-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding-left: 2px;
}
.ws-zoom-controls span {
  min-width: 44px;
  color: var(--ocr-text);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ws-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  background: var(--ocr-bg-deep);
}
.ws-viewer,
.ws-editor {
  min-height: 0;
  display: grid;
}
.ws-viewer {
  grid-template-rows: minmax(0, 1fr) auto;
  border-right: 1px solid var(--ocr-border);
  background: var(--ocr-bg-canvas);
}
.ws-stage {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 12%, rgba(16, 185, 129, 0.08), transparent 34%),
    linear-gradient(145deg, #070b10, var(--ocr-bg-canvas));
}
.ws-page {
  --ws-page-width: 600px;
  position: relative;
  width: min(var(--ws-page-width), 100%);
  max-width: 600px;
  display: inline-block;
  overflow: visible;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0,0,0,0.56);
}
.ws-image { display: block; width: 100%; height: auto; border-radius: inherit; }
.ws-box-layer { position: absolute; inset: 0; pointer-events: none; }
.ws-bubble-parent {
  display: none;
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.ws-bubble-box-fallback {
  border: 2px dashed rgba(52, 211, 153, 0.95);
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 0 18px rgba(16,185,129,0.35);
}
.ws-bubble-polygon {
  overflow: visible;
}
.ws-bubble-polygon polygon {
  fill: rgba(16, 185, 129, 0.08);
  stroke: rgba(52, 211, 153, 0.95);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.75)) drop-shadow(0 0 10px rgba(16,185,129,0.35));
}
.ws-bubble-parent.active { display: block; }
.ws-box {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 2.5px solid var(--ocr-box);
  border-radius: 3px;
  background: color-mix(in srgb, var(--ocr-box) 22%, transparent);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
  box-shadow: 0 0 6px color-mix(in srgb, var(--ocr-box) 28%, transparent);
}
.ws-box.review {
  border-color: var(--ocr-warning);
  background: color-mix(in srgb, var(--ocr-warning) 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--ocr-warning) 28%, transparent);
}
.ws-box.gpt-keep {
  border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, #22c55e 28%, transparent);
}
.ws-box.gpt-delete {
  border-color: #ef4444;
  background: color-mix(in srgb, #ef4444 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, #ef4444 28%, transparent);
}
.ws-box.gpt-review {
  border-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, #f59e0b 28%, transparent);
}
.ws-box.type-system {
  border-color: #a78bfa;
  background: color-mix(in srgb, #a78bfa 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, #a78bfa 28%, transparent);
}
.ws-box.orientation-vertical {
  border-style: dashed;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.16);
}
.ws-box.type-system.active,
.ws-box.type-system:hover {
  border-color: #c4b5fd;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.45);
}
.ws-bubble-type-badge {
  position: absolute;
  left: -2px;
  top: -28px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 6px 6px 0 0;
  background: #6d28d9;
  color: white;
  box-shadow: 0 2px 7px rgba(0,0,0,0.72);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}
.ws-box.type-speech .ws-bubble-type-badge { background: #047857; }
.ws-box.type-thought .ws-bubble-type-badge { background: #1d4ed8; }
.ws-box.type-sfx .ws-bubble-type-badge { background: #b45309; }
.ws-box.type-side_text .ws-bubble-type-badge { background: #be123c; }
.ws-box.type-system .ws-bubble-type-badge { background: #6d28d9; }
.ws-box.type-clean_only .ws-bubble-type-badge { background: #0f766e; }
.ws-bubble-type-badge.inline {
  position: static;
  display: block;
  width: max-content;
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
}
.ws-text-orientation-badge {
  position: absolute;
  right: -2px;
  top: -19px;
  padding: 2px 5px;
  border-radius: 5px 5px 0 0;
  background: #0f766e;
  color: white;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .04em;
  pointer-events: none;
}
.ws-text-orientation-badge.inline {
  position: static;
  display: block;
  width: max-content;
  margin-top: 4px;
  border-radius: 4px;
  font-size: 9px;
}
#wsToggleVertical.active {
  border-color: #2dd4bf;
  color: #ccfbf1;
  background: rgba(13, 148, 136, 0.22);
}

#wsDrawPolygonTextBox.active {
  border-color: #c084fc;
  color: #f3e8ff;
  background: rgba(126, 34, 206, 0.24);
}
.ws-box.has-angled-text {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.ws-box.has-angled-text .ws-angled-box-svg,
.ws-box.has-angled-text .ws-polygon-handle {
  pointer-events: auto;
}
.ws-box.has-angled-text.review {
  border-color: transparent;
  background: transparent;
}
.ws-box.has-angled-text:hover,
.ws-box.has-angled-text.active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.ws-angled-box-svg {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
  pointer-events: none;
}
.ws-angled-box-svg polygon {
  fill: transparent;
  stroke: rgba(192, 132, 252, 0.86);
  stroke-width: 1.7px;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
}
.ws-box.has-angled-text.review .ws-angled-box-svg polygon {
  stroke: rgba(245, 158, 11, 0.9);
}
.ws-box.has-angled-text.active .ws-angled-box-svg polygon,
.ws-box.has-angled-text:hover .ws-angled-box-svg polygon {
  stroke: rgba(45, 212, 191, 0.95);
}
.ws-polygon-draft {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}
.ws-polygon-draft polygon {
  fill: transparent;
  stroke: rgba(192, 132, 252, 0.72);
  stroke-width: 1.35px;
  stroke-dasharray: 2.6 1.8;
  vector-effect: non-scaling-stroke;
}
.ws-polygon-draft polyline {
  fill: none;
  stroke: rgba(192, 132, 252, 0.82);
  stroke-width: 1.5px;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}
.ws-polygon-draft-point {
  position: absolute;
  z-index: 6;
  width: 11px;
  height: 11px;
  border: 1px solid #7e22ce;
  border-radius: 999px;
  background: rgba(245, 243, 255, 0.95);
  color: #4c1d95;
  font-size: 7px;
  font-weight: 900;
  line-height: 10px;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ws-polygon-handle {
  position: absolute;
  z-index: 6;
  width: 9px;
  height: 9px;
  border: 1.5px solid #7e22ce;
  border-radius: 999px;
  background: rgba(245, 243, 255, 0.96);
  box-shadow: 0 1px 3px rgba(0,0,0,0.38);
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
}
.ws-polygon-handle:active { cursor: grabbing; }
.ws-angled-text-badge {
  position: absolute;
  left: -2px;
  bottom: -19px;
  padding: 2px 5px;
  border-radius: 0 0 5px 5px;
  background: #be185d;
  color: white;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .04em;
  pointer-events: none;
}
.ws-angled-text-badge.inline {
  position: static;
  display: block;
  width: max-content;
  margin-top: 4px;
  border-radius: 4px;
  font-size: 9px;
}
.ws-gpt-badge {
  position: absolute;
  right: -2px;
  bottom: -19px;
  padding: 2px 5px;
  border-radius: 0 0 5px 5px;
  background: #334155;
  color: white;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .03em;
  pointer-events: none;
  text-transform: uppercase;
}
.ws-gpt-badge.gpt-keep,
.ws-gpt-line-badge.gpt-keep { background: #15803d; }
.ws-gpt-badge.gpt-delete,
.ws-gpt-line-badge.gpt-delete { background: #b91c1c; }
.ws-gpt-badge.gpt-review,
.ws-gpt-line-badge.gpt-review { background: #b45309; }
.ws-gpt-line-badge {
  display: block;
  width: max-content;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  color: white;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}
.ws-line-score small {
  display: block;
  margin-top: 4px;
  color: var(--ocr-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.ws-line.gpt-delete { background: rgba(239, 68, 68, 0.08); }
.ws-line.gpt-review { background: rgba(245, 158, 11, 0.08); }
.ws-line.gpt-keep { background: rgba(34, 197, 94, 0.06); }
.ws-box:hover,
.ws-box.active {
  border-color: var(--ocr-primary);
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.42);
}
.ws-resize {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  display: none;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ocr-primary);
  cursor: nwse-resize;
}
.ws-box.active .ws-resize { display: block; }
.ws-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--ocr-border);
  background: rgba(22, 27, 34, 0.94);
}
.ws-footer strong {
  min-width: 96px;
  color: var(--ocr-text);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ws-editor {
  grid-template-rows: auto minmax(0, 1fr) 36px;
  border-left: 0;
  background: var(--ocr-bg-surface);
}
.ws-editor-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border-bottom: 1px solid var(--ocr-border);
  background: var(--ocr-bg-deep);
}
.ws-editor-head .tabs {
  flex: 1 1 auto;
  display: flex;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ws-editor-head .tab-btn {
  flex: 1 1 0;
  height: 44px;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ocr-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: none;
}
.ws-editor-head .tab-btn:hover { color: var(--ocr-text); }
.ws-editor-head .tab-btn.active {
  border-bottom-color: var(--ocr-primary);
  background: var(--ocr-bg-surface);
  color: var(--ocr-primary-strong);
}
.ws-editor-head .status {
  align-self: center;
  margin-right: 10px;
  white-space: nowrap;
  border: 1px solid var(--ocr-border);
  background: rgba(16, 185, 129, 0.1);
  color: var(--ocr-primary-strong);
  font-weight: 850;
}
.ws-panel {
  min-height: 0;
  overflow: auto;
  background: var(--ocr-bg-surface);
}
.ws-line-head,
.ws-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: start;
}
.ws-line-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ocr-border);
  background: rgba(22, 27, 34, 0.96);
  color: var(--ocr-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ws-lines { display: grid; }
.ws-line {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(48,54,61,0.72);
  color: var(--ocr-text);
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}
.ws-line:hover { background: var(--ocr-bg-panel); }
.ws-line.active {
  padding-left: 9px;
  border-left: 3px solid var(--ocr-primary);
  background: var(--ocr-bg-active);
}
.ws-line-no {
  color: var(--ocr-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.ws-line-text {
  min-width: 0;
  color: var(--ocr-text);
  line-height: 1.45;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.ws-line-text:focus { box-shadow: inset 0 -2px 0 rgba(16, 185, 129, 0.68); }
.ws-line-score {
  color: var(--ocr-primary-strong);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ws-line.review .ws-line-score { color: var(--ocr-warning); }
.ws-empty { padding: 16px; color: var(--ocr-muted); }
.ws-translation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
}
.translation-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--ocr-border);
  background: linear-gradient(180deg, rgba(13,17,23,0.48), rgba(22,27,34,0.9));
}
.translation-tools label {
  flex: 1 1 180px;
  color: var(--ocr-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.translation-tools select,
.ws-shell input,
.ws-shell textarea {
  border-color: var(--ocr-border);
  background: var(--ocr-bg-panel);
  color: var(--ocr-text);
}
.translation-tools select { margin-top: 7px; }
.translation-paste-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(48,54,61,0.72);
  background: rgba(13,17,23,0.28);
}
.translation-paste-card label,
.clean-typeset-options label {
  color: var(--ocr-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.translation-paste-card textarea {
  width: 100%;
  min-height: 76px;
  margin-top: 7px;
  resize: vertical;
}
.ws-translation-panel > .premium-note,
.ws-clean-typeset-panel > .premium-note {
  min-height: 26px;
  margin: 0;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(48,54,61,0.72);
  background: rgba(13,17,23,0.32);
  color: var(--ocr-muted);
  font-size: 12px;
}
.translation-lines {
  min-height: 0;
  display: grid;
  align-content: start;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--ocr-bg-surface);
}
.translation-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(48,54,61,0.72);
  color: var(--ocr-text);
  cursor: pointer;
}
.translation-line:hover { background: var(--ocr-bg-panel); }
.translation-line.active {
  border-left: 3px solid var(--ocr-primary);
  padding-left: 9px;
  background: var(--ocr-bg-active);
}
.translation-line-no {
  color: var(--ocr-primary-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
}
.translation-line-text {
  min-width: 0;
  color: var(--ocr-text);
  line-height: 1.45;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.translation-line-text:focus { box-shadow: inset 0 -2px 0 rgba(16, 185, 129, 0.68); }
.ws-translation-panel .actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--ocr-border);
  background: var(--ocr-bg-deep);
}
.ws-translation-panel .actions .btn { flex: 1 1 0; }
.ws-clean-typeset-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: var(--ocr-bg-surface);
}
.clean-typeset-submit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ocr-border);
  border-radius: 10px;
  background: var(--ocr-bg-deep);
}
.clean-typeset-submit-card strong,
.clean-typeset-submit-card small { display: block; }
.clean-typeset-submit-card strong { color: var(--ocr-text); font-size: 15px; }
.clean-typeset-submit-card small { margin-top: 4px; color: var(--ocr-muted); }
.clean-typeset-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--ocr-border);
  border-radius: 10px;
  background: var(--ocr-bg-deep);
}
.clean-typeset-options select,
.clean-typeset-options input[type="file"] { margin-top: 7px; }
.clean-typeset-options input[type="file"] { font-size: 11px; }
.clean-typeset-progress-bar {
  height: 6px;
  border: 1px solid var(--ocr-border);
  border-radius: 999px;
  background: var(--ocr-bg-deep);
}
.clean-typeset-progress-bar span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ocr-primary), #60a5fa);
}
.clean-typeset-step-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--ocr-border);
  border-radius: 10px;
  background: var(--ocr-bg-deep);
  list-style: none;
}
.clean-typeset-step-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  color: var(--ocr-muted);
  font-weight: 800;
}
.clean-typeset-step-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ocr-border);
}
.clean-typeset-step-list li.done { color: var(--ocr-primary-strong); }
.clean-typeset-step-list li.done::before {
  background: var(--ocr-primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
}
.ws-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 16px;
  border-top: 1px solid var(--ocr-border);
  background: var(--ocr-bg-deep);
  color: var(--ocr-muted);
  font-size: 12px;
}
.ws-editor-foot strong {
  color: var(--ocr-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .workspace-main {
    min-height: calc(100dvh - 104px);
    padding: 0;
  }
  .ws-shell {
    height: auto;
    min-height: calc(100dvh - 104px);
    overflow: visible;
  }
  .ws-toolbar {
    position: sticky;
    top: 48px;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 6px;
  }
  .ws-page-tabs {
    max-width: none;
    min-width: 0;
  }
  .ws-tool-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 6px;
  }
  .ws-hotkey-hint { justify-self: start; }
  .ws-page-jump { padding: 7px 8px; }
  .ws-page-jump-label { font-size: 11px; }
  .ws-tools {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .ws-tools .btn,
  .ws-zoom-controls { flex: 0 0 auto; }
  .ws-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 42dvh) minmax(480px, 58dvh);
    min-height: calc(100dvh - 160px);
  }
  .ws-viewer {
    border-right: 0;
    border-bottom: 1px solid var(--ocr-border);
  }
  .ws-stage {
    padding: 10px;
    place-items: start center;
  }
  .ws-page.fit-width { width: min(var(--ws-page-width), 100%); }
  .ws-footer {
    gap: 6px;
    padding: 5px 6px;
  }
  .ws-footer .btn.small { height: 29px; padding: 0 9px; }
  .ws-editor {
    min-height: 480px;
    grid-template-rows: auto minmax(0, 1fr) 34px;
  }
  .ws-editor-head { display: grid; grid-template-columns: 1fr; }
  .ws-editor-head .status { display: none; }
  .ws-editor-head .tab-btn { height: 40px; padding: 0 6px; font-size: 12px; }
  .ws-line-head,
  .ws-line { grid-template-columns: 42px minmax(0, 1fr) 54px; gap: 6px; }
  .ws-line { padding: 9px 9px; }
  .translation-tools,
  .ws-clean-typeset-panel { padding: 12px; }
  .ws-translation-panel > .premium-note,
  .ws-clean-typeset-panel > .premium-note { padding-inline: 12px; }
  .ws-translation-panel .actions { padding: 9px 12px; }
  .clean-typeset-submit-card { padding: 12px; }
}

@media (max-width: 520px) {
  .ws-shell .btn.small { height: 31px; padding: 0 9px; font-size: 11px; }
  .page-tab { width: 32px; height: 28px; font-size: 11px; }
  .ws-body { grid-template-rows: minmax(280px, 40dvh) minmax(520px, 1fr); }
  .ws-editor-head .tab-btn { font-size: 11px; }
  .ws-line-head { font-size: 10px; }
  .translation-line { grid-template-columns: 64px minmax(0, 1fr); }
  .ws-translation-panel .actions { display: grid; grid-template-columns: 1fr; }
}

/* Chapter intake dashboard */
.intake-hero { display: grid; gap: 10px; }
.intake-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 10px; align-items: end; }
.intake-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr); gap: 14px; align-items: start; }
.intake-series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.intake-series-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.intake-series-card img { width: 96px; height: 128px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.intake-cover-placeholder { width: 96px; height: 128px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 900; }
.intake-series-card > div:nth-child(2), .intake-series-card > div:first-child:not(.row-actions) { min-width: 0; }
.intake-series-card strong, .intake-series-card small { display: block; overflow-wrap: anywhere; }
.intake-series-card small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.intake-series-card .row-actions { grid-column: 1 / -1; }
.intake-detail-card { position: sticky; top: 76px; }
.intake-detail-list { display: grid; }
.intake-chapter-row small { line-height: 1.35; }
.intake-pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
[data-intake-status][data-kind="ok"] { color: var(--green); }
[data-intake-status][data-kind="error"] { color: var(--red); }
@media (max-width: 900px) {
  .intake-toolbar { grid-template-columns: 1fr; }
  .intake-layout { grid-template-columns: 1fr; }
  .intake-detail-card { position: static; }
}

/* Team Pickup Board Styles */
.pickup-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .pickup-container {
    grid-template-columns: 1fr;
  }
}

.pickup-main {
  display: flex;
  flex-col: column;
  flex-direction: column;
  gap: 20px;
}

.pickup-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.series-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.series-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.series-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.series-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.series-card:hover .series-cover {
  transform: scale(1.05);
}

.series-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--surface), var(--surface-3));
  color: var(--muted);
}

.source-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 0.5px solid rgba(255,255,255,0.15);
  letter-spacing: 0.5px;
}

.source-badge.kakaopage {
  color: #ffcd00;
  border-color: rgba(255,205,0,0.3);
}

.series-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.series-details h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapters-dropdown {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 6px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chapters-list {
  display: flex;
  flex-direction: column;
}

.chapter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.15s ease;
}

.chapter-row:last-child {
  border-bottom: none;
}

.chapter-row:hover {
  background: var(--surface-2);
}

.chapter-row.my-chapter {
  background: rgba(var(--green-rgb, 46, 160, 67), 0.08);
}

.ch-info {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.ch-num {
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.ch-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-indicator {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.status-indicator.available {
  background: rgba(46, 160, 67, 0.15);
  color: #58a6ff;
}

.status-indicator.claimed {
  background: rgba(210, 153, 34, 0.15);
  color: #f0883e;
}

.status-indicator.done {
  background: rgba(56, 139, 253, 0.15);
  color: #3fb950;
}

/* My Claimed Chapters Card */
.pickup-claims-card {
  border-color: rgba(240, 136, 62, 0.35);
  box-shadow: 0 0 16px rgba(240, 136, 62, 0.08);
}

.claims-list {
  display: flex;
  flex-direction: column;
}

.claim-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.claim-item:last-child {
  border-bottom: none;
}

.claim-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.claim-info .series-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.claim-info .chapter-title {
  font-size: 15px;
  font-weight: 700;
}

.claim-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.deadline-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
}

.timer-label {
  color: var(--muted);
  font-size: 10px;
}

.timer-clock {
  font-family: monospace;
  font-weight: 700;
  color: #f0883e;
}

.timer-clock.warning-pulse {
  animation: clockPulse 1s infinite alternate;
}

.timer-clock.expired {
  color: var(--red);
}

@keyframes clockPulse {
  from { color: #f0883e; transform: scale(1); }
  to { color: var(--red); transform: scale(1.05); }
}

.pulse-btn {
  animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(31, 111, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0); }
}

/* Sidebar Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.leader-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  background: var(--surface-3);
  color: var(--muted);
}

.leader-rank.rank-1 {
  background: #ffcd00;
  color: #000;
  box-shadow: 0 0 8px rgba(255,205,0,0.4);
}

.leader-rank.rank-2 {
  background: #d1d5db;
  color: #000;
}

.leader-rank.rank-3 {
  background: #b45309;
  color: #fff;
}

.leader-info {
  display: flex;
  flex-direction: column;
}

.leader-name {
  font-weight: 600;
  font-size: 13px;
}

.leader-chapters {
  font-size: 11px;
  color: var(--muted);
}

/* Admin Tabs and UI */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab-btn.active {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--text);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.fetched-chapters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.fetched-chapters-header label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.fetched-chapters-list {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}

.fetched-chapter-row {
  display: grid;
  grid-template-columns: 24px 64px 1fr;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.15s ease;
}

.fetched-chapter-row:last-child {
  border-bottom: none;
}

.fetched-chapter-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.fetched-chapter-row:hover {
  background: var(--surface-3);
}

.fetched-chapter-row input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: #58a6ff;
}

.fetched-chapter-row .ch-num {
  font-weight: 700;
  color: var(--muted);
}

.fetched-chapter-row .ch-title {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.series-manager-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.series-manager-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.series-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.series-chapters-table {
  display: flex;
  flex-direction: column;
}

.series-chapters-table .table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 1fr;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.series-chapters-table .table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 1fr;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.series-chapters-table .table-row:last-child {
  border-bottom: none;
}

.actions-cell {
  display: flex;
  gap: 6px;
}

/* Neubrutalism Design System - Scoped to .admin-neo */
.admin-neo {
  --neo-bg-yellow: #FFDE47;
  --neo-btn-violet: #B090FF;
  --neo-accent-orange: #FF9F1C;
  --neo-accent-mint: #17D69A;
  --neo-accent-red: #FF5D8F;
  --neo-ink: #000000;
  --neo-white: #FFFFFF;
  --neo-card-bg: #FFFFFF;
  --neo-border-width: 4px;
  --neo-border: var(--neo-border-width) solid var(--neo-ink);
  --neo-shadow: 8px 8px 0px var(--neo-ink);
  --neo-shadow-sm: 4px 4px 0px var(--neo-ink);
  --neo-shadow-xs: 2px 2px 0px var(--neo-ink);
  --radius: 20px;
  --radius-sm: 12px;

  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 24px 0 80px 0;
  font-family: 'Plus Jakarta Sans', 'Outfit', system-ui, sans-serif;
  color: var(--neo-ink);
}

/* Force Light Neubrutalist theme globally for Admin page body, headers & footers */
body:has(.admin-neo) {
  background: #FFDE47 !important;
  color: #000000 !important;
  transition: background-color 0.3s ease;
}

body:has(.admin-neo) .page-head h1 {
  color: #000000 !important;
}

body:has(.admin-neo) .page-head p {
  color: #333333 !important;
}

body:has(.admin-neo) .app-header {
  background: #FFFFFF !important;
  border-bottom: 4px solid #000000 !important;
  color: #000000 !important;
}

body:has(.admin-neo) .app-header a,
body:has(.admin-neo) .app-header button,
body:has(.admin-neo) .app-header strong,
body:has(.admin-neo) .app-header form button {
  color: #000000 !important;
}

body:has(.admin-neo) .app-header .theme-icon {
  border: 2px solid #000000 !important;
  background: #FFFFFF !important;
}

body:has(.admin-neo) .app-header .credit-pill {
  background: #17D69A !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}

body:has(.admin-neo) .top-nav a {
  color: #000000 !important;
}

body:has(.admin-neo) .top-nav a.active {
  border-bottom-color: #B090FF !important;
  border-bottom-width: 4px !important;
}

body:has(.admin-neo) .bottom-nav {
  background: #FFFFFF !important;
  border-top: 4px solid #000000 !important;
}

body:has(.admin-neo) .bottom-nav a {
  color: #000000 !important;
}

body:has(.admin-neo) .bottom-nav a.active {
  color: #B090FF !important;
}

/* Colors Utilities */
.admin-neo .yellow-bg { background-color: var(--neo-bg-yellow) !important; color: var(--neo-ink) !important; }
.admin-neo .violet-bg { background-color: var(--neo-btn-violet) !important; color: var(--neo-ink) !important; }
.admin-neo .orange-bg { background-color: var(--neo-accent-orange) !important; color: var(--neo-ink) !important; }
.admin-neo .mint-bg { background-color: var(--neo-accent-mint) !important; color: var(--neo-ink) !important; }
.admin-neo .red-bg { background-color: var(--neo-accent-red) !important; color: #FFFFFF !important; }
.admin-neo .white-bg { background-color: var(--neo-white) !important; color: var(--neo-ink) !important; }

/* Tab Buttons Layout */
.admin-neo .neubrutalist-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
}

.admin-neo .tab-btn {
  background: var(--neo-card-bg);
  border: var(--neo-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 14px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 950;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--neo-shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
  color: var(--neo-ink);

  /* Prevents cut-off height truncation from site-wide button styles */
  height: auto !important;
  overflow: visible !important;
  line-height: 1.2 !important;
}

.admin-neo .tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0px var(--neo-ink);
}

.admin-neo .tab-btn.active {
  background-color: var(--neo-btn-violet);
  transform: translateY(0);
  box-shadow: none;
  border-bottom-color: var(--neo-btn-violet);
}

/* Tab Content Wrapper */
.admin-neo .tab-content-panel {
  background-color: var(--neo-card-bg);
  border: var(--neo-border);
  box-shadow: var(--neo-shadow);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 40px;
  min-height: 400px;
  z-index: 1;
}

@media (max-width: 850px) {
  .admin-neo .tab-content-panel {
    border-radius: var(--radius);
    padding: 20px;
  }
}

.admin-neo .tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.admin-neo .tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Metrics display */
.admin-neo .metric-card {
  background: var(--neo-bg-yellow);
  border: var(--neo-border);
  box-shadow: var(--neo-shadow-sm);
  border-radius: var(--radius-sm);
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-neo .metric-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-neo .metric-tag {
  display: inline-block;
  align-self: flex-start;
  border: var(--neo-border);
  background-color: var(--neo-accent-orange);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--neo-shadow-xs);
}

.admin-neo .metric-val {
  font-size: 72px;
  font-weight: 950;
  letter-spacing: -3px;
  line-height: 1;
}

.admin-neo .metric-info {
  font-size: 16px;
  font-weight: 800;
  color: var(--neo-ink);
  opacity: 0.85;
}

/* Hero Banner (Cloudflare browser) */
.admin-neo .hero-card {
  border: var(--neo-border);
  box-shadow: var(--neo-shadow-sm);
  border-radius: var(--radius-sm);
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
  background-color: var(--neo-card-bg);
}

.admin-neo .hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.admin-neo .hero-title {
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -1.5px;
}

.admin-neo .hero-desc {
  font-size: 16px;
  font-weight: 700;
  color: var(--neo-ink);
  opacity: 0.85;
  max-width: 600px;
}

.admin-neo .hero-pills {
  display: flex;
  gap: 12px;
}

.admin-neo .pill {
  border: var(--neo-border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--neo-shadow-xs);
}

/* Neubrutalist grid */
.admin-neo .grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 850px) {
  .admin-neo .grid-two {
    grid-template-columns: 1fr;
  }
  .admin-neo .hero-card {
    grid-template-columns: 1fr;
  }
}

/* Cards inside panel with rounded clipping */
.admin-neo .panel-card {
  border: var(--neo-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--neo-shadow-sm);
  background-color: var(--neo-card-bg);
}

.admin-neo .card-header {
  border-bottom: var(--neo-border);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-neo .card-header h2 {
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.admin-neo .card-badge {
  border: var(--neo-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--neo-shadow-xs);
}

/* Forms with left aligned bounds - TARGET ONLY primary panel forms, NOT inline forms */
.admin-neo .panel-card > form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

.admin-neo .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 500px;
}

/* Enforce HORIZONTAL checkmark and text layout */
.admin-neo label.checkbox-row {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  text-transform: none;
  color: var(--neo-ink);
}

.admin-neo label.checkbox-row input {
  display: none;
}

.admin-neo .custom-check {
  width: 24px;
  height: 24px;
  border: var(--neo-border);
  border-radius: 6px;
  background: var(--neo-white);
  box-shadow: var(--neo-shadow-xs);
  position: relative;
  transition: transform 0.1s;
  flex-shrink: 0;
}

.admin-neo label.checkbox-row input:checked + .custom-check {
  background-color: var(--neo-accent-mint);
}

.admin-neo label.checkbox-row input:checked + .custom-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--neo-ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.admin-neo label.checkbox-row:hover .custom-check {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--neo-ink);
}

/* Inputs with maximum width limits */
.admin-neo .form-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 500px;
}

/* Enforce column labels for standard forms */
.admin-neo label:not(.checkbox-row) {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--neo-ink);
}

.admin-neo input[type="number"],
.admin-neo select,
.admin-neo input[type="text"] {
  width: 100%;
  border: var(--neo-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 800;
  background: var(--neo-white);
  color: var(--neo-ink);
  box-shadow: var(--neo-shadow-xs);
  outline: none;
  transition: transform 0.1s, box-shadow 0.1s;
}

.admin-neo input:focus,
.admin-neo select:focus {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--neo-ink);
}

/* Buttons with bounds */
.admin-neo .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--neo-border) !important;
  border-radius: 8px !important;
  padding: 14px 28px !important;
  font-size: 16px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--neo-shadow-sm) !important;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  color: var(--neo-ink) !important;
}

.admin-neo .btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--neo-ink) !important;
}

.admin-neo .btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--neo-shadow-xs) !important;
}

.admin-neo .panel-card > form .btn {
  width: 100%;
  max-width: 500px;
}

/* Colors variants */
.admin-neo .violet-btn { background-color: var(--neo-btn-violet) !important; }
.admin-neo .yellow-btn { background-color: var(--neo-bg-yellow) !important; }
.admin-neo .orange-btn { background-color: var(--neo-accent-orange) !important; }
.admin-neo .mint-btn { background-color: var(--neo-accent-mint) !important; }
.admin-neo .red-btn { background-color: var(--neo-accent-red) !important; color: #fff !important; }
.admin-neo .white-btn { background-color: var(--neo-white) !important; }

.admin-neo .small-btn {
  font-size: 11px !important;
  padding: 6px 12px !important;
  box-shadow: var(--neo-shadow-xs) !important;
  width: auto !important;
}

.admin-neo .small-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--neo-ink) !important;
}

.admin-neo .small-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--neo-ink) !important;
}

/* Active labels on button toggles */
.admin-neo .premium-active { background-color: var(--neo-accent-mint) !important; }
.admin-neo .admin-active { background-color: var(--neo-btn-violet) !important; color: #FFFFFF !important; }
.admin-neo .team-active { background-color: var(--neo-accent-orange) !important; }

/* User actions inline flex */
.admin-neo .user-actions-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-neo .inline-role-form {
  display: inline-flex !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  flex-direction: row !important;
}

/* Tables with clipping */
.admin-neo .table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.admin-neo table {
  width: 100%;
  border-collapse: collapse;
  background: var(--neo-white);
  border: none;
}

.admin-neo th,
.admin-neo td {
  padding: 16px 24px;
  border-bottom: var(--neo-border);
  border-right: var(--neo-border);
  text-align: left;
  font-size: 15px;
  font-weight: 800;
  color: var(--neo-ink);
}

.admin-neo th {
  background-color: var(--neo-white);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1.5px;
}

.admin-neo th:last-child,
.admin-neo td:last-child {
  border-right: none;
}

.admin-neo tr:last-child td {
  border-bottom: none;
}

.admin-neo .user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-neo .user-info strong {
  font-size: 16px;
  font-weight: 900;
}

.admin-neo .user-info small {
  font-size: 12px;
  color: var(--neo-ink);
  opacity: 0.7;
}

/* OCR Queue monitoring styles */
.admin-neo .queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.admin-neo .queue-pill {
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--neo-shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-neo .queue-pill small {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-neo .queue-pill strong {
  font-size: 32px;
  font-weight: 950;
}

.admin-neo .queue-pill span {
  font-size: 12px;
  font-weight: 800;
}

.admin-neo .queue-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-neo .queue-row {
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--neo-white);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--neo-shadow-xs);
}

.admin-neo .status-badge {
  border: var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: var(--neo-shadow-xs);
}

/* Darker Theme & Layout for Pickup Admin Settings */
.pickup-panel {
  background: var(--surface-2, #15111f);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s;
}
.pickup-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.pickup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.pickup-field label {
  font-weight: 600;
  font-size: 13px;
  color: #e2e8f0;
}
.pickup-field input,
.pickup-field select,
.pickup-field textarea {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pickup-field input:focus,
.pickup-field select:focus,
.pickup-field textarea:focus {
  border-color: var(--team-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}
.pickup-inline-status {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  display: none;
}
.kp-chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.kp-chapter-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
.active-segment {
  background: var(--team-primary) !important;
  color: #fff !important;
  border-color: rgba(0,0,0,0.15) !important;
}
.combobox-option:hover {
  background: var(--team-primary) !important;
}
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Asset revision: route static files through the Raw Nest application. */

/* Canvas-first mobile OCR workspace. */
.ws-key-badge { padding: 1px 4px; border: 1px solid rgba(240,246,252,.2); border-radius: 4px; color: var(--ocr-muted); background: var(--ocr-bg-deep); font: inherit; font-size: 9px; }
.ws-more-menu,
.ws-scroll-controller,
.ws-sheet-peek,
.ws-mobile-line-editor,
.ws-context-actions,
.ws-page-grid,
.ws-focus-exit,
.ws-mobile-toast,
.ws-detection-notice { display: none; }
.ws-shell .ws-more-button { display: none !important; }
.ws-page-counter { min-width: 96px; border: 0; background: transparent; color: var(--ocr-text); font-size: 12px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; }
.workspace-header-page,
.workspace-nav-toggle,
.workspace-nav-menu { display: none; }

@media (max-width: 860px) {
  body.ocr-workspace-page { height: 100dvh; overflow: hidden; padding-bottom: 0; overscroll-behavior: none; }
  .ocr-workspace-page .bottom-nav { display: none; }
  .ocr-workspace-page .app-header { z-index: 40; }
  .ocr-workspace-page .header-actions .theme-icon { display: none; }
  .ocr-workspace-page .workspace-header-page { position: absolute; left: 50%; display: block; color: var(--ink); font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; transform: translateX(-50%); }
  .ocr-workspace-page .workspace-nav-toggle { width: 40px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: 22px; line-height: 1; }
  .ocr-workspace-page .workspace-nav-menu { position: absolute; top: 47px; right: 7px; z-index: 70; width: min(250px,calc(100vw - 14px)); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb,var(--surface) 96%,transparent); box-shadow: 0 18px 48px rgba(0,0,0,.48); backdrop-filter: blur(16px); }
  .ocr-workspace-page .workspace-nav-menu:not([hidden]) { display: grid; }
  .ocr-workspace-page .workspace-nav-menu a,
  .ocr-workspace-page .workspace-nav-menu button { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 800; text-align: left; }
  .ocr-workspace-page .workspace-nav-menu a:hover,
  .ocr-workspace-page .workspace-nav-menu button:hover { background: var(--surface-2); }
  .ocr-workspace-page .workspace-main { height: calc(100dvh - 48px); min-height: 0; padding: 0; }
  .ocr-workspace-page .ws-shell { --ws-sheet-peek: 62px; --ws-keyboard-offset: 0px; height: calc(100dvh - 48px); min-height: 0; overflow: hidden; grid-template-rows: auto minmax(0,1fr); }
  .ocr-workspace-page .ws-toolbar { position: relative; top: auto; z-index: 22; display: block; padding: 7px 7px 8px; background: rgba(13,11,20,.96); backdrop-filter: blur(14px); }
  .ocr-workspace-page .ws-tool-row { display: block; }
  .ocr-workspace-page .ws-hotkey-hint,
  .ocr-workspace-page .ws-page-jump { display: none; }
  .ocr-workspace-page .ws-primary-tools { justify-content: flex-start; overflow-x: auto; gap: 7px; padding: 0 0 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .ocr-workspace-page .ws-primary-tools::-webkit-scrollbar { display: none; }
  .ocr-workspace-page .ws-shell .ws-primary-tools .btn.small { min-width: 68px; height: 62px; flex: 1 0 68px; flex-direction: column; gap: 6px; padding: 6px 8px; border-radius: 9px; font-size: 10px; scroll-snap-align: start; touch-action: manipulation; }
  .ocr-workspace-page .ws-shell .ws-primary-tools .ws-btn-icon,
  .ocr-workspace-page .ws-shell .ws-primary-tools .ws-btn-icon svg { width: 21px; height: 21px; font-size: 19px; }
  .ocr-workspace-page .ws-primary-tools .ws-key-badge { display: none; }
  .ocr-workspace-page .ws-more-button { display: inline-flex !important; }
  .ocr-workspace-page .ws-more-menu { position: fixed; top: 122px; right: 8px; z-index: 45; width: min(292px,calc(100vw - 16px)); max-height: calc(100dvh - 144px); overflow: auto; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 10px; border: 1px solid var(--ocr-border); border-radius: 13px; background: rgba(20,17,31,.98); box-shadow: 0 18px 50px rgba(0,0,0,.62); backdrop-filter: blur(16px); }
  .ocr-workspace-page .ws-more-menu:not([hidden]) { display: grid; }
  .ocr-workspace-page .ws-more-menu button { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--ocr-border); border-radius: 9px; background: var(--ocr-bg-panel); color: var(--ocr-text); font-size: 11px; font-weight: 800; text-align: left; }
  .ocr-workspace-page .ws-body { position: relative; grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr); min-height: 0; padding-bottom: var(--ws-sheet-peek); background: var(--ocr-bg-canvas); }
  .ocr-workspace-page .ws-viewer { min-height: 0; grid-column: 1; grid-row: 1; border: 0; grid-template-rows: minmax(0,1fr) 48px; }
  .ocr-workspace-page .ws-stage { position: relative; padding: 10px 8px; place-items: start center; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-x pan-y; }
  .ocr-workspace-page .ws-stage::-webkit-scrollbar { display: none; }
  .ocr-workspace-page .ws-page.fit-width { width: min(var(--ws-page-width),100%); }
  .ocr-workspace-page .ws-footer { min-height: 48px; justify-content: space-between; gap: 8px; padding: 4px 10px; }
  .ocr-workspace-page .ws-footer .btn.small { min-width: 48px; height: 42px; padding: 0 13px; font-size: 14px; }
  .ocr-workspace-page .ws-footer .btn.small > span[aria-hidden="true"] { font-size: 25px; line-height: 1; }
  .ocr-workspace-page .ws-page-counter { min-width: 130px; min-height: 42px; border: 1px solid var(--ocr-border); border-radius: 9px; background: var(--ocr-bg-panel); font-size: 13px; }
  .ocr-workspace-page .ws-scroll-controller { position: fixed; right: 3px; top: 50%; z-index: 24; width: 48px; display: grid; justify-items: center; gap: 4px; padding: 7px 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(20,17,31,.88); box-shadow: 0 10px 28px rgba(0,0,0,.48); opacity: .38; transform: translateY(-50%); transition: opacity .25s ease; touch-action: none; backdrop-filter: blur(12px); }
  .ocr-workspace-page .ws-scroll-controller.active,
  .ocr-workspace-page .ws-scroll-controller:focus-within { opacity: .98; }
  .ocr-workspace-page .ws-scroll-controller button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ocr-text); font-size: 22px; line-height: 1; }
  .ocr-workspace-page .ws-scroll-track { position: relative; width: 32px; height: 64px; border-radius: 16px; background: linear-gradient(90deg,transparent 14px,rgba(255,255,255,.2) 14px,rgba(255,255,255,.2) 17px,transparent 17px); }
  .ocr-workspace-page .ws-scroll-thumb { position: absolute; left: 50%; top: 0; width: 24px; height: 24px; border: 3px solid #f5f3ff; border-radius: 50%; background: linear-gradient(180deg,#c084fc,#7c3aed); box-shadow: 0 0 0 3px rgba(168,85,247,.22),0 4px 12px rgba(0,0,0,.55); transform: translateX(-50%); cursor: grab; }
  .ocr-workspace-page .ws-scroll-controller output { color: #c084fc; font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
  .ocr-workspace-page .ws-detection-notice { position: fixed; top: 136px; left: 50%; z-index: 21; width: min(330px,calc(100vw - 80px)); display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 9px; align-items: center; padding: 10px 12px; border: 1px solid rgba(168,85,247,.42); border-radius: 11px; background: rgba(20,17,31,.94); color: var(--ocr-text); box-shadow: 0 10px 28px rgba(0,0,0,.45); transform: translateX(-50%); backdrop-filter: blur(12px); }
  .ocr-workspace-page .ws-detection-notice[hidden] { display: none; }
  .ocr-workspace-page .ws-detection-notice strong { font-size: 12px; }
  .ocr-workspace-page .ws-detection-notice small { grid-column: 2; margin-top: 2px; color: var(--ocr-muted); font-size: 10px; line-height: 1.35; }
  .ocr-workspace-page .ws-detection-spinner { grid-row: 1/3; width: 20px; height: 20px; border: 2px solid rgba(192,132,252,.25); border-top-color: #c084fc; border-radius: 50%; animation: spin .85s linear infinite; }
  .ocr-workspace-page .ws-editor { position: fixed; left: 0; right: 0; bottom: var(--ws-keyboard-offset); z-index: 32; width: 100%; height: min(78dvh,720px); min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(192,132,252,.26); border-bottom: 0; border-radius: 22px 22px 0 0; background: rgba(20,17,31,.985); box-shadow: 0 -18px 46px rgba(0,0,0,.58); transform: translateY(calc(100% - var(--ws-sheet-peek))); transition: transform .28s cubic-bezier(.2,.8,.2,1),bottom .16s ease; backdrop-filter: blur(18px); }
  .ocr-workspace-page .ws-editor[data-sheet="half"] { transform: translateY(38%); }
  .ocr-workspace-page .ws-editor[data-sheet="full"] { transform: translateY(0); }
  .ocr-workspace-page .ws-sheet-peek { position: relative; min-height: var(--ws-sheet-peek); flex: 0 0 var(--ws-sheet-peek); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 18px 8px; border: 0; border-bottom: 1px solid var(--ocr-border); background: transparent; color: var(--ocr-text); text-align: left; touch-action: none; }
  .ocr-workspace-page .ws-sheet-handle { position: absolute; top: 7px; left: 50%; width: 58px; height: 5px; border-radius: 999px; background: #77758a; transform: translateX(-50%); }
  .ocr-workspace-page .ws-sheet-summary { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ocr-workspace-page .ws-sheet-chevron { font-size: 20px; transition: transform .2s ease; }
  .ocr-workspace-page .ws-editor:not([data-sheet="collapsed"]) .ws-sheet-chevron { transform: rotate(180deg); }
  .ocr-workspace-page .ws-mobile-line-editor { min-height: 0; display: grid; align-content: start; gap: 12px; padding: 14px 16px; overflow: auto; }
  .ocr-workspace-page .ws-mobile-line-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .ocr-workspace-page .ws-mobile-line-heading strong,
  .ocr-workspace-page .ws-mobile-line-heading span { display: block; }
  .ocr-workspace-page .ws-mobile-line-heading strong { color: var(--ocr-text); font-size: 14px; }
  .ocr-workspace-page .ws-mobile-line-heading span { margin-top: 3px; color: var(--ocr-primary-strong); font-size: 11px; }
  .ocr-workspace-page .ws-mobile-line-heading button { min-width: 64px; min-height: 42px; border: 1px solid var(--ocr-border); border-radius: 8px; background: var(--ocr-bg-panel); color: var(--ocr-text); font-size: 11px; font-weight: 800; }
  .ocr-workspace-page .ws-mobile-line-editor label { display: grid; gap: 6px; color: var(--ocr-muted); font-size: 11px; font-weight: 850; }
  .ocr-workspace-page .ws-mobile-line-editor textarea,
  .ocr-workspace-page .ws-mobile-line-editor select { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--ocr-border); border-radius: 9px; background: var(--ocr-bg-deep); color: var(--ocr-text); font-size: 15px; }
  .ocr-workspace-page .ws-mobile-line-editor textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
  .ocr-workspace-page .ws-mobile-line-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(96px,.45fr); gap: 12px; }
  .ocr-workspace-page .ws-mobile-line-fields > div { display: grid; gap: 6px; padding: 8px 12px; border: 1px solid var(--ocr-border); border-radius: 9px; background: var(--ocr-bg-deep); }
  .ocr-workspace-page .ws-mobile-line-fields > div span { color: var(--ocr-muted); font-size: 11px; font-weight: 850; }
  .ocr-workspace-page .ws-mobile-line-fields > div strong { align-self: end; color: var(--ocr-primary-strong); font-size: 16px; }
  .ocr-workspace-page .ws-editor-head { display: grid; grid-template-columns: 1fr; }
  .ocr-workspace-page .ws-editor-head .status { display: none; }
  .ocr-workspace-page .ws-editor[data-sheet="half"] .ws-editor-head,
  .ocr-workspace-page .ws-editor[data-sheet="half"] > .ws-panel,
  .ocr-workspace-page .ws-editor[data-sheet="half"] .ws-editor-foot { display: none !important; }
  .ocr-workspace-page .ws-editor[data-sheet="full"] .ws-mobile-line-editor { flex: 0 0 auto; max-height: 300px; }
  .ocr-workspace-page .ws-editor[data-sheet="full"] > .ws-panel { flex: 1 1 auto; }
  .ocr-workspace-page .ws-context-actions { min-height: 62px; flex: 0 0 62px; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto minmax(92px,auto); align-items: center; gap: 7px; padding: 8px 10px max(8px,env(safe-area-inset-bottom)); border-top: 1px solid var(--ocr-border); background: rgba(13,11,20,.98); }
  .ocr-workspace-page .ws-context-actions button { min-height: 44px; padding: 0 12px; border: 1px solid var(--ocr-border); border-radius: 9px; background: var(--ocr-bg-panel); color: var(--ocr-text); font-size: 12px; font-weight: 850; }
  .ocr-workspace-page .ws-context-actions button.danger { border-color: rgba(244,63,94,.46); color: #fb7185; background: rgba(244,63,94,.08); }
  .ocr-workspace-page .ws-context-actions button.primary { border-color: #8b5cf6; color: white; background: linear-gradient(180deg,#a855f7,#6d28d9); }
  .ocr-workspace-page .ws-context-actions button:disabled { opacity: .4; }
  .ocr-workspace-page .ws-editor-foot { flex: 0 0 34px; }
  .ocr-workspace-page .ws-page-grid { position: fixed; inset: 0; z-index: 60; align-items: end; padding: 16px 12px max(16px,env(safe-area-inset-bottom)); background: rgba(5,4,10,.74); backdrop-filter: blur(8px); }
  .ocr-workspace-page .ws-page-grid:not([hidden]) { display: flex; }
  .ocr-workspace-page .ws-page-grid-card { width: 100%; max-height: min(76dvh,720px); overflow: hidden; border: 1px solid var(--ocr-border); border-radius: 18px; background: var(--ocr-bg-surface); box-shadow: 0 20px 60px rgba(0,0,0,.62); }
  .ocr-workspace-page .ws-page-grid-card > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--ocr-border); }
  .ocr-workspace-page .ws-page-grid-card > header button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--ocr-bg-panel); color: var(--ocr-text); font-size: 24px; }
  .ocr-workspace-page .ws-page-grid-items { max-height: calc(76dvh - 56px); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 12px; overflow: auto; }
  .ocr-workspace-page .ws-page-grid-item { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--ocr-bg-deep); color: var(--ocr-text); }
  .ocr-workspace-page .ws-page-grid-item.active { border-color: #a855f7; }
  .ocr-workspace-page .ws-page-grid-item img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; opacity: .86; }
  .ocr-workspace-page .ws-page-grid-item span { display: block; padding: 6px; font-size: 11px; font-weight: 850; }
  .ocr-workspace-page .ws-page-grid-item.dirty::after { content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border: 2px solid #161220; border-radius: 50%; background: #c084fc; }
  .ocr-workspace-page .ws-focus-exit { position: fixed; top: max(9px,env(safe-area-inset-top)); left: 9px; z-index: 55; min-height: 44px; padding: 0 13px; border: 1px solid rgba(192,132,252,.5); border-radius: 999px; background: rgba(20,17,31,.9); color: white; font-size: 12px; font-weight: 850; backdrop-filter: blur(10px); }
  .ocr-workspace-page .ws-focus-exit:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; }
  .ocr-workspace-page .ws-mobile-toast { position: fixed; left: 50%; bottom: calc(var(--ws-sheet-peek) + 14px); z-index: 70; max-width: calc(100vw - 30px); padding: 10px 14px; border: 1px solid var(--ocr-border); border-radius: 999px; background: rgba(20,17,31,.96); color: var(--ocr-text); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 12px; font-weight: 800; text-align: center; transform: translateX(-50%); }
  .ocr-workspace-page .ws-mobile-toast:not([hidden]) { display: block; }
  body.ws-focus-active .app-header { display: none; }
  body.ws-focus-active .workspace-main,
  body.ws-focus-active .ws-shell { height: 100dvh; }
  .ocr-workspace-page .ws-shell.focus-mode { grid-template-rows: minmax(0,1fr); }
  .ocr-workspace-page .ws-shell.focus-mode .ws-toolbar { display: none; }
  .ocr-workspace-page .ws-shell.focus-mode .ws-body { padding-bottom: 0; }
  .ocr-workspace-page .ws-shell.focus-mode .ws-footer { position: fixed; top: max(9px,env(safe-area-inset-top)); left: 50%; z-index: 50; width: auto; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; transform: translateX(-50%); }
  .ocr-workspace-page .ws-shell.focus-mode .ws-footer .btn { display: none; }
  .ocr-workspace-page .ws-shell.focus-mode .ws-page-counter { min-height: 44px; background: rgba(20,17,31,.9); backdrop-filter: blur(10px); }
}

@media (max-width: 520px) {
  .ocr-workspace-page .ws-page-nav-word { display: none; }
  .ocr-workspace-page .ws-footer .btn.small { width: 48px; padding: 0; }
}
