:root {
  --ink: #172b3b;
  --muted: #546878;
  --line: #ccd6dd;
  --paper: #fff;
  --surface: #f2f5f7;
  --accent: #176b8a;
  --selected: #e2f1f7;
  --danger: #a82f36;
  --success: #236848;
  --font: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font: 14px/1.55 var(--font);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  padding: 8px 12px;
  min-height: 36px;
  transition: background 0.15s;
}
button:hover {
  background: var(--selected);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.danger {
  color: var(--danger);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  min-height: 36px;
}
/* One chevron for all single-choice dropdowns, including dialogs and developer screens. */
select:where(:not([multiple]):not([size])) {
  padding-right:32px;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23546878' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px;
}
@media (forced-colors:active) {
  select:where(:not([multiple]):not([size])) { appearance:auto; -webkit-appearance:auto; background-image:none; }
}
input[type="checkbox"] {
  width: auto;
  min-height: auto;
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
label input,
label select {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: var(--accent);
}
h1 {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 700;
}
h2 {
  font-size: 16px;
  margin: 0;
}
h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
p {
  margin: 8px 0;
  color: var(--muted);
}
:root { --sidebar-width:232px; --app-bar-height:46px; }
.app-header {
  position:fixed; top:0; left:0; z-index:30;
  width:var(--sidebar-width); height:var(--app-bar-height);
  background:var(--paper); border-right:1px solid var(--line); border-bottom:1px solid var(--line);
}
.brand {
  display:flex; align-items:center; gap:10px; width:100%; height:100%;
  border:0; border-radius:0; padding:0 14px; text-align:left;
}
.brand svg { width:23px; height:23px; stroke:url(#brand-gradient); fill:none; stroke-width:1.8; }
.brand strong { font-size:16px; letter-spacing:.03em; }
@media (forced-colors:active) {
  .brand svg { stroke:ButtonText; }
}
.brand .menu-chevron { margin-left:auto; color:var(--muted); }
#app-menu {
  position:absolute; top:100%; left:0; width:100%; min-width:195px;
  padding:14px; background:var(--paper); border:1px solid var(--line);
  box-shadow:0 5px 14px #172b3b20;
}
#app-menu .app-description { margin:0 0 12px; font-size:13px; }
#session { font-size:12px; display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
#session button { width:100%; text-align:left; }
nav {
  margin-left:var(--sidebar-width);
  height:var(--app-bar-height);
  display: flex;
  gap: 4px;
  background: var(--paper);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  min-height: 46px;
  overflow: auto;
}
nav button {
  border: 0;
  border-radius: 0;
  background: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
}
nav button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
#notice {
  position: fixed;
  right: 18px;
  bottom: 16px;
  max-width: min(620px, 90vw);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 5px;
  box-shadow: 0 3px 18px #172b3b25;
  z-index: 20;
}
#notice.error {
  background: var(--danger);
}
.skip {
  position: absolute;
  top: -100px;
}
.skip:focus {
  top: 0;
  z-index: 50;
  background: white;
  padding: 10px;
}
.workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 280px;
  height: calc(100vh - var(--app-bar-height));
}
.file-panel,
.inspector {
  background: var(--paper);
  overflow: auto;
}
.file-panel {
  border-right: 1px solid var(--line);
}
.inspector {
  border-left: 1px solid var(--line);
}
.panel-heading {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-controls {
  padding: 0 12px 12px;
  display: grid;
  gap: 8px;
}
.file-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #e7edf0;
  padding: 12px 14px;
  display: block;
  overflow: hidden;
}
.file-item.selected {
  background: var(--selected);
  box-shadow: inset 3px 0 var(--accent);
}
.file-item strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.pill {
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  display: inline-block;
  white-space: nowrap;
}
.pill.good {
  color: var(--success);
  background: #eef7f1;
  border-color: #b8d8c5;
}
.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.toolbar {
  padding: 9px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.toolbar .spacer {
  flex: 1;
}
.toolbar button.on {
  background: var(--selected);
  border-color: var(--accent);
  color: var(--accent);
}
.viewport {
  overflow: auto;
  flex: 1;
  min-height: 200px;
  background: #dfe6eb;
  padding: 22px;
  position: relative;
  overscroll-behavior: contain;
}
.drawing {
  display: block;
  background: white;
  box-shadow: 0 2px 8px #172b3b18;
  touch-action: none;
  user-select: none;
}
.drawing rect.box {
  fill: #176b8a09;
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.drawing rect.chosen {
  stroke: #bc6320;
  fill: #bc632014;
  stroke-width: 2;
}
.drawing rect.draft {
  stroke: #bc6320;
  fill: #bc632018;
  stroke-width: 2;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
}
.drawing text {
  fill: var(--accent);
  font-family: var(--mono);
  pointer-events: none;
  paint-order: stroke;
  stroke: white;
  stroke-width: 2px;
}
.statusbar {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: white;
}
.section {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.section > label,
.section > button {
  margin-top: 10px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * {
  min-width: 0;
}
.row input {
  flex: 1;
}

.crop {
  background: var(--surface);
  border: 1px solid var(--line);
  height: 140px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop svg {
  width: 100%;
  height: 100%;
}
.box-list-heading, .box-list-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
}
.box-list-heading { justify-content: space-between; }
.box-list-heading h3 { margin: 0; }
.box-list-navigation button { padding: 5px 9px; font-size: 12px; }
.box-list {
  max-height: 210px;
  overflow: auto;
  margin-top: 8px;
}
.box-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.box-list button.selected {
  background: var(--selected);
}
.box-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 185px;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 260px;
  height: 100%;
  padding: 30px;
}
.empty h2 {
  margin-bottom: 8px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.screen {
  max-width: 1450px;
  padding: 24px;
  margin: auto;
}
.screen-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.screen-head p {
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  min-width: 0;
  align-self: start;
}
.card h2 {
  margin-bottom: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stack {
  display: grid;
  gap: 12px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.error {
  color: var(--danger);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: min(900px, 94vw);
  max-height: 85vh;
  width: 600px;
  padding: 24px;
}
dialog::backdrop {
  background: #172b3b60;
}
dialog input {
  margin: 8px 0 14px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.65 var(--mono);
  max-height: 65vh;
  overflow: auto;
}
.note {
  padding: 10px 12px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  font-size: 12px;
  color: var(--muted);
}
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  gap: 6px;
}
.page-action {
  width: 100%;
}
.file-picker {
  width: 100%;
}
.view-switch {
  display: none;
}
.wide {
  grid-column: 1/-1;
}
.busy {
  cursor: progress;
}
.audit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 1150px) {
  :root { --sidebar-width:195px; }
  .workspace {
    grid-template-columns: 195px minmax(0, 1fr) 245px;
  }

  .toolbar button {
    padding: 7px 9px;
  }
}
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 245px;
  }
  .file-panel {
    display: none;
  }
  .workspace.show-files .file-panel {
    display: block;
    grid-column: 1/-1;
    max-height: 45vh;
  }
  .view-switch {
    display: inline-block;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .screen {
    padding: 16px;
  }
  .toolbar {
    gap: 4px;
  }
  .viewport {
    padding: 12px;
  }
}
@media (max-width: 560px) {
  :root { --sidebar-width:140px; }

  #session {
    gap: 4px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .editor {
    min-height: 60vh;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .viewport {
    height: 45vh;
    flex: auto;
  }
  .file-panel {
    max-height: 35vh;
  }
  .brand strong {
    font-size: 16px;
  }
  nav {
    padding: 0 4px;
  }
  nav button {
    padding: 10px;
  }
  .screen-head {
    display: block;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .section .crop {
    height: 160px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.assist-rough { fill:none;stroke:#176b8a;stroke-width:2;stroke-dasharray:7 5;vector-effect:non-scaling-stroke; }
.assist-candidate {fill:rgba(0,130,80,.06);stroke:#008250;stroke-width:2;vector-effect:non-scaling-stroke;}
.assist-panel {border-left:4px solid #008250;background:#f3faf7;}

.search-panel { border-left: 3px solid #a65c17; background: #fffaf4; }
.search-panel progress { width: 100%; margin: 8px 0; }
.search-references { display: flex; gap: 8px; }
.search-references svg { width: 64px; height: 64px; border: 1px solid var(--line); background: white; }
.search-results { display: grid; gap: 6px; margin-top: 12px; }
.search-result { display: grid; grid-template-columns: 20px 64px 1fr; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); background: white; cursor: pointer; }
.search-result input { width: 18px; height: 18px; }
.search-result svg { width: 64px; height: 64px; }
.search-result span { font-size: 12px; }
.search-candidate { fill: none; stroke: #a65c17; stroke-dasharray: 4 3; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.search-chosen { stroke: #198151; stroke-dasharray: none; stroke-width: 2.5; }
.zoom-input { width: 65px; padding: 6px; }
.page-navigation { display:flex; align-items:center; gap:8px; padding:6px 12px; background:white; border-bottom:1px solid var(--line); }
.page-navigation label { display:flex; align-items:center; gap:6px; }
.page-navigation input { width:65px; margin:0; }
.page-navigation button { min-width:40px; }
.review-crop { height:180px; background:white; border:1px solid var(--line); margin-top:8px; }
.review-crop svg { width:100%; height:100%; }
.candidate-review { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.review-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.review-actions button { flex:1; font-size:12px; }
.candidate-review > .page-action { margin-top:8px; }
.search-candidate { pointer-events:stroke; cursor:pointer; }
.search-panel details { margin-top:12px; }
.drawing { margin:0 auto; }
.inspector { overflow-anchor:none; }
.search-panel .search-references svg { width:40px; height:40px; }
.search-panel .review-crop { height:140px; }
.search-panel .candidate-review p { font-size:12px; margin:5px 0; }

.section .refinement-editor { height:240px; background:white; }
.refinement-editor svg { width:100%; height:100%; touch-action:none; user-select:none; }
.refinement-handle { fill:white; stroke:#008250; stroke-width:1.5; vector-effect:non-scaling-stroke; }
.refinement-editor [tabindex]:focus { outline:none; stroke:#165dce; stroke-width:3; }

.model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.model-grid .stack { gap: 8px; }
.model-grid p { margin: 4px 0; }
@media (max-width: 800px) { .model-grid { grid-template-columns: 1fr; } }

.file-row { border-bottom:1px solid var(--line); background:var(--paper); }
.file-row:has(.file-item.selected) { background:var(--selected); box-shadow:inset 3px 0 var(--accent); }
.file-row .file-item { border-bottom:0; padding-bottom:6px; background:transparent; box-shadow:none; }
.file-row:hover { background:var(--selected); }
.file-row-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:0 8px 8px 14px; }
.file-row-footer small { color:var(--muted); font-size:11px; min-width:0; }
.page-manage { flex-shrink:0; padding:2px 9px; font-size:11px; }
.file-row .file-item:disabled { opacity: .7; cursor: default; }

.file-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.file-item-heading strong { min-width: 0; padding-top: 3px; }
.file-page-number { display: flex; flex-shrink: 0; align-items: baseline; gap: 3px; color: var(--ink); font-size: 22px; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.file-page-number > span { font-size: 12px; font-weight: 600; }
.file-item.selected .file-page-number { color: var(--accent); }

.pill.status-unstarted, .pill.status-inactive { color: #465563; background: #eef1f4; border-color: #c6cfd7; }
.pill.status-working { color: #884000; background: #fff0d9; border-color: #e7b46a; }
.pill.status-confirmed { color: var(--success); background: #e6f4eb; border-color: #9fc9af; }

.drawing rect.resize-handle { fill: white; stroke: #bc6320; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: all; }

/* Project controls share the top navigation across every role. */
.project-picker { display:flex; align-items:center; gap:8px; flex-shrink:0; margin:0; font-size:12px; }
.project-picker select {
  width:190px; max-width:28vw; height:36px; margin:0; padding:6px 32px 6px 10px;
}
.project-actions { display:flex; gap:8px; flex-wrap:wrap; }
.project-search { display:block; max-width:400px; margin:16px 0; }
.project-description { white-space:pre-wrap; overflow-wrap:anywhere; max-width:600px; }
textarea { font:inherit; width:100%; border:1px solid var(--line); padding:8px; resize:vertical; }

.label-swatch { display:inline-block; width:16px; height:16px; border:1px solid #0003; border-radius:3px; flex-shrink:0; vertical-align:middle; }
.current-label { display:flex; gap:8px; align-items:center; margin:10px 0; overflow-wrap:anywhere; }
.label-suggestions { display:flex; flex-direction:column; gap:4px; max-height:230px; overflow:auto; margin:8px 0; }
.label-suggestions button { display:flex; align-items:center; gap:8px; text-align:left; white-space:normal; }
.label-suggestions small { padding-top:4px; color:var(--muted); }
.label-create { color:var(--accent); }
.label-tabs { margin:16px 0; }
.label-tabs [aria-pressed=true] { background:var(--selected); border-color:var(--accent); color:var(--accent); }
input[type=color] { width:52px; height:36px; padding:3px; cursor:pointer; }

.label-example{width:48px;height:48px;object-fit:contain;background:white;border:1px solid #cbd5e1;vertical-align:middle;margin-right:6px}.label-suggestions button{display:flex;align-items:center;gap:6px}

.drawing .other-label{opacity:.2}
.drawing .same-label rect.box{fill:#176b8a20}
.drawing rect.label-halo{fill:none;pointer-events:none;vector-effect:non-scaling-stroke;stroke-width:0;opacity:1;animation:label-outward-halo 1.5s ease-in-out 3 both}
@keyframes label-outward-halo{0%,20%,80%,100%{stroke-width:0}50%{stroke-width:16px}}
.drawing .label-flash{animation:label-confirm-blink 1.5s ease-in-out 3}
@keyframes label-confirm-blink{0%,20%,80%,100%{opacity:0}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.drawing .label-flash{animation:none}.drawing rect.label-halo{animation:none;display:none}}

.drawing .selection-badge rect{fill:#b54720;stroke:none}
.drawing .selection-badge text{fill:#fff;stroke:none;stroke-width:0;paint-order:normal;font-family:var(--font);font-weight:600}

.label-actions-menu { margin: 8px 0; }
.label-actions-menu summary { cursor: pointer; color: var(--muted); font-size: 12px; }

.selection-heading-badge { display:inline-block; background:#b54720; color:#fff; padding:2px 6px; border-radius:3px; font-weight:600; }

/* Main counting tool and quieter history controls. */
.toolbar .tool-icon { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.toolbar .count-tool { display:inline-flex; align-items:center; gap:7px; background:#f2f8fa; border-color:var(--line); color:#135f79; font-weight:600; }
.toolbar .count-tool .sparkle-icon { fill:currentColor; stroke:none; }
.toolbar .count-tool:hover:not(:disabled) { background:#e2f1f7; }
.toolbar .count-tool.on { background:var(--accent); border-color:var(--accent); color:white; }
.toolbar .count-tool.on:hover:not(:disabled) { background:#125971; }
.toolbar #select-tool.on, .toolbar #draw-tool.on { background:white; border-color:var(--accent); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.history-tools { display:flex; gap:4px; margin-left:10px; padding-left:10px; border-left:1px solid var(--line); }
.toolbar .history-tool { display:inline-flex; align-items:center; justify-content:center; width:40px; padding:8px; background:transparent; border-color:transparent; color:var(--muted); }
.toolbar .history-tool:hover:not(:disabled) { background:var(--surface); color:var(--ink); }
.toolbar button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

button.review-crop { display:block; width:100%; padding:0; border-radius:0; overflow:hidden; cursor:pointer; }
button.review-crop:hover:not(:disabled) { background:white; border-color:var(--accent); }
button.review-crop:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.merge-source { display:flex; align-items:center; gap:8px; margin:12px 0; flex-wrap:wrap; }
.merge-targets { border:0; padding:0; margin:12px 0; max-height:320px; overflow:auto; }
.merge-targets legend { font-weight:600; margin-bottom:8px; }
.merge-target { display:flex; align-items:center; gap:8px; padding:8px; margin:0 0 6px; border:1px solid var(--line); border-radius:4px; cursor:pointer; }
.merge-target input[type="radio"] { width:auto; margin:0; flex:none; accent-color:var(--accent); }
.merge-target:has(input:checked) { background:var(--selected); border-color:var(--accent); }
.merge-target:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.merge-target > span:last-child { overflow-wrap:anywhere; }
.merge-target .label-example, .merge-source .label-example { flex:none; margin:0; }

.page-search-options { display:flex; flex-direction:column; align-items:stretch; gap:8px; margin:8px 0; font-size:11px; white-space:nowrap; }
.page-search-options label { display:flex; align-items:center; gap:3px; margin:0; font-size:inherit; }
.page-search-options select { width:72px; min-width:0; padding:4px 24px 4px 6px; margin:0; font-size:11px; background-position:right 4px center; }
.page-search-options input[type="checkbox"] { width:13px; height:13px; margin:0; accent-color:var(--accent); }

.page-management-header h2 { margin:0; overflow-wrap:anywhere; }
.page-management-header p { margin:6px 0 0; }
.page-management-section { border-top:1px solid var(--line); margin-top:20px; padding-top:16px; }
.page-management-section h3 { margin:0 0 8px; }
.page-management-section p { margin:0 0 12px; }
.page-management-section label { display:block; margin-bottom:6px; }
.page-project-controls { display:flex; align-items:center; gap:8px; }
.page-project-controls select { flex:1; min-width:0; margin:0; }
.page-project-controls button { flex:none; }
.page-management-danger h3 { color:var(--danger); }
.page-management-footer { display:flex; justify-content:flex-end; border-top:1px solid var(--line); padding-top:16px; margin-top:20px; }
.page-management-dialog .error:empty { display:none; }
@media(max-width:560px) { .page-project-controls { flex-direction:column; align-items:stretch; } }
.page-navigation .summary-trigger { margin-left:auto; white-space:nowrap; }
.count-summary-dialog { width:1100px; max-width:96vw; }
.count-summary-header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.count-summary-header h2 { margin:0; }
.count-summary-section { margin-top:24px; border-top:1px solid var(--line); padding-top:16px; }
.count-summary-section h3 { margin:0 0 8px; }
.count-summary-project { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.count-summary-project label { display:flex; align-items:center; gap:8px; }
.count-summary-project select { width:220px; max-width:50vw; }
.count-page-totals { display:flex; flex-wrap:wrap; gap:8px 20px; font-size:12px; }
.count-summary-table .count-number { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.count-summary-table tbody th { text-align:left; font-weight:500; }
.count-summary-table tfoot { background:var(--surface); font-weight:700; }

.count-summary-table tbody .count-number { font-size:20px; font-weight:600; line-height:1.4; }
.count-summary-table tfoot .count-number { font-size:24px; font-weight:700; line-height:1.4; }
.count-summary-table thead .count-number { font-size:12px; white-space:normal; min-width:110px; }

/* Collapsible drawing list: keep a visible, keyboard-accessible restore control. */
.file-panel-toggle { flex:none; width:44px; height:44px; padding:10px; border:0; background:transparent; }
.file-panel-toggle svg { display:block; width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.file-panel .panel-heading { gap:6px; padding:4px 4px 4px 14px; position:sticky; top:0; background:var(--paper); z-index:1; }
.file-panel .panel-heading h2 { flex:1; }
@media (min-width:851px) {
  .workspace.files-collapsed { grid-template-columns:48px minmax(0,1fr) 280px; }
  .workspace.files-collapsed .file-panel { overflow:hidden; }
  .workspace.files-collapsed #file-panel-content,
  .workspace.files-collapsed .panel-heading h2,
  .workspace.files-collapsed #page-count { display:none; }
  .workspace.files-collapsed .file-panel .panel-heading { padding:4px 1px; }
  .workspace.files-collapsed .file-panel-toggle svg { transform:rotate(180deg); }
  body:has(.workspace.files-collapsed) { --sidebar-width:48px; }
  body:has(.workspace.files-collapsed) .brand { padding:0; justify-content:center; }
  body:has(.workspace.files-collapsed) .brand strong,
  body:has(.workspace.files-collapsed) .brand .menu-chevron { display:none; }
}
@media (min-width:851px) and (max-width:1150px) {
  .workspace.files-collapsed { grid-template-columns:48px minmax(0,1fr) 245px; }
}
@media (max-width:850px) { .file-panel-toggle { display:none; } }

.page-navigation .navigation-doc-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; margin:0 8px; }
.page-navigation > button, .page-navigation > label, .page-navigation #document-total { flex-shrink:0; white-space:nowrap; }
@media (max-width:560px) {
  .page-navigation { gap:4px; padding:6px; }
  .page-navigation input { width:48px; }
  .page-navigation .navigation-doc-name { margin:0; }
}
.confirmed-search-dialog { width:calc(100vw - 32px); max-width:1700px; height:calc(100dvh - 32px); max-height:none; padding:0; overflow:hidden; }
.confirmed-search-dialog[open] { display:flex; flex-direction:column; }
.batch-header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 18px; border-bottom:1px solid var(--line); flex-shrink:0; }
.batch-header h2 { margin:0; }
.batch-header p { margin:4px 0 0; color:var(--muted); overflow-wrap:anywhere; }
.batch-header button { flex-shrink:0; }
.confirmed-search-dialog > .error { margin:8px 18px; }
.confirmed-search-dialog > .error:empty { display:none; }
.batch-setup { padding:20px; overflow:auto; }
.batch-setup > label { max-width:650px; }
.batch-label-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:8px; margin:16px 0; }
.batch-label-options label { display:flex; align-items:center; gap:10px; border:1px solid var(--line); padding:10px; cursor:pointer; }
.batch-label-options label:has(input:checked) { background:var(--selected); border-color:var(--accent); }
.batch-label-options .batch-crop, .batch-labels .batch-crop { width:48px; height:48px; flex:none; background:white; }
.batch-label-options small,.batch-labels small { display:block; color:var(--muted); }
.batch-work { display:grid; grid-template-columns:220px minmax(0,1fr) 320px; flex:1; min-height:0; }
.batch-labels { overflow:auto; border-right:1px solid var(--line); padding:8px; }
.batch-labels button { width:100%; display:flex; align-items:center; gap:8px; text-align:left; margin-bottom:6px; overflow-wrap:anywhere; }
.batch-labels [aria-pressed=true] { background:var(--selected); border-color:var(--accent); }
.batch-page { min-width:0; min-height:0; display:flex; flex-direction:column; }
.batch-tools { padding:8px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line); }
.batch-viewport { flex:1; overflow:auto; background:var(--surface); cursor:grab; touch-action:none; min-height:0; }
.batch-viewport > svg { display:block; max-width:none; background:white; }
.batch-review { display:flex; flex-direction:column; min-height:0; overflow:hidden; border-left:1px solid var(--line); padding:14px; }
.batch-review-content { flex:1; min-height:0; overflow:auto; scrollbar-gutter:stable; }
.batch-review-actions { flex:none; padding-top:8px; border-top:1px solid var(--line); background:var(--panel,white); }
.batch-review-actions > button { display:block; width:100%; height:48px; margin:8px 0; }
.batch-review-actions [data-adopt] { height:64px; overflow-wrap:anywhere; }
.batch-review > button { display:block; width:100%; margin:8px 0; }
.batch-review [data-conflict] { display:flex; align-items:center; gap:8px; }
.batch-review [data-conflict] .batch-crop { width:48px; height:48px; }
.batch-review h3 { margin-top:0; overflow-wrap:anywhere; }
.batch-comparison { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.batch-comparison .batch-crop { display:block; width:100%; height:145px; border:1px solid var(--line); background:white; }
.batch-warning { padding:8px; background:#fff0d9; color:#884000; }
.batch-complete { color:var(--success); padding:10px; background:#e6f4eb; }
@media(max-width:1000px) { .batch-work { grid-template-columns:160px minmax(0,1fr) 270px; } }
@media(max-width:720px) { .batch-work { display:flex; flex-direction:column; overflow:auto; } .batch-labels { max-height:140px; flex:none; } .batch-page { min-height:300px; flex:none; } .batch-viewport { height:250px; } .batch-review { height: min(650px,80dvh); flex:none; overflow:hidden; } .batch-header { align-items:flex-start; padding:8px; } }
.batch-label-choice { border:1px solid var(--line); min-width:0; }
.batch-label-choice:has(input:checked) { background:var(--selected); border-color:var(--accent); }
.batch-label-options .batch-label-choice > label { border:0; background:transparent; }
.batch-label-choice > label > span { min-width:0; overflow-wrap:anywhere; }
.batch-label-choice details { border-top:1px solid var(--line); padding:8px 10px; font-size:12px; }
.batch-label-choice summary { cursor:pointer; color:var(--muted); }
.batch-label-options .batch-label-choice details label { display:block; border:0; padding:8px 0 0; }
.batch-label-choice details select { font-size:12px; }

.toolbar #emphasize-frames[aria-pressed="true"] { background:var(--selected); border-color:var(--accent); color:var(--accent); }
.drawing .continuous-label-flash, .drawing .continuous-label-flash rect.label-halo { animation-iteration-count:infinite; }

.confirmed-page-hint { position:fixed; z-index:1000; pointer-events:none; padding:7px 10px; border-radius:4px; background:#243746; color:white; font-size:13px; line-height:1.5; box-shadow:0 2px 8px #0002; }

/* Review uses the saved correspondence pair as its primary visual evidence. */
.review-screen { max-width:1500px; }
.review-filters { display:flex; flex-wrap:wrap; gap:12px; margin:16px 0 8px; }
.review-filters label { flex:1 1 180px; max-width:340px; }
.review-screen button,.review-screen select { min-height:44px; }
.review-screen :focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.review-workspace { display:grid; grid-template-columns:minmax(240px,310px) minmax(0,1fr); gap:18px; align-items:start; }
.review-queue { background:var(--paper); border:1px solid var(--line); min-width:0; }
#pair-review-counts, #refinement-counts { padding:12px 16px; border-bottom:1px solid var(--line); }
#pair-review-counts p, #refinement-counts p { margin:0; }
#pair-review-counts p + p, #refinement-counts p + p { margin-top:6px; }
#pair-review-list { max-height:calc(100dvh - 320px); min-height:240px; overflow:auto; }
.review-entry { display:block; width:100%; border:0; border-bottom:1px solid var(--line); border-radius:0; text-align:left; padding:12px 16px; }
.review-entry[aria-current=true] { background:var(--selected); box-shadow:inset 4px 0 var(--accent); }
.review-entry-heading { display:flex; flex-wrap:wrap; gap:6px; align-items:center; justify-content:space-between; font-weight:600; overflow-wrap:anywhere; }
.review-entry-heading .pill { font-size:12px; font-weight:400; }
.review-entry-thumbs { display:flex; align-items:center; gap:8px; margin:10px 0 6px; }
.review-entry-thumbs img { width:48px; height:48px; border:1px solid var(--line); background:white; image-rendering:pixelated; }
.review-entry-thumbs > span { color:var(--muted); font-size:12px; margin-left:4px; }
.review-entry-page { display:block; overflow-wrap:anywhere; color:var(--muted); font-size:12px; }
.review-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; padding:12px 16px; border-top:1px solid var(--line); }
.review-pagination span { font-size:12px; color:var(--muted); }
.review-detail { background:var(--paper); border:1px solid var(--line); padding:20px; min-width:0; }
.review-detail-head { display:flex; flex-wrap:wrap; align-items:start; justify-content:space-between; gap:12px; }
.review-detail-head h2 { font-size:20px; margin-bottom:4px; }
.review-detail-head p { margin:0 0 16px; overflow-wrap:anywhere; }
.review-pair { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:0 0 16px; }
.review-pair figure,.review-context-grid figure { margin:0; min-width:0; }
.review-pair figcaption { color:var(--ink); font-size:14px; font-weight:600; padding:8px 0; }
.review-image-frame { border:1px solid var(--line); background:white; padding:16px; height:224px; display:grid; place-items:center; }
.review-image-frame img { width:100%; height:100%; max-width:192px; max-height:192px; object-fit:contain; image-rendering:pixelated; }
.review-evidence { display:flex; flex-wrap:wrap; gap:8px 20px; padding:10px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); color:var(--muted); font-size:13px; }
.review-warning,.review-missing { border-left:3px solid var(--accent); background:var(--surface); padding:10px 12px; color:var(--ink); }
#pair-review-form fieldset { border:0; padding:0; margin:20px 0 0; min-width:0; }
#pair-review-form legend { font-weight:600; font-size:16px; margin-bottom:10px; }
.review-choices { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.review-choices label { display:flex; gap:8px; align-items:center; min-height:48px; padding:10px 12px; border:1px solid var(--line); cursor:pointer; }
.review-choices label:has(input:checked) { background:var(--selected); border-color:var(--accent); color:var(--accent); font-weight:600; }
.review-choices input[type=radio] { width:18px; height:18px; min-height:0; margin:0; flex:none; accent-color:var(--accent); }
.review-note-label { display:block; margin:14px 0; }
.review-note-label summary { cursor:pointer; color:var(--accent); padding:4px 0; }
.review-note-label textarea { display:block; width:100%; margin-top:6px; padding:10px; border:1px solid var(--line); border-radius:3px; color:var(--ink); font:inherit; resize:vertical; }
.review-save-actions { display:flex; flex-wrap:wrap; gap:8px; }
.review-secondary { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.review-secondary summary { cursor:pointer; padding:4px 0; color:var(--accent); }
.review-secondary[open] summary { margin-bottom:12px; }
.review-context-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px; }
.review-context-grid figcaption { margin-bottom:8px; }
.review-context-image { display:block; width:100%; max-height:300px; object-fit:contain; background:white; border:1px solid var(--line); }
.review-raw-image { width:128px; height:128px; max-width:100%; image-rendering:pixelated; border:1px solid var(--line); }
.review-provenance { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:8px 16px; }
.review-provenance dt { color:var(--muted); }
.review-provenance dd { margin:0; overflow-wrap:anywhere; }
.review-empty { padding:24px 16px; }
.review-empty h2 { font-size:17px; }
.review-queue .review-empty { padding:20px 16px; }
.review-queue .review-empty h2 { margin:0 0 8px; }
.review-queue .review-empty p { margin:0; }
#pair-review-error:empty,#pair-review-status:empty { display:none; }
@media(max-width:1000px) { .review-workspace { grid-template-columns:230px minmax(0,1fr); gap:12px; } .review-detail { padding:14px; } .review-pair { gap:10px; } .review-image-frame { padding:10px; } }
@media(max-width:720px) { .review-workspace { display:block; } .review-queue { margin-bottom:14px; } #pair-review-list { min-height:0; max-height:260px; } .review-entry { padding:10px 16px; } .review-filters label { max-width:none; } .review-pair { gap:8px; } .review-image-frame { padding:8px; height:160px; } .review-choices { gap:6px; } .review-choices label { padding:10px 6px; } .review-save-actions button { flex:1 1 140px; } }

.recrop-dialog{width:min(920px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;border:1px solid #bdcbd2;border-radius:8px;padding:24px;background:#fff;color:inherit}
.recrop-dialog::backdrop{background:rgba(20,35,45,.4)}.recrop-dialog fieldset{border:0;padding:0;min-width:0}.recrop-editors{display:grid;grid-template-columns:1fr 1fr;gap:20px}.recrop-editors section{min-width:0}.recrop-editors .refinement-editor{height:280px;border:1px solid #bdcbd2}.recrop-transform{display:flex;gap:16px;flex-wrap:wrap;align-items:end;margin:16px 0}.recrop-dialog textarea{width:100%}.recrop-dialog button,.review-context-grid button{min-height:44px}.recrop-saved{padding:16px 0;border-bottom:1px solid #d9e1e5}.recrop-saved label{display:inline-block;margin:8px 12px 8px 0}.recrop-saved .review-pair{max-width:480px}.review-context-grid button{margin-top:8px;width:100%}
@media(max-width:700px){.recrop-editors{grid-template-columns:1fr}.recrop-dialog{padding:16px}.recrop-editors .refinement-editor{height:220px}}
.review-filters label[hidden] { display:none !important; }
.refinement-review-frames { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:20px 0 10px; }
.refinement-review-frames figure { margin:0; min-width:0; }
.refinement-review-frames figcaption { margin-bottom:8px; font-weight:600; }
.refinement-review-image { display:block; width:100%; height:260px; border:1px solid var(--line); background:white; }
.refinement-frame { fill:none; stroke-width:2; }
.refinement-frame.rough_box { stroke:#a96612; }
.refinement-frame.predicted_box { stroke:#176b8a; }
.refinement-frame.corrected_box { stroke:#168044; }
.refinement-input-range { fill:none; stroke:#667c89; stroke-width:1; stroke-dasharray:5 4; }
.refinement-native-input { max-width:100%; max-height:280px; border:1px solid var(--line); image-rendering:pixelated; }
#refinement-form textarea { width:100%; margin-top:8px; }
@media(max-width:1000px) { .refinement-review-frames { grid-template-columns:1fr; } .refinement-review-image { height:240px; } }
#refinement-target-editor {margin:20px 0;padding:16px;border:1px solid var(--line);background:white;}
#refinement-target-editor .refinement-review-image {height:360px;width:100%;}
#refinement-target-editor figure {margin:0;}
#refinement-target-editor svg > .refinement-frame.corrected_box {display:none;}


.section .search-candidate-preview { height:220px; }
#search-drawing-editor [tabindex]:focus { outline:none; stroke:#165dce; stroke-width:3; }
#search-candidate-label-picker { margin:8px 0 16px; }

.page-search-checks { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }

.batch-canvas { position:relative; flex:1; min-height:0; display:flex; }
.batch-reference { position:absolute; top:12px; right:12px; width:180px; max-width:45%; padding:10px; border:1px solid var(--line); background:white; box-shadow:0 4px 16px #20313d20; z-index:2; }
.batch-reference summary { cursor:pointer; color:var(--accent); }
.batch-reference .batch-crop { width:100%; height:120px; display:block; margin:8px 0; }
.batch-reference strong,.batch-reference small { display:block; overflow-wrap:anywhere; }
.batch-reference small { color:var(--muted); margin-top:4px; }
.batch-candidate-preview { height:220px; }
.batch-review-content [data-conflict] { width:100%; margin:8px 0; }
.batch-review-actions [data-adopt] { height:48px; }
.batch-review-actions .review-actions { margin:8px 0; }
.batch-review-actions .review-actions button { min-height:40px; }

/* Give the candidate preview, label name and action their own rows. */
#search-candidate-label-picker {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:center;
  gap:10px;
  margin:6px 0 10px;
}
#search-candidate-label-picker .current-label { display:grid; grid-template-columns:16px minmax(0,1fr); min-width:0; gap:8px; margin:0; }
#search-candidate-label-picker .current-label > .composition-thumbnail,
#search-candidate-label-picker .current-label > .label-example,
#search-candidate-label-picker [data-favorite-status] { grid-column:1 / -1; }
#search-candidate-label-picker [data-favorite-status]:empty { display:none; }
#search-candidate-label-picker .current-label strong { min-width:0; }
#search-candidate-label-picker .label-example { width:32px; height:32px; flex-shrink:0; object-fit:contain; }
#search-candidate-label-picker [data-change-label] { width:100%; margin:0; padding:8px; }
#search-candidate-label-picker [data-label-options],
#search-candidate-label-picker .label-actions-menu,
#search-candidate-label-picker > p { grid-column:1 / -1; }
#search-candidate-label-picker .label-actions-menu { margin:0; }
.candidate-review > h4 { margin:12px 0 6px; }

/* Shared layout for both roles; IDs are reserved for behavior, not spacing. */
.model-settings-screen { max-width:1240px; }
.model-settings-screen > h1 { margin:0 0 12px; }
.model-settings-screen > p { margin:0 0 32px; }
.model-settings-screen .settings-group { display:grid; gap:20px; margin-top:36px; }
.model-settings-screen .settings-group > header { display:grid; gap:8px; }
.model-settings-screen .settings-group > header h2 { margin:0; font-size:20px; }
.model-settings-screen .settings-group > header p { margin:0; color:var(--muted); }
.model-settings-screen .model-settings-panel {
  display:grid; gap:20px; min-width:0; padding:24px;
  background:var(--paper); border:1px solid var(--line); border-radius:8px;
}
.model-settings-screen .model-settings-panel > h3 {
  margin:0; padding-bottom:16px; border-bottom:1px solid var(--line); font-size:17px;
}
.model-settings-screen .settings-form { display:grid; gap:20px; margin:0; min-width:0; }
.model-settings-screen .settings-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.model-settings-screen .settings-profile-grid .card { align-self:stretch; gap:16px; }
.model-settings-screen .settings-profile-grid h4 { margin:0; font-size:15px; }
.model-settings-screen .settings-profile-grid label { display:grid; gap:6px; min-width:0; }
.model-settings-screen .settings-profile-grid input,
.model-settings-screen .settings-profile-grid select { width:100%; min-width:0; }
.model-settings-screen .settings-experiment { grid-column:1 / -1; padding-top:4px; gap:8px; }
.model-settings-screen .settings-experiment label { display:flex; align-items:start; gap:8px; }
.model-settings-screen .settings-experiment input { width:auto; flex:none; margin-top:3px; }
.model-settings-screen .settings-experiment p { color:var(--muted); }
.model-settings-screen .settings-form > button { justify-self:start; min-height:44px; }
.model-settings-screen .settings-form > p,
.model-settings-screen .stack > p { margin:0; }
.model-settings-screen [role="status"]:empty { display:none; }
.model-settings-screen .settings-model-library { padding-top:16px; border-top:1px solid var(--line); min-width:0; }
.model-settings-screen .settings-model-library summary { cursor:pointer; line-height:1.6; padding:4px 0; }
.model-settings-screen .settings-model-library > .stack,
.model-settings-screen .settings-model-library ul { margin:16px 0 0; }
.model-settings-screen .settings-model-library ul { padding-left:24px; }
.model-settings-screen .settings-model-library li + li { margin-top:12px; }
.model-settings-screen .settings-model-library .mono { display:block; overflow-wrap:anywhere; margin-top:4px; color:var(--muted); }
.model-settings-screen .settings-thresholds { min-width:0; margin:0; padding:16px 20px 20px; border:1px solid var(--line); border-radius:4px; gap:16px; }
.model-settings-screen .settings-thresholds legend { padding:0 6px; font-weight:700; }
@media(max-width:760px) {
  .model-settings-screen .settings-profile-grid { grid-template-columns:minmax(0,1fr); }
  .model-settings-screen .model-settings-panel { padding:16px; }
}

/* Keep both independently cropped components visible as one label. */
.composition-thumbnail{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;max-width:100%;vertical-align:middle}
.composition-thumbnail .label-example{margin:0;width:42px;height:42px;object-fit:contain}
.composition-thumbnail .batch-crop{width:46px;height:46px;flex:0 0 46px}
.composition-thumbnail .label-example:last-child,.composition-thumbnail .batch-crop:last-child{width:68px;flex-basis:68px}
.composition-thumbnail small{max-width:68px;white-space:normal}
.batch-labels .composition-thumbnail{flex-wrap:wrap}

/* Tie the drawing cue to the actual sub-selection control, including automatic entry. */
.pair-drawing-hint{display:none;padding:10px 14px;gap:4px 14px;flex-wrap:wrap;background:var(--selected);color:var(--accent);border-bottom:2px solid var(--accent)}
.workspace:has(#draw-pair-sub[aria-pressed="true"]) .pair-drawing-hint{display:flex}
.workspace:has(#draw-pair-sub[aria-pressed="true"]) #viewport{box-shadow:inset 0 0 0 3px var(--accent)}
#draw-pair-sub[aria-pressed="true"]{border:2px solid var(--accent);font-weight:700}
.pair-steps{list-style:none;padding:0;margin:12px 0;cursor:default}
.pair-steps li{position:relative;display:flex;align-items:baseline;gap:8px;margin:4px 0;padding:6px 8px;border-left:3px solid transparent;color:var(--muted);font-size:12px;line-height:1.5}
.pair-step-number{position:relative;flex:0 0 18px;text-align:center;font-variant-numeric:tabular-nums}
.pair-steps li:not(:last-child)::after{content:"";position:absolute;left:17px;bottom:-5px;height:6px;border-left:1px solid var(--line)}
.pair-steps [aria-current="step"]{background:var(--selected);border-left-color:var(--accent);color:var(--accent);font-size:13px;font-weight:700}
.pair-step-current{margin-left:auto;flex-shrink:0;font-size:11px;white-space:nowrap;font-weight:700}
#pair-setup>details{padding:10px 0;border-block:1px solid var(--line)}
#pair-advanced{margin-top:14px}
#pair-next-step{padding:10px;background:var(--selected);border-left:3px solid var(--accent)}
.pair-registration-preview{display:flex;align-items:center;justify-content:center;gap:16px}
.pair-registration-preview figure{margin:0;min-width:0;flex:1;text-align:center}
.pair-registration-preview svg{width:100%;height:100px;border:1px solid var(--line);background:white}
.pair-registration-preview figcaption{font-size:13px;color:var(--muted)}

.composition-registration .stack{gap:10px}
.composition-registration h2,.composition-registration p{margin:0}
.composition-registration .pair-registration-preview svg{height:72px}

.label-transfer-dialog{width:min(640px,calc(100vw - 32px));box-sizing:border-box;max-height:90vh;overflow:auto}
.label-transfer-dialog h2,.label-transfer-dialog p{margin:0}
.label-transfer-comparison{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.label-transfer-preview{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0;padding:16px;border:1px solid var(--border,#ccd8df);border-radius:6px;overflow-wrap:anywhere}
.label-transfer-preview h3{margin:0;font-size:14px}
.label-transfer-preview img{width:100%;height:100px;object-fit:contain;background:white}
.label-transfer-dialog [data-new-fields]{display:grid;gap:12px}
.label-transfer-dialog [data-new-fields][hidden]{display:none}
@media(max-width:480px){.label-transfer-comparison{grid-template-columns:1fr}.label-transfer-dialog .project-actions{flex-wrap:wrap}}
.label-transfer-dialog fieldset{min-width:0;margin:0;padding:12px}
.label-transfer-dialog fieldset>label{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer}
.label-transfer-dialog input[type=radio]{width:18px;height:18px;min-height:0;padding:0;margin:0;flex:none;accent-color:var(--accent)}
