/* Composer Benchmark labelling manager: shared review pieces (manager.html in the design artifact); the frame is composer_benchmark_shell.css.
   Every rule sits under .cb.cbm; tokens come from composer_benchmark_tokens.css. Page-specific rules live in each page's own file. */
.cb.cbm { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.5; padding-inline: 20px; padding-block: 0 48px; -webkit-font-smoothing: antialiased; }
.cbm *, .cbm *::before, .cbm *::after { box-sizing: border-box; }
.cbm button { font: inherit; color: inherit; }
.cbm :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cbm [hidden] { display: none !important; }
.cbm h1, .cbm h2, .cbm h3, .cbm h4, .cbm p, .cbm dl { margin: 0; }
.cbm .mono { font-family: var(--mono); }
.cbm kbd { font-family: var(--mono); font-size: 0.68rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--paper); color: var(--muted); }
.cbm .small { font-size: 0.75rem; color: var(--muted); }
.cbm .sub { color: var(--muted); font-size: 0.88rem; }
.cbm .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cbm .row.spread { justify-content: space-between; align-items: flex-start; }
.cbm .lowt { color: var(--warn); font-weight: 600; }

/* Buttons, links, toggles */
.cbm .btn { display: inline-block; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.cbm .btn:hover { background: var(--sunk); }
.cbm .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cbm .btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.cbm .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cbm .linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 0.85rem; }
.cbm .toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.cbm .toggles { gap: 6px 16px; }
.cbm .namestoggle { text-decoration: none; white-space: nowrap; }
.cbm .namestoggle::before { content: ""; width: 13px; height: 13px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--paper); flex: none; }
.cbm .namestoggle[aria-checked="true"]::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.5l2.2 2.2L9.5 3.8' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; border-color: var(--accent); }
.cbm .gridwrap { overflow-x: auto; }
.cbm .kv { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 4px 16px; font-size: 0.86rem; }
.cbm .kv dt { color: var(--muted); }
.cbm .kv dd { margin: 0; font-weight: 500; }
.cbm input.other { font: inherit; font-size: 0.84rem; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); width: 100%; }

/* Page */
.cbm .mgr { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cbm .cb.cbh { padding: 0; }
.cbm .pagehead { display: flex; flex-direction: column; gap: 4px; }
.cbm .pagehead h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.cbm .card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cbm .card h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.cbm .h3 { margin: 4px 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cbm .h3q { margin: 4px 0 0; font-size: 1rem; font-weight: 600; }
.cbm .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cbm .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cbm .kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.cbm .kl { font-size: 0.76rem; color: var(--muted); }
.cbm .kv2 { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.cbm .ks { font-size: 0.74rem; color: var(--muted); }
.cbm .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.cbm .bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.cbm .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cbm .board { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.cbm .board th { text-align: left; font-size: 0.7rem; font-weight: 500; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.cbm .board td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.cbm .board td.n, .cbm .board th.n { text-align: right; font-family: var(--mono); }
.cbm .heldout { font-size: 0.84rem; color: var(--ink); background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; }

/* Queue and item detail */
.cbm .work2 { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.cbm .queue { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.cbm .qitem { display: flex; flex-direction: column; gap: 3px; text-align: left; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.cbm .qitem:hover { border-color: var(--line-strong); }
.cbm .qitem[aria-current="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cbm .qi-t { font-weight: 600; font-size: 0.86rem; }
.cbm .qi-s { font-size: 0.74rem; color: var(--muted); }
.cbm .qi-note { font-style: italic; }
.cbm .qi-ab { font-size: 0.76rem; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.cbm .qgroup { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 8px 4px 2px; }
.cbm .qgroup:first-child { padding-top: 0; }
.cbm .ab { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 0.66rem; font-weight: 700; color: #fff; flex: none; }
.cbm .ab.a { background: #2c6cb0; }
.cbm .ab.b { background: #d97706; }
.cbm .swatch { display: inline-block; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; vertical-align: middle; margin-right: 6px; }
.cbm .qi-ab .swatch { width: 14px; height: 14px; border-radius: 4px; margin-right: 0; }
.cbm .detail { gap: 16px; }
.cbm .split2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.cbm .split3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.cbm .stack2 { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Evidence */
.cbm .stage { position: relative; width: 100%; overflow: auto; border-radius: 10px; background: var(--lightbox); padding: 10px; }
.cbm .stage svg { display: block; width: 100%; height: auto; max-height: 340px; margin-inline: auto; border-radius: 4px; }
.cbm .stage.plan svg { background: #ffffff; }
.cbm .stage-empty { color: var(--muted); font-size: 0.84rem; padding: 40px 10px; text-align: center; }
.cbm .evidence { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cbm .allphotos summary { color: var(--accent); cursor: pointer; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 2px; }
.cbm .evstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.cbm .evthumb { display: flex; flex-direction: column; gap: 4px; text-align: left; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 5px; }
.cbm .evthumb img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: var(--sunk); }
.cbm .evid { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; }
.cbm .evnote { font-size: 0.72rem; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Answers */
.cbm .answers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cbm .ans { display: grid; grid-template-columns: auto minmax(0, 1fr) 64px; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--sunk); }
.cbm .ans.single { grid-template-columns: minmax(0, 1fr) 72px; }
.cbm .ans.colour { grid-template-columns: auto minmax(0, 1fr); }
.cbm .ans.colour.single { grid-template-columns: minmax(0, 1fr); }
.cbm .ans.material { grid-template-columns: auto minmax(0, 1fr); }
.cbm .ans.material.single { grid-template-columns: minmax(0, 1fr); }
.cbm .ans > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cbm .ans b { font-size: 0.92rem; }
.cbm .ans .pic svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.cbm .mat-thumb { display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; isolation: isolate; }
.cbm .mat-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.cbm .ans .mat-thumb { max-width: 160px; }
.cbm .anote { font-size: 0.78rem; color: var(--muted); font-style: italic; }
.cbm .bignote { font-size: 1.05rem; font-style: italic; }

/* Tags */
.cbm .tag { display: inline-block; width: fit-content; font-size: 0.68rem; font-weight: 600; border-radius: 4px; padding: 0 5px; border: 1px solid var(--line-strong); color: var(--muted); }
.cbm .tag.unsure { color: var(--gold); border-color: var(--gold); }
.cbm .tag.note { color: var(--accent); border-color: var(--accent); }
.cbm .tag.ready { color: var(--good); border-color: var(--good); }

/* Choices */
.cbm .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cbm .choice-form { display: contents; }
.cbm .choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line-strong); background: var(--paper); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.cbm .choice:hover { background: var(--sunk); }
.cbm .choice .ct { font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; }
.cbm .choice .cs { font-size: 0.76rem; color: var(--muted); }
.cbm .choice.use-a { border-color: #2c6cb0; border-width: 1.5px; }
.cbm .choice.use-b { border-color: #d97706; border-width: 1.5px; }
.cbm .choice.primaryc { border-color: var(--accent); background: var(--accent-soft); }
.cbm .choice.ghostc { border-style: dashed; }

/* Option tiles */
.cbm .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.cbm .tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: center; font-size: 0.72rem; line-height: 1.2; color: var(--ink); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.cbm .tile:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.cbm .tile .pic svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.cbm .tile .pic.blank { display: block; aspect-ratio: 64 / 44; border-radius: 6px; background: var(--sunk); }
.cbm .tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent); }
.cbm .tile.picked { border-color: var(--good); box-shadow: inset 0 0 0 1.5px var(--good); }
.cbm .tile.cant { border-style: dashed; color: var(--muted); }
.cbm .tile .tk { position: absolute; top: 8px; left: 8px; font-family: var(--mono); font-size: 0.6rem; background: rgba(255, 255, 255, 0.92); color: #56616c; border-radius: 4px; padding: 0 4px; }
.cbm .tile .mk { position: absolute; top: 8px; right: 8px; }
.cbm .tile .mk.two { right: 30px; }
.cbm .tile .theirs { position: absolute; top: 6px; right: 6px; font-size: 0.6rem; font-weight: 700; background: var(--good); color: #fff; border-radius: 4px; padding: 0 4px; }
.cbm .tnew { font-size: 0.62rem; font-weight: 600; color: var(--gold); }

/* Metrics */
.cbm .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cbm .metric { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cbm .metric span { font-size: 0.74rem; color: var(--muted); }
.cbm .metric b { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
.cbm .metric.warn b { color: var(--warn); }

/* Empty state, toast, help */
.cbm .emptyc { align-items: center; text-align: center; padding: 48px 20px; }
.cbm .tickbig { width: 56px; height: 56px; border-radius: 50%; background: var(--good-soft); display: grid; place-items: center; }
.cbm .toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 10px; font-size: 0.86rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); z-index: 50; }
.cbm .toast .toast-form { display: inline; margin: 0; }
.cbm .toast button { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.cbm .helpsheet { position: fixed; right: 24px; top: 90px; z-index: 60; width: min(420px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 10px; }
.cbm .helpsheet h2 { font-size: 1.05rem; }

@media (max-width: 1100px) {
  .cbm .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbm .cols, .cbm .split2, .cbm .split3, .cbm .work2 { grid-template-columns: minmax(0, 1fr); }
  .cbm .queue { position: static; max-height: none; flex-direction: row; overflow-x: auto; }
  .cbm .qitem { min-width: 220px; }
}
@media (max-width: 760px) {
  .cbm .kpis.three, .cbm .answers, .cbm .metrics { grid-template-columns: minmax(0, 1fr); }
  .cbm .kv { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .cbm * { transition: none !important; } .cbm .tile:hover { transform: none; } }
