/* singlesdb — internal admin. One hand-written sheet, no build step.
   Utilitarian: dense tables, 13px system stack, flat surfaces, no pills. */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #dde1e6;
  --text: #1b2330;
  --muted: #6a7383;
  --accent: #2559d4;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --good: #1a7f37;
  --warn: #9a6700;
  --side: #1a222e;
  --side-text: #c7cdd6;
  --side-active: #ffffff;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
}

/* The nav is taller than a laptop viewport, so the column scrolls inside
   itself: brand and footer stay put, only the links move. Without the
   min-height:0 the flex child refuses to shrink and the bottom links spill
   past the dark background onto the page. */
.sidebar {
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.side-brand,
.side-whoami,
.switch-user { flex: none; }

.side-brand {
  color: var(--side-active);
  font-weight: 700;
  font-size: 15px;
  padding: 0.25rem 1rem 0.75rem;
  display: block;
}
.side-brand:hover { text-decoration: none; }
.side-brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--side-text);
}

.side-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.side-nav .nav-group {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b93a3;
  padding: 0.9rem 1rem 0.25rem;
}
.side-nav a {
  color: var(--side-text);
  padding: 0.3rem 1rem;
  display: block;
}
.side-nav a:hover { color: var(--side-active); text-decoration: none; }
.side-nav a.active {
  color: var(--side-active);
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}

.side-foot {
  flex: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1rem 0.25rem;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.side-user {
  color: #8b93a3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-foot .side-link { color: var(--side-text); }
.side-foot .side-link:hover { color: var(--side-active); }

/* Full width: the app is tables of prices, positions, and coverage, and a
   cap was clipping the widest of them. Forms keep their own max-widths, so
   they don't stretch with the page. */
.main { padding: 1.25rem 1.5rem 3rem; }

/* login and other signed-out pages */
.auth-main { max-width: 360px; margin: 12vh auto 0; padding: 0 1rem; }

/* ---------- switch user ---------- */

/* Who's driving, readable across the counter. The green is deliberately
   nothing else in the palette — identity should pop, not blend. */
.side-whoami {
  display: block;
  padding: 0 1rem 0.35rem;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #3ecf8e;
}

.switch-user {
  font: inherit;
  font-size: 12px;
  margin: 0 1rem 0.5rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: none;
  color: var(--side-text);
  cursor: pointer;
  align-self: flex-start;
}
.switch-user:hover { color: var(--side-active); border-color: var(--side-active); }

dialog#switch-user-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 320px;
  background: var(--panel);
  color: var(--text);
}
dialog#switch-user-dialog::backdrop { background: rgba(16, 20, 28, 0.55); }
dialog#switch-user-dialog h2 { margin: 0 0 0.25rem; font-size: 16px; }
.switch-user-list { list-style: none; margin: 0.75rem 0; padding: 0; }
.switch-user-list li { border-bottom: 1px solid var(--line); }
.switch-user-list li:last-child { border-bottom: 0; }
.switch-user-row {
  font: inherit;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.25rem;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.switch-user-row:hover { background: #f8f9fb; }
.switch-user-row:disabled { color: var(--muted); cursor: default; }

/* ---------- page head ---------- */

.breadcrumbs { font-size: 12px; color: var(--muted); margin-bottom: 0.25rem; }
.breadcrumbs a { color: var(--muted); }
.crumb-sep { margin: 0 0.35rem; color: var(--line); }
.crumb-here { color: var(--muted); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 20px; }
.page-head .lede { margin: 0.15rem 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 0.5rem; align-items: center; }

/* underline tabs — never pills */
.subnav {
  display: flex;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.subnav a {
  color: var(--muted);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subnav a:hover { text-decoration: none; color: var(--text); }
.subnav a.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- flash ---------- */

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin: 0 0 1rem;
  border: 1px solid;
}
.flash-error { background: #fdecea; border-color: #f5c6c0; color: var(--danger); }
.flash-info { background: #e8f0fe; border-color: #c4d5f7; color: var(--accent); }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.panel-body { padding: 0.75rem; }
.panel-body > :first-child { margin-top: 0; }
.panel-body > :last-child { margin-bottom: 0; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}
.panel table.data { border: 0; }
table.data th, table.data td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
table.data td.wrap, table.data th.wrap { white-space: normal; }
table.data th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8f9fb; }
table.data td.num, table.data th.num { text-align: right; }

.thumb {
  width: 32px;
  height: 44px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  background: var(--bg);
}

/* ---------- badges & chips ---------- */

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg);
}
.badge-good { color: var(--good); border-color: #b6dfc2; background: #ebf7ee; }
.badge-warn { color: var(--warn); border-color: #ecd9a7; background: #fdf6e3; }
.badge-bad { color: var(--danger); border-color: #f5c6c0; background: #fdecea; }

.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); padding: 1.25rem 0.5rem; text-align: center; }
/* prewrap keeps the line breaks staff typed into an issue or comment. */
.prewrap { white-space: pre-wrap; overflow-wrap: break-word; }
/* logtext is machine text — error strings, attribute values, a stack. It
   wraps rather than stretching the table, and stays monospaced so a URL or
   a SQLSTATE can be read character by character. */
.logtext {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre.logtext {
  margin: 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 20rem;
  overflow: auto;
}
/* row-on marks the row you arrived on, so a history list says which of
   forty identical lines is the one you clicked. */
table.data tr.row-on td { background: var(--bg); }
.comment { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 0.75rem; }
.comment p { margin: 0.15rem 0; }

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-block;
  font: inherit;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: #f5c6c0; }
.btn-sm { padding: 0.15rem 0.5rem; font-size: 12px; }

.link-button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.sidebar .link-button { color: var(--side-text); }
.sidebar .link-button:hover { color: var(--side-active); }
.main .link-button { color: var(--accent); }
.main .link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--danger); }

.inline-form { display: inline; }

label.field { display: block; margin-bottom: 0.75rem; font-weight: 600; }
label.field input, label.field select, label.field textarea {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  font: inherit;
  font-weight: 400;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}
label.field input:focus, label.field select:focus, label.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
label.field .hint { font-weight: 400; display: block; margin-top: 0.15rem; }

.row-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.row-form label.field { margin-bottom: 0; flex: 1; min-width: 8rem; }
.row-form .grow-2 { flex: 2; }
.row-form .shrink { flex: 0 0 auto; min-width: 0; }
/* A from/to pair is one filter, so it stays one field: two inputs under
   a single label rather than a stray "max" box adrift on the next row. */
.range { display: flex; gap: 0.35rem; }
label.field .range input { width: 5.5rem; }

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 480px;
}
.form-card.wide { max-width: 720px; }
.form-card h2 { margin: 0 0 0.75rem; font-size: 16px; }
.form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }

/* ---------- stats ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}
.stat .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: block;
}
.stat .stat-value { font-size: 20px; font-weight: 700; }
.stat .stat-sub { font-size: 12px; color: var(--muted); }

/* ---------- card search (intake) ---------- */

.card-search { position: relative; }
.card-search input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-search input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.search-results { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.search-results li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.search-results li:last-child { border-bottom: 0; }
.search-results .result-name { font-weight: 600; }
.search-results .result-meta { color: var(--muted); font-size: 12px; }
.search-results .result-main { flex: 1; min-width: 0; }
.search-results .result-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; }

details.manual-entry { margin-top: 0.75rem; }
details.manual-entry summary { cursor: pointer; color: var(--muted); }
details.manual-entry[open] summary { margin-bottom: 0.5rem; }

/* ---------- batch placement picker ---------- */

table.placement td { padding: 0.25rem 0.35rem; }
.place-cell {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.place-cell:hover { border-color: var(--muted); }
.place-cell.warn { border-color: #ecd9a7; background: #fdf6e3; }
.place-cell input[type="radio"] { accent-color: var(--accent); margin-right: 0.25rem; }
.place-cell:has(input:checked) {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

/* ---------- guides ---------- */

.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 0; }

.guide-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 46rem;
  font-size: 14px;
}
.guide-body h1 { font-size: 20px; margin: 0 0 0.75rem; }
.guide-body h2 {
  font-size: 15px;
  margin: 1.5rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.guide-body h3 { font-size: 14px; margin: 1rem 0 0.35rem; }
.guide-body p, .guide-body li { line-height: 1.65; }
.guide-body ul, .guide-body ol { padding-left: 1.4rem; }
.guide-body li { margin-bottom: 0.3rem; }
.guide-body code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-size: 12px;
}
.guide-body blockquote {
  margin: 0.75rem 0;
  padding: 0.25rem 0.9rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* ---------- scan intake ---------- */

.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  margin: 0.5rem 0;
}
.drop-zone.drag { border-color: var(--accent); background: #e8f0fe; }
.drop-zone p { margin: 0.25rem 0; }
.link-like { color: var(--accent); cursor: pointer; }
.link-like:hover { text-decoration: underline; }

/* The review page earns the whole window: the scan needs to be readable
   at cardboard-in-hand detail. */
/* (.main no longer carries a max-width, so scan review needs no exception.) */

.scan-split { display: flex; gap: 1.25rem; padding: 0.9rem; align-items: flex-start; }
.scan-image {
  width: clamp(280px, 34vw, 520px);
  border-radius: 10px;
  display: block;
  background: var(--bg);
}
.scan-work { flex: 1; min-width: 0; }
.scan-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.6rem;
  border: 1px solid #b6dfc2;
  background: #ebf7ee;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
/* The suggested printing renders big enough to compare against the scan —
   frame, art, and set symbol are what settle a "check the printing". */
.suggestion-image {
  width: clamp(160px, 18vw, 260px);
  border-radius: 8px;
  display: block;
  background: var(--bg);
  flex: 0 0 auto;
}
.scan-suggestion .result-main { flex: 1; min-width: 0; }
.scan-suggestion .result-main .result-name { font-size: 15px; }
.scan-suggestion .result-actions {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
}
.scan-suggestion .result-actions .btn { font-size: 14px; padding: 0.45rem 1rem; }
.scan-work input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scan-work input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.scan-actions { margin-top: 0.5rem; }

@media (max-width: 700px) {
  .scan-split { flex-direction: column; }
  .scan-image { width: 100%; max-width: 420px; }
  .scan-suggestion { flex-wrap: wrap; }
  .suggestion-image { width: 45%; }
}

/* ---------- focus review mode ---------- */

body.focus { background: #171c26; }
body.focus .flash { margin: 0.5rem 1rem; }

.focus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--side);
  color: var(--side-text);
}
.focus-exit { color: var(--side-text); }
.focus-exit:hover { color: #fff; text-decoration: none; }
.focus-title { color: #fff; font-weight: 700; }

.focus-body { padding: 1.25rem; }
.focus-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 1700px;
  margin: 0 auto;
}
/* Scan and suggested printing side by side at the same size, each with a
   magnifier inset overlaid bottom-right showing its own bottom-left corner
   (collector number · set code) — the two loupes compare directly. */
.compare { display: flex; gap: 1.25rem; flex: 0 0 auto; align-items: flex-start; }
.compare-fig { margin: 0; position: relative; width: clamp(300px, 28vw, 580px); }
.compare-image {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: var(--bg);
}
.compare-fig figcaption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
  margin-top: 0.35rem;
}
/* The suggested card's identity, readable from arm's length. */
figcaption.fig-identity {
  font-size: 19px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
figcaption.fig-identity .fig-sub {
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  display: block;
}
.fig-img { position: relative; }
.corner-zoom {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 64%;
  height: 120px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.corner-zoom img {
  position: absolute;
  bottom: -8px;
  left: -5px;
  width: 260%;
}

.focus-work { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }

details.alternates summary { cursor: pointer; color: var(--muted); }
details.alternates[open] summary { margin-bottom: 0.25rem; color: var(--text); }
.alternates-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0.5rem; }
.focus-work .scan-search { font-size: 16px; }
.focus-prices { display: block; margin-top: 0.25rem; font-size: 15px; font-weight: 600; }
.focus-prices .muted { font-weight: 400; margin-left: 0.5rem; }
.focus-providers { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.focus-defaults { margin-bottom: 0; }
.focus-actions { display: flex; gap: 0.5rem; align-items: center; }
.focus-done { max-width: 480px; margin: 10vh auto 0; }
.focus-keys { color: #8b93a3; }

@media (max-width: 900px) {
  .focus-card { flex-direction: column; }
  .compare { flex-wrap: wrap; }
  .compare-fig { width: 100%; max-width: 420px; }
}

/* ---------- pagination ---------- */

.pager { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }
.pager .muted { font-size: 12px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
  }
  .side-brand { padding: 0.25rem 0.5rem; }
  .side-brand small { display: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; align-items: center; overflow: visible; }
  .side-nav .nav-group { display: none; }
  .side-nav a.active { border-left: 0; border-bottom: 2px solid var(--accent); padding: 0.3rem 0.5rem; }
  .side-nav a { padding: 0.3rem 0.5rem; }
  .side-foot { border-top: 0; flex-direction: row; gap: 0.75rem; padding: 0.25rem 0.5rem; }
  .side-user { display: none; }
  .main { padding: 1rem; }
}

@media (max-width: 600px) {
  input, select, textarea { font-size: 16px !important; } /* stop iOS zoom */
}

/* --- Quote slip -----------------------------------------------------------
   The printed buy offer. It renders on the dark focus body on screen, but a
   slip is a paper object: white ground, black text, no chrome. The one rule
   that matters is that the totals survive a cheap receipt printer. */
.print-slip {
  max-width: 46rem;
  margin: 1.5rem auto;
  padding: 1.75rem;
  background: #fff;
  color: #111;
  border-radius: 6px;
}
.print-slip h1 { margin: 0; font-size: 1.4rem; }
.print-slip .muted { color: #666; }
.print-slip table.data { width: 100%; margin-top: 1rem; color: #111; }
.print-slip table.data th { color: #444; border-bottom: 1px solid #ccc; }
.print-slip table.data td { border-bottom: 1px solid #eee; }
.slip-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 2px solid #111;
  padding-bottom: 0.75rem;
}
.slip-total { text-align: right; }
.slip-total .hint { display: block; color: #666; }
.slip-total strong { font-size: 1.8rem; }
.slip-fine { color: #444; font-size: 0.85rem; margin: 0.6rem 0 0; }
.slip-actions { margin-top: 1.5rem; display: flex; gap: 0.5rem; }

@media print {
  /* Paper gets the slip and nothing else — no flashes, no buttons. */
  body.focus { background: #fff; }
  .no-print, .flash { display: none !important; }
  .print-slip { margin: 0; padding: 0; max-width: none; border-radius: 0; }
}

/* --- Catalog browser ------------------------------------------------------
   The card page is a hub: art on the left, facts on the right, then the
   wide tables (position, sales) full-bleed underneath. */
.card-hub {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.card-art { flex: 0 0 260px; }
.card-art img { width: 100%; border-radius: 10px; display: block; }
.card-facts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.card-facts .panel { margin-bottom: 0; }

/* One copy's history: a dated list down a rule. The dot sits on the rule
   rather than beside it, so a long gap between events reads as a gap. */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when { display: block; font-size: 12px; color: var(--muted); }
.timeline p { margin: 0.1rem 0 0; font-size: 13px; }

/* Sparkline. Stroke widths are set here rather than on the element so the
   non-uniform viewBox scaling doesn't distort them. */
.spark {
  width: 100%;
  height: 130px;
  display: block;
  margin: 0.25rem 0 0.75rem;
  overflow: visible;
}
.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.spark-axis {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.spark-dot { fill: var(--accent); }
.spark-dot-first { fill: var(--muted); }
.spark-label { fill: var(--muted); font-size: 11px; font-family: inherit; }

/* Coverage: the set checklist's headline numbers. */
.coverage { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.coverage-stat { flex: 1 1 200px; }
.coverage-num { display: block; font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.coverage .hint { display: block; margin-bottom: 0.4rem; }

/* A bar that reads as a proportion without a chart library. Fixed width:
   inside an auto-layout table cell a percentage width resolves circularly
   (cell sizes to content, content sizes to cell) and the label after the
   bar gets pushed out of the clip. The coverage header re-widens it. */
.meter {
  display: inline-block;
  width: 7rem;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.4rem;
}
.coverage .meter { width: 100%; max-width: 12rem; margin-right: 0; }
.meter-fill { display: block; height: 100%; background: var(--accent); }

.pager { display: flex; gap: 0.5rem; }

@media (max-width: 800px) {
  .card-hub { flex-direction: column; }
  .card-art { flex: none; max-width: 260px; }
}

/* A rule above each day's first row groups a day's observations visually
   without nesting tables — the day reads as a block, and its date is
   printed once rather than repeated down every row. */
.data tr.day-start > td { border-top: 1px solid var(--line); }

/* .subnav inside a panel is a tab strip over that panel's own data, so it
   loses the page-level bottom margin. */
.panel-body > .subnav { margin-bottom: 0; }
.spark-multi { height: 200px; }
.spark-multi-line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

/* Throughput bars on the dashboard: proportion at a glance, no chart
   library. Inline width is set by barPct against the window's peak. */
.bar {
  display: inline-block;
  height: 10px;
  min-width: 2px;
  background: var(--good, #2e7d32);
  border-radius: 2px;
  vertical-align: middle;
}
td.you { background: rgba(46, 125, 50, 0.08); }

/* Hovering a candidate swaps it into the compare view rather than
   floating over it — the scan you are reading against is right there. */
[data-zoom] { cursor: zoom-in; }
