/* Current Sheet — app stylesheet. Hand-written, no build step (B4).
   Visual language: a drawing sheet. Paper ground, ink rules, titleblock-style captions, monospace for
   anything that is an identifier (sheet numbers, project numbers, links). Green / red / amber are
   RESERVED for status — never decoration — because on the verify page they are the answer. */

:root {
  --paper: #f3f1ea;
  --surface: #fffefb;
  --ink: #1a1d21;
  --ink-2: #4a4f57;
  --ink-3: #7b8089;
  --rule: #cfcbbd;
  --rule-strong: #1a1d21;
  --accent: #1d4e89;          /* blueprint blue: links, focus, primary action */
  --accent-ink: #ffffff;
  --ok: #1b7a3a;      --ok-bg: #e4f2e7;
  --bad: #b3261e;     --bad-bg: #fbe6e4;
  --warn: #9a5b00;    --warn-bg: #fdf0d5;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 2px;
  --gap: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--sans);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; font-weight: 650; }
h2.sub { margin: 2rem 0 .5rem; }
p { margin: 0 0 var(--gap); }
.lede { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .93em; }
.right { text-align: right; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: .35rem 0; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* Titleblock caption: the small upper-case label above a value. */
.cap, .field > span, fieldset.field > legend, .table th, .tb dt {
  font-size: .6875rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 600; margin: 0;
}
.cap a { color: inherit; }

/* ---- header: a titleblock strip ---- */
.strip {
  display: flex; align-items: stretch; min-height: 3.25rem;
  background: var(--surface); border-bottom: 2px solid var(--rule-strong);
}
.strip > * { border-right: 1px solid var(--rule); }
.strip__brand {
  display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem;
  color: var(--ink); text-decoration: none; border-right: 2px solid var(--rule-strong);
}
.mark {   /* a QR finder pattern — the one ornament in the product */
  width: 18px; height: 18px; border: 3px solid var(--ink); position: relative; flex: none;
}
.mark::after { content: ""; position: absolute; inset: 3px; background: var(--ink); }
.strip__nav { display: flex; flex: 1; border-right: 0; }
.strip__nav--right { justify-content: flex-end; }
.strip__nav a {
  display: flex; align-items: center; padding: 0 1.1rem; color: var(--ink-2); text-decoration: none;
  font-weight: 550; border-right: 1px solid var(--rule); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.strip__nav--right a { border-right: 0; border-left: 1px solid var(--rule); }
.strip__nav a:hover { color: var(--ink); background: var(--paper); }
.strip__nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.strip__cell { display: flex; flex-direction: column; justify-content: center; padding: 0 1rem; min-width: 0; }
.strip__cell .val { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.strip__account { border-left: 1px solid var(--rule); }
.strip__out { border-right: 0; }

/* ---- page frame ---- */
.sheet { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  padding-bottom: .9rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--rule-strong); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 1.5rem; margin-bottom: 1.5rem; }
.panel--narrow { max-width: 27rem; margin: 3rem auto 0; border-color: var(--rule-strong); box-shadow: 4px 4px 0 var(--rule); }
.panel--form { max-width: 44rem; }
.panel > h2 { margin-bottom: 1rem; }
.panel--narrow h1 { margin-bottom: 1.25rem; }
.panel--narrow h1 + .lede { margin-top: -.75rem; }
.panel.empty { text-align: center; padding: 3rem 1.5rem; border-style: dashed; background: transparent; }
.panel.empty p { color: var(--ink-2); max-width: 34rem; margin-inline: auto; }
.aside { margin: 1.25rem 0 0; color: var(--ink-3); font-size: .9rem; }

/* Titleblock data strip: caption over value, ruled cells. */
.tb { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 0 0 1.5rem;
  background: var(--surface); border: 1px solid var(--rule-strong); }
.tb > div { padding: .6rem .85rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 -1px -1px 0; }
.tb__wide { grid-column: span 2; }
.tb dd { margin: .15rem 0 0; font-weight: 550; }

/* ---- forms ---- */
.field { display: block; margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.field > span, fieldset.field > legend { display: block; margin-bottom: .3rem; padding: 0; }
.field em { text-transform: none; letter-spacing: 0; font-style: normal; font-weight: 400; }
.field small { display: block; margin-top: .3rem; color: var(--ink-3); font-size: .8rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 10rem; }
.field-row .field--grow { flex-grow: 3; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--ink-3); border-radius: var(--r); padding: .5rem .6rem; min-height: 2.5rem;
}
input.mono { font-family: var(--mono); }
input.copy { background: var(--paper); border-color: var(--rule); min-width: 18rem; }
select { width: auto; padding-right: 1.75rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent);
}
.field.is-invalid input, .field.is-invalid select { border-color: var(--bad); background: var(--bad-bg); }
.field .field-error { display: block; margin-top: .3rem; color: var(--bad); font-size: .85rem; font-weight: 550;
  text-transform: none; letter-spacing: 0; }
.form-error { color: var(--bad); background: var(--bad-bg); border-left: 3px solid var(--bad); padding: .55rem .75rem; font-weight: 550; }
.choice { display: flex; gap: .6rem; align-items: baseline; padding: .55rem .7rem; border: 1px solid var(--rule); margin-top: -1px; background: #fff; cursor: pointer; }
.choice--off { color: var(--ink-3); background: transparent; cursor: not-allowed; }
.choice input { flex: none; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  min-height: 2.5rem; padding: 0 1rem; border-radius: var(--r);
  color: var(--ink); background: var(--surface); border: 1px solid var(--ink);
}
.btn:hover { background: var(--paper); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #163c6b; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding: 0 .6rem; }
.btn--quiet:hover { color: var(--ink); background: var(--paper); border-color: var(--rule); }
.btn--danger { color: var(--bad); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: progress; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule-strong); margin-bottom: 1.5rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: .55rem .85rem; border-bottom: 1px solid var(--rule-strong); background: var(--paper); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: .6rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.rowlink { font-weight: 600; }

/* ---- status chips: the only place colour carries meaning ---- */
.chip { display: inline-block; font: 600 .6875rem/1 var(--sans); font-style: normal; text-transform: uppercase; letter-spacing: .06em;
  padding: .3rem .45rem; border-radius: var(--r); border: 1px solid currentColor; vertical-align: middle; }
.chip--ok { color: var(--ok); background: var(--ok-bg); }
.chip--bad { color: var(--bad); background: var(--bad-bg); }
.chip--warn { color: var(--warn); background: var(--warn-bg); }
.chip--muted { color: var(--ink-3); background: transparent; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--r); font-weight: 550; max-width: min(90vw, 36rem);
  box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
.toast.is-bad { background: var(--bad); }

/* ---- notes ---- */
.note { padding: .65rem .85rem; border-left: 3px solid var(--ink-3); background: var(--surface); margin: 0 0 1.25rem; font-weight: 550; }
.note--warn { border-color: var(--warn); background: var(--warn-bg); color: #5c3700; }
.note--ok { border-color: var(--ok); background: var(--ok-bg); color: #0f4a23; }
kbd { font: 600 .78em/1 var(--mono); padding: .15rem .35rem; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; background: var(--surface); white-space: nowrap; }

/* ---- upload ---- */
.drop { display: block; position: relative; padding: 2.25rem 1.5rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--ink-3); border-radius: var(--r); background: var(--paper); }
.drop:hover, .drop.is-over, .drop:focus-within { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--paper)); }
.drop.is-busy { pointer-events: none; opacity: .6; }
.drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
.drop__title { display: block; font-weight: 650; font-size: 1.05rem; }
.drop__hint { display: block; margin-top: .35rem; color: var(--ink-2); font-size: .9rem; }
.progress { margin-top: 1rem; }
.progress__bar { height: .5rem; background: var(--paper); border: 1px solid var(--rule-strong); }
.progress__bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.progress__text { margin: .45rem 0 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#upload .form-error { margin: 1rem 0 0; }

/* ---- titleblock review cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--rule-strong); display: flex; flex-direction: column; }
.card__img { display: block; background: #fff; border-bottom: 1px solid var(--rule-strong); aspect-ratio: 7 / 5; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.card__facts { display: grid; grid-template-columns: repeat(3, auto); gap: .25rem 1.25rem; margin: 0 0 1rem; justify-content: start; }
.card__facts dt { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.card__facts dd { margin: .1rem 0 0; font-weight: 550; }
.card .btn { align-self: flex-start; }

/* ---- the confirm table (brief 7.3) ---- */
.sheet--wide { max-width: 104rem; }
.summary { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  min-height: 3.35rem; padding: .3rem .85rem; margin-bottom: -1px; background: var(--surface); border: 1px solid var(--rule-strong); border-bottom-width: 2px; }
.summary__text { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.summary__text .is-bad { color: var(--bad); }
.summary__text .is-warn { color: var(--warn); }
.summary__text .is-quiet { color: var(--ink-3); font-weight: 550; }
.summary__actions { display: flex; gap: .6rem; align-items: center; }
.btn--primary[disabled] { cursor: not-allowed; opacity: .45; }
.tip { position: relative; display: inline-flex; border-radius: var(--r); }
.tip__text { display: none; position: absolute; right: 0; top: calc(100% + .45rem); z-index: 30; width: max-content; max-width: 24rem;
  background: var(--ink); color: #fff; padding: .55rem .7rem; border-radius: var(--r); font-size: .85rem; font-weight: 550; line-height: 1.35;
  box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
.tip:hover .tip__text, .tip:focus .tip__text, .tip:focus-within .tip__text { display: block; }
.tip:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.confirm__wrap { overflow: visible; }        /* the header sticks to the viewport, under the summary bar */
.confirm__table th { top: 3.35rem; z-index: 10; box-shadow: 0 1px 0 var(--rule-strong); }
.confirm__table td { vertical-align: top; padding: .5rem .6rem; }
.confirm__table tbody tr { border-left: 4px solid transparent; scroll-margin-top: 8rem; }
.confirm__table tbody tr:hover { background: transparent; }
.confirm__table tr.is-blocking { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.confirm__table tr.is-warn { border-left-color: var(--warn); }
.confirm__table tr.is-excluded { opacity: .5; }
.confirm__table tr.is-excluded .cell { text-decoration: line-through; }
.confirm__table tr.is-highlight { outline: 2px solid var(--bad); outline-offset: -2px; }
.confirm__table tr.is-saving .c-status { opacity: .45; }
.confirm__table tr.is-unsure .cell.num { color: var(--warn); font-weight: 700; }
.c-page { width: 3.5rem; color: var(--ink-3); }
.c-thumb { width: 136px; }
.c-thumb img { display: block; width: 120px; max-height: 7rem; object-fit: contain; height: auto; border: 1px solid var(--rule); background: #fff; }
.c-crop { width: 13rem; }
.c-crop .crop { display: block; max-width: 100%; max-height: 7rem; width: auto; height: auto; border: 1px solid var(--rule-strong); background: #fff; }
.c-num { width: 11rem; } .c-disc { width: 6.5rem; } .c-inc { width: 4.5rem; text-align: center; } .c-status { width: 15rem; }
.confirm__table td input.cell { border-color: transparent; background: transparent; min-height: 2.25rem; padding: .35rem .45rem; cursor: cell; text-overflow: ellipsis; }
.confirm__table td input.cell.num { font-family: var(--mono); font-size: 1rem; font-weight: 650; }
.confirm__table td input.cell:hover:not(:disabled) { border-color: var(--rule); background: #fff; }
.confirm__table td input.cell:focus { border-color: var(--accent); background: #fff; outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; }
.confirm__table td input.cell.is-editing { cursor: text; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.confirm__table td input.cell:disabled { color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; cursor: default; }
.cell-check { width: 1.15rem; height: 1.15rem; margin-top: .55rem; accent-color: var(--accent); cursor: pointer; }
.xlinks { margin: .3rem 0 .5rem; font-size: .85rem; color: var(--ink-2); line-height: 1.35; }
.xlinks:last-child { margin-bottom: 0; }
@keyframes cs-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.confirm__table tr.is-flash > td { animation: cs-flash 1.2s ease-out; }
.pager { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.pager__text { margin-right: .6rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager .btn { min-height: 2rem; padding: 0 .7rem; }
.pager .btn.is-current { background: var(--ink); color: #fff; }

/* ---- publish dialog ---- */
.dialog { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 1.5rem; width: min(34rem, 92vw); background: var(--surface); color: var(--ink);
  box-shadow: 6px 6px 0 rgb(0 0 0 / .18); }
.dialog::backdrop { background: rgb(26 29 33 / .45); }
.dialog h2 { font-size: 1.25rem; }

/* ---- flow steps ---- */
.steps { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: -0.5rem 0 1.5rem; border: 1px solid var(--rule); background: var(--surface); }
.steps li { flex: 1 1 8rem; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-right: 1px solid var(--rule); color: var(--ink-3);
  font-size: .8rem; font-weight: 600; white-space: nowrap; }
.steps li:last-child { border-right: 0; }
.steps li span { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border: 1px solid currentColor; font: 600 .7rem/1 var(--mono); flex: none; }
.steps li.is-done { color: var(--ink-2); }
.steps li.is-done span { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }
.steps li.is-now { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.steps li.is-now span { background: var(--accent); border-color: var(--accent); color: #fff; }

.card--placed { border-color: var(--ok); }
.card__where { margin: -.5rem 0 1rem; color: var(--ink-2); font-size: .85rem; }
.panel--warn { border-color: var(--warn); border-left-width: 3px; }
.faillist li { padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.faillist li:last-child { border-bottom: 0; }
.btn--small { min-height: 2rem; padding: 0 .7rem; font-size: .85rem; }
.btn--block { display: flex; width: 100%; }
.restamp { margin: -0.5rem 0 1.5rem; }
.restamp .aside { margin-top: .5rem; max-width: 44rem; }

/* ---- downloads ---- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dl__item { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); text-decoration: none; }
.dl__item:hover { background: color-mix(in srgb, var(--accent) 6%, #fff); border-color: var(--accent); }
.dl__kind { font: 700 .7rem/1 var(--mono); letter-spacing: .08em; padding: .45rem .4rem; border: 2px solid var(--ink); }
.dl__name { flex: 1; font-weight: 650; }
.dl__name small { display: block; font-weight: 400; color: var(--ink-2); font-size: .85rem; }
.dl__go { font-size: 1.3rem; color: var(--accent); }
.sheetlinks summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: .5rem; }
.sheetlinks__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0 .75rem; }
.sheetlinks__list li { padding: .15rem 0; }

/* ---- the stamp locator (brief 8.2) ---- */
.head--tight { margin-bottom: 1rem; }
.locator__group { margin: 0; text-align: right; }
.locator__group .cap { display: block; }
.locator { display: grid; grid-template-columns: minmax(0, 1fr) 21.5rem; gap: 1.25rem; align-items: start; }
.locator__stage { position: relative; height: clamp(26rem, calc(100vh - 15rem), 70rem); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; border: 1px solid var(--rule-strong);
  background-color: #dcd9cf; background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 24px 24px; }
.locator__stage.is-panning { cursor: grabbing; }
.locator__stage:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.locator__sheet { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff no-repeat 0 0 / 100% 100%; box-shadow: 0 2px 14px rgb(0 0 0 / .28); --inv: 1; will-change: transform; }
.locator__sheet img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; transition: opacity .2s; }
.locator__ink { position: absolute; pointer-events: none; outline: calc(1px * var(--inv)) dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.lstamp { position: absolute; left: 0; top: 0; cursor: move; touch-action: none; }
.lstamp svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lstamp__ring { position: absolute; inset: calc(-3px * var(--inv)); border: calc(2px * var(--inv)) solid var(--accent); pointer-events: none;
  box-shadow: 0 0 0 calc(5px * var(--inv)) color-mix(in srgb, var(--accent) 22%, transparent); }
.lstamp.is-dragging .lstamp__ring { border-style: dashed; box-shadow: none; }
.lstamp--bare .lstamp__ring { border-style: dotted; }
.locator__loading { position: absolute; left: 50%; top: .75rem; transform: translateX(-50%); margin: 0; padding: .35rem .7rem; background: var(--ink); color: #fff; font-size: .85rem; font-weight: 550; border-radius: var(--r); }
.locator__viewing { position: absolute; left: .75rem; top: .75rem; right: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  padding: .45rem .5rem .45rem .8rem; background: var(--warn-bg); border: 1px solid var(--warn); color: #5c3700; font-weight: 650; cursor: default; }
.locator__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-top: .6rem; }
.locator__hud { margin-left: auto; display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--rule-strong); box-shadow: 2px 2px 0 rgb(0 0 0 / .15); cursor: default; }
.hud-btn { font: 600 1.05rem/1 var(--sans); min-width: 2.4rem; min-height: 2.4rem; border: 0; border-right: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.hud-btn:last-child { border-right: 0; }
.hud-btn:hover { background: var(--paper); }
.hud-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -3px; }
.hud-btn--text { font-size: .8rem; padding: 0 .7rem; }
.hud-pct { display: grid; place-items: center; min-width: 3.6rem; font: 600 .8rem/1 var(--mono); border-right: 1px solid var(--rule); }
.locator__keys { margin: 0; color: var(--ink-3); font-size: .8rem; }
.locator__keys kbd { margin-right: .15rem; }

.locator__panel { background: var(--surface); border: 1px solid var(--rule-strong); position: sticky; top: .75rem;
  display: flex; flex-direction: column; max-height: clamp(26rem, calc(100vh - 13.5rem), 70rem); }   /* as tall as the stage: Apply is never below the fold */
.locator__scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.locator__foot { flex: none; border-top: 1px solid var(--rule-strong); }
.lp { padding: .7rem 1rem; border-bottom: 1px solid var(--rule); }
.lp:last-child { border-bottom: 0; }
.lp .cap { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .45rem; }
.lp__value { font: 650 .9rem/1 var(--mono); color: var(--ink); text-transform: none; letter-spacing: 0; }
.lp__hint { margin: .5rem 0 0; color: var(--ink-2); font-size: .8rem; line-height: 1.4; }
.lp__note { margin: .6rem 0 0; font-size: .85rem; }
.readout { margin: 0; font: 650 1.02rem/1.35 var(--mono); font-variant-numeric: tabular-nums; min-height: 2.7em; }
.lp input[type=range] { width: 100%; min-height: 1.75rem; padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
.lp__scale { display: flex; justify-content: space-between; color: var(--ink-3); font: 500 .7rem/1 var(--mono); }
.lp--options { display: grid; gap: .5rem; }
.lp--options input[type=text] { min-height: 2.1rem; padding: .3rem .5rem; font: 500 .85rem var(--mono); }
.lp--options .btn { justify-self: start; padding-left: 0; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 550; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

/* anchor selector: a sheet in miniature — outer ring is the page, inner ring the drawing border */
.anchorpad { position: relative; height: 7.25rem; margin: 0 .4rem; }
.anchorpad__page { position: absolute; inset: .55rem; border: 1px solid var(--ink-3); background: #fff; }
.anchorpad__ink { position: absolute; inset: 1.15rem 1.45rem; border: 2px solid var(--ink); }
.anchorpad__label { position: absolute; left: 50%; transform: translateX(-50%); top: .15rem; white-space: nowrap; font: 600 .6rem/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.anchorpad__ink .anchorpad__label { color: var(--ink-2); top: 50%; transform: translate(-50%, -50%); }
.anchorpad__dot { position: absolute; width: 1.15rem; height: 1.15rem; padding: 0; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--surface); cursor: pointer; transform: translate(-50%, -50%); }
.anchorpad__dot:hover { border-color: var(--accent); }
.anchorpad__dot[aria-checked="true"] { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.anchorpad__dot:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.anchorpad__dot--page_tl { left: .55rem; top: .55rem; }  .anchorpad__dot--page_tr { left: calc(100% - .55rem); top: .55rem; }
.anchorpad__dot--page_bl { left: .55rem; top: calc(100% - .55rem); }  .anchorpad__dot--page_br { left: calc(100% - .55rem); top: calc(100% - .55rem); }
.anchorpad__dot--ink_tl { left: 2rem; top: 1.7rem; }  .anchorpad__dot--ink_tr { left: calc(100% - 2rem); top: 1.7rem; }
.anchorpad__dot--ink_bl { left: 2rem; top: calc(100% - 1.7rem); }  .anchorpad__dot--ink_br { left: calc(100% - 2rem); top: calc(100% - 1.7rem); }

/* coverage: the only coloured block on the screen, because it is a status */
.lp--coverage { border-left: 4px solid var(--rule); }
.lp--coverage[data-state="clear"] { border-left-color: var(--ok); background: var(--ok-bg); }
.lp--coverage[data-state="flagged"] { border-left-color: var(--warn); background: var(--warn-bg); }
.lp--coverage[data-state="error"] { border-left-color: var(--bad); background: var(--bad-bg); }
.coverage__line { margin: 0; font-weight: 650; line-height: 1.35; }
.lp--coverage[data-state="clear"] .coverage__line { color: #0f4a23; }
.lp--coverage[data-state="flagged"] .coverage__line { color: #5c3700; }
.lp--coverage[data-state="checking"] .coverage__line { color: var(--ink-2); font-weight: 550; }
.coverage__list { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-top: .6rem; max-height: 11rem; overflow-y: auto; }
.coverage__sheet { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; padding: .35rem .5rem; border: 1px solid var(--warn); background: #fff; color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.coverage__sheet strong { font-family: var(--mono); font-size: .9rem; }
.coverage__sheet span { font-size: .72rem; color: var(--warn); font-weight: 600; }
.coverage__sheet:hover { background: var(--paper); }
.coverage__split { width: 100%; margin-top: .2rem; font-size: .72rem; }
.lp--apply { display: grid; gap: .4rem; }

@media (max-width: 960px) {
  .locator { grid-template-columns: minmax(0, 1fr); }
  .locator__stage { height: 62vh; }
  .locator__panel { position: static; max-height: none; }
  .locator__group { text-align: left; }
  .locator__keys { display: none; }
}

@media (max-width: 720px) {
  .strip { flex-wrap: wrap; }
  .strip__brand { flex: 1; border-right: 0; padding: 0 .9rem; min-height: 2.75rem; }
  .is-public .strip__nav { flex-basis: 100%; border-top: 1px solid var(--rule); min-height: 2.5rem; justify-content: flex-start; }
  .strip__cell { display: none; }
  .strip__out { display: flex; border-left: 1px solid var(--rule); padding: 0 .4rem; }
  .strip__nav--right { flex: 0 1 auto; order: 0; flex-basis: auto; border-top: 0; }
  .is-app .strip__nav { order: 3; flex-basis: 100%; border-top: 1px solid var(--rule); min-height: 2.75rem; }
  .sheet { padding: 1.25rem .9rem 3rem; }
  .head { align-items: flex-start; flex-direction: column; }
  .tb__wide { grid-column: auto; }
  .panel--narrow { margin-top: 1rem; box-shadow: none; }
  .confirm__wrap { overflow-x: auto; }
  .confirm__table th { position: static; }
  .c-crop { width: 14rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .strip__nav a, input, select { transition: background-color .12s, border-color .12s, color .12s; }
}

/* ---- B64: the numbering grid — one box per row, so Tab moves down the column ---- */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.numgrid { margin-top: .25rem; }
.numgrid-link { margin: -.5rem 0 1rem; font-weight: 600; }
.numgrid .note { margin-bottom: 1rem; }
.numgrid__table td { vertical-align: middle; padding: .5rem .6rem; }
.numgrid__table tbody tr { border-left: 4px solid transparent; scroll-margin-top: 6rem; }
.numgrid__table tbody tr:hover { background: transparent; }
.numgrid__table tr.is-blocking { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.numgrid__table tr.is-excluded { opacity: .5; }
.numgrid__table tr.is-saving .c-status { opacity: .45; }
.numgrid__table tr.is-flash > td { animation: cs-flash 1.2s ease-out; }
.numgrid__table .c-num { width: 13rem; }
.numgrid__table .c-fill { width: 7.5rem; }
.numgrid__table td input.cell { min-height: 2.5rem; padding: .35rem .5rem; text-overflow: ellipsis; }
.numgrid__table td input.cell.num { font-family: var(--mono); font-size: 1.05rem; font-weight: 650; }
.numgrid__table td input.cell:focus { border-color: var(--accent); background: #fff; outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; }
.numgrid__table tr:hover .c-fill .btn { border-color: var(--accent); }

/* BRIEF-REVIT-ADDIN R5.1: the /revit page — three install steps, and the key shown once */
.install-steps { margin: .25rem 0 1rem; padding-left: 1.4rem; line-height: 1.55; }
.install-steps li { margin: .25rem 0; }
.keybox { margin: 1rem 0; padding: .75rem 1rem; border: 1px solid var(--rule); background: var(--surface); }
.keybox__key { margin: 0 0 .5rem; font-size: 1rem; user-select: all; white-space: pre-wrap; word-break: break-all; }
