/* ModuGlyph cabinet: one small design system for every product page.
   Tokens first, then layout, then components. Pages add no CSS of their own and
   no colours: a new look is a new :root block plus, at most, component tweaks.
   The direction is described in docs/design/style-e.md. */

:root {
  --bg: #f1f0ec;
  --surface: #f8f7f4;
  --text: #2e2d2b;
  --muted: #6f6c66;
  --line: #dad7d0;
  --line-strong: #cfccc5;
  --accent: #4e6a85;
  --accent-strong: #3a516a;
  --accent-text: #ffffff;
  --ok: #456f51;
  --ok-bg: #e6ece6;
  --warn: #826336;
  --warn-bg: #f0e9dc;
  --danger: #8f3b33;
  --danger-bg: #f2e3e1;
  --slot-bg: #e4e2dc;
  --slot-line: #d2cfc8;
  --slot-pad: 14px;
  /* The two colours of a code's squares, wherever the interface draws squares itself. */
  --module-dark: #000000;
  --module-light: #ffffff;
  --radius: 8px;
  --radius-control: 6px;
  /* The only spacing values: inside controls 8/12, between fields 16, card padding
     and page gutters 24, section rhythm 32, narrow-page top 48. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --gap: var(--s4);
  --shadow: none;
  --font: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: var(--font); font-size: 15px; line-height: 22px; color: var(--text); }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
/* Headings and paragraphs carry no margins: spacing comes from the parent's gap. */
h1 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; line-height: 22px; font-weight: 600; margin: 0; }
p { margin: 0; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 20px; }

/* Layout */
.topbar {
  display: flex; align-items: center; gap: var(--s5);
  padding: var(--s3) var(--s5); background: var(--bg); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-line { text-align: center; }
.brand-line .brand { font-size: 18px; }
.nav { display: flex; gap: var(--s2); flex: 1; }
.nav a {
  padding: var(--s2) var(--s3); border-radius: var(--radius-control);
  color: var(--muted); text-decoration: none; font-size: 14px; line-height: 20px;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.page { max-width: 960px; margin: 0 auto; padding: var(--s6) var(--s5) 64px; outline: none; }
.page.narrow { max-width: 440px; padding-top: var(--s7); }
.page.narrow > .stack { gap: var(--s5); }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4);
  margin-bottom: var(--s5); flex-wrap: wrap;
}
.titles { display: grid; gap: var(--s1); min-width: 0; }
.stack { display: grid; gap: var(--gap); align-content: start; }
.stack.tight { gap: var(--s3); }
.stack > * { min-width: 0; }
.stack > .button:not(.block), .stack > button:not(.block) { justify-self: start; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.push { margin-left: auto; }
.footnote { margin-top: var(--s4); }
.split { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: var(--s5); }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.tabs a {
  padding: var(--s2) var(--s3); color: var(--muted); text-decoration: none; font-size: 14px;
  line-height: 20px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); font-weight: 500; }

/* Account menu */
.menu { position: relative; }
.menu-button {
  background: none; border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: var(--s2) var(--s3); font: inherit; font-size: 13px; line-height: 20px;
  color: var(--text); cursor: pointer;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-button:hover { border-color: var(--line-strong); }
.menu-items {
  position: absolute; right: 0; top: calc(100% + var(--s2)); min-width: 180px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s2); display: grid;
}
.menu-items a, .menu-items button {
  text-align: left; padding: var(--s2) var(--s3); border-radius: var(--radius-control); border: 0;
  background: none; font: inherit; font-size: 14px; line-height: 20px; color: var(--text);
  text-decoration: none; cursor: pointer;
}
.menu-items a:hover, .menu-items button:hover { background: var(--bg); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s5); box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }
.form-card { max-width: 560px; }
.badge.after { margin-left: var(--s2); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--radius-control);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.button:disabled { opacity: 0.55; cursor: default; }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--bg); color: var(--text); }
.button.danger { background: var(--surface); color: var(--danger); border-color: var(--line-strong); }
.button.danger:hover { background: var(--danger-bg); color: var(--danger); }
.button.small { min-height: 32px; padding: 0 var(--s3); font-size: 13px; }
.button.block { width: 100%; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: var(--accent-strong); }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Forms */
.field { display: grid; gap: var(--s2); }
.field > span { font-weight: 500; font-size: 14px; line-height: 20px; }
.field small { color: var(--muted); font-size: 13px; line-height: 20px; }
.optional { color: var(--muted); font-weight: 400; }
/* A field for programs only, see the sign-up form. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
input, select {
  width: 100%; padding: var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-control); font: inherit; font-size: 15px; line-height: 20px;
  background: var(--surface); color: var(--text);
}
/* A file field: a button-looking label with the chosen name beside it. The
   input lies over the whole field, invisible, so a click anywhere opens the
   chooser and the browser's validation and focus ring still land on it. */
.file-field { position: relative; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; min-height: 44px; }
.file-field .button { pointer-events: none; }
.file-name { font-size: 14px; line-height: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; opacity: 0; cursor: pointer; }
.file-field:focus-within .button { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Every dropdown is drawn the same way: the height, radius and type of a button,
   and a caret of its own with room beside the text. */
select {
  min-height: 44px; padding: 0 var(--s6) 0 var(--s3); cursor: pointer;
  font-size: 14px; font-weight: 500; appearance: none; -webkit-appearance: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236f6c66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s3) center; background-size: 12px 8px;
}
.row > select { width: auto; flex: 0 1 auto; max-width: 100%; }
.caption { font-weight: 500; font-size: 14px; line-height: 20px; white-space: nowrap; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, .button:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[readonly] { background: var(--bg); color: var(--muted); }

/* Feedback */
.alert {
  padding: var(--s3) var(--s4); border-radius: var(--radius-control); font-size: 14px;
  line-height: 20px; border: 1px solid transparent;
}
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--warn-bg); color: var(--warn); }
.badge {
  display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; line-height: 20px;
  color: var(--muted); white-space: nowrap;
}
.badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
  flex: none;
}
.badge.ok { color: var(--ok); }
.badge.ok::before { background: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.warn::before { background: var(--warn); }
.badge.danger { color: var(--danger); }
.badge.danger::before { background: var(--danger); }
.empty { text-align: center; padding: var(--s7) var(--s5); justify-items: center; }
.empty p { color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line);
  border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* The slot: every QR picture sits on its own mat. Whatever the code looks like
   stays inside; the interface never paints in a slot and takes no colour from it.
   Buttons, captions and badges sit outside. */
.slot {
  background: var(--slot-bg); border: 1px solid var(--slot-line); border-radius: var(--radius);
  padding: var(--slot-pad); display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1;
}
.slot.selected { border: 2px solid var(--accent); padding: calc(var(--slot-pad) - 1px); }
.slot > img, .slot > svg {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
  image-rendering: pixelated;
}
.slot.thumb { --slot-pad: 6px; width: 64px; border-radius: var(--radius-control); flex: none; }
.slot.mini { --slot-pad: 4px; width: 44px; border-radius: var(--radius-control); flex: none; }
.slot-meta {
  display: flex; justify-content: space-between; gap: var(--s3); font-family: var(--mono);
  font-size: 11px; line-height: 16px; color: var(--muted); padding: var(--s2) var(--s1) 0;
}

/* The picture editor: the picture under its crop window beside the prepared
   picture. Both are slots; every control sits outside them. */
.editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: start; }
.editor h3, .editor-card h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.crop-window {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--module-light);
  touch-action: none; cursor: grab; user-select: none;
}
.crop-window.dragging { cursor: grabbing; }
.crop-window.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.replace-picture { cursor: pointer; }
.replace-picture:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-window:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-window > img { position: absolute; max-width: none; pointer-events: none; }
.modules-slot > .modules { cursor: pointer; }
.modules-slot > .modules.bare { cursor: default; }
/* The upload target: the picture's slot before there is a picture. The input lies
   over it, so a click anywhere opens the chooser; a drop raises the border. */
.slot.upload { position: relative; border-style: dashed; }
.slot.upload.over { border-color: var(--accent); background: var(--surface); }
.upload-words { display: grid; gap: var(--s2); justify-items: center; text-align: center; }
.upload-words .button { pointer-events: none; }
.slot.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot.upload > img { object-fit: cover; }
.modules rect.on { fill: var(--module-dark); }
.modules rect.off { fill: var(--module-light); }
.modules rect.locked { cursor: not-allowed; }
.modules.pencil { cursor: crosshair; touch-action: none; }
/* A pencil for a pointer that hovers; its tip is the hot spot. */
@media (hover: hover) {
  .modules.pencil {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M2 18l1.2-4.6L13.6 3l3.4 3.4L6.6 16.8z' fill='%23ffffff' stroke='%232e2d2b' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M2 18l1.2-4.6 3.4 3.4z' fill='%232e2d2b'/%3E%3Cpath d='M11.8 4.8l3.4 3.4' stroke='%232e2d2b' stroke-width='1.4'/%3E%3C/svg%3E") 2 18, crosshair;
  }
}
.pencil-tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.modules rect.hatch { pointer-events: none; opacity: 0.55; }
/* While an answer is on its way the fixed squares may be about to move. */
.modules-slot.pending rect.hatch { opacity: 0.2; }
.modules .hatch-line { fill: var(--muted); }
.modules rect.edit-mark { fill: none; stroke: var(--accent); stroke-width: 0.16; pointer-events: none; }
.editor-tools .check { margin-left: auto; }
.editor-tools .button.small, .pencil-tool.button.small { min-height: 44px; }
.zoom { display: flex; align-items: center; gap: var(--s3); }
.zoom > input { flex: 1 1 auto; min-width: 0; }
.turn-tools { display: inline-flex; align-items: center; gap: var(--s2); }
.turn-tools .turn-arrow { min-height: 44px; min-width: 44px; padding: 0; font-size: 20px; line-height: 1; }
/* The tools in one row under both pictures: turn, pencil, zoom, undo. The row
   never wraps; the zoom slider takes what is left, and undo comes at the end
   so that the row does not shift when it appears. */
.editor > .toolbar, .editor > .caption-line, .editor > .editor-tools, .editor > .editor-help { grid-column: 1 / -1; }
.toolbar { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.toolbar > .zoom { flex: 1 1 120px; min-width: 0; }
.toolbar > .link-button { flex: none; }
.caption-line { justify-content: flex-start; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; padding-top: 0; }
.caption-line > .link-button { font-family: var(--font); font-size: 12px; }
/* The separator travels with the turn caption, so a wrap never leaves it alone. */
.caption-line > .turn-part { white-space: nowrap; }
.editor > .editor-tools .check { margin-left: 0; }
.editor-help > summary { font-size: 13px; }
.editor-help > p { margin: var(--s2) 0 0; }
.editor-go { align-items: center; gap: var(--s3) var(--s4); }
.editor-go > label { display: inline-flex; align-items: center; gap: var(--s3); min-width: 0; }
.editor-go > label > select { min-width: 0; flex: 1 1 auto; }
input[type="range"] {
  width: 100%; min-height: 44px; padding: 0; margin: 0; border: 0; background: none;
  accent-color: var(--accent); cursor: pointer;
}

/* Asset list */
.asset-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--s5);
  align-items: center; padding: var(--s4) var(--s5); text-decoration: none; color: inherit;
  border-top: 1px solid var(--line);
}
.asset-row:first-child { border-top: 0; }
.asset-row:hover { background: var(--bg); color: inherit; }
.asset-name {
  font-weight: 500; line-height: 22px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-destination {
  color: var(--muted); font-size: 13px; line-height: 20px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.asset-meta {
  text-align: right; display: grid; gap: var(--s1); justify-items: end; font-size: 13px;
  line-height: 20px; color: var(--muted);
}

/* QR options: four across on a full page, never fewer than two across. */
.choices {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(min(180px, calc(50% - 8px)), 1fr));
}
/* Options under the prepared picture they were shaped after:
   source -> prepared picture -> QR options. A group is one cell of the option grid. */
.derivation { display: grid; gap: var(--s2); min-width: 0; align-content: start; }
.derivation.two { grid-column: span 2; }
.derivation.wide { grid-column: 1 / -1; }
/* A code that is not made yet: the mat, nothing on it. */
.placeholder { display: grid; gap: var(--s2); min-width: 0; align-content: start; }
.placeholder > .slot { border-style: dashed; }
/* The source thumbnail sits beside the first line, not in the middle of the paragraph. */
.lineage { align-items: flex-start; }
.explain > p { margin: 0; }
/* A disclosure, not a link: a chevron that turns when it is open. */
.aside > summary { cursor: pointer; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: var(--s1); }
.aside > summary::-webkit-details-marker { display: none; }
.aside > summary::before { content: "\25B8"; font-size: 12px; transition: transform 0.15s; }
.aside[open] > summary::before { transform: rotate(90deg); }
.aside > p { margin: var(--s2) 0 0; }
.figure { display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.figure .badge { display: flex; white-space: normal; }
.explain { flex: 1 1 240px; }
.choice { display: grid; gap: var(--s2); min-width: 0; align-content: start; }
.choice-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--s2); font-size: 13px; line-height: 20px; color: var(--muted);
}
.choice-foot > * { white-space: nowrap; }
.url {
  font-family: var(--mono); font-size: 12px; line-height: 20px; overflow-wrap: anywhere;
  background: var(--bg); border: 1px solid var(--line); padding: var(--s2) var(--s3);
  border-radius: var(--radius-control);
}
.tech { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.history {
  border-top: 1px solid var(--line); padding: var(--s3) 0; display: flex; gap: var(--s3);
  align-items: center; flex-wrap: wrap; font-size: 14px; line-height: 20px;
}
.history:first-child { border-top: 0; padding-top: 0; }
.history:last-child { padding-bottom: 0; }
.history-label { min-width: 104px; }
.history > .choices, .history > .row { flex-basis: 100%; }
.alert.stack .row { flex-wrap: nowrap; align-items: flex-start; }
/* Cards side by side while there is room: the overview of the admin section. */
.split-even { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.row > input:not([type="checkbox"]) { width: auto; flex: 1 1 180px; }
.account { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.account:first-child { border-top: 0; }
.session {
  display: flex; justify-content: space-between; gap: var(--s3); align-items: center;
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.session > div { min-width: 0; }
.session > .button { white-space: nowrap; flex: none; }
.session:first-child { border-top: 0; padding-top: 0; }
.session:last-child { padding-bottom: 0; }

/* Scan analytics: tiles, the chart, breakdown bars, the filter controls, the table. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); }
.tile {
  display: grid; gap: var(--s1); min-width: 0; padding: var(--s3) var(--s4); border: 1px solid var(--line);
  border-radius: var(--radius-control); background: var(--bg);
}
.tile-value { font-size: 22px; line-height: 28px; font-weight: 600; }
.tile-label { font-size: 13px; line-height: 20px; font-weight: 500; }
.tile-hint { font-size: 12px; line-height: 16px; color: var(--muted); }
.chart { margin: 0; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar.empty { fill: var(--line); }
.chart .bar.active { fill: var(--accent-strong); }
.chart .hit { fill: transparent; outline: none; }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart-tip {
  position: absolute; top: 0; display: grid; gap: var(--s1); padding: var(--s2) var(--s3);
  font-size: 13px; line-height: 20px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; z-index: 2;
}
.bars { display: grid; gap: var(--s2); }
.bar-row {
  display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) auto; gap: var(--s3);
  align-items: center; font-size: 14px; line-height: 20px;
}
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: var(--slot-bg); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-count {
  font-size: 13px; line-height: 20px; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: flex-end; }
.controls .field { min-width: 160px; }
.check {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px;
  font-size: 14px; line-height: 20px; cursor: pointer;
}
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--accent); }
input[type="date"], input[type="search"] { min-height: 44px; }
.picker { position: relative; min-width: 240px; }
.picker > summary {
  list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center;
  padding: 0 var(--s6) 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  background: var(--surface); font-size: 14px; font-weight: 500; line-height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236f6c66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s3) center; background-size: 12px 8px;
}
.picker > summary::-webkit-details-marker { display: none; }
.picker-body {
  position: absolute; z-index: 4; top: calc(100% + var(--s2)); left: 0; min-width: 300px;
  max-width: 90vw; padding: var(--s3); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.picker-body .row > input[type="search"] { flex: 1; width: auto; min-width: 140px; }
.picker-list { max-height: 240px; overflow: auto; display: grid; gap: var(--s1); }
.picker-item {
  display: flex; gap: var(--s2); align-items: center; min-height: 32px; padding: 0 var(--s1);
  cursor: pointer; font-size: 14px; line-height: 20px;
}
.picker-item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results.loading { opacity: 0.5; transition: opacity 0.2s; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.card.flush.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th, .table td { padding: var(--s3) var(--s5); text-align: left; border-top: 1px solid var(--line); }
.table th { font-size: 13px; color: var(--muted); font-weight: 500; border-top: 0; }
.table th.num, .table td.num { text-align: right; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* The landing: /login and /signup carry the product's public page beside the form.
   The form's column stays in sight while the text scrolls. */
.landing { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s6); align-items: start; }
.landing-text { gap: var(--s6); }
.landing-text .brand { font-size: 18px; }
.landing b { font-weight: 600; }
.landing-form { position: sticky; top: var(--s5); }
.hero { font-size: 28px; line-height: 36px; letter-spacing: -0.02em; }
.hero, .hero + p { max-width: 560px; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.example { display: grid; gap: var(--s2); }
.example .slot { --slot-pad: 10px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.step { display: grid; gap: var(--s1); align-content: start; }
.step b { font-size: 14px; }
.step span { font-size: 13px; line-height: 20px; color: var(--muted); }
.footer-links { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 13px; }

/* One column: the form first, for those who come back to sign in. */
@media (max-width: 960px) {
  .landing { grid-template-columns: 1fr; }
  .landing-form { position: static; order: -1; }
  .hero { font-size: 24px; line-height: 30px; }
}

/* The phone layout is this set of overrides and nothing else. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: var(--s3); padding: var(--s3) var(--s4); }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav a { flex: none; }
  .nav a, .tabs a, .menu-items a, .menu-items button { padding-top: var(--s3); padding-bottom: var(--s3); }
  .menu { margin-left: auto; }
  .menu-button { max-width: 160px; padding-top: 11px; padding-bottom: 11px; }
  .page { padding: var(--s5) var(--s4) var(--s7); }
  .page.narrow { padding-top: var(--s5); }
  .page-head { margin-bottom: var(--s4); }
  .card { padding: var(--s4); }
  .card.flush { padding: 0; }
  .split { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  /* `width: 100%`: an auto-margined grid item shrinks to its content, and the
     crop window has none of its own (the picture inside is absolutely placed). */
  .editor .slot { width: 100%; max-width: 320px; margin: 0 auto; }
  .editor .slot-meta { max-width: 320px; margin: 0 auto; }
  .editor-tools .check { margin-left: 0; }
  /* Zoom is a pinch on the picture: the slider goes, the row keeps 44px targets. */
  .toolbar > .zoom { display: none; }
  .toolbar > .link-button { margin-left: auto; }
  .split .slot:not(.thumb):not(.mini) { max-width: 320px; margin: 0 auto; }
  .split .slot-meta { max-width: 320px; margin: 0 auto; }
  .choices { gap: var(--s3); }
  .figure .slot.thumb { width: 52px; --slot-pad: 5px; }
  .row > select { flex: 1 1 100%; }
  .choice-foot .button { flex: 1 1 auto; }
  .button.small { min-height: 44px; }
  .link-button { min-height: 44px; display: inline-flex; align-items: center; }
  .row > .button:not(.small) { flex: 1 1 auto; }
  .asset-row { grid-template-columns: 52px minmax(0, 1fr); gap: var(--s3); padding: var(--s3) var(--s4); }
  .asset-row .slot.thumb { --slot-pad: 5px; width: 52px; }
  .asset-meta {
    grid-column: 2; text-align: left; justify-items: start; grid-auto-flow: column;
    justify-content: start; gap: var(--s3);
  }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { padding: var(--s3); }
  /* The Generate row: the button, then the choice, then the note, each on a line. */
  .editor-go > label { flex: 1 1 100%; }
  .editor-go > .small { flex-basis: 100%; }
  /* A line of the history: its label and "Show" on the first line, the date under them. */
  .history { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s1); }
  .history-label { min-width: 0; grid-column: 1; grid-row: 1; }
  .history > .push { grid-column: 2; grid-row: 1; }
  .history > .small:not(.history-label), .history > .choices, .history > .row { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-row .bar-track { grid-column: 1 / -1; }
  .controls .field, .controls .picker, .controls .check { flex: 1 1 100%; }
  .picker-body { min-width: 0; width: 100%; }
  .table th, .table td { padding: var(--s2) var(--s3); }
  .examples { gap: var(--s3); }
  .steps { grid-template-columns: 1fr; }
}
