/* Prodromos web app (hit-list item 67; designed in prototype/app/).
   Layout: a reference-manager shell. Navy bar and wordmark on top, a left rail
   (sections + your folders) beside the paper list; the rail becomes a scrolling
   tab strip on phones.
   Tokens and components are copied from site/style.css (itself taken from the
   digest email, send_digest.py) so the app, the site and the inbox read as one
   product. Light only, as on the site (Tom, 2026-10-02). */

:root {
  --accent: #1a2f4d;
  --accent-hover: #24406a;
  --tint: #dce5ef;
  --tint-soft: #f5f8fb;
  --ink: #1a1a1a;
  --body: #333;
  --meta: #555;
  --muted: #8a8f96;
  --rule: #e0e0e0;
  --field: #c9d3df;
  --bg: #ffffff;
  --on-accent: #ffffff;

  --rct-bg: #dfeaf7;  --rct-ink: #235a8f;
  --sr-bg: #f1ecf9;   --sr-ink: #6b3fa0;
  --pre-bg: #fff3cd;  --pre-ink: #8a6d1b;

  --yes-bg: #e3f4e8;  --yes-ink: #1b6b3a;  --yes-bd: #b9e0c6;
  --no-bg: #fbe6e6;   --no-ink: #9b2c2c;   --no-bd: #efc2c2;
  --save-bg: #fdf3d7; --save-ink: #8a6512; --save-bd: #ecd79a;

  --shadow: 0 1px 2px rgba(26, 47, 77, .06), 0 12px 32px rgba(26, 47, 77, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--body); font: 15px/1.6 var(--font); }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { height: 8px; background: var(--accent); }
.gutter {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Prototype notice: the site's .draft amber. */
.proto {
  background: var(--pre-bg); color: var(--pre-ink); font-size: 13px;
}
.proto .gutter { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding-block: 8px; }
.proto strong { color: var(--pre-ink); }
.proto button { background: none; border: 0; padding: 0; color: var(--pre-ink); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* Masthead. */
.masthead .gutter { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-block: 16px; }
.logo { display: block; line-height: 0; }
.logo img { display: block; width: 132px; height: auto; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--meta); flex-wrap: wrap; }
.who .name { color: var(--ink); font-weight: 600; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--tint); border-radius: 999px; padding: 2px 9px;
}
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }
.linkbtn.quiet { color: var(--meta); }
.linkbtn.danger { color: var(--no-ink); }

/* Shell. */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding-block: 8px 64px; align-items: start; }
.rail { position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); font-size: 14px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail a {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 7px 10px; border-radius: 4px; color: var(--body); text-decoration: none; border-left: 3px solid transparent;
}
.rail a:hover { background: var(--tint-soft); color: var(--accent); }
.rail a[aria-current="page"] { background: var(--tint); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.rail .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail .group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 4px; }
.rail .folder a { padding-left: 16px; }
.rail .newfolder { margin: 6px 10px 0; font-size: 13px; }

main { min-width: 0; }
.pagehead { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-end; margin: 0 0 18px; }
.pagehead > div { min-width: 0; }
h1 { font-size: 26px; line-height: 1.25; color: var(--ink); margin: 0 0 4px; letter-spacing: -.01em; text-wrap: balance; }
.lead { color: var(--meta); margin: 0; max-width: 44em; }
h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: var(--tint); border-left: 4px solid var(--accent); padding: 6px 10px; margin: 28px 0 4px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
h2 .sub { font-weight: 600; letter-spacing: .04em; color: var(--meta); text-transform: none; }
h3 { font-size: 16px; color: var(--ink); margin: 0 0 4px; }
.section-title { font-size: 19px; font-weight: 700; color: var(--ink); margin: 36px 0 6px; text-wrap: balance; }
.section-title:first-child { margin-top: 8px; }
.hint { font-size: 13px; color: var(--meta); margin: 0 0 10px; max-width: 46em; }

/* Buttons. */
.button {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--on-accent);
  text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); cursor: pointer;
}
.button:hover { background: var(--accent-hover); }
.button.secondary { background: var(--bg); color: var(--accent); border-color: var(--field); }
.button.secondary:hover { background: var(--tint-soft); border-color: var(--accent); }
.button.danger { background: var(--no-ink); border-color: var(--no-ink); }
.button[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Toolbar: search + filters. */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 0 0 6px; }
.search { flex: 1 1 260px; min-width: 0; }
input[type=text], input[type=email], input[type=search], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--field); border-radius: 6px; padding: 8px 11px; width: 100%;
}
select { width: auto; padding-right: 28px; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--field); background: var(--bg); color: var(--meta);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.resultline { font-size: 13px; color: var(--meta); margin: 12px 0 0; }
.resultline .count-line { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Selection bar for bulk actions. */
.selbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 9px 14px; margin: 12px 0 0; font-size: 14px;
}
.selbar .button { background: var(--bg); color: var(--accent); border-color: var(--bg); padding: 5px 12px; font-size: 13px; }
.selbar .linkbtn { color: var(--on-accent); }
/* The folder menu opens inside the navy bar: give it back the page's colours. */
.selbar .popmenu, .selbar .popmenu label { color: var(--accent); font-weight: 600; }
.selbar .popmenu .button { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Paper rows, as in the digest. */
.rows { list-style: none; padding: 0; margin: 0; }
.rows .nearhead { padding: 14px 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 8px; padding: 14px 8px 14px 4px; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row .pick { padding-top: 3px; }
.row .pick input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.row .title { font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none; line-height: 1.4; }
.row .title:hover { text-decoration: underline; }
.row .num { color: var(--muted); font-weight: 400; }
.row .src { font-size: 13px; color: var(--meta); margin-top: 3px; }
.row .src .topic { color: var(--accent); font-size: 12px; }
.row .why, .row .findings { font-size: 13px; color: var(--body); margin-top: 6px; max-width: 70ch; }
.label { color: var(--accent); font-weight: 600; }
.row .infolders { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--meta); background: var(--tint-soft); border: 1px solid var(--rule); border-radius: 3px; padding: 0 6px; }

.badge { display: inline-block; border-radius: 3px; padding: 1px 6px; font-size: 12px; font-weight: 600; margin: 2px 6px 0 0; }
.badge.rct { background: var(--rct-bg); color: var(--rct-ink); }
.badge.sr  { background: var(--sr-bg);  color: var(--sr-ink); }
.badge.pre { background: var(--pre-bg); color: var(--pre-ink); }
.badges { margin-top: 4px; }

.buttons { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
  font-size: 12px; font-weight: 600; text-decoration: none; border: 1px solid;
}
.btn.yes  { background: var(--yes-bg);  color: var(--yes-ink);  border-color: var(--yes-bd); }
.btn.no   { background: var(--no-bg);   color: var(--no-ink);   border-color: var(--no-bd); }
.btn.save { background: var(--save-bg); color: var(--save-ink); border-color: var(--save-bd); margin-left: 10px; }
.btn.plain { background: var(--bg); color: var(--accent); border-color: var(--field); }
.btn.cpd { margin-left: 10px; }
.btn[aria-pressed="true"].yes  { background: var(--yes-ink);  color: var(--on-accent); border-color: var(--yes-ink); }
.btn[aria-pressed="true"].no   { background: var(--no-ink);   color: var(--on-accent); border-color: var(--no-ink); }
.btn[aria-pressed="true"].save { background: var(--save-ink); color: var(--on-accent); border-color: var(--save-ink); }
.btn.logged { background: var(--tint); color: var(--accent); border-color: var(--tint); }

/* Folder picker popover. */
.pop { position: relative; display: inline-block; }
.popmenu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 230px; max-width: min(300px, 80vw);
  background: var(--bg); border: 1px solid var(--field); border-radius: 6px; box-shadow: var(--shadow); padding: 8px; font-size: 14px;
}
.popmenu label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.popmenu label:hover { background: var(--tint-soft); }
.popmenu input[type=checkbox] { accent-color: var(--accent); }
.popmenu form { display: flex; gap: 6px; margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 8px; }
.popmenu form input { padding: 5px 8px; font-size: 13px; }
.popmenu form .button { padding: 5px 10px; font-size: 13px; }

/* Callouts and notices. */
.callout { background: var(--tint); border-radius: 4px; padding: 12px 14px; font-size: 14px; color: var(--body); line-height: 1.55; margin: 14px 0; }
.callout strong { color: var(--ink); }
.okline { display: flex; gap: 10px; align-items: flex-start; }
.okline .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--yes-ink); margin-top: 6px; }
.example { border: 1px dashed var(--field); border-radius: 6px; padding: 12px 14px; margin: 10px 0 0; font-size: 14px; }
.example .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.alertline { border-left: 4px solid var(--no-ink); background: var(--no-bg); padding: 8px 12px; border-radius: 0 4px 4px 0; color: var(--ink); }
.alertline .k { color: var(--no-ink); font-weight: 700; }
.empty { border: 1px dashed var(--field); border-radius: 6px; padding: 26px 20px; text-align: center; color: var(--meta); margin-top: 16px; }

/* Folders. */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 8px; }
.fcard { border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 4px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.fcard a.fname { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 16px; }
.fcard a.fname:hover { text-decoration: underline; }
.fcard .fmeta { font-size: 13px; color: var(--meta); }
.fcard .actions { margin-top: auto; padding-top: 6px; font-size: 13px; gap: 14px; }
.fcard.pinned { border-top-color: var(--save-ink); background: var(--tint-soft); }
.chip .n { font-weight: 400; opacity: .75; margin-left: 2px; }
.newform { display: flex; gap: 8px; flex-wrap: wrap; max-width: 520px; margin-top: 8px; }
.newform input { flex: 1 1 220px; }
.confirm { background: var(--no-bg); border: 1px solid var(--no-bd); border-radius: 6px; padding: 12px 14px; margin-top: 12px; font-size: 14px; color: var(--ink); }
.confirm .actions { margin-top: 10px; }

/* CPD. */
.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 6px 0 4px; }
.stat .v { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .k { font-size: 13px; color: var(--meta); }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .cite { font-weight: 600; color: var(--accent); text-decoration: none; }
td .refl { color: var(--body); margin-top: 4px; }
td .none { color: var(--muted); font-style: italic; }
.status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.ok { color: var(--yes-ink); }
.status.wait { color: var(--pre-ink); }
.rowactions { display: flex; gap: 12px; font-size: 13px; white-space: nowrap; }
.inline-field { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; }

/* Plans and subscription. */
.current { border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 4px; padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.current .pname { font-size: 18px; font-weight: 700; color: var(--accent); }
.current .pmeta { font-size: 14px; color: var(--meta); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.plan { border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 4px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.plan.is-current { border-color: var(--accent); box-shadow: var(--shadow); }
.plan .name { font-size: 17px; font-weight: 700; color: var(--accent); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.plan .price { font-size: 14px; font-weight: 600; color: var(--meta); font-variant-numeric: tabular-nums; }
.plan ul { padding-left: 18px; margin: 0; font-size: 14px; }
.plan .inherit { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.plan li { margin-bottom: 4px; }
.plan .actions { margin-top: auto; padding-top: 6px; }
.toggle { display: inline-flex; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; }
.toggle button { border: 0; background: var(--bg); color: var(--meta); padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.stripe { border: 1px solid var(--field); border-radius: 6px; padding: 14px 16px; margin-top: 14px; background: var(--tint-soft); }
.stripe h3 { margin-bottom: 4px; }
.stripe p { margin: 0 0 10px; font-size: 14px; }
.stripe .small { font-size: 12px; color: var(--meta); margin: 10px 0 0; }

.products { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.product { border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; }
.product.on { border-color: var(--accent); background: var(--tint-soft); }
.product.soon { opacity: .62; }
.product input { margin-top: 4px; accent-color: var(--accent); }
.product .pl { font-weight: 700; color: var(--accent); }
.product .pd { font-size: 13px; color: var(--body); }
.product .side { font-size: 12px; color: var(--meta); text-align: right; white-space: nowrap; }
.product .size { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--meta); }
.product .size .est { font-variant-numeric: tabular-nums; }
.included { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--yes-ink); }

.settings { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--rule); border-radius: 6px; margin-top: 8px; }
.setting { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.setting:last-child { border-bottom: 0; }
.setting > div:first-child { min-width: 0; flex: 1 1 280px; }
.setting .k { font-weight: 600; color: var(--ink); }
.setting .d { font-size: 13px; color: var(--meta); }
.setting label.k { display: block; margin-bottom: 4px; }
.setting input[type=text], .setting input[type=email] { width: 100%; max-width: 360px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--field); border-radius: 999px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Home: the digest, with summary tiles down the right; on narrower screens
   the tiles move above the digest as a row (one column on phones). */
.homegrid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 28px; align-items: start; margin-top: 4px; }
.homegrid .tiles { grid-column: 2; grid-row: 1; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 12px; }
.homemain { grid-column: 1; grid-row: 1; min-width: 0; }
.homemain > .suggest:first-child { margin-top: 0; }
/* Narrower: "To rate" above the digest (it drives rating), CPD and retraction
   alerts below it, so the top of the page is the digest (Tom, 2026-10-24). */
@media (max-width: 1100px) {
  .homegrid { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .homegrid .tiles { display: contents; }
  .homegrid .t-rate { order: 0; }
  .homemain { order: 1; }
  .homegrid .t-low { order: 2; }
  .homegrid .tile { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; }
  .homegrid .tile .tk { flex-basis: 100%; }
  .homegrid .tile .tv { font-size: 20px; }
}
@media (max-width: 520px) {
  .homegrid .tile { padding: 10px 12px; }
  .homegrid .tile .tk { flex-basis: 100%; }
  .homegrid .tile .tv { font-size: 20px; }
}
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--rule);
  border-top: 3px solid var(--accent); border-radius: 4px; text-decoration: none; color: var(--body); min-width: 0;
}
a.tile:hover { background: var(--tint-soft); }
.tile .tk { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile .tv { font-size: 24px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.25; }
.tile .tv.ok { color: var(--yes-ink); }
.tile .td { font-size: 13px; color: var(--meta); }
.tile .tf { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tf:hover { text-decoration: underline; }

/* Digest-size slider: stops only at the score ladder's rungs. */
.dial { flex-direction: column; align-items: stretch !important; gap: 4px !important; max-width: 460px; }
.dialhead { display: flex; justify-content: space-between; gap: 12px; color: var(--meta); }
.dialhead label { font-weight: 600; color: var(--ink); }
.dialhead .est { font-weight: 700; color: var(--accent); }
.dial input[type=range] { width: 100%; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.ticks { display: flex; justify-content: space-between; padding: 0 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick { position: relative; min-width: 1.4em; text-align: center; }
.tick.on { color: var(--accent); font-weight: 700; }
.tick.cal::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.dialfoot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.calmark { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* A suggestion from the near-miss signal: the reader decides. */
.suggest { background: var(--tint); border-left: 4px solid var(--accent); border-radius: 0 4px 4px 0; padding: 12px 14px; margin: 14px 0; color: var(--body); font-size: 14px; }
.suggest p { margin: 0 0 10px; }
.suggest strong { color: var(--ink); }
.product .size .suggest { margin: 6px 0 0; width: 100%; }

input.code { font: 600 22px/1.2 var(--mono); letter-spacing: .3em; text-align: center; }

/* Sign-in. */
.signin { max-width: 440px; margin: 40px auto 80px; }
.signin .panel { border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 4px; padding: 26px 24px; }
.signin form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.signin label { font-weight: 600; color: var(--ink); font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* Dialogs. */
dialog {
  border: 0; border-radius: 8px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: var(--shadow); color: var(--body); background: var(--bg);
}
dialog::backdrop { background: rgba(26, 47, 77, .35); }
.dhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 0; }
.dhead h3 { font-size: 18px; margin: 0; }
.dclose { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--meta); cursor: pointer; padding: 4px; }
.dbody { padding: 10px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.dbody .cite { font-size: 14px; color: var(--meta); }
.dbody .cite strong { color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; padding: 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; font-size: 14px; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--tint-soft); }
.radio input { margin-top: 4px; accent-color: var(--accent); }
.radio .rl { font-weight: 600; color: var(--ink); }
.radio .rd { display: block; font-size: 13px; color: var(--meta); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.minutes { display: flex; flex-wrap: wrap; gap: 6px; }
.preview { font: 12px/1.5 var(--mono); background: var(--tint-soft); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; max-height: 220px; overflow: auto; white-space: pre; color: var(--ink); margin: 0; }
.warn { font-size: 13px; color: var(--pre-ink); background: var(--pre-bg); border-radius: 4px; padding: 8px 10px; }

/* Toast. */
.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--on-accent); font-size: 14px; border-radius: 6px; padding: 10px 16px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

footer { border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
footer .gutter { padding-block: 14px 28px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  /* minmax(0, 1fr), not 1fr: a plain 1fr column grows to the tab strip's full
     length (~600px) and stretches the whole page on phones. */
  .shell { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rail { position: static; min-width: 0; }
  .rail nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); position: relative; }
  /* iPhones zoom into any field set below 16px and stay zoomed after typing;
     16px stops the zoom happening at all. */
  input[type=text], input[type=email], input[type=search], select, textarea,
  .popmenu form input { font-size: 16px; }
  .rail a { flex: none; border-left: 0; border-bottom: 3px solid transparent; border-radius: 4px 4px 0 0; }
  .rail a[aria-current="page"] { border-bottom-color: var(--accent); }
  .rail .group, .rail .folder, .rail .newfolder { display: none; }
  .plans { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  /* Anchor folder menus to the paper (or the selection bar), not the button,
     so a button near the right edge can't push the menu off-screen. */
  .pop { position: static; }
  .row > div { position: relative; }
  .popmenu { left: 0; right: 0; max-width: none; min-width: 0; }
  .row { grid-template-columns: 20px minmax(0, 1fr); padding-right: 0; }
  .btn.save, .btn.cpd { margin-left: 0; }
  .product { grid-template-columns: 22px minmax(0, 1fr); }
  .product .side { grid-column: 2; text-align: left; }
  .product .size { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
