:root {
  color-scheme: light;
  --paper: oklch(98% .003 100);
  --surface: oklch(96% .004 100);
  --line: oklch(87% .006 100);
  --ink: oklch(25% .008 100);
  --muted: oklch(48% .009 100);
  --accent: oklch(43% .07 173);
  --accent-soft: oklch(93% .025 173);
  --warning: oklch(42% .10 65);
  --danger: oklch(43% .15 28);
  --stage: oklch(21% .004 100);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
.coverage-note { margin: 0 12px 10px; padding: 10px; line-height: 1.45; background: var(--accent-soft); border-radius: 6px; font-size: 12px; color: var(--ink); }
.navigator-heading { flex-wrap: wrap; gap: 5px; }
body { margin: 0; height: 100dvh; min-height: 650px; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
button, select, input[type="search"], textarea { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); }
button { min-height: 34px; padding: 6px 11px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background-color 120ms ease-out, border-color 120ms ease-out; }
button:hover:not(:disabled) { background: oklch(92% .008 100); border-color: oklch(73% .012 100); }
button:active:not(:disabled) { background: oklch(87% .012 100); }
button:disabled, select:disabled { cursor: not-allowed; opacity: .45; }
button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: oklch(73% .04 173); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select, textarea { padding: 8px 9px; min-width: 0; }
textarea { width: 100%; resize: vertical; min-height: 62px; max-height: 150px; line-height: 1.5; }
select { width: 100%; }
h1, h2, p { margin: 0; }
h1 { font-size: 15px; font-weight: 680; line-height: 1.35; }
h2 { font-size: 13px; font-weight: 680; }
.subtle { color: var(--muted); font-size: 11px; line-height: 1.5; }
.app-header { min-height: 70px; flex-shrink: 0; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 20px; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; font-weight: 750; }
.save-region { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 34px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.save-dot.saved { background: var(--accent); }
.save-dot.dirty { background: oklch(64% .12 73); }
.save-dot.error { background: var(--danger); }
.header-actions, .button-row { display: flex; gap: 7px; align-items: center; }
.small { min-height: 27px; font-size: 11px; padding: 3px 8px; }
.notice { padding: 10px 20px; background: oklch(94% .025 85); border-bottom: 1px solid var(--line); line-height: 1.5; flex-shrink: 0; }
.notice a { color: var(--accent); font-weight: 650; margin-left: 8px; }
.conflict { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 20px; background: oklch(93% .035 65); border-bottom: 1px solid oklch(78% .04 65); }
.conflict p { margin-top: 4px; max-width: 80ch; line-height: 1.5; }
.workspace { display: grid; grid-template-columns: 200px minmax(360px, 1fr) 302px; flex: 1; min-height: 0; }
.navigator { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.navigator-heading { padding: 20px 14px 12px; display: flex; align-items: center; justify-content: space-between; }
.search-label { display: block; padding: 0 12px; }
.search-label input { width: 100%; }
.filter-row { padding: 7px 12px 12px; }
.filter-row select { font-size: 11px; }
.image-list { overflow-y: auto; flex: 1; padding: 2px 7px 12px; }
.image-item { display: flex; text-align: left; align-items: flex-start; gap: 8px; width: 100%; border-color: transparent; background: transparent; border-radius: 5px; padding: 11px 7px; margin: 2px 0; font-weight: 450; }
.image-item[aria-current="true"] { background: var(--accent-soft); border-color: oklch(80% .035 173); }
.image-index { font-size: 10px; color: var(--muted); margin-top: 2px; min-width: 20px; font-variant-numeric: tabular-nums; }
.image-item-copy { overflow: hidden; flex: 1; }
.image-item-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.image-item-status { display: block; font-size: 10px; margin-top: 4px; color: var(--muted); }
.image-item-status.complete { color: var(--accent); }
.image-item-status.needs_review { color: var(--warning); }
.navigator-footer { display: flex; flex-direction: column; gap: 3px; padding: 15px; border-top: 1px solid var(--line); }
.navigator-footer strong { font-size: 12px; font-weight: 600; }
.page-controls { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.page-controls .subtle { width: 100%; text-align: center; }
.class-controls { margin-top: 12px; }
.class-controls .subtle { margin-top: 6px; }
#selected-category { margin-top: 5px; }
.box-item:has(.box-swatch[style]) .box-swatch { border-color: var(--ink); }
.main-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.image-heading { padding: 18px 20px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 82px; }
.image-title { min-width: 0; }
.image-title h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.pill { font-size: 10px; line-height: 1.4; font-weight: 600; background: oklch(92% .007 100); border-radius: 4px; padding: 3px 6px; white-space: nowrap; }
.pill.complete { color: var(--accent); background: var(--accent-soft); }
.pill.needs_review { color: var(--warning); background: oklch(93% .035 85); }
.toolbar { padding: 0 14px 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.toolbar button { padding: 5px 8px; min-height: 31px; font-size: 11px; }
.view-tools { margin-left: auto; }
kbd { font-family: inherit; font-size: 10px; color: var(--muted); margin-left: 4px; }
#zoom-level { min-width: 36px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.stage { position: relative; flex: 1; min-height: 260px; overflow: hidden; background: var(--stage); margin: 0 14px; border-radius: 5px; overscroll-behavior: none; }
canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
canvas:focus-visible { outline: 2px solid oklch(74% .06 173); outline-offset: -3px; }
.stage-message { position: absolute; inset: 0; display: grid; place-items: center; color: oklch(84% .005 100); font-size: 13px; padding: 30px; text-align: center; pointer-events: none; background: var(--stage); }
.stage-mode, .overlay-warning { position: absolute; pointer-events: none; bottom: 12px; left: 13px; border: 1px solid oklch(40% .007 100); border-radius: 4px; color: oklch(86% .006 100); background: oklch(23% .006 100 / .9); font-size: 10px; padding: 6px 9px; letter-spacing: .02em; }
.overlay-warning { bottom: auto; top: 12px; background: oklch(35% .065 75 / .95); }
.stage-footer { display: flex; gap: 10px; justify-content: space-between; font-size: 10px; color: var(--muted); padding: 10px 16px; }
#coordinate-readout { font-variant-numeric: tabular-nums; }
.shortcuts { padding: 0 16px 13px; font-size: 11px; color: var(--muted); }
.shortcuts summary { cursor: pointer; width: fit-content; }
.shortcuts p { line-height: 1.7; padding-top: 7px; max-width: 75ch; }
.review-panel { overflow-y: auto; background: var(--paper); border-left: 1px solid var(--line); }
.review-panel section { padding: 18px; }
.review-panel section + section { border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: 11px; display: block; margin-bottom: 7px; }
.task-section select { font-size: 13px; font-weight: 550; }
.instruction { font-size: 12px; line-height: 1.6; margin: 12px 0 5px; }
.inline-note { font-size: 11px; line-height: 1.6; padding: 9px 10px; background: var(--surface); border-radius: 5px; margin-top: 12px; }
.count { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.box-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; margin-top: -4px; margin-bottom: 10px; }
.legend-line { width: 15px; border-top: 2px solid var(--accent); }
.legend-line.dashed { border-top-style: dashed; margin-left: 8px; }
.box-list { max-height: 230px; overflow-y: auto; margin: 0 -5px 10px; padding: 0 5px; }
.box-item { width: 100%; margin-bottom: 5px; display: flex; align-items: center; gap: 9px; text-align: left; font-size: 11px; padding: 7px 8px; }
.box-swatch { width: 14px; height: 11px; border: 2px solid var(--accent); flex-shrink: 0; }
.box-swatch.proposal { border-style: dashed; }
.box-swatch.ambiguous { border-color: oklch(61% .13 70); }
.box-copy { flex: 1; min-width: 0; }
.box-copy small { overflow: hidden; text-overflow: ellipsis; }
.box-state { max-width: 75px; white-space: normal; text-align: right; line-height: 1.4; }
.box-copy small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 3px; }
.box-state { font-size: 10px; font-weight: 450; color: var(--muted); }
.empty-boxes { color: var(--muted); font-size: 12px; padding: 7px 0 12px; line-height: 1.6; }
.selected-controls { padding: 0 0 9px; }
.selected-controls .button-row { gap: 5px; }
.selected-controls button { font-size: 10px; padding: 6px 7px; flex: 1; }
.danger-text { color: var(--danger); background: transparent; border-color: transparent; margin-top: 3px; }
.full-width { display: block; width: 100%; margin-top: 7px; font-size: 12px; }
#accept-proposals { font-size: 11px; }
#proposal-note { margin-top: 7px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.55; margin-top: 13px; cursor: pointer; }
.check-row input { margin: 2px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.completion-help { margin: 13px 0 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: oklch(98% .006 173); min-height: 38px; }
button.primary:hover:not(:disabled) { background: oklch(36% .065 173); }
.export-note { font-size: 10px; line-height: 1.6; color: var(--muted); margin-top: 12px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 8px 15px; font-size: 10px; line-height: 1.5; color: var(--muted); flex-shrink: 0; }
#storage-path { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 45%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (min-width: 1550px) { .workspace { grid-template-columns: 225px minmax(360px, 1fr) 325px; } .review-panel section { padding: 21px; } .box-list { max-height: 280px; } }
@media (max-width: 1180px) { .workspace { grid-template-columns: 162px minmax(300px, 1fr) 270px; } .review-panel section { padding: 14px; } .image-heading { padding: 16px 14px; align-items: flex-start; } .image-heading .button-row button { font-size: 11px; padding: 6px 8px; } .view-tools { margin-left: 0; } .toolbar { gap: 7px; } .save-region { font-size: 11px; } }
@media (max-width: 930px) { body { height: auto; min-height: 100dvh; } .workspace { grid-template-columns: 145px minmax(0, 1fr); } .navigator { grid-row: 1 / 3; } .main-panel { min-height: 620px; } .review-panel { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); } .review-panel .finish-section { grid-column: 1 / -1; } .review-panel section + section { border-top: 0; } .review-panel .finish-section { border-top: 1px solid var(--line); } .header-actions button { font-size: 11px; } .app-header { flex-wrap: wrap; gap: 8px 16px; } .save-region { order: 3; width: 100%; } .image-list { max-height: calc(100dvh - 280px); } .conflict { align-items: flex-start; flex-direction: column; } }
@media (max-width: 600px) { .workspace { display: flex; flex-direction: column; } .navigator { border-right: 0; border-bottom: 1px solid var(--line); } .navigator-heading { padding: 10px 14px; } .search-label, .filter-row, .navigator-footer { display: none; } .image-list { display: flex; padding: 0 7px 7px; gap: 4px; overflow-x: auto; } .image-item { width: 160px; flex-shrink: 0; } .main-panel { min-height: 560px; } .review-panel { display: block; border-left: 0; } .review-panel section + section { border-top: 1px solid var(--line); } .identity { min-width: 0; } .app-header { padding: 12px; } .app-footer { flex-direction: column; gap: 3px; } #storage-path { max-width: 100%; } .stage-footer { font-size: 9px; } .image-title h2 { max-width: 170px; } }
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .field-label { display: flex; flex-direction: column; gap: 6px; }
.login-card input { width: 100%; }
.login-error { margin: 0; color: var(--danger); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.link-button { background: none; border: none; padding: 0; margin-left: 4px; color: var(--accent); font: inherit; font-size: 11px; text-decoration: underline; cursor: pointer; }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
