/* Layout: a working desk. Left rail = the day's records, main = one record's flow (intake, working, review, posted).
   Cool graphite neutrals, one steel-blue accent, semantic colours reserved for evidence state. */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #17212b;
  --muted: #5a6877;
  --line: #d6dde4;
  --accent: #1d5f8f;
  --accent-ink: #ffffff;
  --accent-soft: #dbe9f4;
  --good: #1b7a4b;
  --good-bg: #e3f3ea;
  --warn: #9a5700;
  --warn-bg: #fdf1dc;
  --bad: #b3261e;
  --bad-bg: #fbe6e4;
  --focus: #1d5f8f;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1419;
    --surface: #161e26;
    --surface-2: #1c2630;
    --ink: #e6ecf1;
    --muted: #94a2b0;
    --line: #2b3743;
    --accent: #6db2e3;
    --accent-ink: #0b1218;
    --accent-soft: #1d3446;
    --good: #5fcf94;
    --good-bg: #123023;
    --warn: #f0b45a;
    --warn-bg: #33250f;
    --bad: #ff8d84;
    --bad-bg: #38171a;
    --focus: #6db2e3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1419;
  --surface: #161e26;
  --surface-2: #1c2630;
  --ink: #e6ecf1;
  --muted: #94a2b0;
  --line: #2b3743;
  --accent: #6db2e3;
  --accent-ink: #0b1218;
  --accent-soft: #1d3446;
  --good: #5fcf94;
  --good-bg: #123023;
  --warn: #f0b45a;
  --warn-bg: #33250f;
  --bad: #ff8d84;
  --bad-bg: #38171a;
  --focus: #6db2e3;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; padding-inline: 16px; padding-block: 16px 48px; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 1.25rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.shell { max-width: 1180px; margin-inline: auto; display: grid; gap: 16px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand small { color: var(--muted); }
.states { display: flex; flex-wrap: wrap; gap: 6px; }
.states button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.states button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--surface-2); font-weight: 600; }
.mocknote { font-size: 0.82rem; color: var(--muted); }

.desk { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .desk { grid-template-columns: minmax(0, 1fr); } }

.rail { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; }
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rail li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px; border-radius: 6px; align-items: center; }
.rail .rname { font-weight: 600; overflow-wrap: anywhere; }
.rail .ralbum { grid-column: 1 / -1; color: var(--ink); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rail .ralbum:empty { display: none; }
.rail .meta { grid-column: 1; }
.rail li[aria-current="true"] { background: var(--surface-2); outline: 1px solid var(--line); }
.rail .rid { font-weight: 600; }
.rail .meta { color: var(--muted); font-size: 0.82rem; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.76rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.idle { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 16px; min-width: 0; }
.panel header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.sub { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.drop { border: 1.5px dashed var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 12px; background: var(--surface-2); }
.typedfirst { display: grid; gap: 12px; margin: 14px 0; }
.drop.over { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { width: 92px; aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--line); background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px); display: grid; place-items: end start; padding: 6px; font-size: 0.7rem; color: var(--muted); font-family: var(--font-mono); }
.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-weight: 600; }
.hint { color: var(--muted); font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 6px; cursor: pointer; min-width: 52px; font-family: var(--font-mono); }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.text { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); width: 100%; }
textarea.text { min-height: 84px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
a.btn { color: inherit; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
details { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: var(--surface-2); }
details summary { cursor: pointer; font-weight: 600; }
.scale { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin-top: 8px; }
.scale b { font-family: var(--font-mono); }

.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.steps .done .dot { background: var(--good); border-color: var(--good); }
.steps .now .dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.steps .wait { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps .now .dot { animation: none; border-top-color: var(--accent); } }

.stop { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--ink); border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.stop strong { color: var(--warn); }
.nofit { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--ink); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 6px; }
.nofit strong { color: var(--warn); }
.nofit ul { margin: 0; padding-left: 18px; }
.cand { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.cand.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cand label { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; cursor: pointer; }
.cand .title { font-weight: 600; }
.score { font-family: var(--font-mono); font-weight: 500; }
.tablewrap { overflow-x: auto; }
.cand > * { min-width: 0; }
td { overflow-wrap: anywhere; }
.tablewrap td:last-child { white-space: nowrap; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
td.num { font-variant-numeric: tabular-nums; }
ul.checks { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.checkbox { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.confirm { border: 1px solid var(--accent); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; background: var(--surface-2); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.guide { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 12px 14px; background: var(--surface-2); }
.guide > summary { cursor: pointer; }
.guide .tipsbody { display: grid; gap: 6px; margin-top: 8px; }
.guide .examples summary { cursor: pointer; font-weight: 600; }
.guide .exgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 240px)); gap: 12px; margin-top: 8px; }
.guide figure { margin: 0; display: grid; gap: 4px; }
.guide figure img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); display: block; }
.guide figcaption { font-size: 0.85rem; color: var(--ink); }
.guide ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cap { font-variant-numeric: tabular-nums; }
.fine { font-size: 0.8rem; margin-top: -2px; }
.nonebox { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 14px; background: var(--surface-2); margin-left: 24px; }
[hidden] { display: none !important; }
.rail li { cursor: pointer; }
.rail .newbtn { width: 100%; }
.thumb { overflow: hidden; position: relative; }
.thumbpic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: relative; z-index: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: color-mix(in srgb, var(--bg) 78%, transparent); padding: 1px 3px; border-radius: 3px; }
.thumb button { position: relative; z-index: 1; background: color-mix(in srgb, var(--bg) 78%, transparent); border-radius: 3px; }
.thumb button { all: unset; cursor: pointer; justify-self: end; align-self: start; font-size: 0.8rem; padding: 0 4px; }
.err { color: var(--bad); }
.nonebox button[disabled] { cursor: not-allowed; }
td.good { color: var(--good); font-weight: 600; }
td.bad { color: var(--bad); font-weight: 600; }
td.other { color: var(--muted); }
#cands { display: grid; gap: 12px; }
.idrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-left: 24px; }
.rid { font-family: var(--font-mono); user-select: all; -webkit-user-select: all; }
.idrow a { color: var(--accent); }
details.more { border: 0; padding: 0; background: transparent; }
details.more > summary { padding: 8px 0; color: var(--accent); }
details.more > div { display: grid; gap: 12px; margin-top: 8px; }
details.evidence { background: var(--surface); }
.cand details.evidence { margin-top: 4px; }

/* ---- the list of today's records: a title on wide screens, a fold-away section on a phone ---- */
.rail details.today { border: 0; padding: 0; background: transparent; }
.rail details.today > summary { list-style: none; cursor: default; padding: 0 0 6px; }
.rail details.today > summary::-webkit-details-marker { display: none; }
.rail details.today > summary h3 { display: inline; }

/* ---- touch: camera button and hints that fit the device ---- */
#takePhoto { display: none; }
@media (pointer: coarse) {
  #takePhoto { display: inline-block; }
}

/* ---- phone ---- */
@media (max-width: 860px) {
  body { padding-inline: 12px; }
  .desk > main { order: 1; }
  .desk > .rail { order: 2; }   /* the list of records sits below the form on a phone */
  .rail { padding: 10px; }
  .rail details.today > summary { cursor: pointer; padding: 12px 4px; min-height: 44px; display: flex; align-items: center; border-top: 1px solid var(--line); }
  .rail details.today > summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); }
  .rail details.today[open] > summary::after { content: "\25B4"; }
  .rail li { padding: 12px 8px; }
  .btn { min-height: 44px; }
  .chips button { min-height: 44px; min-width: 52px; }
  details summary { padding-block: 11px; }
  details.more > summary { padding-block: 12px; }
  input.text, textarea.text, select { font-size: 16px; }   /* anything smaller makes iPhone zoom in on focus */
  textarea.text { min-height: 120px; }
  .hint, .sub { font-size: 0.9rem; }
  .pill { font-size: 0.85rem; padding: 2px 10px; }
  .guide .exgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .guide figcaption { font-size: 0.82rem; }
  .cand { padding: 12px 10px; }
  .cand label { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .cand label .pill { grid-column: 2; justify-self: start; }
  .cand input[type="radio"], #pickNone { width: 24px; height: 24px; margin: 0; }
  .idrow a, .idrow button { min-height: 44px; display: inline-flex; align-items: center; }
  .cand label { min-height: 44px; }
  label.row { min-height: 44px; }
  h3, th { font-size: 0.85rem; }
  footer a, .foot a { display: inline-block; padding: 12px 6px; }
}

/* ---- header actions: only on a phone, where the list and the New record button are not at the top ---- */
.hdrnav { display: none; }
@media (max-width: 860px) {
  .hdrnav { display: flex; gap: 8px; width: 100%; }
  .hdrnav .btn { flex: 1; }
  .rail .newbtn { display: none; }
  .rail details.today > summary { border-top: 0; }
}

/* ---- phone: the comparison table becomes one small block per identifier ---- */
@media (max-width: 700px) {
  .tablewrap table, .tablewrap tbody, .tablewrap tr, .tablewrap td { display: block; width: 100%; }
  .tablewrap thead { display: none; }
  .tablewrap tr { display: grid; grid-template-columns: minmax(5.5rem, 1fr) minmax(0, auto); gap: 2px 8px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tablewrap td { border: 0; padding: 0; min-width: 0; }
  .tablewrap td.idname { font-weight: 600; grid-column: 1; grid-row: 1; }
  .tablewrap td:last-child { grid-column: 2; grid-row: 1; font-size: 0.85rem; text-align: right; white-space: normal; max-width: 60vw; }
  .tablewrap td[data-label] { grid-column: 1 / -1; }
  .tablewrap td[data-label]::before { content: attr(data-label) "  "; color: var(--muted); font-family: var(--font-sans, inherit); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
}

/* Brand logo: off-white artwork; multiply drops it into the light page, a chip keeps it readable in dark mode */
.brand h1 { line-height: 0; }
.logo { height: 40px; width: auto; display: block; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo { mix-blend-mode: normal; border-radius: 8px; }
}
:root[data-theme="dark"] .logo { mix-blend-mode: normal; border-radius: 8px; }
.rail li.railmore { display: grid; grid-template-columns: 1fr; gap: 8px; cursor: default; }
.rail li.railmore .btn { width: 100%; box-sizing: border-box; text-align: center; }

/* Login and sign-up pages: one narrow card, phone first. */
.authcard { max-width: 26rem; margin: 0 auto; padding-inline: 16px; padding-block: 32px 48px; display: grid; gap: 16px; }
.authcard .logo { max-width: 12rem; height: auto; }
.authform { display: grid; gap: 14px; }
.authcard .ok { color: var(--good); background: var(--good-bg); border-radius: 6px; padding: 8px 12px; }
.authcard .err { color: var(--bad); background: var(--bad-bg); border-radius: 6px; padding: 8px 12px; }
.authcard .fineprint { color: var(--muted); font-size: 0.85rem; display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.authcard .fineprint p { margin: 0; }
.logout { margin: 0; }
.who { color: var(--muted); font-size: 0.85rem; align-self: center; }
.admintable { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
/* Short columns never break inside a word; the email may wrap at any character; the table scrolls sideways on a narrow screen instead of squeezing. */
.admintable td:nth-child(1), .admintable td:nth-child(3), .admintable td:nth-child(4), .admintable td:nth-child(6) { white-space: nowrap; }
.admintable td:nth-child(2) { overflow-wrap: anywhere; }
.admintable th, .admintable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.yourdata { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.9rem; }
.yourdata summary { cursor: pointer; font-weight: 600; }
.cand #listingForm { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }

/* ---- account menu: the first letter of the username; tap for the full name and Log out ---- */
.topbar { position: relative; }
.acct { position: absolute; top: 7px; right: 0; }
.acct > summary { list-style: none; cursor: pointer; }
.acct > summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.8rem; }
.acctmenu { position: absolute; right: 0; top: 34px; z-index: 20; min-width: 180px; display: grid; gap: 10px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.acctmenu .who { overflow-wrap: anywhere; }
.topbar:has(.acct) .brand { padding-right: 36px; }
details.acct { border: 0; padding: 0; background: transparent; }
.acct > summary { display: block; line-height: 0; }
.acct .avatar { display: flex; }
.idrow a.attrib { color: var(--muted); font-size: 0.8rem; }
.idrow a.viewrel { font-weight: 600; }

/* Text in the evidence table (runouts, catalog numbers) can always be selected and copied, on a tablet too. */
.tablewrap td, .mono, .idrow .rid { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.tablewrap { -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }

/* Account page */
.acctpage .panel { display: grid; gap: 10px; }
.acctlist { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.acctlist dt { color: var(--muted); }
.acctlist dd { margin: 0; overflow-wrap: anywhere; }
.acctpage .ok { color: var(--good); background: var(--good-bg); border-radius: 6px; padding: 8px 12px; }
.acctpage .err { color: var(--bad); }
.acctmenu .btn, .acctmenu .logout .btn { display: block; width: 100%; box-sizing: border-box; text-align: center; text-decoration: none; font: inherit; font-weight: 600; line-height: 1.2; }

/* Feedback box under a posted record */
details.feedback { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; display: grid; gap: 10px; }
details.feedback > summary { cursor: pointer; color: var(--muted); }
details.feedback textarea { width: 100%; box-sizing: border-box; font: inherit; }

/* Collapsible sections on the Account page */
details.collapse > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary h3 { margin: 0; }
details.collapse > summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
details.collapse[open] > summary::after { content: "\2212"; }
details.collapse[open] > summary { margin-bottom: 10px; }
.acctpage .stack { display: grid; gap: 6px; justify-items: start; }
.acctpage .stack p { margin: 0; }

/* Grade pickers: one bar from M to P, the meaning shown under it as you tap */
.scalebar { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.scalebar button { border: 0; border-right: 1px solid var(--line); background: transparent; color: inherit; padding: 12px 0 10px; min-height: 48px; min-width: 0; display: grid; gap: 6px; justify-items: center; font-family: var(--font-mono); font-size: 0.82rem; cursor: pointer; }
.scalebar button:last-child { border-right: 0; }
.scalebar button i { display: block; width: 100%; height: 4px; background: var(--accent); opacity: 1; }
.scalebar button:nth-child(2) i { opacity: 0.89; }
.scalebar button:nth-child(3) i { opacity: 0.78; }
.scalebar button:nth-child(4) i { opacity: 0.67; }
.scalebar button:nth-child(5) i { opacity: 0.56; }
.scalebar button:nth-child(6) i { opacity: 0.45; }
.scalebar button:nth-child(7) i { opacity: 0.34; }
.scalebar button:nth-child(8) i { opacity: 0.23; }
.scalebar button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.scalebar button[aria-pressed="true"] i { background: var(--accent-ink); opacity: 1; }
.scalebar button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.scalelive { min-height: 2.7em; display: grid; gap: 1px; font-size: 0.85rem; }
.scalelive b { font-size: 0.95rem; }
.scalelive span { color: var(--muted); }

/* Media and sleeve grades stack at every width: side by side they misalign on a tablet, where the two hints wrap differently */
.gradestack { grid-template-columns: minmax(0, 1fr); }

/* Grade pickers on a tablet or desktop: two rows of four tiles, M to VG large and G+ to P below them; a phone keeps the bar */
.gwords { display: none; }
@media (min-width: 700px) {
  .scalebar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
  .scalebar button { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); grid-template-columns: minmax(0, 1fr); gap: 2px; justify-items: start; text-align: left; padding: 10px 12px; min-height: 64px; align-content: center; }
  .scalebar button:last-child { border-right: 1px solid var(--line); }
  .scalebar button i { display: none; }
  .scalebar button > span:first-child { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600; }
  .gwords { display: block; font-family: var(--font-body); font-weight: 400; }
  .gwords b { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
  .gwords small { display: none; }
  .scalebar button:nth-child(n+5) { min-height: 48px; padding-block: 8px; }
  .scalebar button:nth-child(n+5) > span:first-child { font-size: 1rem; }
  .scalebar button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); font-weight: 400; }
  .scalebar button[aria-pressed="true"] > span:first-child { color: var(--accent); }
  .scalebar button:focus-visible { outline-offset: 2px; }
  .scalelive { min-height: 2.7em; }
}

/* Header shared by the Account, Send feedback and privacy pages */
.sitebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sitebar .logolink { display: block; line-height: 0; }
.sitebar .acct { position: relative; top: 0; right: 0; }

.tally { margin: 0; font-size: 1.1rem; }
.tally strong { font-family: var(--font-mono); font-size: 2rem; line-height: 1; color: var(--accent); margin-right: 6px; }
.sitebar .barright { display: flex; align-items: center; gap: 10px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; flex: none; }
.keepbox { border-top: 1px solid var(--line); padding-top: 10px; }

/* All records page: the same rows as the main screen's list, as links, a page at a time. */
.recordspage .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.recordspage a.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px; border-radius: 6px; align-items: center; color: inherit; text-decoration: none; }
.recordspage a.row:hover, .recordspage a.row:focus-visible { background: var(--surface-2); }
.recordspage .rname { font-weight: 600; overflow-wrap: anywhere; }
.recordspage .ralbum { grid-column: 1 / -1; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.recordspage .ralbum:empty { display: none; }
.recordspage .meta { color: var(--muted); font-size: 0.82rem; }
.recordspage .pager { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.recordspage .datefilter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.recordspage .datefilter .field { margin: 0; }
.signupq { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 12px; }
.signupq legend { padding: 0 6px; font-weight: 600; }
.signupq select { max-width: 100%; }

/* Account, Send feedback, All records and privacy: the header spans the page like the main screen, the content sits in a column under it. */
.sitepage { max-width: 1180px; margin: 0 auto; padding-block: 0 48px; display: grid; gap: 16px; }
.sitepage .logo { max-width: 12rem; height: auto; }
.sitepage .pagecol { width: 100%; max-width: 40rem; margin: 0 auto; display: grid; gap: 16px; min-width: 0; }
.sitepage > h2, .sitepage > p, .sitepage > footer { margin: 0; }
.acctgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.acctgrid .acol { display: grid; gap: 16px; min-width: 0; align-content: start; }
@media (max-width: 860px) { .acctgrid { grid-template-columns: minmax(0, 1fr); } }
.sitepage .err { background: var(--bad-bg); border-radius: 6px; padding: 8px 12px; }
.sitepage .fineprint { color: var(--muted); font-size: 0.85rem; display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.sitepage .fineprint p { margin: 0; }
/* A page column can never be wider than the screen, whatever a panel holds (a long unbroken line, a wide field). */
.sitepage { grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.sitepage .panel input.text, .sitepage .panel select, .sitepage .panel textarea { max-width: 100%; box-sizing: border-box; }
ul.checks li.typo { color: var(--warn); font-weight: 600; }
