/* Studbook — the web view.
 *
 * Same palette as the native client (mobile/src/theme.ts). Dark by default for
 * the same reason: this gets opened standing in a loft or a garage as often as
 * at a desk.
 *
 * One stylesheet, no framework, no build step. The image bakes these files in,
 * so a change here needs a rebuild — which is also why there is no bundler to
 * go wrong. */

:root {
  --bg: #12131a;
  --surface: #1d1f2a;
  --surface-alt: #262936;
  --text: #f2f3f7;
  --faint: #8a8fa3;
  --accent: #ffcf3f;
  --good: #4ade80;
  --danger: #f87171;
  --border: #2f3342;

  /* THE ELEMENT COLOURS, under the names LEGO gives them.
   *
   * Named for the plastic rather than for the role — `--brick-red` and not
   * `--danger-brick` — because a brick is a physical thing here and the same
   * red is the delete button and a 3001 in somebody's collection. Roles are
   * mapped onto these below, so a role can move to a different colour without
   * a token whose name then lies about its value. */
  --brick-yellow: #f5cd2f;
  --brick-red:    #c4281b;
  --brick-blue:   #0d6ecd;
  --brick-green:  #3f9c35;
  --brick-grey:   #545861;   /* dark stone grey, the app's default element */
  --brick-black:  #22252f;
  --brick-orange: #d67923;
  --brick-lime:   #a5ca18;
  --brick-purple: #6b3fa0;
  --brick-azure:  #078bc9;
  --brick-tan:    #dec69c;
  --brick-white:  #f2f3f7;

  /* THE SHELF COLOURS — the darker family, and a separate list on purpose.
   *
   * Rows carry text in --text and --faint, and those two are fixed. A row in
   * bright yellow or lime would need its own text colour and its own faint,
   * which is four more values per colour and a contrast question each time.
   * These are all dark enough that the app's existing two work on every one of
   * them, so a row can be any colour in the list and nothing else has to move.
   *
   * Saturation is what carries "different bricks" here, not brightness. The
   * bright plastic stays on the chrome, where this file already sets the text
   * colour by hand. */
  --shelf-1: #545861;   /* dark stone grey */
  --shelf-2: #234a7d;   /* earth blue */
  --shelf-3: #7a2a22;   /* dark red */
  --shelf-4: #2f5d34;   /* earth green */
  --shelf-5: #5a3b28;   /* reddish brown */
  --shelf-6: #4a3568;   /* dark purple */
  --shelf-7: #235c5c;   /* dark turquoise */
  --shelf-8: #2b2f3d;   /* dark bluish grey */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jNNNDU2IDE0NC41aDQ3TTU1MiAxNDQuNWgyM00yNCAxNjguNWg0N003MiAxNjguNWg0N00xMjAgMTY4LjVoNzFNMjQwIDE2OC41aDIzTTMxMiAxNjguNWgyM000MDggMTY4LjVoNDdNNDU2IDE2OC41aDQ3TTAgMTkyLjVoMjNNMTkyIDE5Mi41aDIzTTIxNiAxOTIuNWgyM00yNjQgMTkyLjVoNDdNMzM2IDE5Mi41aDQ3TTM4NCAxOTIuNWgyM00xMjAgMjE2LjVoNzFNMjQwIDIxNi41aDk1TTQ1NiAyMTYuNWg3MU01MjggMjE2LjVoMjNNMCAyNDAuNWgyM00yMTYgMjQwLjVoMjNNNDA4IDI0MC41aDQ3TTUyOCAyNDAuNWgyM001NTIgMjQwLjVoMjNNMCAyNjQuNWg5NU05NiAyNjQuNWg0N00xNDQgMjY0LjVoMjNNMTY4IDI2NC41aDIzTTIxNiAyNjQuNWgyM00yNDAgMjY0LjVoOTVNMzM2IDI2NC41aDIzTTM2MCAyNjQuNWgyM000NTYgMjY0LjVoNDdNNTA0IDI2NC41aDIzIi8+PC9zdmc+');
  --baseplate-size: 576px 288px;

  /* GEOMETRY. One set of numbers, because a brick that is a different depth in
   * two places stops reading as the same moulding. `--stud` is the diameter and
   * `--stud-gap` the centre-to-centre pitch: real bricks are 8mm pitch on a 4.8mm
   * stud, and holding roughly that ratio is most of what makes it convincing. */
  --stud: 14px;
  --stud-gap: 24px;   /* THE MODULE — see tools/brickwall.py */
  --lip: 5px;            /* the moulded bottom edge, the thing that says 3D */
  --brick-radius: 6px;   /* LEGO corners are barely rounded. Resist rounding. */
}

* { box-sizing: border-box; }

body {
  color: var(--text);
  /* `ui-rounded` first for the one platform that has a rounded system face.
   * Everywhere else this falls straight through to what was here before —
   * no webfont, because font-src is 'self' and a brick-shaped UI does not
   * need a download to read as one. */
  font: 15px/1.5 ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0 0 4rem;

  /* THE BASEPLATE, and it is BUILT rather than printed — a mosaic of separate
   * pieces in eight near-black colours, varying in both dimensions the way a
   * brick-built floor does, each with its own studs. It was a flat colour with
   * a grid of dots until the app in front of it was assembled out of elements,
   * at which point the background was the one surface still being a texture.
   *
   * DELIBERATELY NEARLY INVISIBLE. It sits behind everything and its job is to
   * be recognised, not read: the whole palette spans about 6% of the range
   * between the darkest and lightest value on screen. Turned up, it competes
   * with the box art it exists to sit behind. */
  background-color: var(--bg);
  background-image: var(--baseplate);
  background-size: var(--baseplate-size);
}

main { margin: 0 auto; max-width: 46rem; padding: 1.25rem; }

h1 { font-size: 1.35rem; letter-spacing: -0.3px; margin: 0; }
h2 { font-size: 1.6rem; letter-spacing: -0.4px; margin: 0 0 0.25rem; }

.muted { color: var(--faint); }
.error { color: var(--danger); min-height: 1.2em; }
.warn  { color: var(--danger); font-weight: 600; }
.ok    { color: var(--good); }

/* -- the brick ------------------------------------------------------- */

/* ONE MOULDING, USED EVERYWHERE.
 *
 * Every raised surface in this app is `.brick` plus a colour. Nothing else
 * draws its own studs or its own shadow, for the reason the palette comment
 * gives one level up: two things that are meant to be the same plastic have to
 * come out of the same mould, or the illusion goes before anyone can say why.
 *
 * THE THREE SHADOWS ARE THE WHOLE EFFECT and they are not interchangeable:
 *   1. a hairline of light along the top edge      — the moulding catches light
 *   2. an inset band of dark at the bottom, --lip  — the side wall you see
 *   3. a soft cast shadow below                    — it is sitting ON something
 * Drop (2) and it is a rounded rectangle with studs on it. (2) is why the
 * padding-bottom adds --lip: content that runs into the side wall reads as a
 * text-clipping bug rather than as depth.
 *
 * COLOUR COMES IN THROUGH --brick, one custom property, so the studs derive
 * their own highlight and rim from it with color-mix. A variant sets one value
 * and the shading follows; stating the shades by hand is three chances for a
 * stud to be a slightly different plastic from the brick under it. */

.brick,
header,
button:not(.link):not(.tab):not(.chip),
.upload, .donate,
.row, .card, .part, .sibling, .pickerrow,
.badge,
.sethead, .photocard, .picker,
.set-section,
#toast {
  /* TWO LAYERS: the plastic, and the joints between the elements it is built
     from. The overlay is alpha only, so it tints to whatever --brick is — one
     asset for every colour in the palette. See tools/brickwall.py. */
  background-color: var(--brick, var(--brick-grey));
  background-image: var(--wall);
  background-size: var(--wall-size);
  border: 0;
  border-radius: var(--brick-radius);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent),
    inset 0 calc(var(--lip) * -1) 0 color-mix(in srgb, #000 32%, transparent),
    0 3px 4px rgba(0, 0, 0, 0.45);
  color: var(--text);
  padding-bottom: calc(0.7rem + var(--lip));
  position: relative;
}

/* The studs, straddling the top edge — you are looking at the brick slightly
 * from the front, which is the angle that reads as LEGO at a glance.
 *
 * A tiled background rather than child elements: the count then follows the
 * width for free, so a brick that wraps to a phone loses studs instead of
 * overflowing them. `left`/`right` inset the row so the end studs sit inside
 * the corner radius rather than hanging off it.
 *
 * pointer-events: none because this overlaps whatever is above it, and a stud
 * that eats a click on the row above is a bug nobody would look for here. */
.brick::before,
header::before,
button:not(.link):not(.tab):not(.chip)::before,
.upload::before, .donate::before,
.row::before, .card::before, .part::before,
.sibling::before, .pickerrow::before,
.badge::before,
.sethead::before, .photocard::before, .picker::before,
.set-section::before,
#toast::before {
  background-image:
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--brick, var(--brick-grey)) 82%, #fff) 0 40%,
      color-mix(in srgb, var(--brick, var(--brick-grey)) 76%, #000) 41% 49%,
      transparent 50%);
  background-repeat: repeat-x;
  background-size: var(--stud-gap) var(--stud);
  content: "";
  height: var(--stud);
  left: 10px;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: calc(var(--stud) / -2);
}

/* The element colours. Only --brick is set: everything else derives. */
.brick.yellow { --brick: var(--brick-yellow); color: #1a1b21; }

/* -- which plastic each thing is moulded from ------------------------ */

/* The nameplate and the primary action are the yellow this app already used
 * as its accent — `theme.ts` has called #ffcf3f "LEGO yellow" since the app
 * was written, so this is that decision followed through rather than a new
 * one. Dark text on yellow, because 4.5:1 does not happen the other way. */
header,
button:not(.link):not(.tab):not(.chip),
.upload {
  --brick: var(--brick-yellow);
  color: #1a1b21;
}
.upload { color: #1a1b21; }

/* Content sits on grey. Fifty sets in fifty colours is a toy box, not a
 * collection you can read — the bright plastic is reserved for the things you
 * press and the things that are trying to tell you something. */
.row, .card, .part, .sibling, .pickerrow, .sethead, .photocard, .badge, #toast {
  --brick: var(--brick-grey);
}
.picker { --brick: var(--brick-black); }

/* Rows are PLATES. This is the line that keeps a long collection scannable:
 * same mould, a third of the depth, studs small enough to read as texture. */
.row, .card, .part, .sibling, .pickerrow, .badge {
  --lip: 3px;
  --stud: 9px;
  --stud-gap: 24px;
}

/* The picker list scrolls, so a stud straddling the top edge would be sliced
 * by the scroll container on the first row and nowhere else — an artefact that
 * looks like a rendering bug rather than a brick. Tiles are the honest answer
 * and are a real element for the same reason. */
.pickerrow::before { content: none; }

/* Meaning keeps its colours, now as plastic rather than as text alone. */
.badge.read     { --brick: var(--brick-green); color: #f2f3f7; }
.badge.searched { --brick: var(--brick-yellow); color: #1a1b21; }
.badge.guess    { --brick: var(--brick-grey); }
.card.unknown   { --brick: var(--brick-red); }
#toast.bad      { --brick: var(--brick-red); color: #fff; }
.row.unidentified { --brick: var(--brick-red); }
.row.unidentified .title { color: var(--accent); }

.brick.red    { --brick: var(--brick-red); }
.brick.blue   { --brick: var(--brick-blue); }
.brick.green  { --brick: var(--brick-green); }
.brick.black  { --brick: var(--brick-black); }

/* GREEN, and the only green brick in the app. Every other colour here already
 * means something — yellow is the primary action, red is destructive or
 * unidentified, grey is content — and this is neither an action on your
 * collection nor a warning, so it gets its own plastic rather than borrowing
 * a meaning. One element, so no wall. */
.donate {
  --brick: var(--brick-green);
  color: #f2f3f7;
  display: inline-block;
  font-weight: 700;
  margin-top: 0.4rem;
  padding: 0.6rem 1.1rem calc(0.6rem + var(--lip));
  text-decoration: none;
}
.donate:active { transform: translateY(calc(var(--lip) - 1px)); }

/* A SINGLE ELEMENT has no joints in it. Anything you press is one brick, so
 * the wall comes off — a button showing internal courses reads as a wall you
 * are pressing rather than as a piece you could pick up. */
button:not(.link):not(.tab):not(.chip),
.upload, .donate,
.sibling,
#toast {
  background-image: none;
}

/* THE SHELF. Rows cycle the darker palette so a collection reads as a shelf of
 * different sets rather than as one long extrusion.
 *
 * nth-child rather than a class per row, and that is the load-bearing part:
 * app.js builds every one of these and a colour assigned in JS would be a
 * second place the palette lives. Eight colours on a 9n cycle, so the sequence
 * shifts by one each time round and two rows the same colour never end up
 * adjacent down the list either. */
.row:nth-child(9n + 1), .card:nth-child(9n + 1) { --brick: var(--shelf-1); }
.row:nth-child(9n + 2), .card:nth-child(9n + 2) { --brick: var(--shelf-2); }
.row:nth-child(9n + 3), .card:nth-child(9n + 3) { --brick: var(--shelf-3); }
.row:nth-child(9n + 4), .card:nth-child(9n + 4) { --brick: var(--shelf-4); }
.row:nth-child(9n + 5), .card:nth-child(9n + 5) { --brick: var(--shelf-5); }
.row:nth-child(9n + 6), .card:nth-child(9n + 6) { --brick: var(--shelf-6); }
.row:nth-child(9n + 7), .card:nth-child(9n + 7) { --brick: var(--shelf-7); }
.row:nth-child(9n + 8), .card:nth-child(9n + 8) { --brick: var(--shelf-8); }
.row:nth-child(9n + 9), .card:nth-child(9n + 9) { --brick: var(--shelf-2); }

/* An unidentified set is red WHATEVER its position in the cycle. Meaning beats
 * decoration — this is the one row you are being asked to look at. */
.card.unknown { --brick: var(--brick-red); }

/* A PLATE is a brick a third of the height — same mould, shallower wall.
 * List rows are plates rather than bricks, which is the whole reason a
 * fifty-set collection still scans: the studs and the depth are still there,
 * at the size where they read as texture instead of as fifty separate toys. */
.plate {
  --lip: 3px;
  --stud: 9px;
  --stud-gap: 24px;
}

/* A SLOPE caps a section. In LEGO it is the part that stops a build ending in
 * a bare vertical wall; here it does the same job for a panel, which is the one
 * shape in this language that was still a plain rectangle.
 *
 * The facet is a triangle in a LIGHTER mix of the brick's own colour, because
 * an angled face catches more light than the top does — that shading is the
 * whole illusion, and a flat-coloured triangle just looks like a missing
 * corner. Derived from --brick with color-mix like everything else, so a slope
 * is the same plastic as the brick it sits on whatever colour that is.
 *
 * BOTH TOP CORNERS. One reads as damage; two read as a deliberate course of
 * slopes capping the section, which is how a real build ends a wall.
 *
 * A slope has NO STUDS on its angled face, so `--slope` also pulls the stud row
 * in at both ends — without that the studs run straight across the facet and
 * the corner stops being a slope and becomes a corner with a triangle on it. */
.sloped,
.sethead, .photocard, .picker {
  --slope: 30px;
  /* A slope replaces the rounded corner rather than sitting inside it. Left
     rounded, the facet's outer point floats a pixel or two off the edge and the
     whole thing reads as a stray triangle. */
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* BOTH FACETS ON ONE LAYER, and this is the second attempt.
 *
 * The first put the left facet on ::before, which is the stud row — and the
 * stud row is itself inset by --slope so the studs stay off the angled faces.
 * So the left facet drew 30px in from the corner it was supposed to be on, and
 * only the right one appeared. A rule cannot have three pseudo-elements; the
 * answer is that it does not need them. Two background layers on one full-width
 * bar, each a linear-gradient with a hard stop at 50%, is two triangles. */
.sloped::after,
.sethead::after, .photocard::after, .picker::after {
  background-image:
    linear-gradient(to bottom right,
      color-mix(in srgb, var(--brick, var(--brick-grey)) 80%, #fff) 0 50%,
      transparent 50%),
    linear-gradient(to bottom left,
      color-mix(in srgb, var(--brick, var(--brick-grey)) 80%, #fff) 0 50%,
      transparent 50%);
  background-position: left top, right top;
  background-repeat: no-repeat, no-repeat;
  background-size: var(--slope) var(--slope);
  content: "";
  height: var(--slope);
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

/* The studs stop short of both faces. A slope has none on its angled part, and
   without this they run straight across the facet and the corner stops being a
   slope and becomes a corner with a triangle on it. */
.sloped::before,
.sethead::before, .photocard::before, .picker::before {
  left: var(--slope);
  right: var(--slope);
}

/* A 1x1 ROUND STUD, as a list bullet.
 *
 * `list-style: disc` was the last unstyled mark in the app — a typographic dot
 * in a page built out of plastic. A round stud is the element LEGO uses for
 * exactly this: the smallest thing you can put down to mark a spot.
 *
 * The prose lists are the only place bullets appear, and they are set
 * descriptions from BrickLink, so the mark has to survive arbitrary text
 * lengths and wrapping — hence absolute against the line box rather than a
 * ::marker, which cannot carry a gradient in every engine. */
.proselist {
  list-style: none;
  margin: 0 0 0.6rem;
  padding-left: 1.5rem;
}
.proselist li {
  margin-bottom: 0.3rem;
  position: relative;
}
.proselist li::before {
  background:
    radial-gradient(circle at 50% 38%,
      color-mix(in srgb, var(--brick-yellow) 88%, #fff) 0 44%,
      color-mix(in srgb, var(--brick-yellow) 74%, #000) 45% 100%);
  border-radius: 50%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  content: "";
  height: 10px;
  left: -1.15rem;
  position: absolute;
  top: 0.42em;
  width: 10px;
}

/* A TILE is a brick with a smooth top. Real ones exist for the same reason
 * these do — somewhere you need the shape without the texture, usually because
 * something else has to sit flat on it. */
.tile::before { content: none; }

/* Pressing one down. The travel is exactly --lip, so the brick sinks by the
 * height of its own wall and the wall disappears — which is what pressing a
 * brick onto a plate actually looks like. */
.brick:not(:disabled):active {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
    inset 0 -1px 0 color-mix(in srgb, #000 26%, transparent),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transform: translateY(calc(var(--lip) - 1px));
}
.brick:not(:disabled):active::before { top: calc(var(--stud) / -2); }

/* Keyboard focus has to survive a surface that is already carrying three
 * shadows, so it is an outline rather than a fourth one. */
.brick:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .brick { transition: none; }
}

/* -- header ---------------------------------------------------------- */

header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  /* The top margin is the studs' clearance. Without it the first row of studs
     is cut off by the viewport, which reads as a broken image. */
  margin: calc(var(--stud) / 2 + 0.6rem) auto 1.4rem;
  /* 43.5rem, not 46rem: main is 46rem OUTER with 1.25rem of padding inside,
     so its content box is 43.5rem. Matching that is what makes the nameplate
     sit flush with the rows under it instead of overhanging them. */
  max-width: 43.5rem;
  padding: 0.9rem 1.1rem calc(0.9rem + var(--lip));
  width: calc(100% - 2.5rem);
}
header h1 { font-weight: 800; letter-spacing: 0.2px; }
/* On yellow plastic the faint grey is unreadable — this is the one place the
   role colour has to be restated rather than inherited. */
#summary { color: #4a4327; font-size: 0.85rem; font-weight: 600; margin-right: auto; }
/* `header button.link`, not `header .link`: the latter ties on specificity
   with `button.link` in the forms section below, which is LATER in the file
   and therefore wins — the header links rendered in accent yellow ON yellow
   and were invisible until this was two selectors deep.
   
   THESE ARE SEPARATE ELEMENTS CLIPPED ONTO THE NAMEPLATE, each a 1x2 plate in
   its own colour. A row of text on one yellow slab is the one place the header
   still looked printed rather than built, and it is also the place with the
   most obvious excuse for colour: four controls that do four different things.
   
   The wall comes off them for the same reason it comes off a button — one
   element, no internal joints. */
header button.link {
  background-color: var(--brick, var(--shelf-1));
  background-image: none;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -3px 0 rgba(0, 0, 0, 0.34),
    0 2px 3px rgba(0, 0, 0, 0.4);
  color: #f2f3f7;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 5px;
  padding: 0.3rem 0.55rem calc(0.3rem + 3px);
  position: relative;
}
/* Two studs each, on the 24px module like everything else. */
header button.link::before {
  background-image:
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--brick, var(--shelf-1)) 82%, #fff) 0 40%,
      color-mix(in srgb, var(--brick, var(--shelf-1)) 76%, #000) 41% 49%,
      transparent 50%);
  background-repeat: repeat-x;
  background-size: 24px 9px;
  content: "";
  height: 9px;
  left: 6px;
  pointer-events: none;
  position: absolute;
  right: 6px;
  top: -4px;
}
/* nth-of-type counts the hidden ones too, so the sequence is stable as the
   app shows and hides controls by role rather than reshuffling colours. */
header button.link:nth-of-type(1) { --brick: var(--brick-azure); }
header button.link:nth-of-type(2) { --brick: var(--shelf-6); }
header button.link:nth-of-type(3) { --brick: var(--shelf-4); }
header button.link:nth-of-type(4) { --brick: var(--shelf-1); }
header button.link:nth-of-type(5) { --brick: var(--brick-red); }
header button.link:active { transform: translateY(3px); }

/* -- forms ----------------------------------------------------------- */

form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }

/* A SOCKET, not a brick. Everything you press stands proud; everything you
   type into is moulded into the baseplate, so the two are never confused by
   shape alone. Same trick as the brick in reverse: the light is at the bottom
   and the shadow at the top. */
input, select, textarea {
  background: #0e0f15;
  border: 1px solid #05060a;
  border-radius: var(--brick-radius);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.65),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  padding: 0.7rem 0.8rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
}

button {
  /* `border: 0` stays here rather than moving to .brick: a .link button is
     excluded from the brick and would otherwise come back wearing the user
     agent's default button border, which is what happened. */
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1rem calc(0.75rem + var(--lip));
}
button:disabled { cursor: default; opacity: 0.55; }

/* Excluded from the brick by :not(.link) — a text link is not a moulding, and
   giving every one of these studs would put a toy box in the header. */
button.link {
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-weight: 400;
  padding: 0;
}

.toolbar { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.toolbar input { flex: 1; }

/* -- sorting and filtering the collection ---------------------------- */

/* A CHIP IS NOT A BUTTON, for the same reason a tab is not: the app's button
   rule paints a filled accent block, and ten of those in a row reads as ten
   primary actions rather than as a set of switches. Hence `:not(.chip)` on
   the four brick selectors above — the exclusion list this file already keeps
   for `.link` and `.tab`. */

#collectioncontrols { margin-bottom: 1rem; }

.controlrow {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
/* The text box takes what is left; the two menus size to their content so a
   long theme name does not squeeze the thing people type into. */
.controlrow input { flex: 1 1 14rem; min-width: 0; }
.controlrow select { flex: 0 1 auto; width: auto; }
#collorder {
  flex: 0 0 auto;
  font-size: 1.1rem;
  /* A glyph that changes between two characters of different widths would
     shift the row under a press. */
  min-width: 2rem;
  text-align: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  background: #191b23;
  border: 0;
  border-radius: 999px;
  color: var(--faint);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
}
.chip:hover { background: #22252f; color: var(--text); }
.chip.on {
  background: var(--brick-yellow);
  color: #1a1b21;
}
/* Drawn, and drawn as nothing to press. The count is still the answer to "how
   many of these do I have", which is worth showing even when it is none. */
.chip.none { opacity: 0.45; }
.chip.clear {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
}
.chip.clear:hover { background: #22252f; }

.upload {
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 1rem calc(0.75rem + var(--lip));
  white-space: nowrap;
}

/* -- rows and cards -------------------------------------------------- */

ul { list-style: none; margin: 0; padding: 0; }

.row, .card {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  /* The gap is the studs' room. A plate's studs are 10px, so half of one
     clears the plate above and the stack reads as stacked rather than as
     overlapping. */
  margin-bottom: calc(0.5rem + var(--stud) / 2);
  padding: 0.7rem 0.7rem calc(0.7rem + var(--lip));
}

.thumb {
  background: var(--surface-alt);
  border-radius: 4px;
  flex: none;
  height: 56px;
  object-fit: contain;
  width: 56px;
}

.body { flex: 1; min-width: 0; }
.title { font-weight: 600; }
/* The YEAR gets its own line and the accent colour. The one high-confidence
 * error in the 2026-09-08 eval was a set identified as the wrong GENERATION of
 * itself — same name, eight years apart — and the year is the single field that
 * resolves it at a glance. */
.year { color: var(--accent); font-weight: 700; }
.meta { color: var(--faint); font-size: 0.8rem; }
.reason { color: var(--faint); font-size: 0.8rem; margin-top: 0.3rem; }
.conf { color: var(--faint); font-size: 0.85rem; font-weight: 600; }

.badge {
  display: block;
  font-size: 0.85rem;
  margin-bottom: calc(0.75rem + var(--stud) / 2);
  padding: 0.7rem 0.8rem calc(0.7rem + var(--lip));
}

/* Same-name siblings. Shown, never auto-promoted — the older set is the right
 * answer whenever it is the one actually owned. */
.siblings { border-top: 1px solid var(--border); margin-top: 0.55rem; padding-top: 0.55rem; }
.sibling {
  cursor: pointer;
  display: block;
  font: inherit;
  margin-bottom: calc(0.25rem + var(--stud) / 2);
  padding: 0.45rem 0.6rem calc(0.45rem + var(--lip));
  text-align: left;
  width: 100%;
}
.sibling .year { margin-right: 0.6rem; }

/* -- item editor ----------------------------------------------------- */

.editor { display: grid; gap: 0.5rem; grid-template-columns: 1fr 1fr; }
.editor label { color: var(--faint); font-size: 0.8rem; }
.editor .wide { grid-column: 1 / -1; }

/* -- toast ----------------------------------------------------------- */

#toast {
  bottom: 1rem;
  left: 50%;
  margin: 0;
  padding: 0.7rem 1.1rem calc(0.7rem + var(--lip));
  position: fixed;
  transform: translateX(-50%);
  z-index: 60;
}
/* The pressed-brick transform would fight translateX and slide the toast off
   its own centre, so it opts out — nothing presses a toast anyway. */
#toast:active { transform: translateX(-50%); }

@media (max-width: 34rem) {
  .toolbar { flex-direction: column; }
  /* On a phone the text box gets its own line and the two menus share the
     next one, rather than three controls fighting over 320px. A basis small
     enough for both to fit is what keeps them on one row — `auto` sizes each
     to its longest option and wraps at around 380px, which is most phones. */
  .controlrow { flex-wrap: wrap; }
  .controlrow input { flex: 1 0 100%; }
  .controlrow select { flex: 1 1 7rem; min-width: 0; }
  .editor { grid-template-columns: 1fr; }
}

/* -- the public view ------------------------------------------------- */

/* Larger thumbnails than the owner's list: this page has no editing, no
 * toolbar and one job, which is to look at the sets. */
body.share .thumb { height: 84px; width: 84px; }
body.share .row { padding: 0.85rem; }

footer {
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  margin: 2rem auto 0;
  max-width: 46rem;
  padding: 1rem 1.25rem;
}
footer a { color: var(--faint); }

/* The per-item share switch on the owner's list. */
.share {
  align-items: center;
  color: var(--faint);
  display: flex;
  flex: none;
  font-size: 0.8rem;
  gap: 0.35rem;
}
.share-wrap { align-items: center; display: inline-flex; flex: none; gap: 0.45rem; }
.share-view {
  font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
}
.share-view:hover { text-decoration: underline; }

/* The Accounts screen. */
.actions { display: flex; flex: none; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.actions .link { font-size: 0.8rem; }
.link.danger { color: var(--danger); }
#userlist .row { align-items: flex-start; }
#newuserform select { padding: 0.55rem; }

/* Account screen. */
h3 { font-size: 1rem; margin: 1.6rem 0 0.4rem; }
.small { font-size: 0.8rem; }
#codes {
  background: #0e0f15;
  border-radius: var(--brick-radius);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.9rem;
  white-space: pre-wrap;
}
#totpsecret { font-size: 1.1rem; letter-spacing: 2px; }
#totpuri { word-break: break-all; }
#passkeybox { margin-top: 1.5rem; }

/* ------------------------------------------------- the settings panel
 *
 * THE MARKUP IS THE SHARED ONE AND IS NOT TOUCHED. `settings-panel.js` lives in
 * tartarus-common and four apps render from it, so a cosmetic change made
 * THERE would be a submodule bump across ops, vault, dsm and this — for a page
 * only one of them needed to look different. Everything below targets the
 * classes that panel already emits: `.set-section`, `.src`, `.set-clear`.
 *
 * Styling somebody else's markup from outside has one rule: change nothing
 * about what it MEANS. `(from .env)` and `(saved here)` still read as those
 * words, and the remove-a-secret checkbox is still a checkbox with its label —
 * both carry a meaning the panel's own comments spent a paragraph each
 * earning, and a redesign that made either quieter would be undoing that.
 *
 * A SECTION IS A BRICK, which is what the rest of this stylesheet does with
 * every other container. That is the whole change: the panel was a stack of
 * unbounded labels with no grouping, so eleven sections read as one very long
 * form. As bricks they read as eleven things.
 */
.set-section {
  /* BLACK PLASTIC, AND THAT IS A CONTRAST DECISION RATHER THAN A TASTE ONE.
     The default `--brick-grey` (#545861) put the help text — `--faint`,
     #8a8fa3 — at about 2:1 against its own background, which is unreadable and
     was unreadable in the first screenshot of this page. Every field here has a
     paragraph of help under it explaining something that costs money or breaks
     a passkey if misread, so that text is not decoration. Black element takes
     it to roughly 4.5:1 without touching the palette. */
  --brick: var(--brick-black);
  margin-bottom: calc(1.4rem + var(--stud) / 2);
  padding: 1rem 1.1rem calc(1rem + var(--lip));
}

/* The heading, on a coloured tile set into the brick. Dark text because every
   colour it cycles through is a light plastic; a tile is the flat-topped
   element, which is what you use where something has to sit flush. */
.set-section h3 {
  background: var(--tile, var(--brick-yellow));
  border-radius: calc(var(--brick-radius) - 1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -2px 0 rgba(0, 0, 0, 0.26);
  color: #1a1b21;
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.7rem 0.4rem;
}

/* THE COLOUR CYCLE, on the tile only and never on the panel.
 *
 * The collection does this to its rows and it reads as a shelf of different
 * sets. A settings form is not a shelf: eleven differently-coloured PANELS
 * behind small grey text is a page you cannot read, and the contrast would
 * have to change per section to stay legible. The plastic stays one colour and
 * the tile carries the difference — which is also how a real drawer of parts
 * is organised. */
.set-section:nth-of-type(6n+1) { --tile: var(--brick-yellow); }
.set-section:nth-of-type(6n+2) { --tile: var(--brick-azure); }
.set-section:nth-of-type(6n+3) { --tile: var(--brick-lime); }
.set-section:nth-of-type(6n+4) { --tile: var(--brick-orange); }
.set-section:nth-of-type(6n+5) { --tile: var(--brick-tan); }
.set-section:nth-of-type(6n+6) { --tile: var(--brick-white); }

/* One field. The label is the name, the socket is below it, and the help text
   is below that — read in the order you need them. */
#settings-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 1.1rem;
}
#settings-form label:last-child { margin-bottom: 0; }

#settings-form input[type=text], #settings-form input[type=number],
#settings-form input[type=password], #settings-form select {
  display: block;
  font-weight: 400;
  margin-top: 0.4rem;
  width: 100%;
}
/* A checkbox is not a socket — it is a thing you press, so it keeps its own
   size and comes out of the block flow the text inputs use.

   `accent-color` is the whole of the LEGO in it: a ticked box comes up in the
   app's yellow rather than the browser's blue, which is the one colour on this
   page that would belong to nothing. It also keeps the NATIVE control — a
   hand-built toggle here would have to re-implement the focus ring, the
   keyboard behaviour and the indeterminate state, and `patch()` reads
   `.checked` off exactly this element. */
#settings-form input[type=checkbox] {
  accent-color: var(--accent);
  box-shadow: none;
  display: inline-block;
  height: 1.1rem;
  margin-right: 0.45rem;
  vertical-align: -2px;
  width: 1.1rem;
}

/* A BOOLEAN'S BOX SITS AFTER ITS CHIP, which is the shared panel's markup order
   and not something to change from out here. Left bare it reads as floating
   loose at the end of the line, so it gets a socket of its own to sit in —
   which is also what says "this is the control" on a row whose label, chip and
   control are otherwise all one line of text. */
#settings-form label > input[type=checkbox] {
  background: #0e0f15;
  border: 1px solid #05060a;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-left: 0.5rem;
}

/* WHERE THE VALUE COMES FROM, as a small tile rather than parenthesised grey.
   It is the one piece of state on this page that is easy to miss and expensive
   to be wrong about — "saved here" means a default can never reach this
   install again, which is the freeze bug that cost three boards 78 keys. */
.src {
  color: var(--faint);
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 0.35rem;
}
label > .src:first-of-type {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  color: var(--faint);
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  margin: 0 0 0 0.4rem;
  padding: 0.1rem 0.4rem 0.15rem;
  text-transform: lowercase;
  vertical-align: 1px;
}
.src.restart {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  display: inline-block;
}

/* `#settings-form label` is an ID selector, so it beats a bare class and the
   remove-a-secret label inherited its 600 — rendering LOUDER than the help text
   above it, which is exactly backwards for the quieter of the two. Matched at
   the same specificity rather than with !important. */
#settings-form .set-clear {
  color: var(--faint);
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 0.45rem;
}

/* The help text sits under its own field and above the next label, which is
   ambiguous without something to say which it belongs to. A rule down the left
   does it, in the section's own tile colour. */
label > .src:last-child {
  border-left: 2px solid color-mix(in srgb, var(--tile, var(--brick-yellow)) 45%, transparent);
  line-height: 1.45;
  margin-top: 0.5rem;
  padding-left: 0.6rem;
}
.err { color: var(--danger); }

/* The set picker, 2026-09-12.
   A dialog rather than a page: correcting an item is something you do TO a row
   you are looking at, and navigating away loses that context. */
.backdrop {
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 50;
}
.picker {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 80vh;
  max-width: 520px;
  padding: 1.25rem 1.25rem calc(1.25rem + var(--lip));
  width: 100%;
}
/* A dialog does not depress when you click inside it. */
.picker:active { transform: none; }
.picker h2 { font-size: 1.1rem; margin: 0; }
.picker input { width: 100%; }
/* The add-a-label row: an input that takes the space and a button that does
   not, in the dialog that edits the label set. */
.labeladd { display: flex; gap: 0.5rem; }
.labeladd button { flex: none; }
.pickerlist { display: flex; flex-direction: column; overflow-y: auto; }
/* A button that looks like a row: the whole thing is the target, because a
   small link inside a list item is a miss waiting to happen on a phone. */
.pickerrow {
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.pickerrow:hover { --brick: #61656f; }

/* The detail page, 2026-09-12. */
.facts { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.75rem 0; }
.fact {
  border-bottom: 1px solid var(--surface-alt);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 0.3rem;
}
.factkey { color: var(--faint); }
.factval { text-align: right; }
/* Horizontal strip rather than a grid: an item usually has one or two
   photographs, and a grid of one looks like a layout bug. */
.photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.photos img { border-radius: 8px; max-height: 240px; object-fit: cover; }

/* -- set header, shaped like the top of a BrickLink catalogue entry --- */

.sethead {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  margin-top: calc(var(--stud) / 2);
  padding: 0.9rem 0.9rem calc(0.9rem + var(--lip));
}

/* Box art is printed to sit on white. Dropped straight onto this theme half
   of every set disappears into the background, so the image gets its own
   light panel — which is also what makes the block read as a catalogue
   entry rather than as another row of the app. */
/* A smooth white tile. Deliberately the one element with no studs on it:
   box art is the thing you are trying to look at. */
.setheadimg {
  align-items: center;
  background: #f2f3f7;
  border-radius: var(--brick-radius);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  display: flex;
  flex: 0 0 200px;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
  padding: 0.4rem;
}
/* No image is not a white slab. The light panel exists to carry box art, so
   with nothing to carry it drops back to the card's own surface — otherwise
   an unidentified set, which is the emptiest page this app draws, gets the
   loudest element on it. */
.setheadimg:empty,
.setheadimg.blank {
  background: var(--surface-alt);
  border: 1px dashed var(--border);
}
.setheadimg img { display: block; max-height: 220px; max-width: 100%; object-fit: contain; }
.setheadimg .muted { font-size: 0.75rem; text-align: center; }

.setheadbody { flex: 1; min-width: 0; }
.crumb { color: var(--faint); font-size: 0.75rem; margin-bottom: 0.3rem; }
.settitle {
  display: flex;
  flex-wrap: wrap;
  font-size: 1.05rem;
  gap: 0.6rem;
  margin: 0 0 0.7rem;
}
.setno { color: var(--accent); }

/* `max-content` on the key column is what gives the spec block its BrickLink
   look: every value starts at the same x, hard against the longest label,
   rather than drifting with the content the way a flex row does. */
.specs {
  display: grid;
  font-size: 0.85rem;
  gap: 0.2rem 1rem;
  grid-template-columns: max-content 1fr;
}
.speckey { color: var(--faint); }
.specval { min-width: 0; overflow-wrap: anywhere; }

.setlinks { font-size: 0.8rem; margin-top: 0.7rem; }
/* The app styles `button.link` and never a bare anchor, so this one rendered
   in the browser's default blue — the only link in the app that did. */
.setlinks a { color: var(--accent); text-decoration: none; }
.setlinks a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .sethead { flex-direction: column; }
  .setheadimg { flex-basis: auto; width: 100%; }
}

/* -- tabs, under the set header -------------------------------------- */

/* IT SCROLLS, SINCE 2026-09-15 AND THE SEVENTH TAB.
 *
 * This was a plain flex row. Seven tabs — Details, Photo, Inventory, Minifigs,
 * Instructions, Reviews, Search — measure about 600px of labels, so on a 360px
 * phone the default `flex-shrink: 1` squeezed them until the text wrapped
 * inside each tile and the strip became two ragged lines of half-words.
 *
 * The mobile client's ItemDetail has scrolled its strip since it was written
 * and its own comment says why: "a native strip that scrolls cannot overflow,
 * and adding a seventh will not silently break the layout." That prediction was
 * about THIS file, and it came true the moment a seventh was added.
 *
 * `flex: 0 0 auto` is the half that matters — without it the tabs shrink
 * instead of scrolling and the overflow never triggers. */
.tabstrip {
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabstrip .tab { flex: 0 0 auto; white-space: nowrap; }
/* A tab is not a button. The app's button rule paints a filled accent block,
   which on three of these reads as three primary actions rather than as a
   place you are standing. */
/* Still true, and now it is a TILE rather than a flat label: smooth-topped,
   sitting in the strip, and the one you are standing on is the only one raised
   into a brick. That keeps the comment's point — six tabs must not read as six
   primary actions — while letting the strip belong to the rest of the app. */
.tabstrip .tab {
  background: #191b23;
  border: 0;
  border-radius: var(--brick-radius) var(--brick-radius) 0 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.4);
  color: var(--faint);
  font-weight: 700;
  margin-bottom: -1px;
  padding: 0.55rem 0.9rem;
}
.tabstrip .tab:hover { background: #22252f; color: var(--text); }
.tabstrip .tab.on {
  background: var(--brick-yellow);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 -2px 4px rgba(0, 0, 0, 0.35);
  color: #1a1b21;
}

.photocard {
  display: flex;
  gap: 1rem;
  margin-bottom: calc(0.75rem + var(--stud) / 2);
  margin-top: calc(var(--stud) / 2);
  padding: 0.75rem 0.75rem calc(0.75rem + var(--lip));
}
.photocard img {
  border-radius: 8px;
  flex: 0 0 260px;
  max-height: 260px;
  object-fit: cover;
  width: 260px;
}
.photoside { flex: 1; min-width: 0; }
/* A reading is a SENTENCE, not a value. Right-aligned it wraps ragged-left and
   reads as two half-lines; the rest of `.facts` is short values and stays as
   it is. */
.photoside .factval { text-align: left; }
.photoside .fact { gap: 1.5rem; }
.photoside h4 { font-size: 0.85rem; margin: 0.9rem 0 0.2rem; }

@media (max-width: 560px) {
  /* SIX TABS DO NOT FIT ON ONE ROW, and `flex: 1` did not save it: a flex item
     will not shrink below its own label, so the strip was 474px of tabs in a
     360px space and the whole PAGE scrolled sideways. Wrapping keeps every tab
     visible, which a horizontal scroll would not — a tab you have to discover
     by dragging is one nobody presses. */
  .tabstrip { flex-wrap: wrap; gap: 0 0.1rem; }
  .tabstrip .tab { flex: 0 0 auto; padding: 0.5rem 0.55rem; }
  .photocard { flex-direction: column; }
  .photocard img { flex-basis: auto; width: 100%; }
}

/* -- inventory ------------------------------------------------------- */

.parts {
  display: grid;
  gap: calc(0.4rem + var(--stud) / 2) 0.4rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: calc(var(--stud) / 2);
}
.part {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0.45rem calc(0.45rem + var(--lip));
}
/* Part images are photographed on white, same as box art. */
.part .thumb { background: #f2f3f7; flex: 0 0 44px; height: 44px; object-fit: contain; width: 44px; }
.part .body { min-width: 0; }
.part .title { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part .meta { font-size: 0.72rem; }
.qty { color: var(--accent); font-weight: 700; margin-left: auto; }

/* -- the order list (a second column on each part) -------------------- */

.order { border-left: 3px solid var(--accent); margin: 0.6rem 0 1rem; padding-left: 0.7rem; }
.order-head { align-items: baseline; display: flex; gap: 0.7rem; justify-content: space-between; }
/* The want box sits AFTER the set's own count, so "×4" (what is in the box)
   and "need 2" (what is missing) read as two facts rather than one. */
.part .want { align-items: center; display: flex; gap: 0.25rem; margin-left: 0.4rem; }
.part .want span { color: var(--faint); font-size: 0.68rem; text-transform: uppercase; }
.part .want input { max-width: 4.2rem; padding: 0.15rem 0.25rem; width: 100%; }
pre.export {
  background: #f7f8fb; border: 1px solid #d9dce4; font-size: 0.72rem;
  margin: 0.6rem 0; max-height: 40vh; overflow: auto; padding: 0.6rem;
  white-space: pre; width: 100%;
}

/* -- headline value and set description ------------------------------ */

.headline { align-items: baseline; display: flex; gap: 0.7rem; margin-bottom: 0.9rem; }
.headlineval { color: var(--accent); font-size: 1.5rem; font-weight: 700; }
.setdesc { line-height: 1.5; margin: 0.2rem 0 0.3rem; }
.setdesc p { margin: 0 0 0.6rem; }
/* `white-space: pre-wrap` is gone with the text-blob rendering it existed for:
   paragraphs and list items are real elements now, so a wrapped bullet indents
   under its own text instead of returning to the left margin. */
/* `ul { list-style: none }` at the top of this file is right for the app's own
   lists — the launcher rail, the candidate cards — and wrong for prose. These
   items get a mark set back explicitly, and since 4bd3e32's successor that mark
   is a 1x1 round stud rather than a disc; the rule is up with the other
   elements. Without any of it the items indent correctly and have no markers,
   which reads as broken spacing rather than as a list. */
/* The attribution belongs to the paragraph above it, not to the facts table
   below — without this it reads as a row of the wrong block. */
.setdesc + .meta { margin-bottom: 1rem; }

/* -- instruction links ----------------------------------------------- */

.docs { display: flex; flex-direction: column; gap: 0.4rem; }
.doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  text-decoration: none;
}
.doc:hover { border-color: var(--accent); }
.docname { font-weight: 600; }

/* The three-step identify flow. Colour carries the meaning that matters most
   here — where the photograph went — so it is not left to the wording alone. */
.badge.local { --brick: var(--brick-blue); color: #f2f3f7; }
.badge.sent  { --brick: var(--brick-yellow); color: #1a1b21; }

/* Ask Claude. Separated from the candidate list by a rule and set in the quiet
   palette: it is the last resort, not the call to action, and the local answer
   above it is right most of the time. */
.escalate {
  border-top: 1px solid var(--border);
  margin-top: 0.9rem;
  padding-top: 0.75rem;
}
.escalate .meta { margin-bottom: 0.5rem; }
.escalate .ask  { --brick: var(--brick-grey); font: inherit; width: 100%; }
.escalate .ask[disabled] { cursor: default; opacity: 0.65; }

/* The approval queue. Two actions per row, and they must not look alike: one
   lets a stranger into somebody's collection and the other does not. Colour
   carries that, because a row of identical grey buttons is how the wrong one
   gets pressed. */
#pendingbox { margin-bottom: 1.2rem; }
#pendinglist .row { align-items: center; display: flex; gap: 0.5rem; }
#pendinglist .row .body { flex: 1; }
#pendinglist button {
  font: inherit;
  padding: 0.5rem 0.9rem calc(0.5rem + var(--lip));
}
#pendinglist button.primary { --brick: var(--brick-green); color: #f2f3f7; }
#pendinglist button.danger  { --brick: var(--brick-red);   color: #fff; }
#pendinglist button[disabled] { cursor: default; opacity: 0.6; }
#pendinglist .warn { display: block; margin-bottom: 0.6rem; }
.small { font-size: 0.78rem; }

/* The collection footer: a member's way to reach the owner, and the owner's
   view of what was sent. Set apart from the list above it, because it is not
   another item. */
.footerbox { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1rem; }
.footerbox h3 { margin-bottom: 0.3rem; }
.footerbox textarea {
  background: #0e0f15;
  border: 1px solid #05060a;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 0.7rem;
  resize: vertical;
  width: 100%;
}
.footerbox form button { font: inherit; margin-top: 0.5rem; }
/* Unread stands out; read fades back. The operator should be able to see at a
   glance what is still owed a reply. */
#inboxlist .row.unread { --brick: var(--brick-blue); }
#inboxlist .row { align-items: flex-start; display: flex; gap: 0.5rem; }
#inboxlist .row .body { flex: 1; }
.messagetext { margin-top: 0.4rem; white-space: pre-wrap; }

/* A stranger's signup message, in the approval queue. `pre-wrap` because people
   write paragraphs and line breaks, and running them together changes what they
   said. Same reason as `.messagetext` above. */
#pendinglist .application {
  color: var(--text); font-size: 0.85rem; margin: 0.4rem 0 0.2rem;
  white-space: pre-wrap;
}

/* The repair list: unverified and rejected registrations. Same shape as the
   queue above it, but its actions are ordinary links rather than the Approve /
   Refuse pair, so it does not borrow `#pendinglist`'s button gilding. */
#stucklist .row { align-items: flex-start; display: flex; gap: 0.5rem; }
#stucklist .row .body { flex: 1; min-width: 0; }
#stucklist .application {
  color: var(--text); font-size: 0.85rem; margin: 0.4rem 0 0.2rem;
  white-space: pre-wrap;
}

/* The reviews tab. Each row is a link to somebody else's work, so it reads as
   a card you can follow rather than as text this app wrote. */
.reviewhead { align-items: baseline; display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.reviewscore { color: var(--text); font-size: 1.8rem; font-weight: 700; }
.review {
  background: var(--surface, #1d1f2a);
  border-radius: 6px;
  display: block;
  margin-bottom: 0.6rem;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
}
.review:hover { background: var(--surface-alt, #262936); }
.reviewtop { align-items: baseline; display: flex; gap: 0.5rem; justify-content: space-between; }
.reviewsource { color: var(--text); font-weight: 600; }
.reviewrating { color: var(--accent, #ffcf3f); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.reviewsnippet { color: var(--faint); font-size: 0.85rem; line-height: 1.4; margin-top: 0.35rem; }

/* The one irreversible control in the app. Set apart and marked, because the
   layout should say "this is different" before the label has to. */
#dangerzone {
  border: 1px solid var(--brick-red);
  border-radius: var(--brick-radius);
  margin-top: 2rem;
  padding: 1rem;
}
#dangerzone h3 { color: var(--brick-red); margin-bottom: 0.4rem; }
#dangerzone button.danger { --brick: var(--brick-red); color: #fff; font: inherit; }

/* The value breakdown. Three figures that must not read as one running total,
   so each is its own line with its own label and its own coverage — never a
   column of numbers under a single heading, which is how they would get added
   by eye. */
.valuerow {
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0;
}
.valuerow:last-child { border-bottom: 0; }
.valuelabel { color: var(--text); flex: 1; }
.valueamount { color: var(--accent); font-weight: 700; white-space: nowrap; }
.valuerow .meta { min-width: 8.5rem; text-align: right; }
@media (max-width: 480px) {
  .valuerow { flex-wrap: wrap; }
  .valuerow .meta { min-width: 0; text-align: left; width: 100%; }
}

/* -- the report form -------------------------------------------------- */

/* A RADIO IS NOT A SOCKET, and the shared `input, select, textarea` rule above
   gives it one: width 100%, padding, inset shadow. Left alone, each radio
   renders as a full-width sunken box with its label stranded beside it, which
   is exactly how this shipped on 2026-09-19 and what "the buttons and text
   don't line up" meant.

   THE SETTINGS FORM ALREADY SOLVED THIS for checkboxes, scoped to itself. This
   is the second instance; a THIRD should generalise the base rule to
   `input:not([type=checkbox]):not([type=radio])` rather than adding a third
   copy. It is scoped here because the settings screen renders correctly today
   and a shared-rule change could only be verified by looking at it.

   `accent-color` for the same reason the checkbox has it: a selected radio
   comes up in the app's yellow rather than the browser's blue, and the native
   control keeps its focus ring and keyboard behaviour. */
#reportkind {
  border: 0;
  margin: 0 0 0.6rem;
  padding: 0;
}
#reportkind legend {
  margin-bottom: 0.4rem;
  padding: 0;
}
.kindrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}
.kindrow label {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}
#reportkind input[type=radio] {
  accent-color: var(--accent);
  /* A COMPLETE RESET, AND IT FIXES NOTHING KNOWN. The base
     `input, select, textarea` rule also sets background, border and
     border-radius; undoing only padding and shadow left those applying to a
     native control. The theory was that an engine honouring them would draw a
     rounded dark box instead of a circle — and it was WRONG: Chromium and
     Firefox both render identically to the pixel with and without these four
     lines, measured rather than eyeballed.

     Kept anyway because the reset is more correct than the partial one and
     WebKit is untested here. Not kept as an explanation for anything: the
     misalignment reported on 2026-09-19 was not this. */
  appearance: auto;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: none;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  width: 1.05rem;
}

#reportform textarea { resize: vertical; }
#reportform input[type=text], #reportform textarea { margin-bottom: 0.6rem; }

/* A LABEL, A CONTROL AND A BUTTON ON ONE LINE, which `.actions` cannot do:
   it has no `align-items`, so the default `stretch` pulls the label to the
   row height and its text sits at the top beside a centred input. */
.inlinefield {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inlinefield label { flex: none; }
.inlinefield input { flex: 1 1 14rem; width: auto; }
.inlinefield .link { flex: none; font-size: 0.8rem; }

