:root {
  --ink: #182521;
  --muted: #697772;
  --soft: #91a09b;
  --line: #dfe7e3;
  --line-strong: #cdd9d4;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #edf2f0;
  --canvas: #111816;
  --accent: #0aa77b;
  --accent-dark: #08795d;
  --accent-soft: #dff8ef;
  --violet: #6978ed;
  --danger: #d34b55;
  --warning: #d28b22;
  --topbar-height: 68px;
  --left-width: 286px;
  --right-width: 318px;
  --shadow: 0 18px 55px rgba(20, 41, 34, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--surface-2);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-size: 14px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, canvas:focus-visible {
  outline: 2px solid rgba(10, 167, 123, .52);
  outline-offset: 2px;
}
.is-hidden { display: none !important; }

.login-shell { display: grid; grid-template-columns: minmax(430px, .85fr) minmax(520px, 1.15fr); width: 100%; height: 100%; background: #f7faf8; }
.login-card { width: min(440px, calc(100% - 72px)); margin: auto; padding: 48px 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 760; letter-spacing: -.03em; }
.brand-large { font-size: 21px; margin-bottom: 68px; }
.brand-mark { position: relative; display: inline-flex; align-items: flex-end; gap: 3px; width: 27px; height: 27px; padding: 5px; border-radius: 8px; background: var(--ink); overflow: hidden; }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: #7ff0cf; transform: rotate(14deg); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; opacity: .8; }
.eyebrow { margin: 0 0 14px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.login-card h1 { max-width: 410px; margin: 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.15; letter-spacing: -.055em; }
.login-copy { max-width: 390px; margin: 22px 0 36px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.login-form { display: grid; gap: 18px; }
.login-form label, .field-label { display: grid; gap: 8px; color: #4d5b56; font-size: 12px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input { height: 42px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #9aa7a2; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 167, 123, .1); outline: none; }
.login-form input { height: 49px; padding: 0 15px; }
.form-error { min-height: 18px; margin: -6px 0 -4px; color: var(--danger); font-size: 12px; }
.button { min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 680; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, color .15s, box-shadow .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--accent); color: white; box-shadow: 0 5px 14px rgba(10, 167, 123, .2); }
.button-primary:hover:not(:disabled) { background: #07966f; }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: #3d4b46; }
.button-secondary:hover:not(:disabled) { border-color: #aab9b3; background: #f9fbfa; }
.button-quiet { color: var(--muted); }
.button-quiet:hover { background: var(--surface-3); color: var(--ink); }
.button-large { height: 50px; margin-top: 2px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.button-block { width: 100%; }
.login-foot { display: flex; align-items: center; gap: 8px; margin-top: 34px; color: #89958f; font-size: 11px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.login-visual { position: relative; margin: 18px; overflow: hidden; border-radius: 20px; background: radial-gradient(circle at 73% 22%, rgba(103, 121, 237, .34), transparent 27%), linear-gradient(145deg, #17392f 0%, #0c1714 55%, #101c25 100%); box-shadow: var(--shadow); }
.visual-grid { position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom right, black, transparent 75%); }
.visual-polygon { position: absolute; width: min(70%, 640px); aspect-ratio: 1; left: 50%; top: 46%; transform: translate(-50%, -50%); filter: drop-shadow(0 30px 45px rgba(0,0,0,.28)); }
.depth-rings { position: absolute; border: 1px solid rgba(114, 239, 204, .22); border-radius: 50%; }
.depth-rings::before, .depth-rings::after { content: ""; position: absolute; inset: 12%; border: inherit; border-radius: inherit; }
.depth-rings::after { inset: 28%; }
.ring-one { width: 500px; height: 500px; top: -230px; right: -180px; }
.ring-two { width: 420px; height: 420px; bottom: -220px; left: -170px; }
.visual-caption { position: absolute; left: 42px; right: 42px; bottom: 40px; display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); color: white; }
.visual-caption span { color: #87e8cb; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.visual-caption strong { font-size: 14px; font-weight: 560; }

.app-shell { width: 100%; height: 100%; background: var(--surface-2); }
.topbar { height: var(--topbar-height); display: flex; align-items: center; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.topbar-brand { min-width: calc(var(--left-width) - 18px); font-size: 17px; }
.topbar-divider { width: 1px; height: 28px; margin-left: -20px; background: var(--line); }
.dataset-heading { min-width: 260px; }
.dataset-heading-row { display: flex; align-items: center; gap: 9px; }
.dataset-heading h1 { max-width: 400px; margin: 0; overflow: hidden; color: #27332f; font-size: 14px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 750; }
.status-pill.annotating { background: #e5f7f1; color: #0a7c5d; }
.status-pill.submitted { background: #fff2d9; color: #9a6515; }
.status-pill.approved { background: #e6f6ec; color: #267a47; }
.status-pill.rejected { background: #fde8e9; color: #b33741; }
.progress-line { display: flex; align-items: center; gap: 9px; margin-top: 6px; color: var(--soft); font-size: 10px; }
.progress-track { width: 84px; height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.save-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; color: var(--muted); font-size: 11px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: #58b797; }
.save-state.dirty i { background: var(--warning); }
.save-state.saving i { background: var(--violet); animation: pulse 1s infinite; }
.save-state.error i { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #53615c; font-size: 16px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.icon-button:disabled { cursor: not-allowed; opacity: .35; }
.danger-hover:hover:not(:disabled) { border-color: #f2c7ca; background: #fff2f3; color: var(--danger); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 7px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #25332e; color: #adf2dd; font-size: 12px; font-weight: 800; }
.user-copy { display: grid; min-width: 65px; line-height: 1.3; }
.user-copy strong { font-size: 11px; }
.user-copy small { color: var(--soft); font-size: 9px; }

.workspace { height: calc(100% - var(--topbar-height)); display: grid; grid-template-columns: var(--left-width) minmax(420px, 1fr) var(--right-width); }
.sidebar { min-width: 0; overflow: hidden; background: var(--surface); }
.sidebar-left { border-right: 1px solid var(--line); }
.sidebar-right { overflow-y: auto; border-left: 1px solid var(--line); }
.side-tabs { height: 48px; display: grid; grid-template-columns: 1fr 1fr; align-items: end; padding: 0 16px; border-bottom: 1px solid var(--line); }
.side-tab { position: relative; height: 47px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.side-tab::after { content: ""; position: absolute; height: 2px; left: 20%; right: 20%; bottom: -1px; border-radius: 2px 2px 0 0; background: transparent; }
.side-tab.is-active { color: var(--ink); }
.side-tab.is-active::after { background: var(--accent); }
.side-panel { height: calc(100% - 48px); display: flex; flex-direction: column; padding: 14px 12px; }
.search-box { display: flex; align-items: center; height: 37px; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--soft); }
.search-box input { height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 11px; }
.filter-row { display: flex; gap: 5px; margin: 10px 0 14px; }
.filter-chip { flex: 1; height: 29px; padding: 0 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; }
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.is-active { border-color: var(--line); background: var(--surface); color: var(--accent-dark); box-shadow: 0 2px 8px rgba(24,37,33,.06); }
.list-caption { display: flex; justify-content: space-between; padding: 0 5px 8px; color: var(--soft); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.image-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px 12px; scrollbar-width: thin; scrollbar-color: #d0dbd6 transparent; }
.image-item { width: 100%; min-height: 52px; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 3px; padding: 8px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.image-item:hover { background: var(--surface-2); }
.image-item.is-active { border-color: #bde8da; background: var(--accent-soft); }
.image-state-dot { width: 8px; height: 8px; border: 2px solid #c7d1cd; border-radius: 50%; }
.image-state-dot.draft { border-color: var(--warning); background: #fff0cd; }
.image-state-dot.completed { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 1px white; }
.image-item-copy { min-width: 0; display: grid; gap: 4px; }
.image-item-copy strong { overflow: hidden; color: #34413d; font-size: 10.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.image-item-copy small { color: var(--soft); font-size: 9px; }
.image-item-tail { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.review-token { padding: 3px 5px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.review-token.pending { background: #fff2d9; color: #8b5a12; }
.review-token.approved { background: var(--accent-soft); color: var(--accent-dark); }
.review-token.rejected { background: #fff0f1; color: #a83a43; }
.review-token.revising { background: #fff2d9; color: #8b5a12; }
.review-token.unsubmitted { background: var(--surface-3); color: var(--muted); }
.depth-token { padding: 3px 5px; border-radius: 4px; background: #ebedff; color: #6370c9; font-size: 8px; font-weight: 800; }
.panel-intro { padding: 5px 4px 14px; }
.panel-intro h2 { margin: 0 0 7px; font-size: 14px; }
.panel-intro p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.add-label-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.add-label-form input { height: 36px; font-size: 11px; }
.label-list { flex: 1; overflow-y: auto; padding-top: 10px; }
.label-item { width: 100%; display: grid; grid-template-columns: 11px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 39px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #45524e; text-align: left; cursor: pointer; }
.label-item:hover { background: var(--surface-2); }
.label-item.is-active { border-color: #bde8da; background: var(--accent-soft); color: #17664f; font-weight: 700; }
.color-dot { width: 9px; height: 9px; border-radius: 3px; }
.label-item small { color: var(--soft); font-size: 9px; }

.annotator-stage { min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.toolstrip { position: relative; z-index: 3; min-height: 51px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-bottom: 1px solid #dfe6e3; background: #f9fbfa; box-shadow: 0 3px 12px rgba(18,29,25,.07); }
.tool-group { display: flex; gap: 3px; }
.tool-group.compact { gap: 4px; }
.tool-button { min-width: 62px; height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #64716d; font-size: 11px; font-weight: 650; cursor: pointer; }
.tool-button:hover { background: var(--surface-3); }
.tool-button.is-active { border-color: #bde8da; background: var(--accent-soft); color: #087759; }
.tool-icon { display: inline-block; width: 14px; height: 14px; }
.polygon-icon { clip-path: polygon(50% 0, 100% 38%, 80% 100%, 18% 92%, 0 35%); border: 2px solid currentColor; background: transparent; }
.edit-icon { position: relative; border: 1.5px solid currentColor; transform: rotate(45deg) scale(.75); }
.edit-icon::after { content: ""; position: absolute; width: 4px; height: 4px; right: -3px; bottom: -3px; border-radius: 50%; background: currentColor; box-shadow: -12px 0 currentColor, 0 -12px currentColor, -12px -12px currentColor; }
.hand-icon { display: grid; place-items: center; font-size: 16px; }
.tool-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--line); }
.toolstrip-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.toolbar-save-slot { display: flex; align-items: center; padding-left: 7px; border-left: 1px solid var(--line); }
.toolbar-save-slot.is-empty { display: none; }
.save-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.view-switch { height: 31px; display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); }
.view-option { min-width: 44px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; cursor: pointer; }
.view-option.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(20,36,30,.12); }
.view-option:disabled { cursor: not-allowed; opacity: .4; }
.opacity-control { display: flex; align-items: center; gap: 6px; margin-left: 2px; color: var(--muted); font-size: 9px; }
.opacity-control.is-disabled { opacity: .35; pointer-events: none; }
.opacity-control input { width: 62px; height: 20px; padding: 0; accent-color: var(--violet); border: 0; box-shadow: none; }
.opacity-control output { width: 25px; font-size: 8px; }
.zoom-controls { display: flex; align-items: center; gap: 3px; }
.zoom-value { width: 52px; height: 31px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; cursor: pointer; }
.toolstrip .icon-button { width: 31px; height: 31px; }
.toolstrip .button { min-height: 34px; white-space: nowrap; }
.canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background-color: #111816; background-image: radial-gradient(circle at center, #1b2824 0, #111816 68%); }
#annotationCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#annotationCanvas.mode-draw { cursor: crosshair; }
#annotationCanvas.mode-edit { cursor: default; }
#annotationCanvas.mode-pan, #annotationCanvas.is-panning { cursor: grab; }
#annotationCanvas.is-panning { cursor: grabbing; }
.canvas-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #a7b5b0; pointer-events: none; }
.canvas-empty strong { font-size: 13px; font-weight: 620; }
.canvas-empty small { color: #6f7f79; font-size: 10px; }
.empty-orbit { position: relative; width: 42px; height: 42px; margin-bottom: 5px; border: 1px solid #4a5b55; border-radius: 50%; }
.empty-orbit::after { content: ""; position: absolute; width: 7px; height: 7px; top: 4px; right: 2px; border-radius: 50%; background: #6ee0bf; box-shadow: 0 0 12px rgba(110,224,191,.7); }
.canvas-badge { position: absolute; left: 14px; top: 14px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 7px; background: rgba(14,24,21,.78); backdrop-filter: blur(8px); color: #b8c6c1; font-size: 9px; font-weight: 700; pointer-events: none; }
.draw-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 7px 11px; border: 1px solid rgba(111,232,197,.25); border-radius: 8px; background: rgba(10,36,29,.85); color: #a9ead7; font-size: 9px; pointer-events: none; }
.canvas-statusbar { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 12px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(11,17,15,.75); color: #74827d; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; pointer-events: none; }

.right-section { padding: 16px 15px; border-bottom: 1px solid var(--line); }
.objects-section { min-height: 218px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading > div { display: flex; align-items: center; gap: 7px; }
.section-heading h2 { margin: 0; color: #3a4742; font-size: 11px; font-weight: 760; letter-spacing: .01em; }
.section-heading > span { color: var(--soft); font-size: 9px; }
.image-review-card { display: grid; gap: 5px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.image-review-card strong { color: #34413d; font-size: 10.5px; font-weight: 700; }
.image-review-card span { color: var(--muted); font-size: 9px; line-height: 1.55; }
.image-review-card p { margin: 3px 0 0; padding: 8px; border-radius: 6px; background: #fff8e9; color: #796037; font-size: 9px; line-height: 1.55; }
.image-review-card p.rejected { background: #fff0f1; color: #88444a; }
.count-badge { min-width: 20px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-weight: 800; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent-dark); font-size: 9px; font-weight: 700; cursor: pointer; }
.text-button:disabled { opacity: .4; cursor: not-allowed; }
.danger-text { color: var(--danger); }
.object-list { max-height: 240px; overflow-y: auto; margin: 0 -5px; padding: 0 5px; }
.object-empty { padding: 24px 18px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--soft); font-size: 9px; line-height: 1.6; text-align: center; }
.object-item { width: 100%; min-height: 43px; display: grid; grid-template-columns: 23px 10px minmax(0,1fr) auto; align-items: center; gap: 7px; margin-bottom: 3px; padding: 5px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.object-item:hover { background: var(--surface-2); }
.object-item.is-selected { border-color: #bde8da; background: var(--accent-soft); }
.visibility-toggle { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--soft); font-size: 12px; cursor: pointer; }
.object-copy { min-width: 0; display: grid; gap: 3px; }
.object-copy strong { overflow: hidden; font-size: 10px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.object-copy small { color: var(--soft); font-size: 8px; }
.object-index { color: var(--soft); font-family: ui-monospace, monospace; font-size: 8px; }
.inspector-section.is-disabled { opacity: .62; }
.field-inline { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.field-inline input { height: 36px; font-size: 11px; }
.property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.property-grid > div { display: grid; gap: 4px; padding: 9px; border-radius: 7px; background: var(--surface-2); }
.property-grid span { color: var(--soft); font-size: 8px; }
.property-grid strong { color: #4d5a55; font-size: 10px; }
.inspector-actions { display: flex; justify-content: space-between; margin-top: 12px; }
.file-card { display: grid; gap: 5px; margin-bottom: 11px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.file-card strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-card span { color: var(--soft); font-size: 8px; }
.mini-state { padding: 3px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-weight: 750; }
.mini-state.draft { background: #fff2d9; color: #9a6515; }
.mini-state.completed { background: var(--accent-soft); color: #087759; }
.mini-state.review-pending { background: #fff2d9; color: #8b5a12; }
.mini-state.review-approved { background: var(--accent-soft); color: var(--accent-dark); }
.mini-state.review-rejected { background: #fff0f1; color: #a83a43; }
.mini-state.review-revising { background: #fff2d9; color: #8b5a12; }
.mini-state.review-unsubmitted { background: var(--surface-3); color: var(--muted); }
.workflow-track { display: flex; align-items: flex-start; justify-content: space-between; }
.workflow-track b { flex: 1; height: 1px; margin: 6px 5px 0; background: var(--line); }
.workflow-step { display: grid; justify-items: center; gap: 5px; color: var(--soft); font-size: 8px; white-space: nowrap; }
.workflow-step i { width: 12px; height: 12px; border: 2px solid var(--line-strong); border-radius: 50%; background: white; }
.workflow-step.is-done, .workflow-step.is-active { color: var(--accent-dark); font-weight: 700; }
.workflow-step.is-done i { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px white; }
.workflow-step.is-active i { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.workflow-step.is-rejected { color: var(--danger); }
.workflow-step.is-rejected i { border-color: var(--danger); background: #fff0f1; }
.review-message { margin-top: 13px; padding: 9px; border-left: 3px solid var(--warning); border-radius: 4px 7px 7px 4px; background: #fff8e9; color: #796037; font-size: 9px; line-height: 1.55; }
.review-message.rejected { border-color: var(--danger); background: #fff0f1; color: #88444a; }
.workflow-actions { display: grid; gap: 7px; margin-top: 13px; }
.workflow-note { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.6; }
.workflow-actions.two { grid-template-columns: 1fr 1fr; }
.review-save-slot { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.review-save-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-save-copy span { color: var(--body); font-size: 10px; font-weight: 700; }
.review-save-copy small { color: var(--soft); font-size: 8px; white-space: nowrap; }
.review-save-slot .save-actions { width: 100%; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 7px; }
.review-save-slot .save-actions .button { min-width: 0; width: 100%; padding-inline: 8px; }

.modal { max-width: none; max-height: none; padding: 0; border: 0; border-radius: 13px; background: transparent; box-shadow: 0 20px 70px rgba(5,20,15,.25); }
.modal::backdrop { background: rgba(9,17,14,.48); backdrop-filter: blur(2px); }
.modal-card { width: 500px; padding: 25px; border-radius: 13px; background: white; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.modal-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-heading .eyebrow { margin-bottom: 7px; }
.shortcut-grid { display: grid; grid-template-columns: minmax(150px,1fr) auto auto auto; align-items: center; gap: 10px 7px; color: var(--muted); font-size: 11px; }
.shortcut-grid kbd { min-width: 28px; padding: 5px 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: #46534f; font-family: inherit; font-size: 9px; font-weight: 700; text-align: center; }
.shortcut-grid b { color: var(--soft); font-size: 9px; font-weight: 500; }
.modal-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--soft); font-size: 10px; line-height: 1.6; }
.review-modal .modal-card { width: 470px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 390px; display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: #23312c; box-shadow: 0 12px 35px rgba(0,0,0,.22); color: white; font-size: 11px; line-height: 1.5; animation: toast-in .2s ease-out; }
.toast i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #6ee0bf; }
.toast.error i { background: #ff7c84; }
.toast.warning i { background: #f2bb5e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  :root { --left-width: 245px; --right-width: 280px; }
  .opacity-control { display: none; }
  .topbar-brand { min-width: 150px; }
  .topbar-divider { margin-left: 0; }
  .save-state { display: none; }
}
@media (max-width: 960px) {
  :root { --left-width: 220px; --right-width: 250px; }
  .tool-button { min-width: 39px; font-size: 0; }
  .tool-icon { margin: 0; }
  .zoom-controls { display: none; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

/* Shared accessibility and workspace context */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #17231f;
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); }
select:focus-visible {
  outline: 2px solid rgba(10, 167, 123, .52);
  outline-offset: 2px;
}

.dataset-heading { width: min(360px, 29vw); min-width: 240px; }
.dataset-heading-row { min-width: 0; }
.dataset-switcher-field { min-width: 0; flex: 1; }
.dataset-switcher-field select {
  width: 100%;
  height: 31px;
  padding: 0 30px 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--surface-2);
  color: #2f3d38;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.dataset-switcher-field select:hover:not(:disabled) { border-color: var(--line-strong); background-color: #fff; }
.dataset-switcher-field select:disabled { cursor: default; color: var(--muted); opacity: 1; }
.progress-line { margin-left: 1px; }

.search-box kbd {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  background: white;
  color: var(--soft);
  font-family: inherit;
  font-size: 8px;
}
.search-box input { min-width: 0; }

.review-mode-notice {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 10px;
  border: 1px solid #d9dbee;
  border-radius: 7px;
  background: #f2f3ff;
  color: #5d66a9;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.is-review-mode .toolstrip { gap: 8px; }
.is-review-mode .inspector-section input:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: #4e5c57;
  opacity: 1;
}
.tool-button { font-size: 11px; }
.tool-group.compact .icon-button {
  width: auto;
  min-width: 40px;
  padding: 0 8px;
  font-size: 9px;
}
.toolstrip > .tool-group:not(.compact) .tool-button { min-width: 54px; }
.toolstrip .button { font-size: 10px; }

@media (max-width: 1260px) {
  .dataset-heading { width: min(300px, 27vw); min-width: 220px; }
  .review-mode-notice { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .user-copy { display: none; }
  .user-chip { min-width: 0; padding-left: 8px; }
}

@media (max-width: 1060px) {
  .topbar { gap: 12px; }
  .topbar-brand { min-width: 125px; }
  .topbar-divider { margin-left: 0; }
  .dataset-heading { width: 250px; min-width: 200px; }
  .topbar-actions .button { padding: 0 9px; font-size: 10px; }
  .review-mode-notice { display: none; }
  .toolstrip { gap: 4px; }
  .toolstrip > .tool-group:not(.compact) .tool-button { min-width: 46px; padding: 0 7px; }
}

@media (max-width: 860px) {
  :root { --left-width: 200px; --right-width: 230px; }
  .topbar-brand > span:last-child { display: none; }
  .topbar-brand { min-width: 34px; }
  .dataset-heading { width: 240px; }
  #managementLink, .save-state { display: none; }
  .workspace { grid-template-columns: var(--left-width) minmax(360px, 1fr) var(--right-width); }
  .view-option { min-width: 38px; padding: 0 6px; }
}

/* Keep the central canvas toolbar readable at its actual container width. */
.annotator-stage { container-type: inline-size; }
.tool-group,
.tool-button,
.view-switch,
.opacity-control,
.zoom-controls,
.toolstrip-actions,
.save-actions { flex-shrink: 0; }
.tool-button { white-space: nowrap; }

@container (max-width: 940px) {
  .zoom-controls,
  .opacity-control { display: none; }
  .is-review-mode .toolstrip-actions { display: none; }
}

@container (max-width: 900px) {
  .review-mode-notice { display: none; }
}

@container (max-width: 700px) {
  .tool-group.compact,
  .tool-group.compact + .tool-divider { display: none; }
  .save-actions .button { padding-left: 9px; padding-right: 9px; }
}

@container (max-width: 560px) {
  .toolstrip { flex-wrap: wrap; align-content: center; row-gap: 7px; }
  .toolstrip-actions {
    width: 100%;
    flex: 1 0 100%;
    justify-content: flex-end;
    margin-left: 0;
    padding-top: 7px;
    border-top: 1px solid var(--line);
  }
  .toolstrip-actions > .tool-divider { display: none; }
  .save-actions { max-width: 100%; margin-left: auto; }
}

@container (max-width: 340px) {
  .toolstrip { padding-inline: 6px; }
  .toolstrip > .tool-divider { display: none; }
  .toolstrip > .tool-group:not(.compact) .tool-button { min-width: 38px; padding-inline: 5px; }
  .view-option { min-width: 34px; padding-inline: 4px; }
  .save-actions { width: 100%; }
  .save-actions .button { min-width: 0; flex: 1 1 0; }
}

