/* HaughtStudio — one stylesheet, no build step.
   Surfaces run darkest to lightest, the brand gradient is used sparingly
   (the user's own message, the primary action, the send button), and nothing
   else competes with it. */

/* ---------------------------------------------------------------- tokens */

:root {
  /* Surfaces, darkest to lightest. */
  --bg: #0b0912;
  --bg-drawer: #0a0810;
  --surface: #14111c;
  --card: #1b1826;
  --card-2: #221d30;
  --card-3: #2a2438;

  /* The panel behind text laid over a photograph -- `--card` at 0.78, so the
     words hold over the lightest hero while the picture still reads through.
     See `.list-row.has-hero` for where it is used. */
  --scrim: rgba(27, 24, 38, 0.78);

  /* The logo's own purples. */
  --purple-900: #2b0f52;
  --purple-700: #4c1d95;
  --purple-500: #7c5ce6;
  --purple-400: #8b6be8;
  --purple-300: #a98cf0;

  /* The wordmark wherever a name is set as text rather than drawn as a logo:
     the same purple, lifted at the top and deepened at the foot the way the
     logo's own lettering is. The middle stop is --purple-300 itself, so the
     fade reads as one colour. Matches HaughtStudio's own drawer. */
  --wordmark-grad: linear-gradient(180deg, #c2aaf7 0%, #a98cf0 58%, #8d6fe8 100%);

  /* Brand accent is a gradient, used sparingly: the user's own message, the
     primary action, and the send button. Nothing else. */
  --accent: #8b5cf6;
  --accent-2: #5b9af5;
  --grad: linear-gradient(100deg, #8a6be8 0%, #5b9af5 100%);
  --grad-soft: linear-gradient(100deg, rgba(138, 107, 232, 0.18), rgba(91, 154, 245, 0.18));

  /* Text. */
  --text: #f3f1f8;
  --text-dim: #9c96ae;
  --text-faint: #6e6880;
  /* A listing's DESCRIPTION, one step above --text-dim.

     Metadata can afford to be quiet; the sentence that says what a listing is
     cannot. At 13px, --text-dim measures 6.1:1 on a plain card but only 3.0:1
     over the darkest scrim a hero photograph can produce (0.78 of --card over
     white), which is under the 4.5:1 floor for body text -- so the description
     was the one line that got harder to read exactly where the picture was
     brightest. This reads 9.6:1 on a card and 4.7:1 on that worst-case scrim.
     Used only where a listing's own summary is drawn; a new use of it is a
     claim that the text is prose rather than a label. */
  --text-body: #c3bdd3;

  /* Semantic. */
  --gold: #f0c24b;
  --danger: #e5484d;
  --ok: #46b17b;
  --warn: #e2a33c;

  /* Categories are a second axis (see store.CATEGORIES), so they carry their
     own accent -- a teal that sits clearly apart from the three family colours
     (persona purple, skill gold, connector blue), so a category chip is never
     mistaken for a kind chip. */
  --cat: #57c9b3;
  --cat-soft: rgba(87, 201, 179, 0.14);
  --cat-line: rgba(87, 201, 179, 0.38);

  /* Lines and shape. */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  /* The card edge: how thick a listing card's border is, and therefore the width
     of the family ring drawn over it (see `.edge`). One token, because the two
     have to agree to the pixel -- the ring is an absolutely positioned child, so
     its offsets are this value negated, and a card whose border was thicker than
     the ring's band would show a seam of its own line colour inside the ring. */
  --card-edge: 2px;
  /* Chips and tags are rounded squares rather than pills: a half-circle cap is
     a capsule, and at these sizes it spends the ends of the label on curve
     instead of on the word. One token, so every chip keeps the same corner. */
  --radius-chip: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);

  --drawer-w: 256px;
  --topbar-h: 52px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 0.6em; }
p:last-child { margin-bottom: 0; }

a { color: var(--purple-300); }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.mono { font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.02em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A name set as text rather than drawn as the logo -- the HaughtStudio row in
   the drawer, and any other wordmark to come. The gradient is painted as a
   background clipped to the glyphs, so the flat purple underneath is what a
   browser without that clipping shows: never an empty line, and never a purple
   block behind the letters. */
.wordmark { color: var(--purple-300); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark {
    background-image: var(--wordmark-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Clamp helper for multi-line previews. */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------------------------------------------------------------- layout */

.app {
  display: flex;
  height: 100%;
  height: 100dvh;
  /* Written by `fitShell` in app.js from the visual viewport, so the shell
     follows the on-screen keyboard and -- the reason it exists -- is restored
     when the keyboard closes. `100dvh` stays as the fallback for the frame
     before the script runs and for a browser without `visualViewport`. */
  height: var(--app-height, 100dvh);
  min-height: 0;
}

.drawer {
  width: var(--drawer-w);
  flex: 0 0 var(--drawer-w);
  background: var(--bg-drawer);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 17, 28, 0.9), rgba(11, 9, 18, 0.65));
  backdrop-filter: blur(8px);
}

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Content spans the window rather than sitting in a measured column: the
   marketplace's screens are lists and grids, so a fixed measure only bought
   empty gutters. Long-form prose still sets its own reading measure on the
   text itself (see .page-lede and .md). */
.view-inner {
  max-width: none;
  margin: 0 auto;
  padding: 16px 18px 44px;
}

.view-inner.wide { max-width: none; }

/* --------------------------------------------------------------- sidebar */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 12px 10px;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--card-2);
  display: grid; place-items: center;
  flex: 0 0 38px;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { min-width: 0; }
.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--purple-300);
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-top: -1px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 9px 12px;
}

.drawer-foot {
  padding: 9px;
  border-top: 1px solid var(--line);
}

.newchat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  margin: 4px 4px 14px;
  width: calc(100% - 8px);
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(110, 90, 230, 0.28);
}
.newchat:hover { filter: brightness(1.06); }
.newchat:active { transform: translateY(1px); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 14.5px;
  text-decoration: none;
}
.nav-row:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav-row.active { background: var(--card-2); color: var(--text); }
.nav-row .icon { flex: 0 0 18px; opacity: 0.85; }
.nav-row .wordmark { font-weight: 650; }
.nav-row .count { margin-left: auto; color: var(--text-faint); font-size: 12.5px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 10px 5px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

.chat-list { display: flex; flex-direction: column; gap: 3px; }

.chat-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 11px;
  cursor: pointer;
  color: var(--text-dim);
}
.chat-row:hover { background: rgba(255, 255, 255, 0.045); }
.chat-row.active { background: var(--card-2); color: var(--text); }
.chat-row-top {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
}
.chat-row-title {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.chat-row-time {
  font-size: 11.5px;
  color: var(--text-faint);
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 5px;
}
.chat-row-preview {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-row .star-on { color: var(--gold); }

/* ------------------------------------------------------------------ bits */

.icon { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.icon-lg { width: 26px; height: 26px; }
.icon-xl { width: 34px; height: 34px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.icon-btn.danger:hover { background: rgba(229, 72, 77, 0.14); color: var(--danger); }
.icon-btn.gold { color: var(--gold); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--card-3); }
.btn.primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 22px rgba(110, 90, 230, 0.25);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn.danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.35); background: rgba(229, 72, 77, 0.08); }
/* The green half of the same pair, so a control that toggles between putting
   something in and taking it out reads as one object in two states rather than as
   two unrelated buttons. Same weights as `.btn.danger` on purpose: if one is
   adjusted, the other has to be. */
.btn.ok { color: var(--ok); border-color: rgba(70, 177, 123, 0.35); background: rgba(70, 177, 123, 0.08); }
/* Both deepen their OWN tint on hover, in one rule, because they are a pair: the
   base `.btn:hover` cannot do it -- it sets a grey background at the same
   specificity, so whichever of the two is declared later wins and the button
   would answer the pointer with somebody else's colour. */
.btn.ok:hover { background: rgba(70, 177, 123, 0.16); }
.btn.danger:hover { background: rgba(229, 72, 77, 0.16); }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.tint {
  background: var(--grad-soft);
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--purple-300);
}
.btn.tint:hover { background: rgba(139, 92, 246, 0.22); }
.btn:disabled { opacity: 0.5; cursor: default; }

.big-action {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--grad);
  color: #fff;
  font-size: 15.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(110, 90, 230, 0.28);
}
.big-action:hover { filter: brightness(1.06); }
.big-action .icon { width: 21px; height: 21px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-pad { padding: 13px 15px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 9px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }

.divider { height: 1px; background: var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-chip);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
}
.chip.plain { background: transparent; border-color: transparent; }
.chip.danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.3); }

/* Family accents: personas purple, skills gold, connectors blue. Each carries
   its own --kind / --kind-soft / --kind-line, so the avatar, feature mark, chip
   and page-head icon of a listing all pick up one colour and the three kinds
   read apart at a glance -- most useful in the mixed Everything list and search
   results. */
.kind-persona   { --kind: var(--purple-300); --kind-soft: rgba(169, 140, 240, 0.16); --kind-line: rgba(169, 140, 240, 0.34); }
.kind-skill     { --kind: var(--gold);       --kind-soft: rgba(240, 194, 75, 0.15);  --kind-line: rgba(240, 194, 75, 0.34); }
.kind-connector { --kind: var(--accent-2);   --kind-soft: rgba(91, 154, 245, 0.16);  --kind-line: rgba(91, 154, 245, 0.34); }

.avatar.kind-persona, .avatar.kind-skill, .avatar.kind-connector {
  background: var(--kind-soft);
  color: var(--kind);
}
.chip.kind-persona, .chip.kind-skill, .chip.kind-connector {
  color: var(--kind);
  border-color: var(--kind-line);
}
.feature-mark.kind-persona, .feature-mark.kind-skill, .feature-mark.kind-connector {
  background: var(--kind-soft);
  border-color: var(--kind-line);
  color: var(--kind);
}
.page-head .icon.kind-persona, .page-head .icon.kind-skill, .page-head .icon.kind-connector {
  color: var(--kind);
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
}

.avatar {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--card-3);
  display: grid;
  place-items: center;
  font-size: 20px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: 16px; }

/* ---------------------------------------------------------------- inputs */

.field { display: flex; flex-direction: column; gap: 6px; }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.18);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.textarea.mono { font-family: var(--mono); font-size: 13px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

/* A field the browser has just refused. Red on the control itself so it is found
   without reading, plus the sentence beneath it -- colour alone would carry no
   meaning for anybody who cannot see it. */
.input.input-invalid,
.input.input-invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}
.field-error { font-size: 12.5px; color: var(--danger); line-height: 1.45; }

.hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.45; }

/* A checkbox with an explanation beside it. */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  cursor: pointer;
}
.check-row input { margin-top: 2px; flex: 0 0 auto; }
.check-row strong { display: block; font-weight: 600; }

/* Switch */

.switch {
  position: relative;
  display: inline-block;
  width: 52px; height: 31px;
  flex: 0 0 52px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--card-3);
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  transition: background 0.16s ease;
  pointer-events: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 23px; height: 23px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .track { background: var(--purple-500); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(21px); }

/* Segmented control (markdown toggle, list/grid) */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.segmented button.on { background: var(--card-3); color: var(--text); }

/* Stepper */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 3px;
}
.stepper button {
  width: 34px; height: 32px;
  border: 0; background: transparent;
  color: var(--text); font-size: 17px;
  border-radius: 8px; cursor: pointer;
}
.stepper button:hover { background: rgba(255, 255, 255, 0.06); }
.stepper .value { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ page shells */

.page-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.page-head .icon { width: 24px; height: 24px; color: var(--purple-300); }
.page-head h1 { font-size: 23px; }
.page-lede {
  color: var(--text-dim);
  font-size: 14px;
  max-width: 62ch;
  margin: 0 0 14px;
}
/* The author's own words. `pre-wrap` because the field is a textarea: a second
   paragraph the author typed must not collapse into the first. */
.author-about { white-space: pre-wrap; }
.page-foot {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 72ch;
}

/* The search field at the top of the Everything screen. */

.search-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.search-bar:focus-within {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.18);
}
.search-bar .icon { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; }
.search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 10px 0;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-faint); }
/* No native clear button -- the field carries its own. */
.search-bar input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-bar .clear {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  flex: 0 0 auto;
}
.search-bar .clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.search-bar .clear .icon { width: 15px; height: 15px; }
.search-bar .clear[hidden] { display: none; }

/* List rows with a right-hand action, as on the persona and skills screens.
   Each row is its own card with a gap between, rather than one block of
   divided rows, so the separations read clearly at a glance. */

.list { display: flex; flex-direction: column; gap: 6px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  background: var(--card);
  border: var(--card-edge) solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  text-align: left;
  color: inherit;
}
/* `background-color`, not the `background` shorthand: the shorthand resets
   background-image, which would drop a row's hero the moment it was hovered. */
.list-row:hover { background-color: var(--card-2); border-color: var(--line-strong); }

/* A row whose listing has a hero. The image is set inline by itemRow; this is
   the rest -- how it is fitted, and what has to change to stay legible on top of
   a photograph. */
.list-row.has-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.list-row.has-hero:hover { background-color: var(--card); border-color: var(--line-strong); }

/* Legibility over the photograph: ONE panel behind the row's whole text column.

   A hero row is mostly a picture, and every word in it -- the name, the
   summary, the price and the tally -- sits on whatever the picture happens to
   be at that point. Patching each element separately (a shadow on the name, a
   scrim behind the summary, another behind the tally) held up on a wide
   desktop row and came apart on a phone, where the row is tall enough that all
   three land on the photo and the separate boxes read as three floating
   patches. One rectangle behind the column is legible over any photograph and
   reads as one surface rather than as a pile of them.

   The panel is a pseudo-element with inset past the column's box rather than
   padding on the column itself: padding would grow every hero row, and the
   panel wants to sit in the row's existing rhythm. `--scrim` is `--card` at
   0.78, dark enough that the lightest photograph cannot wash the words out
   while the picture still reads as the row's own background.

   `z-index` on the column is what creates the stacking context the panel
   needs. Without one, a negative-z pseudo-element paints UNDER the row's own
   background image -- i.e. behind the photograph -- and is never seen. */
.list-row.has-hero .list-row-main {
  position: relative;
  z-index: 0;
}
.list-row.has-hero .list-row-main::before {
  content: '';
  position: absolute;
  inset: -6px -10px;
  z-index: -1;
  border-radius: 10px;
  background: var(--scrim);
}

/* Where a listing's hero photograph is held back until the row is pointed at.

   On Everything the list is mixed, so a persona's hero shares the screen with
   two other families and the pictures begin to compete with the listings
   themselves. A shelf is one family, but it is the family that has faces in it
   when it is personas, so the same crowding happens there and the same rule
   applies. A connector or a skill has no hero in practice, so nothing is scoped
   away from them by accident -- `hero-dim` is set on the view root by
   `screenEverything` and `screenShelf`, and by no other screen.

   The picture is painted TWICE on purpose. The row keeps the inline background
   image that `itemRow` sets per listing, and a pseudo-element inherits that same
   image, desaturated, laid over the top of it. The duplication is what keeps
   `filter` off the row itself: a filter there would take the teal out of the
   category chips and the colour out of the family chip with it, and those chips
   are the colour cue that makes a list scannable. The row's children are lifted
   above the pseudo, so the desaturation stops at the photograph.

   The pseudo carries the row's own background colour UNDER its image, so a hero
   PNG with soft alpha cannot let the un-desaturated copy bleed through its
   edges. `border-radius: inherit` keeps the card's corners. Both `:hover` and
   `:focus-visible` restore the colour, so the row is understood by pointer and
   by keyboard alike. */
.hero-dim .list-row.has-hero { position: relative; isolation: isolate; }
.hero-dim .list-row.has-hero::before {
  content: '';
  position: absolute;
  /* The row's border box, NOT its padding box: `inset: 0` on an absolutely
     positioned box stops at the padding edge, so the row's own border ring still
     painted the row's background image -- the un-desaturated copy -- as a
     hairline of full colour tracing every dimmed photograph. Reaching the border
     width past the padding edge is what covers it, and the border drawn here is
     the same width for the same reason. */
  inset: calc(-1 * var(--card-edge));
  z-index: 0;
  border-radius: inherit;
  /* The outline is redrawn here, or covering the border ring would erase the
     row's edge. `saturate` is a no-op on a white line and the brightness drop
     moves it by a hair, so it still reads exactly as the row's own border. */
  border: var(--card-edge) solid var(--line);
  background-color: var(--card);
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Held back, not drained. At saturate(0) a photograph of a person reads as a
     broken thumbnail rather than as a picture waiting to be looked at, and a
     near-zero resting value made the hover a snap back to full colour. Keeping
     most of the colour at rest, with a small brightness drop to make the row
     recede, narrows the gap the pointer has to cross -- so pointing at a row
     now lifts it rather than switching it on. */
  filter: saturate(0.42) brightness(0.95);
  transition: filter 0.26s ease, border-color 0.26s ease;
}
.hero-dim .list-row.has-hero > * { position: relative; z-index: 1; }
.hero-dim .list-row.has-hero:hover::before,
.hero-dim .list-row.has-hero:focus-visible::before {
  filter: none;
  border-color: var(--line-strong);
}

/* The card's edge carries the family.

   A mixed list is the one place the family chip and the colour of the mark have
   to do the work alone, and on a row with a hero photograph even the chip can be
   hard to find. Applied to the two shapes a listing is browsed as -- the list row
   and the Featured card -- so the same listing reads the same colour wherever it
   appears.

   The border is the QUIET half of it: the family's line colour at rest, its solid
   colour on hover, and it is what is left when the ring below cannot be drawn
   (a blurred adult row clips it, see `.nsfw-blur`). */
.list-row.kind-persona, .list-row.kind-connector, .list-row.kind-skill,
.feature-card.kind-persona, .feature-card.kind-connector, .feature-card.kind-skill,
.item-tile.kind-persona, .item-tile.kind-connector, .item-tile.kind-skill {
  border-color: var(--kind-line);
}
.list-row.kind-persona:hover, .list-row.kind-connector:hover, .list-row.kind-skill:hover,
.list-row.kind-persona:focus-visible, .list-row.kind-connector:focus-visible, .list-row.kind-skill:focus-visible,
.feature-card.kind-persona:hover, .feature-card.kind-connector:hover, .feature-card.kind-skill:hover,
.item-tile.kind-persona:hover, .item-tile.kind-connector:hover, .item-tile.kind-skill:hover,
.item-tile.kind-persona:focus-visible, .item-tile.kind-connector:focus-visible, .item-tile.kind-skill:focus-visible {
  border-color: var(--kind);
}

/* ...and the ring is the bright half: a band the width of the card's border,
   traced exactly over it, faded along its length so the CORNERS read brighter
   than the middle of each long edge.

   A child element rather than a border, because a border is one colour and this
   is a gradient -- and a gradient cannot be a border: `border-image` ignores
   `border-radius`, which would square off every card in the app. The ring is
   instead the padding box of an absolutely positioned span, with a mask that
   keeps only that band and hides the fill. Its box is positioned from the card's
   PADDING box, so `inset` of the negated border width lands it exactly on the
   card's border box -- border and ring then cover the same pixels, which is why
   both read the one `--card-edge`.

   The fade is a plain horizontal gradient: opaque family colour at each end,
   the family's translucent line colour across the middle. On a wide card that is
   exactly the effect asked for -- bright left and right ends, a quiet run across
   the top and bottom -- and unlike an angular (conic) gradient it stays true
   whatever a card's proportions happen to be, because it follows the box rather
   than the angle from its centre. */
.list-row, .feature-card, .item-tile { position: relative; }
.edge {
  position: absolute;
  inset: calc(-1 * var(--card-edge));
  z-index: 2;
  padding: var(--card-edge);
  border-radius: inherit;
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--kind) 0%, var(--kind-line) 50%, var(--kind) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* Pointing at a card fills the ring in: the fade is what says "a card at rest",
   and hover is the moment to say everything about it at once. */
.list-row:hover > .edge, .list-row:focus-visible > .edge,
.feature-card:hover > .edge,
.item-tile:hover > .edge, .item-tile:focus-visible > .edge {
  background-image: none;
  background-color: var(--kind);
}

/* The ring is a child, and the hero rules lift every child of a hero row above
   the dimming pseudo -- including this one, which must stay out of flow and
   above them both. */
.hero-dim .list-row.has-hero > .edge { position: absolute; z-index: 2; }

/* A hero row paints its edge from a pseudo-element rather than from its own
   border (see above), so the accent has to be redrawn there too -- otherwise the
   one row that is mostly a photograph would keep the neutral edge. The pseudo's
   own `border-color` rules are the more specific ones, so these come after. */
.hero-dim .list-row.has-hero.kind-persona::before,
.hero-dim .list-row.has-hero.kind-connector::before,
.hero-dim .list-row.has-hero.kind-skill::before {
  border-color: var(--kind-line);
}
.hero-dim .list-row.has-hero.kind-persona:hover::before,
.hero-dim .list-row.has-hero.kind-connector:hover::before,
.hero-dim .list-row.has-hero.kind-skill:hover::before,
.hero-dim .list-row.has-hero.kind-persona:focus-visible::before,
.hero-dim .list-row.has-hero.kind-connector:focus-visible::before,
.hero-dim .list-row.has-hero.kind-skill:focus-visible::before {
  border-color: var(--kind);
}

.list-row .avatar { flex: 0 0 42px; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
/* The name is the one thing in a row title that can be long, so it is the one
   that gives way: without this a long name pushes the price and the badge out of
   the row instead of shortening itself. */
.list-row-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* What a connector costs, under its name in a browse row and deliberately NOT
   bold. It sits in `.list-row-facts` with the rating tally -- see there for why
   the two share a line. */
.list-row-main .title-cost,
.item-tile .title-cost {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 0;
}
/* The coin carries the unit, so it takes the accent rather than the dim text
   colour -- the same pairing the listing page's cost line uses. */
.list-row-main .title-cost .icon,
.item-tile .title-cost .icon { color: var(--accent-2); flex: 0 0 auto; }
.list-row-main .title-cost > span,
.item-tile .title-cost > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* What a call costs and how the listing has been rated: one line under the name,
   because both are facts about the listing rather than part of its name.

   The tally used to end the row instead, at the far right, which is where a
   desktop row has room for it -- but on a phone the name, the price and the
   tally were three things competing for 390px, and the name and the price were
   what gave way. Side by side under the name, and with the family chip dropped
   at that width (see the phone breakpoint below), all three fit. */
.list-row-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
  min-width: 0;
}
.list-row-sub {
  color: var(--text-body);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.list-row-end { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* The end of a paged list: the next page asked for by press, and the node an
   observer watches so scrolling asks for it too (see `paintMore`). Centred
   under the rows so it reads as the end of the list rather than as a row. */
.load-more {
  display: block;
  margin: 14px auto 4px;
}
.load-more[hidden] { display: none; }

/* A listing row on a phone.

   A wide row is a name and its metadata in two columns, and 390px has no room
   for both -- the browser resolved the argument by ellipsizing the name to make
   room for the price, and the price to make room for the family chip. So the
   phone row is the same row with the right-hand column emptied of everything the
   text can say for itself:

   * the family chip goes: the mark beside the name carries the family for a
     listing with no icon of its own, the price line already singles out a
     connector, and a page of one family -- which is what the Connectors shelf
     is -- never needed the chip at all. What is left is the chevron: one glyph,
     and still the sign that the row opens something.
   * the name wraps instead of being cut off, and takes as much of the line as it
     needs; a badge sharing its line -- NSFW, Pending -- wraps beneath it rather
     than shortening it.

   Nothing above the breakpoint moves: a wide screen keeps the chip and the
   single-line name exactly as it had them. */
@media (max-width: 620px) {
  .list-row { align-items: flex-start; }
  .list-row-title { flex-wrap: wrap; }
  .list-row-title > span:first-child {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  .list-row-end > .row-kind { display: none; }
}

/* Everything at rest on a desktop: the catalogue as TILES.

   A row spends most of a wide window on whitespace around one listing, so the
   resting list becomes a grid of cards and the eye takes in several at once.
   Nothing about the listing changes -- same facts, same link, same accent
   -- and the moment a filter is in force the screen goes back to rows (see
   `paint` in app.js). A phone never renders this at all: the choice is made in
   JavaScript from `(pointer: fine)`, not by a media query here, because tiles
   are a different DOM shape rather than the same one restyled. */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
}

.item-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: var(--card-edge) solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.item-tile:hover, .item-tile:focus-visible {
  background: var(--card-2);
  border-color: var(--line-strong);
}

/* A listing's hero, when it has one, is the tile's banner. `overflow` lives
   here rather than on the tile so the family ring (inset past the border) is
   not clipped, and the blur's scale-up is cropped instead. */
.tile-hero {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-3);
  border-radius: calc(var(--radius) - var(--card-edge)) calc(var(--radius) - var(--card-edge)) 0 0;
}
.tile-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 12px 13px 13px;
}
.tile-head { display: flex; align-items: center; gap: 7px; }
.tile-head .avatar { width: 38px; height: 38px; flex-basis: 38px; }
.tile-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

/* Two lines, then clipped: a long name may not make one tile taller than the
   rest, which would break the grid's alignment for the whole row. */
.tile-name {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tile-sub {
  font-size: 12.5px;
  color: var(--text-body);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* The chips sit at the foot of the tile whatever the name and summary did, so a
   row of tiles lines up rather than each card ending where its text happened to. */
.item-tile .row-cats { margin-top: auto; padding-top: 3px; }

/* Everything screen: the Featured strip above the full list. */

.list-stack { display: flex; flex-direction: column; gap: 20px; }

.group-title {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin: 0 0 8px;
}

.feature-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.feature-head .icon { width: 19px; height: 19px; color: var(--gold); }
.feature-title { font-size: 18px; }
.feature-note { margin-left: auto; font-size: 12px; color: var(--text-faint); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px;
  background: var(--card);
  border: var(--card-edge) solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.feature-card:hover { background: var(--card-2); border-color: var(--line-strong); }
.feature-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feature-mark {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.feature-mark .icon { width: 21px; height: 21px; }
.feature-name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
/* The author's handle under the name on a card. Dimmer and smaller than the
   name, a step above the summary: it is a fact about the listing, but a smaller
   one than what the listing does. Clipped rather than wrapped so every card in a
   grid stays the same height. */
.feature-author {
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feature-summary {
  font-size: 13px;
  color: var(--text-body);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Everything, with categories chosen: one row per category, each row a strip
   that scrolls SIDEWAYS.

   The vertical scroll is the page's own -- the rows stack, so a reader who picks
   ten categories scrolls down through them -- and the sideways scroll is per row,
   so a category holding forty listings does not push the next category off the
   screen. Two axes, each doing the one job it is good at.

   The strip takes `tabindex` (set by `categoryRow`) so it can be scrolled and its
   cards opened from the keyboard; the ring around it on focus-visible is the
   only cue that it is a control as well as a list, and it is drawn inset so it
   reads as belonging to the strip rather than to the page. */
.cat-rows { display: flex; flex-direction: column; gap: 18px; }

.cat-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--cat);
}
.cat-row-head .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.cat-row-title { font-size: 15.5px; color: var(--text); }
.cat-row-count { margin-left: auto; font-size: 12px; color: var(--text-faint); }

.cat-scroll {
  display: flex;
  gap: 10px;
  /* `x` only, and `pad` rather than `hidden`: the scrollbar belongs to this row
     and not to the page, and the cards keep their own ring inside it. */
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  margin: -2px -2px 0;
  scroll-snap-type: x proximity;
  border-radius: var(--radius-sm);
}
.cat-scroll:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 2px; }

/* On anything that is not a phone, the rail is DRAWN rather than left to the
   platform.

   A desktop browser's own scrollbar for a box like this is an overlay that exists
   only while the box is being scrolled, which leaves a row of cards running off
   the right edge with nothing on screen saying it continues -- and these strips
   are the only thing in the app that scrolls sideways, so there is no habit to
   fall back on. A phone is a different situation: swiping is the gesture, the
   rail would sit under a thumb, and the platform's overlay is there when it is
   wanted. So the rail is styled up at 621px and left alone below it, matching the
   one breakpoint the rest of this stylesheet uses for "narrow". */
@media (min-width: 621px) {
  .cat-scroll {
    /* Room for the rail, held whether or not this row overflows, so a row that
       scrolls and a row that does not are the same height. */
    padding-bottom: 16px;
    /* Firefox, which has no ::-webkit-scrollbar to style. `thin` is its
       equivalent of the height below; the colours are the same pair. */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.32) rgba(255, 255, 255, 0.07);
  }
  .cat-scroll::-webkit-scrollbar { height: 14px; }
  /* A track of its own, so the rail reads as a slot with a handle in it rather
     than as one pale bar that could be a divider. */
  .cat-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 99px;
  }
  .cat-scroll::-webkit-scrollbar-thumb {
    /* The transparent border is what insets the handle inside the track. */
    background: rgba(255, 255, 255, 0.34);
    border: 3px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
  }
  .cat-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.55);
    background-clip: padding-box;
  }
}
/* A card in a strip is a fixed width rather than a share of one: `flex: 0 0 auto`
   would let a long name decide how wide a card is and make the strip's cards
   different sizes, and a share would make them as wide as the viewport. */
.cat-scroll > .feature-card {
  flex: 0 0 236px;
  scroll-snap-align: start;
}
/* The summary in a strip card is clamped to two lines rather than three: these
   cards sit in a row of equals, and a card whose text runs a line longer than its
   neighbours' makes the whole strip taller. */
.cat-scroll > .feature-card .feature-summary { -webkit-line-clamp: 2; }

@media (max-width: 620px) {
  /* On a phone the cards keep a width that shows a second card's edge, which is
     the only hint that the row continues -- a card as wide as the screen looks
     like a list of one. */
  .cat-scroll > .feature-card { flex-basis: 76%; }
}

/* Card with a title/description on the left and a control on the right. */
.setting-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.setting-card .body { flex: 1; min-width: 0; }
.setting-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.setting-card p { color: var(--text-dim); font-size: 13.5px; }

/* --------------------------------------------------------------- markdown */

.md { font-size: 15px; line-height: 1.65; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: 1.2em 0 0.5em; line-height: 1.3; }
.md h1 { font-size: 1.45em; }
.md h2 { font-size: 1.25em; }
.md h3 { font-size: 1.1em; }
.md ul, .md ol { margin: 0.6em 0; padding-left: 1.4em; }
.md li { margin: 0.25em 0; }
.md blockquote {
  margin: 0.8em 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--purple-700);
  color: var(--text-dim);
}
.md code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 5px;
  border-radius: 5px;
}
.md pre {
  background: #0d0b14;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  overflow-x: auto;
  margin: 0.8em 0;
}
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.md table { border-collapse: collapse; margin: 0.8em 0; width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line-strong); padding: 7px 10px; text-align: left; }
.md th { background: var(--card-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md img { max-width: 100%; border-radius: var(--radius-sm); }
.md a { color: var(--purple-300); }

/* ------------------------------------------------------------------ chat */

.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.chat-thread {
  max-width: 820px;
  margin: 0 auto;
  padding: 26px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: stretch; }

.bubble {
  max-width: 100%;
  border-radius: var(--radius-lg);
  padding: 14px 17px 8px;
  position: relative;
}
.msg.user .bubble {
  max-width: 78%;
  background: var(--grad);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 10px 26px rgba(110, 90, 230, 0.22);
}
.msg.assistant .bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
}
.msg.error .bubble { border-color: rgba(229, 72, 77, 0.4); }

.bubble-body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble-body.md { white-space: normal; }
.msg.user .bubble .md code { background: rgba(0, 0, 0, 0.22); }

.bubble-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  min-height: 32px;
}
.msg.user .bubble-foot { justify-content: flex-end; }
.msg.user .bubble-foot .icon-btn { color: rgba(255, 255, 255, 0.82); }
.msg.user .bubble-foot .icon-btn:hover { background: rgba(0, 0, 0, 0.16); color: #fff; }
.bubble-foot .tool-tag {
  font-size: 12px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: var(--radius-chip);
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
}
.bubble-foot .tool-tag:hover { background: rgba(255, 255, 255, 0.09); }
.bubble-foot .spacer { flex: 1; }

.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attachment {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
}
.msg.assistant .attachment { background: var(--card-2); }
.attachment .icon-btn { width: 22px; height: 22px; color: inherit; opacity: 0.72; }
.attachment .icon-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.14); color: inherit; }
.attachment .icon { width: 15px; height: 15px; }
.attachment-thumb {
  width: 26px; height: 26px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.attach-thumb {
  width: 20px; height: 20px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

/* Collapsible bubbles */

.bubble-content { min-width: 0; }
.bubble.collapsed .bubble-content { display: none; }

.bubble-preview {
  display: none;
  color: var(--text-dim);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg.user .bubble-preview { color: rgba(255, 255, 255, 0.88); }
.bubble.collapsed .bubble-preview { display: block; }

.collapse-btn .icon { transition: transform 0.15s ease; }
.bubble.collapsed .collapse-btn .icon { transform: rotate(-90deg); }

/* Downloadable media (images inside replies, attachments, tool output) */

.media-block {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.media-block img, .media-block video { display: block; max-width: 100%; border-radius: var(--radius-sm); }
.media-block.media-broken .media-actions { display: none; }

.media-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 4px;
  line-height: 0;
}
.media-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(10, 8, 16, 0.7);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.media-btn:hover { background: rgba(10, 8, 16, 0.92); }
.media-btn .icon { width: 16px; height: 16px; }

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.media-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  line-height: 0;
}
.media-tile img { display: block; width: 100%; height: 150px; object-fit: cover; }

/* A tile whose asset has not decoded yet, or has gone missing. */
.media-loading, .media-missing {
  display: grid;
  place-items: center;
  height: 150px;
  line-height: 1;
  color: var(--text-faint);
  font-size: 12px;
  padding: 0 10px;
  text-align: center;
}

/* Thinking panel */

.thinking {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2px;
}
.thinking summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 550;
}
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary:hover { color: var(--text); }
.thinking .chevron { margin-left: auto; transition: transform 0.15s ease; }
.thinking[open] .chevron { transform: rotate(90deg); }
.thinking-body {
  padding: 0 14px 13px;
  color: var(--text-dim);
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 42vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--purple-300);
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool-log { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; }
.tool-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
}
.tool-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 7px; }
.tool-line.bad .dot { background: var(--danger); }
.tool-line .name { font-family: var(--mono); }

/* Empty state */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px 20px;
}
.empty-state .mark {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--card-2);
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.empty-state .mark img { width: 100%; height: 100%; object-fit: cover; }
.empty-state h2 { font-size: 24px; color: var(--purple-300); letter-spacing: -0.02em; }
.empty-state p { color: var(--text-dim); max-width: 44ch; }

/* Composer */

.composer { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
.composer-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: 6px 6px 6px 8px;
}
.composer-inner:focus-within { border-color: rgba(139, 92, 246, 0.55); }
.composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  max-height: 200px;
  min-height: 40px;
  padding: 9px 4px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--text-faint); }
.send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  flex: 0 0 40px;
}
.send-btn:disabled { opacity: 0.45; cursor: default; }
.send-btn:not(:disabled):hover { filter: brightness(1.08); }

.attach-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 4px 7px 4px 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ----------------------------------------------------------- hover / menu */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 210px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.menu button:hover { background: rgba(255, 255, 255, 0.07); }
.menu button.danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------------------------------------------------------------- modals */

.modal-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.modal-root:empty { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 4, 10, 0.62);
  backdrop-filter: blur(3px);
  border: 0;
  padding: 0;
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  pointer-events: auto;
  width: min(620px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal.wide { width: min(880px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; flex: 1; }
.modal-body { padding: 15px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

/* ----------------------------------------------------------------- toast */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.18s ease;
  max-width: min(92vw, 520px);
}
.toast.bad { border-color: rgba(229, 72, 77, 0.5); color: #ffd9da; }
.toast.good { border-color: rgba(70, 177, 123, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------- mcp / etc */

.server-card { padding: 0; overflow: hidden; }
.server-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-faint);
  flex: 0 0 9px;
}
.status-dot.ok { background: var(--ok); }
.status-dot.error { background: var(--danger); }
.server-card .tools {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
}
.tool-item { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; }

.memory-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.memory-row:last-child { border-bottom: 0; }
.memory-row blockquote {
  margin: 0;
  border-left: 3px solid var(--purple-700);
  padding-left: 11px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.drop-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.015);
}
.drop-zone.hot { border-color: var(--purple-500); background: rgba(124, 92, 230, 0.08); }

.preview-tile {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--text-faint);
}
.preview-tile img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------- topbar and chat shell */

[hidden] { display: none !important; }

.view--chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}
.topbar-side.end { justify-content: flex-end; }
.topbar-mid { flex: 0 1 auto; min-width: 0; display: flex; justify-content: center; }
.topbar-center { text-align: center; min-width: 0; }
.topbar-title { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.topbar-sub { font-size: 11.5px; color: var(--text-faint); margin-top: -1px; }

.persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-chip);
  color: var(--text-dim);
  cursor: pointer;
  max-width: 240px;
  font-size: 13.5px;
}
.persona-chip:hover { border-color: var(--line-strong); color: var(--text); }
.persona-chip-mark {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: var(--card-3);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 15px;
}
.persona-chip-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.persona-chip-name {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------- list extras */

.row-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.row-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.row-note .icon { width: 15px; height: 15px; }
.section-label .icon { width: 14px; height: 14px; }

.current-persona {
  border-color: rgba(139, 92, 246, 0.45);
  background: linear-gradient(100deg, rgba(139, 92, 246, 0.15), rgba(91, 154, 245, 0.09));
}

.chat-list-full { display: flex; flex-direction: column; }
.chat-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 14px 4px;
  cursor: pointer;
  color: inherit;
}
.chat-list-row:hover { background: rgba(255, 255, 255, 0.03); }
.chat-list-row:last-child { border-bottom: 0; }

/* ------------------------------------------------------------- widgets */

.stop-square {
  width: 12px; height: 12px;
  border-radius: 3px;
  background: #fff;
  display: block;
}

.preview-box {
  min-height: 200px;
  max-height: 46vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.tool-output {
  margin-top: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  max-height: 40vh;
  overflow: auto;
}

/* --------------------------------------------------------------- authors */

/* A person's page: a larger identity block, then the same list rows the rest
   of the app uses. The avatar keeps the brand gradient (rather than a family
   accent) because an author is not one kind. */
.author-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.author-head .avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 16px;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.author-head .avatar .icon { width: 27px; height: 27px; }
.author-id { min-width: 0; }
.author-name { font-size: 25px; margin-bottom: 8px; }

/* The family controls under the count: one button per family the author has,
   each switching that family's section. Drawn as `.cat-chip.type-kind` so a
   selected family LIGHTS in its own accent (persona purple, connector blue,
   skill gold) and an unselected one falls back to the neutral surface -- the
   same language the catalogue's type chips use, for the same decision. */
.author-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 16px;
}
.author-filter { padding: 5px 10px; }
.author-filter .icon { width: 14px; height: 14px; }
/* Off is dimmed but still obviously pressable, so "hidden" cannot read as
   "unavailable": the family is still there, it is just not on show. */
.author-filter:not(.on) { opacity: 0.85; }
.author-filter:not(.on):hover { opacity: 1; }
.author-filter:focus-visible { outline: 2px solid var(--kind); outline-offset: 2px; }
.author-none { margin: 0 0 8px; }

/* The directory's two ordering buttons, directly under the search field. They
   are plain buttons rather than chips because they change the ORDER of the whole
   page rather than filtering it, and an active one is lit in the brand purple so
   "this is how the list is sorted" is legible without reading the heading. */
.rank-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.rank-btn { gap: 6px; }
.rank-btn .icon { width: 14px; height: 14px; }
.rank-btn.on {
  color: var(--purple-300);
  border-color: rgba(169, 140, 240, 0.5);
  background: rgba(169, 140, 240, 0.14);
}
.rank-btn.on:hover { background: rgba(169, 140, 240, 0.2); }
/* The star and thumb keep their own colours inside a lit button, so the two
   rankings still read apart at a glance. */
.rank-btn.on .icon { color: var(--purple-300); }

/* An author's three numbers -- stars from readers, thumbs up, thumbs down --
   on ONE line wherever an author is shown: the directory row, the directory
   tile and the top of their page. Same order everywhere, so the three facts
   read the same way on every screen. */
.author-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: -2px 0 8px;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.25;
}
.author-stat { display: inline-flex; align-items: center; gap: 4px; }
.author-stat .icon { width: 14px; height: 14px; }
.author-stat .rating-num { font-variant-numeric: tabular-nums; }

/* The star is FILLED and purple wherever an author's numbers are shown -- the
   directory row, the directory tile and their page -- so it reads as a star at a
   glance rather than as another outline glyph beside the two thumbs. Purple
   because that is the brand accent an author card already carries; the thumbs
   stay in the muted metadata colour, which is what keeps the line from becoming
   three equal marks. */
.author-stat.star-stat .icon,
.author-stats > .star-btn .icon {
  fill: var(--purple-500);
  stroke: var(--purple-400);
}
.author-stat.star-stat { color: var(--purple-300); }

/* The star on an author's own page is the one of the three a reader can change,
   so it is a button -- stripped of the button chrome so it still reads as one of
   the numbers rather than as a fifth kind of control. */
.star-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--purple-300);
  cursor: pointer;
}
.star-btn:hover { color: var(--purple-200, var(--purple-300)); filter: brightness(1.15); }
/* The reader's own star: the same purple, brighter, so "this is mine" is legible
   without changing what a star means. */
.star-btn.on { color: var(--text); }
.star-btn.on .icon { fill: var(--purple-400); stroke: var(--purple-300); }
.star-btn:disabled { opacity: 0.5; cursor: default; }

/* The tile's own spacing, because its name and subtitle already carry margins;
   the line sits between them rather than pushing them apart. */
.author-tile .author-stats { margin: -4px 0 4px; }

/* An author's listings are grouped by kind, each under its own heading. The
   section carries the kind's class so the icon picks up the family accent. */
.author-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}
.author-group-head .icon { width: 18px; height: 18px; color: var(--kind, var(--purple-300)); }
.author-group-title { font-size: 16px; }
.author-group-count {
  color: var(--text-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* One author in the Authors directory. The name gets a line of its own and the
   family counts sit underneath it rather than beside it.

   Beside the name they were competing for the same width, and on a phone the
   chips won outright: a long author name was squeezed into a one-character
   column and the row grew to several hundred pixels tall. So the name is
   truncated rather than wrapped, at every width (the full handle is on the row's
   `title`), and the counts wrap as ordinary metadata below.

   The name selector is deliberately more specific than the phone rule that lets
   a LISTING's name wrap -- `.list-row-title > span:first-child` -- because this
   row wants the opposite of what that rule is for. */
.author-row .list-row-title { flex-wrap: nowrap; }
.author-row .list-row-title > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.author-row-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* A chip that is also a link -- the author on a listing. Keeps the chip shape
   so it sits with the other metadata, but reads as clickable on hover. */
a.chip { text-decoration: none; cursor: pointer; }
a.chip:hover {
  color: var(--text);
  background: var(--card-3);
  border-color: var(--line-strong);
}
a.chip.plain:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}

@media (max-width: 620px) {
  .author-head { gap: 13px; }
  .author-head .avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
  .author-name { font-size: 22px; }
  /* The header action drops to its own line rather than squeezing a long title. */
  .page-head { flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ help */

.stills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.still {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 12px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.still:hover { background: var(--card-2); border-color: var(--line-strong); }
.still:active { transform: translateY(1px); }
.still:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 2px; }
.still-art { width: 100%; max-width: 230px; color: var(--purple-300); line-height: 0; }
.still-art svg { width: 100%; height: auto; display: block; }
/* The still and its caption take the family accent, matching the drawer icon
   and the listing rows for the same kind. */
.still.kind-persona .still-art, .still.kind-skill .still-art, .still.kind-connector .still-art { color: var(--kind); }
.still.kind-persona .still-a, .still.kind-skill .still-a, .still.kind-connector .still-a { color: var(--kind); }
.still-text { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.still-q {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.still-a { font-size: 15px; font-weight: 600; color: var(--text); }

.help-grid { display: flex; flex-direction: column; gap: 11px; }

.concept {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 12px;
}
.concept-icon {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.concept-icon .icon { width: 22px; height: 22px; }
.concept-body { flex: 1; min-width: 0; }
.concept-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.concept-head h3 { font-size: 17px; }
.concept-body p { color: var(--text-dim); font-size: 14px; }
.concept-body p + p { margin-top: 7px; }
.concept-body strong { color: var(--text); font-weight: 600; }
.concept-example {
  margin-top: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-sm);
}
.concept-example .label { display: block; margin-bottom: 4px; }
.concept-example p { margin: 0; font-style: italic; color: var(--text); font-size: 13.5px; }

/* Concept cards carry the same family accent as the rest of the app: the icon
   badge, the tagline chip and the example's background tint all take the kind
   colour. */
.concept.kind-persona .concept-icon, .concept.kind-skill .concept-icon, .concept.kind-connector .concept-icon {
  background: var(--kind-soft);
  border-color: var(--kind-line);
  color: var(--kind);
}
.concept.kind-persona .concept-head .chip, .concept.kind-skill .concept-head .chip, .concept.kind-connector .concept-head .chip {
  color: var(--kind);
  border-color: var(--kind-line);
}
.concept.kind-persona .concept-example, .concept.kind-skill .concept-example, .concept.kind-connector .concept-example {
  background: var(--kind-soft);
}

.help-h2 { font-size: 18px; margin: 22px 0 6px; }

@media (max-width: 620px) {
  .stills { grid-template-columns: 1fr; }
  .still { flex-direction: row; text-align: left; gap: 14px; padding: 12px 14px; }
  .still-art { width: 104px; flex: 0 0 104px; max-width: none; }
  .still-text { align-items: flex-start; }
  .concept { gap: 12px; padding: 13px; }
  .concept-icon { width: 38px; height: 38px; flex-basis: 38px; }
}

/* ------------------------------------------------------------ responsive */

.only-mobile { display: none; }
.only-desktop { display: initial; }

@media (max-width: 900px) {
  .only-mobile { display: initial; }
  .only-desktop { display: none; }

  .drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(86vw, var(--drawer-w));
    flex-basis: auto;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  body.drawer-open .drawer { transform: none; }

  .view-inner { padding: 14px 14px 36px; }
  .chat-thread { padding: 18px 14px; }
  .msg.user .bubble { max-width: 92%; }
  .composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 21px; }
  .modal-wrap { padding: 0; place-items: end center; }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar .chat-title-block { min-width: 0; }
}

@media (min-width: 901px) {
  #hamburger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* -------------------------------------------------- collection and ratings */

/* A listing's adoption and rating controls.

   They are one flow now rather than one card: Add/Remove sits under the title,
   and the thumbs sit under the metadata row. Adding a listing is still what
   unlocks rating it, which is why the disabled thumbs say so on hover. */

/* Add / Remove, on its own line directly under the title. */
.item-actions { display: flex; gap: 10px; margin: 4px 0 12px; }

/* The metadata row: kind, author, how many have added it, dates. */
.item-meta { margin-bottom: 10px; }

/* The thumbs. Two icons and their tallies, no card and no heading -- the glyphs
   are the explanation. Borderless until hovered so the row reads as metadata
   rather than as another block; the active state still tints, because a rating
   you cast needs to be visible. */
/* What one call costs. A quiet row rather than a chip, because it is a
   statement of price and not another tag: the coin carries the unit, the amount
   is the one thing worth reading, and "per call" is deliberately dimmer -- it is
   the qualifier, not the number. */
.cost-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--text-dim);
}
.cost-line .icon { width: 17px; height: 17px; color: var(--accent-2); flex: 0 0 auto; }
.cost-line .cost-amount { color: var(--text); font-weight: 600; }
.cost-line .cost-per { font-size: 12.5px; }

.rating-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
/* A persona's download leads the row: taking the file is why the reader is
   here, so it comes before the verdicts. The extra gap keeps it from reading as
   another rating control, and the row wraps rather than squeezing the label. */
.rating-row .rating-download { margin-right: 8px; }
.rating-row .rate-btn {
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text-faint);
}
.rating-row .rate-btn .icon { width: 16px; height: 16px; }
.rating-row .rate-count { font-weight: 500; font-size: 13px; }
.rating-row .rate-btn:disabled { opacity: 0.4; }

/* A listing's page stacks several cards -- description, persona file, images,
   how-to-use. Adjacent cards would otherwise share an edge and read as one block,
   so each one after another gets room. Scoped to this page rather than applied to
   `.card` everywhere: a list screen renders cards that are deliberately tight. */
.item-view > .card + .card { margin-top: 12px; }

/* The listing page's own type scale. The app's base is 15px and the catalogue
   screens keep to it, but this page is a reading page: its prose is set at the
   browser's own 16px so a long description is comfortable to read, and its
   rhythm is tightened to compensate -- bigger words, closer blocks. The scoping
   is deliberate; the list screens and the chat thread stay compact. */
.item-view .card-pad { padding: 14px 16px; }
.item-view .md { font-size: 16px; }
.item-view .chip { font-size: 13px; }

.rate-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
}
.rate-btn:hover:not(:disabled) { background: var(--card-2); color: var(--text); }
.rate-btn:disabled { opacity: 0.45; cursor: default; }
.rate-btn .icon { width: 17px; height: 17px; }
.rate-count { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

.rate-btn.up.active {
  color: var(--ok);
  border-color: rgba(70, 177, 123, 0.45);
  background: rgba(70, 177, 123, 0.12);
}
.rate-btn.down.active {
  color: var(--danger);
  border-color: rgba(229, 72, 77, 0.45);
  background: rgba(229, 72, 77, 0.12);
}

/* The compact tally on a list row: two thumbs and their counts, borderless so
   it does not compete with the family chip beside it. */
.rating-chip { gap: 5px; padding: 3px 7px; color: var(--text-faint); }
.rating-chip .icon { width: 14px; height: 14px; }
.rating-chip .rating-num { font-variant-numeric: tabular-nums; font-size: 12.5px; }
/* A connector always shows its tally, so this is what "nobody has voted yet"
   looks like: dimmer than a real score, so an unrated connector does not read as
   a rated one with a zero. The border goes with it -- a chip outline would still
   draw the eye to a number that says nothing. */
.rating-chip.rating-none { color: var(--text-faint); opacity: 0.65; border-color: transparent; }

/* ------------------------------------------- the Connectors screen's groups */

/* A page-level action row, above the list. Used by the Connectors screen, where
   the one thing somebody arrived to do should not be under a list that may be
   long. */
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.shelf-section { margin-bottom: 26px; }
/* The section heading carries its own count, so a group that is short reads as
   short rather than as a list that failed to load. */
.shelf-title { display: flex; align-items: baseline; gap: 9px; }
.shelf-count {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.shelf-note { color: var(--text-faint); font-size: 12.5px; margin: -6px 0 10px; }
/* The one word in a group heading that is a claim about who may see the group
   -- Public, on a shelf. Bold and in the persona accent, so it reads before the
   rest of the sentence rather than as more of the same small caps. */
.shelf-title .shelf-vis {
  font-weight: 700;
  color: var(--purple-300);
  letter-spacing: 0.06em;
}

.icon-sm { width: 14px; height: 14px; }

/* ------------------------------------------- collection rows with ratings */

/* A collection row is a card like any other list row, but the name is a link
   and the rating control is a sibling of it -- so the thumb press rates while
   the name navigates, and neither swallows the other's click. */
.list-row.collection-row { cursor: default; }
.collection-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* The inline thumbs: the same .rate-btn as a listing page, one size down, so a
   collection of many assets stays scannable. */
.rate-inline { display: flex; align-items: center; gap: 6px; }
.rate-btn.sm { padding: 5px 10px; gap: 6px; }
.rate-btn.sm .icon { width: 15px; height: 15px; }
.rate-btn.sm .rate-count { font-size: 12.5px; }

@media (max-width: 620px) {
  /* On a phone the row stacks: name on top, ratings beneath, right-aligned. */
  .list-row.collection-row { flex-wrap: wrap; }
  .collection-main { flex-basis: 100%; }
  .list-row.collection-row .list-row-end { margin-left: auto; }
}

/* A collection TILE. The card is a div rather than a link, because the rating
   control must not be inside one: the body opens the listing, the footer rates
   it, exactly as the row splits the two. */
.collection-tile { display: flex; flex-direction: column; }
.collection-link { flex: 1; color: inherit; text-decoration: none; }
.collection-tile-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 9px 13px;
  border-top: 1px solid var(--line);
}

/* An author TILE: the directory on a desktop. It borrows `item-tile`'s card
   and carries no family accent -- a person is not one of the three families,
   which is why there is no `kind-*` class and no edge ring on one. */
.author-tile .avatar { width: 38px; height: 38px; flex-basis: 38px; }
.author-tile .tile-badges .chip { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ categories */

/* A category chip is small and plain wherever it is shown, so a listing's
   labels read as metadata rather than as calls to action. */
.row-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
/* .chip.cat-mini, not .cat-mini: the base .chip.plain rule is more specific
   than a single class, so the category colour has to match its weight. */
.chip.cat-mini {
  font-size: 11.5px;
  padding: 2px 8px;
  color: var(--cat);
  background: var(--cat-soft);
  border-color: var(--cat-line);
}
/* The category line on a listing's page: chips on their own row, spaced from
   the summary below. The bottom margin lives here rather than as an inline
   style on the row, so the spacing rules are all in one place. */
.cats-row { margin: 0 0 12px; }

/* The selectable chip, used both by the Everything filter row and the submit
   form's picker. One style so "a category you can toggle" looks the same
   wherever it appears. */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.cat-filter:empty { display: none; }
.cat-filter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 2px;
}
.cat-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-picker { display: flex; flex-wrap: wrap; gap: 8px; }

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.cat-chip:hover { background: var(--card-2); color: var(--text); }
.cat-chip.on {
  color: var(--cat);
  border-color: var(--cat-line);
  background: var(--cat-soft);
}
/* A selected type uses its family's own accent (persona purple, connector blue,
   skill gold), so a family chip reads in the same colours as the listings. The
   neutral `type-all` variant is the single-select rows that keep an All chip of
   their own: the How To hub and the news index. */
.cat-chip.type-all.on {
  color: var(--purple-300);
  border-color: rgba(169, 140, 240, 0.5);
  background: rgba(169, 140, 240, 0.14);
}
.cat-chip.type-kind.on {
  color: var(--kind);
  border-color: var(--kind-line);
  background: var(--kind-soft);
}
.cat-chip .cat-count {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-faint);
}
.cat-chip.on .cat-count { color: inherit; }
.cat-chip.clear { color: var(--text-faint); }
.cat-chip.clear .icon { width: 14px; height: 14px; }

/* The Everything controls, on ONE row directly under the search field: the
   Filters button and the three family chips. They are all ways of narrowing the
   same list, so they read as one group; a "Type" heading of its own made the
   chips look like a second, unrelated control block.

   The row wraps rather than scrolling or overflowing, which is what lets a phone
   keep the same markup: the chips drop to a second line at a narrow width
   instead of being cut off. `position: relative` on the wrap anchors the
   category window below its button. */
.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.catalog-controls .cat-filter { margin: 0; }

.filter-menu-wrap {
  position: relative;
  display: block;
}
.filter-menu-wrap[hidden] { display: none; }

/* The category window. Absolute rather than fixed, so it stays with its button
   when the page scrolls, and aligned to the button's LEFT edge because the button
   is now on the left: opening inward keeps the window on screen instead of off
   the side of it. The chips inside are the same `.cat-chip` used everywhere else
   -- what is new is only where they live. */
.filter-open[aria-expanded="true"],
.filter-open[aria-expanded="true"]:hover {
  background: var(--card-3);
  color: var(--text);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: var(--cat-soft);
  color: var(--cat);
}
.filter-count[hidden] { display: none; }

.filter-pop {
  position: absolute;
  top: calc(100% + 8px);
  /* The button is on the left now, so the window opens rightward from it. */
  left: 0;
  z-index: 45;
  width: min(440px, calc(100vw - 28px));
  padding: 13px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* Capped to the viewport and laid out as a column, so the footer stays on
     screen whatever the window's contents do. The cost block made this window
     about 110px taller, and a popover that grows past the bottom of a short
     viewport takes its own Done button with it -- there is nothing to scroll,
     because the popover is absolutely positioned rather than in flow. The list is
     the only part that gives, which is also the only part that should. */
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}
.filter-pop[hidden] { display: none; }
.filter-pop-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.filter-pop-title { font-size: 13px; font-weight: 650; }
.filter-pop-note { margin-left: auto; font-size: 12px; color: var(--text-faint); }

/* The cost block, under the categories and above the footer.

   Separated by a hairline rather than a second window, because it is the same
   act -- narrowing the list -- reached by a different kind of control, and a
   reader who has just been typing in the search field should not have to wonder
   whether the slider belongs to it. */
.filter-pop-block {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.filter-pop-block-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.filter-pop-block-head .icon { width: 14px; height: 14px; color: var(--accent-2); flex: 0 0 auto; }
.filter-pop-block .hint { display: block; margin-top: 7px; font-size: 11.5px; line-height: 1.45; }

/* The two-thumb range.

   Both inputs are stretched over one track and take no pointer events, and only
   their THUMBS do -- that is what stops the upper input's invisible body from
   swallowing every press meant for the lower one. `accent-color` is left to the
   browser, so the thumbs are the platform's own and stay the right size for the
   pointer that is using them. */
.range-readout {
  margin-left: auto;
  font-size: 12px;
  color: var(--cat);
  font-variant-numeric: tabular-nums;
}
.range-wrap { position: relative; height: 26px; }
/* The track and its fill take no pointer events, so a press that is not on a
   thumb arrives at the wrapper with the wrapper as its target -- which is how
   `dualRange` tells "the bare track" from "a thumb" and moves the nearest end. */
.range-track {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
/* What is inside the two thumbs. Drawn behind them rather than as a second pair
   of tracks, so the ends of the bar line up with the middle of each thumb. */
.range-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 99px;
  background: var(--cat-line);
  pointer-events: none;
}
.range-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  /* The upper input above the lower one, until the wrapper says otherwise: the
     two coincide whenever one end is dragged onto the other, and there only the
     topmost is grabbable (see `dualRange`, which re-decides on pointermove).
     Stated rather than left to DOM order, so the stacking is a decision rather
     than a side effect of which element was appended second. */
  z-index: 4;
}
.range-wrap .range-input:nth-of-type(2) { z-index: 5; }
/* Only the thumbs are grabbable. No track styling at all, because the track
   behind them is the `.range-track` above; a second one drawn by the inputs would
   sit under it and show through the fill's translucent ends. */
.range-input::-webkit-slider-runnable-track { background: none; border: none; }
.range-input::-moz-range-track { background: none; border: none; }
.range-input::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cat);
  border: 2px solid var(--card-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cat);
  border: 2px solid var(--card-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.range-input::-webkit-slider-thumb:active { cursor: grabbing; }
.range-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.45); }
.range-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.45); }
/* An end that is sitting on its stop: dimmed, because the value it shows is the
   scale's end rather than a number the reader chose. */
.range-input[data-at-end="min"]::-webkit-slider-thumb { opacity: 0.6; }
.range-input[data-at-end="max"]::-webkit-slider-thumb { opacity: 0.6; }
/* A long vocabulary scrolls inside the window rather than growing it: a hundred
   names is taller than a small window may be. The negative margin lets the chip
   outlines breathe without eating the padding. */
/* On a phone -- and on anything that leaves too little room under the button --
   the window is a sheet pinned to the bottom of the viewport rather than a
   popover hanging off the button.

   Anchored to the button it cannot work there: the button sits about 258px down
   the page, so even capped to the viewport's height the window started too low
   and ran past the bottom of the screen -- taking Select all, Reset and Done
   with it, on the one screen where they are hardest to reach by scrolling. A
   sheet has the whole viewport to work with, and puts Done under the thumb
   rather than under the fold.

   `is-sheet` is set by `fitFilterPanel`, not by a media query, because the test
   is how much room the anchor leaves rather than how wide the window is: a phone
   in landscape is 740px wide and only 360px tall, and it needs the sheet just as
   much as a portrait one does.

   The sheet's `bottom`, `left` and `width` are also set inline by
   `fitFilterPanel`, from the visual viewport. `position: fixed` is measured
   against the LAYOUT viewport, which does not move when the keyboard opens or
   the page is pinched, so the declarations here are the fallback for the moment
   before the first measure -- not the final answer. `bottom` rather than `top` so
   the sheet grows upward as the list allows. */
.filter-pop.is-sheet {
  position: fixed;
  left: 12px;
  right: auto;
  bottom: 12px;
  top: auto;
  /* Capped and centred: on a phone this is the viewport less its margins, and on
     a wide-but-short window -- where a sheet is also used, because the anchor
     leaves too little room -- it stays a filter panel rather than growing into a
     1200px bar. `fitFilterPanel` sets all three inline from the visual viewport;
     these are the values before the first measure, and no `transform` is used
     because the inline positioning has to be able to place the sheet without one. */
  width: min(440px, calc(100vw - 24px));
  /* Above the top bar and the drawer's scrim, so nothing paints over it. */
  z-index: 95;
}

/* The category list scrolls inside the window rather than growing it: a hundred
   names is taller than a small window may be. The minimum is what keeps one row
   of chips visible when the room measured in `fitFilterPanel` is small, instead
   of collapsing the list to nothing. */
.filter-pop-list {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 244px;
  overflow-y: auto;
  margin: -2px;
  padding: 2px;
}
/* The hairline between the chosen chips and the rest of the vocabulary: the top
   group is "what you have set", and the split is what makes that legible at a
   glance rather than by reading which chips are filled in. Full width, so it
   breaks the row wherever the chips happen to wrap. */
.cat-split {
  flex: 1 1 100%;
  height: 1px;
  margin: 2px 0 4px;
  background: var(--line);
}
/* The window's search field, a little tighter than the form field it otherwise
   looks like: it narrows a list rather than filling in a form. */
.filter-pop .cat-search { margin-bottom: 10px; padding: 8px 11px; font-size: 13px; }
.filter-pop-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.filter-pop-foot .btn.primary { margin-left: auto; }

/* ------------------------------------------------------------ top rated */

/* Three columns, one per family, under the Featured strip on Everything. Each
   column carries its family accent so the three read apart at a glance, the
   same way the browse lists and author pages do. */
.top-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.top-col {
  min-width: 0;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.top-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--kind, var(--purple-300));
}
.top-col-head .icon { width: 17px; height: 17px; }
.top-col-title { font-size: 13.5px; font-weight: 650; color: var(--text); }

.top-rows { display: flex; flex-direction: column; gap: 2px; }
.top-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}
.top-row:hover { background: var(--card-2); }
.top-rank {
  flex: 0 0 auto;
  width: 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
.top-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 550;
  /* The whole name matters here, so it wraps onto a second line rather than
     being clipped the way a browse row's summary is. */
  overflow-wrap: anywhere;
}
.top-row .rating-chip { flex: 0 0 auto; }
/* The author's handle on a ranked row, between the name and the tally. It gives
   way first: the name says which listing, and the handle is the qualifier on it.
   A ranked row is narrow, so the handle is clipped rather than wrapped -- a
   three-line row would break the alignment the rank numbers rely on. */
.top-author {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-empty { padding: 8px; color: var(--text-faint); font-size: 12.5px; }

/* One author in the Popular Authors strip: their handle, the two totals the
   ranking is built from, and how much they have published.

   Laid out on `.feature-grid` alongside the featured cards, so the strip is the
   same shape as the one above it -- an author is presented as a card in the same
   rhythm as a listing, since that is the company it keeps here. */
.author-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  background: var(--card);
  border: var(--card-edge) solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.author-card:hover { background: var(--card-2); border-color: var(--line-strong); }
.author-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* The same mark that fronts a listing card, without a family to colour it: an
   author is not a persona, a connector or a skill, so it takes the neutral
   purple the `--grad-soft` mark already carries. When the author has a picture
   the box holds it instead (see `authorAvatar`), which is why `.author-mark` is
   listed with the `has-icon` boxes below. */
.author-mark {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.author-mark .icon { width: 21px; height: 21px; }
.author-handle {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.author-stats { display: flex; align-items: center; gap: 6px; }
/* The two chips carry their real totals and name themselves on hover, so a
   position in the ranking can be read rather than guessed at. The card's own
   hover must not repaint them, so they keep the plain chip's quiet styling. */
.author-stats .chip { font-size: 12px; }
.author-listings { font-size: 12px; color: var(--text-faint); }
/* The description on a starred author's card, clamped to two lines. Dimmer than
   the handle and quieter than the totals: it is there to remind a reader what
   this person writes about, not to be the reason they opened the card. */
.author-card-sub { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
/* No author qualifies yet: one sentence, in the same rhythm as a strip whose
   families are all empty. */
.author-empty { padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

@media (max-width: 720px) {
  .top-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- connectors */

/* The pending flow: a connector whose server has not answered yet. Laid out as
   what to do rather than as an error, because it is a normal stage of publishing
   rather than a failure -- the publisher simply has a step left. */
.connector-card { display: flex; flex-direction: column; gap: 14px; }
.connector-head { display: flex; align-items: center; gap: 14px; }
.connector-head > .icon { color: var(--accent-2); flex: 0 0 auto; }
.connector-title { font-weight: 600; }

/* The remaining flow: a heading, the numbered steps, and the two notes under
   them. The block is one unit so the order reads at a glance -- the note about
   the probe belongs to step 3, and the note about leaving belongs to the whole
   screen. */
.connector-steps-block { display: flex; flex-direction: column; gap: 8px; }
.connector-steps-title { font-weight: 600; font-size: 14px; color: var(--text); }
.connector-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.connector-steps a { color: var(--accent-2); }
/* Quoted fragments -- `Authorization: Bearer`, `tools/list` -- in both the steps
   and the notes under them. */
.connector-steps-block code {
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  overflow-wrap: anywhere;
}
/* Quieter than the list, because neither note is a step: one explains what
   Submit does, the other reassures that leaving costs nothing. */
.connector-steps-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-faint);
}

.connector-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(229, 72, 77, 0.4);
  border-radius: 10px;
  background: rgba(229, 72, 77, 0.08);
  color: #ffd9da;
  font-size: 13px;
  line-height: 1.45;
}
.connector-error .icon { flex: 0 0 auto; margin-top: 1px; }

.connector-gateway { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.connector-gateway .label { color: var(--text-dim); font-size: 13px; }

/* The endpoint that is promised rather than live. It sits under the steps as
   their outcome, and its label does the work of saying so -- a URL in a field
   reads as a fact unless something says it is not one yet. Sentence case rather
   than the form's uppercase `.label`, because this is a sentence about the value
   below it rather than the name of a field. */
.connector-endpoint { display: flex; flex-direction: column; gap: 6px; }
.connector-endpoint-label { color: var(--text-dim); font-size: 12.5px; }

/* The minted key, on the one screen that ever sees it. It is set apart with a
   tinted panel rather than another plain row because it is the thing the
   publisher has to act on, and because the "shown once" note beside it is the
   part that is easy to skip and expensive to miss. */
.connector-key {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(91, 154, 245, 0.34);
  background: rgba(91, 154, 245, 0.10);
}
.connector-key-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
}
.connector-key-head .icon { color: var(--accent-2); }
.connector-key .hint { margin: 0; }

/* The key's field and the eye that lives inside it. The wrapper takes no chrome
   of its own: the field keeps the border a reader sees, and the wrapper exists
   only to be the box the eye is positioned against -- so the eye sits inside the
   field rather than beside it, and reads as a control on its value instead of as
   another button in the row. */
.key-field {
  position: relative;
  display: flex;
  flex: 1 1 240px;
  min-width: 0;
}
.key-field .gateway-url { flex: 1; padding-right: 42px; }
.key-eye {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.key-eye:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.key-eye[aria-pressed="true"] { color: var(--accent-2); }
.key-eye:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 1px; }
.key-eye .icon { width: 17px; height: 17px; }
.key-eye:disabled { opacity: 0.5; cursor: progress; }

/* Masked until asked for. The dashes are wide enough to read as a withheld
   value rather than as a broken one, and the fixed width says nothing about how
   long the key is. */
.key-value { letter-spacing: 0.06em; color: var(--text-dim); }
.key-value.is-shown { color: var(--text); letter-spacing: normal; font-weight: 600; }

.gateway-url {
  flex: 1 1 240px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.connector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.connector-tools { display: flex; flex-direction: column; gap: 8px; }
.connector-tools .label { color: var(--text-dim); font-size: 13px; }
/* The Reload Tool List button's glyph turns while the probe is out. Only the
   icon moves, so the button keeps its size and the form does not jump while a
   publisher waits for their server. */
.connector-tools .icon.is-spinning { animation: spin 0.9s linear infinite; }

/* A checkbox with its explanation beside it, rather than a bare tick. */
.check-field { flex-direction: row; align-items: flex-start; gap: 10px; }
.check-field input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }

/* The line between what the listing IS and what is optional about it.
   Hairline only -- it separates two groups inside one form, so it has to read as
   a boundary without becoming a heading of its own. The word on it is what makes
   the direction of travel obvious: everything below is optional. Its text is in
   the family accent, because it is a marker on a form rather than body copy. */
.field-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-300);
}
.field-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-strong);
}

/* The tool-name appends that change what a call bills, on the connector form.
   Purple like the form's other markers (`.field-divider`) rather than a warning
   tone: naming a tool to use an append is a facility, not a caveat. The tags are
   shown as they have to be typed -- leading underscore included -- so the list
   is copyable by eye. */
.tool-appends {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius);
}
.tool-appends-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-300);
}
.tool-appends-title::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(139, 92, 246, 0.35);
}
.tool-appends-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tool-appends-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-appends-tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.32);
  color: var(--purple-300);
}

/* The category search sits directly above the chips it narrows, with a smaller
   gap than a field's, so the two read as one control. */
/* A "Pending" badge: the listing is the viewer's own and the world cannot see it
   yet. Amber rather than an error colour -- nothing is wrong, there is just a
   step left -- and it is the only badge of its kind, so it needs to be findable
   rather than loud. */
.chip.pending {
  color: var(--gold);
  border-color: rgba(240, 194, 75, 0.42);
  background: rgba(240, 194, 75, 0.13);
  font-weight: 600;
}

/* A pending row is the viewer's own unfinished work, and the badge on its title
   line already names that state. Its EDGE is left to the family like every other
   card's (see the family-edge rules near `.list-row`), deliberately: a second
   accent there would make the one pending connector on the screen the only
   card whose colour says "skill". What is left here is the room the badge needs
   on the title line. */
.list-row.is-pending .list-row-title { gap: 9px; }

/* --------------------------------------------------------- adult content */

/* An "NSFW" badge: the publisher marked the listing as adult.

   Red, and the only red badge a listing carries -- pending is amber and the
   three kinds have their own accents -- so adult is never mistaken for either.
   Drawn whether or not the pictures under it are blurred, because it IS the
   warning: it is what makes a blurred picture read as deliberate rather than
   broken, and it is the only cue left to a reader who has chosen to see these
   listings at all. */
.chip.nsfw {
  color: var(--danger);
  border-color: rgba(229, 72, 77, 0.42);
  background: rgba(229, 72, 77, 0.13);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* No hero-row override is needed for the badge: it sits inside the text column,
   which now carries a single scrim panel (see `.list-row.has-hero`), so its own
   translucent red tint lands on a surface that is already opaque enough. */

/* The blur, when the reader has asked for it (see settings.js).

   Set on the WRAPPER of an adult listing -- a row, a featured card, or a
   listing's own page -- so one rule covers every picture inside it wherever that
   listing is drawn. `img` rather than a list of slots: on an adult listing every
   picture is that listing's, so a picture slot added later is covered without a
   second selector to remember.

   The scale is what keeps the blur off the edges. A blurred image sampled at its
   own bounds shows whatever is behind it as a soft rim, so it is drawn a little
   larger than its frame -- every frame here already has `overflow: hidden`, so
   the excess is cropped rather than laid over the neighbours. */
.nsfw-blur img {
  filter: blur(18px);
  transform: scale(1.08);
}

/* A row's hero is a CSS background rather than an `<img>`, so it needs its own
   treatment -- and it is the same trick the dimming rule uses (see `.hero-dim`),
   for the same reason: a `filter` on the row itself would blur or drain the text,
   the chips and the price along with the photograph. A pseudo-element inherits
   the row's own background image and carries the filter instead, and the row's
   children are lifted above it.

   `::after`, not `::before`, so the two can coexist: on a row that is both dimmed
   and blurred, the blurred copy paints over the dimmed one, which is exactly
   right. The row's own background colour sits under the image so a soft edge
   cannot let the unblurred original show through the corners.

   `overflow: hidden`, unlike the dimming rule, because a blur is the one filter
   that leaves the box: the blurred copy is drawn past its own edges, and on a
   row whose corners are rounded that would be a soft glow around the card. The
   row's own outline is unaffected -- `overflow` clips descendants, not the
   element's own border. */
.nsfw-blur.list-row.has-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.nsfw-blur.list-row.has-hero::after {
  content: '';
  position: absolute;
  /* Past the padding edge, to cover the row's border ring -- the same reason the
     dimming pseudo reaches the border width out, or a hairline of full colour
     would trace every blurred photograph. */
  inset: calc(-1 * var(--card-edge));
  z-index: 0;
  border-radius: inherit;
  border: var(--card-edge) solid var(--line);
  background-color: var(--card);
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(16px);
}
/* The blur pseudo redraws the row's edge for the same reason the dimming one
   does, so the family accent has to be redrawn with it or a blurred adult
   listing is the one card on the page with a neutral edge. */
.nsfw-blur.list-row.has-hero.kind-persona::after,
.nsfw-blur.list-row.has-hero.kind-connector::after,
.nsfw-blur.list-row.has-hero.kind-skill::after {
  border-color: var(--kind-line);
}
.nsfw-blur.list-row.has-hero > * { position: relative; z-index: 1; }

/* The notice at the top of an adult listing's page: what the blur is, and the
   one control that lifts it. Above the hero it is about, because a blurred
   picture with no explanation reads as a broken one, and the reader's decision
   -- look, or not -- belongs before the picture rather than after it. */
.nsfw-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.32);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 13.5px;
}
.nsfw-notice .icon { flex: 0 0 auto; }
.nsfw-notice-text { flex: 1; min-width: 0; color: var(--text); }
.nsfw-notice .btn { flex: 0 0 auto; }

/* --------------------------------------------------------------- switches */

/* The two switches at the top of a listing form: NSFW, and Public / Private.

   They lead the form rather than sitting among the fields because they are not
   facts about the listing's TEXT -- they decide who ever reads it, and what
   happens when they do. Both are drawn from one control (see `toggleField`). */
.toggle-group {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* A switch: the input is the control, the track is what you see.

   The input is kept in the DOM and focusable rather than replaced by a div, so
   Space toggles it, the form still posts it, and a screen reader announces it as
   the switch it is (`role="switch"`). It is taken out of the visual flow with
   `clip`, NOT with `display: none` -- that would drop it out of the tab order
   and off the accessibility tree, and a switch nobody can reach with a keyboard
   is not a switch.

   `input:checked + .toggle-track` and `~ .toggle-copy` are why the input comes
   first in the markup. Deliberately sibling selectors rather than `:has()`: same
   result, and it does not depend on how new the browser is. */
.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.toggle-field + .toggle-field {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toggle-track {
  flex: 0 0 auto;
  position: relative;
  display: inline-block;
  width: 44px;
  height: 25px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  transition: background 0.22s ease, border-color 0.22s ease;
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.22s ease, background 0.22s ease;
}

/* On: the brand gradient, purple into blue. The knob travels the track's width
   less its own and the two 2px insets -- 44 - 19 - 4 -- so it comes to rest
   flush with the far end whatever size the track is given. */
.toggle-input:checked + .toggle-track {
  background: var(--grad);
  border-color: transparent;
}
.toggle-input:checked + .toggle-track .toggle-knob {
  transform: translateX(21px);
  background: #ffffff;
}
.toggle-input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.toggle-input:disabled + .toggle-track { opacity: 0.5; }

.toggle-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.toggle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
}
/* The current state, said in words beside the title. The knob says it too, but
   only to somebody who knows which way is on -- and "Public / Private" is a
   label that means two opposite things depending on the answer. */
.toggle-state {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.toggle-input:checked ~ .toggle-copy .toggle-state { color: var(--purple-300); }
.toggle-note { font-size: 12.5px; }

/* ------------------------------------------------------------- settings */

/* The Settings screen: one card of toggles, and nothing else on the page. */
.settings-card { display: flex; flex-direction: column; margin: 0 0 16px; }

/* `section-label` carries the drawer's own margins, which are wrong inside a
   card: it labels a group of nav rows there, and heads a card here. */
.settings-card .section-label { margin: 0 0 6px; }

/* Public Profile: the handle and the description belong to one subject, so the
   second field gets a gap the card's own stack does not provide. The count sits
   opposite the hint, and stays put while the text grows. */
.profile-field { margin-top: 14px; }
.profile-save { margin-top: 14px; }
.char-count { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* A value that cannot be edited, drawn as text rather than as a field, on the
   same line as its label. It carries no border and no box, because those are what
   say "you can type here". */
.handle-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0; }
.fixed-value {
  color: var(--text);
  font-weight: 600;
}

/* One toggle: the box, a title, and the line that explains it. The row is a
   `label`, so the whole line is the hit target rather than the 18px box beside
   it, and the hairline between rows is what makes two of them read as two
   settings rather than as one paragraph. */
.setting-row { gap: 12px; padding: 10px 2px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-title { font-size: 15px; font-weight: 600; }

/* Between the affirmation and the toggles it unlocks. `--line-strong`, unlike
   the hairline between the toggles themselves: the two groups are a gate and
   what is behind it, not two rows of one list. */
.setting-row + .toggle-field {
  border-top: 1px solid var(--line-strong);
  margin-top: 14px;
  padding-top: 14px;
}

/* The affirmation is a statement, so it is a checkbox rather than a switch --
   and it is given a little more room than a toggle, because it is two sentences
   of legal wording rather than one line of explanation. */
.settings-card .check-field .hint { max-width: 68ch; }

.cat-search { margin-bottom: 2px; }
/* `type="search"` draws a platform clear button that does nothing here (the
   chips re-render on input), so it is suppressed rather than left as a control
   that appears to reset something and does not. */
.cat-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* A chip at the cap: still readable, clearly not clickable. */
.cat-chip:disabled { opacity: 0.45; cursor: not-allowed; }

/* The persona file on a listing: the thing a reader came for, so it is offered
   with the same prominence an image download gets. */
.persona-file-card { display: flex; flex-direction: column; gap: 14px; }

/* What the file carries, under its name and above the download. The divider is
   the same rule the actions already wear, so the card reads as one header, one
   table of contents and one action. */
.persona-contents {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.persona-group > .section-label { margin: 0 0 4px; }
.persona-name { font-size: 16px; font-weight: 600; }
/* A real ordered list: the numbers are part of what the page says. It is a block,
   not a flex column, because a flex item loses its marker. */
.persona-list { margin: 0; padding-left: 20px; font-size: 13.5px; }
.persona-list li { margin-top: 8px; }
.persona-list li:first-child { margin-top: 0; }
.persona-item-name { display: block; color: var(--text); font-weight: 600; }
.persona-item-detail {
  display: block;
  color: var(--text-dim);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------- listing media */

/* The hero: one wide band above the name.

   The box has a FIXED aspect ratio and the image is cropped into it
   (`object-fit: cover`), which is the whole of "the crop is predictable" -- the
   same source always lands in the same frame at every viewport width, and the
   publisher's original is never modified to achieve it. `aspect-ratio` is the
   only width-dependent value; the ratio is the server's target (1600x600) and is
   stated here once. */
.hero-band {
  aspect-ratio: 1600 / 600;
  width: 100%;
  margin: 0 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--card-2);
}
.hero-band img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* A listing's mark: the FAMILY GLYPH, or the listing's own icon image when it has
   one.

   The glyph form keeps its accent colour, which comes from the `kind-*` class on
   the box (see the family accents above) -- so the box, not the <svg>, carries
   the kind now that the box may hold an image instead. The image form drops the
   accent tint: it is a plain crop of somebody's picture, not a glyph to colour.
   `has-icon` is what tells the two apart for sizing, since they are otherwise
   the same box. */
.avatar.has-icon,
.author-mark.has-icon,
.feature-mark.has-icon,
.page-mark.has-icon {
  background: var(--card-2);
  border-color: var(--line);
  padding: 0;
  /* A crop stays inside its rounded box. `.avatar` already clipped; the other
     two did not, which only showed once an image could be drawn larger than its
     frame -- which is what the NSFW blur does to keep the blur off the edges. */
  overflow: hidden;
}

.avatar.has-icon img,
.author-mark.has-icon img,
.feature-mark.has-icon img,
.page-mark.has-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The mark beside a listing's name on its own page. It takes the icon when there
   is one and the glyph when there is not, so the two must be the same box. */
.page-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
}
.page-mark > .icon { width: 26px; height: 26px; color: var(--kind, var(--purple-300)); }

/* The hero and icon controls, in edit mode. The two slots share one row, each
   with its add/replace control above its preview, then a short hint. The hero
   preview is exactly two icons wide and the same height, so the pair reads as
   one wide and one square rather than two differently-sized boxes. */
.media-card { display: flex; flex-direction: column; gap: 16px; }
.media-row { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.media-field { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.media-field .hint { max-width: 144px; }

/* The preview is the point of the row: it shows the CROP, in the same box shape
   the listing uses, so a publisher sees what the picture will actually look like
   before committing to it. */
.media-preview {
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* `--hero` / `--icon` rather than bare `hero` / `icon`: `.icon` is the global
   SVG sizing class (18px square), so a bare `icon` here would be squashed by it.
   The role names are what the server uses, so the modifier keeps them and adds
   the prefix rather than inventing a second vocabulary. */
.media-preview--hero { width: 144px; aspect-ratio: 2 / 1; }
.media-preview--icon { width: 72px; aspect-ratio: 1 / 1; }
/* The author's profile picture uses the square icon treatment -- it is drawn at
   the same small sizes -- with its own modifier so the two cannot be tuned into
   disagreement by accident. The corner is the author card's, so the preview is
   the shape the picture will actually appear in. */
.media-preview--avatar { width: 72px; aspect-ratio: 1 / 1; border-radius: 16px; }

/* ------------------------------------------------------------------------
   The profile-picture swatch: ONE control, not a button beside a preview.

   The picture itself is the button. An image badge sits in its lower-right
   corner whether the slot is empty or full, so "there is nothing here yet" and
   "you can change this" are the same object rather than two. Pressing it opens a
   short menu -- upload/replace, remove (only when there is something to remove),
   cancel.

   The sizing below is the Settings variant: slightly larger than a listing's
   icon preview because it carries the "None yet" label as well, and the menu
   needs a comfortable anchor.
   ------------------------------------------------------------------------ */
.media-swatch-wrap { position: relative; display: inline-flex; flex-direction: column; }
.media-preview--avatar.media-swatch { width: 88px; }

.media-swatch {
  position: relative;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card-2);
}
.media-swatch:hover { border-color: var(--line-strong); }
.media-swatch:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 2px; }
.media-swatch .media-swatch-empty {
  max-width: 100%;
  padding: 0 8px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text-faint);
}
/* The badge is small and sits INSIDE the lower-right corner, so it is legible
   against a picture of any colour: a dark chip with a light glyph rather than a
   bare icon that a busy photo could swallow. */
.media-swatch-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(11, 9, 18, 0.82);
  border: 1px solid var(--line-strong);
  color: var(--purple-300);
}
.media-swatch-badge .icon { width: 14px; height: 14px; }
.media-swatch:hover .media-swatch-badge { color: var(--text); border-color: var(--purple-300); }

/* The menu behind the swatch is a `.menu` (fixed, above the page) with its own
   width and section rules. It lives in the shared `#menu-root` layer rather than
   inside the field, so the form's scroll container cannot clip it. */
.media-swatch-menu {
  min-width: 180px;
  left: 0;
  top: 0;
}
.media-swatch-menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* The box owns the whole field, so its note gets the form's width rather than
   stacking into the narrow strip a media row would give it. */
.media-field--swatch { align-items: flex-start; }
.media-field--swatch .hint { max-width: 62ch; }
/* In the submit/edit form the two slots sit side by side, so their notes keep
   the row's own narrow measure -- the wide one is for a settings card, where the
   field has a column to itself. */
.media-row .media-field--swatch .hint { max-width: 200px; }
/* A slot this deployment cannot fill (no bucket) says so by being inert, the
   same way the button it replaced was disabled. */
.media-swatch:disabled { opacity: 0.5; cursor: default; }
.media-swatch:disabled:hover { border-color: var(--line); }
.media-swatch:disabled:hover .media-swatch-badge { color: var(--purple-300); border-color: var(--line-strong); }
.media-preview.empty { border-style: dashed; }
.media-preview.empty .hint { font-size: 11.5px; }

/* What a persona file carried, read before the rest of the form is filled in.
   A quiet panel rather than a form field: it is a report about the bytes, not
   something the publisher edits -- what they edit are the fields below it, which
   were filled from these values. */
.persona-import {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}
.persona-import-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.persona-import-emoji { font-size: 18px; line-height: 1; }
.persona-import-group { display: flex; flex-direction: column; gap: 6px; }
.persona-import-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.persona-import-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* The summary is the card; the detail is plain prose on the page's own
   background. The summary is the short editorial line, so it reads as a
   callout; the detail is the publisher's own writing and a box around it was
   just a frame. Margins are set here rather than inline so the page's rhythm
   lives in one place.

   Both run at 16px -- the browser's own body size, and the one the listing page
   is a reading page about (see the `.item-view` block above). The measure stays
   near 68ch so the wider type does not turn into a single long line. */
.summary-card { margin: 0 0 12px; }
.summary-text {
  margin: 0;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.5;
  max-width: 66ch;
}
.detail-text {
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  max-width: 68ch;
  margin: 0 0 12px;
}

/* ------------------------------------------------------- cropping a picture */

/* The crop / focus window. A fixed frame with the picture moving behind it, so
   what the frame holds is exactly what gets saved. */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 5, 12, 0.72);
  overflow: auto;
}
.crop-dialog {
  width: min(640px, 100%);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.crop-head { display: flex; align-items: center; gap: 12px; }
.crop-head > .icon { color: var(--purple-300); flex: 0 0 auto; }

/* The frame: the slot's aspect ratio, a hairline, and nothing else -- the
   picture inside it does the talking. `overflow: hidden` is what actually cuts
   the crop, and `touch-action: none` is what lets a drag pan on a touch screen
   instead of scrolling the page.

   The SIZE is set inline by the cropper (it depends on the slot and the
   viewport), so nothing here sets width or height -- the wrapper's only job is to
   sit in the middle of the dialog and hug the frame. */
.crop-viewport { position: relative; align-self: center; }
.crop-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  cursor: grab;
  touch-action: none;
}
.crop-frame:active { cursor: grabbing; }
.crop-stage { position: absolute; top: 0; left: 0; will-change: transform; }
.crop-stage img { display: block; width: 100%; height: 100%; user-select: none; }

/* A rule-of-thirds grid over the frame, so a crop can be composed rather than
   guessed at. Decorative, and never in the saved image. */
.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: calc(100% / 3) calc(100% / 3);
  background-position: -1px -1px;
}

.crop-controls { display: flex; align-items: center; gap: 10px; }
.crop-controls > .icon { color: var(--text-faint); flex: 0 0 auto; }
.crop-zoom { flex: 1 1 auto; accent-color: var(--purple-500); }
.crop-controls .hint { flex: 0 0 auto; text-align: right; }

/* A file input that a styled button drives. The input has to exist and be
   clickable programmatically, but a publisher should not see the browser's own
   control beside a button that does the same thing. */
.hidden-file { display: none; }

/* The gallery, in edit mode: what is attached now, with a remove per image. */
.form-gallery { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.form-gallery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.form-gallery-row img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}
/* A companion file that is not a picture (a PDF) gets a glyph in the same
   44px box the thumbnails occupy, so the rows line up whatever they hold. */
.form-gallery-thumb {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  color: var(--purple-300);
}
.form-gallery-row .hint { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A refusal in the submit form: the one line that says the action did not
   happen. Tinted rather than plain text because it is a state of the form, not
   another field hint -- and it may carry a link (where to buy the plan a
   refusal names), which inherits this colour so it reads as part of the
   sentence rather than as a stray link inside an error. */
.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(229, 72, 77, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(229, 72, 77, 0.08);
  color: #ffd9da;
  font-size: 13px;
  line-height: 1.45;
}
.login-error a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---------------------------------------------------- persona images */

/* The images attached to a persona. The heading states what they are FOR --
   they do not travel inside the .hspersona file, so a reader who arrives with
   that file needs to be told these belong with it. */
.image-card { display: flex; flex-direction: column; gap: 14px; }
.image-head { display: flex; align-items: center; gap: 14px; }
.image-head > .icon { color: var(--purple-300); flex: 0 0 auto; }
.image-title { font-weight: 600; }

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.img-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.img-frame {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The same square, for a file that is not a picture: the glyph and the type,
   centred. There is no preview route for one, so this is what a PDF looks like
   in the gallery instead of a broken <img>. */
.img-frame-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--purple-300);
}
.img-frame-file .hint { color: inherit; opacity: 0.8; letter-spacing: 0.04em; }
.img-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.img-name {
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-actions { display: flex; align-items: center; gap: 6px; }
.img-actions .btn { flex: 1 1 auto; justify-content: center; font-size: 12.5px; padding: 6px 10px; }
.img-remove { flex: 0 0 auto; }

.image-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.image-actions .file-input { flex: 1 1 220px; min-width: 0; }

/* A file input is one of the few controls the browser styles for itself, so it
   is given the same surface as .input rather than left as a default button. */
.file-input {
  font-size: 13px;
  padding: 7px 10px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.file-input:disabled { opacity: 0.55; cursor: not-allowed; }
.file-input::file-selector-button {
  font: inherit;
  margin-right: 10px;
  padding: 4px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}
.file-input::file-selector-button:hover { background: rgba(255, 255, 255, 0.11); }

/* --------------------------------------------------------------- help docs */

/* The How To hub is wider than a normal page, because its article cards are a
   grid; an article itself stays at the comfortable reading width of a normal
   .view-inner. Both build on the page shells above. */

.doc-hub .search-bar { margin-bottom: 12px; }
.doc-hub .doc-cats { margin-bottom: 16px; }

/* A family category chip takes its family’s accent when selected, so the
   Personas, Connectors and Skills filters read in the same colours as the
   listings they lead to. `type-all` keeps the neutral purple it inherits. */
.doc-cats .cat-chip.kind-persona.on {
  color: var(--kind); border-color: var(--kind-line); background: var(--kind-soft);
}
.doc-cats .cat-chip.kind-connector.on {
  color: var(--kind); border-color: var(--kind-line); background: var(--kind-soft);
}
.doc-cats .cat-chip.kind-skill.on {
  color: var(--kind); border-color: var(--kind-line); background: var(--kind-soft);
}

/* A tag is a quiet, monospaced label — used on article cards and metadata. */
.doc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.doc-tag.static { background: transparent; }
.doc-tag .cat-count { font-size: 11px; color: inherit; opacity: 0.7; }

/* The article grid: one card per article, used by the hub’s groups and the
   Related strip. */
.doc-group { margin-bottom: 22px; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
}
.doc-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.doc-tile:hover { background: var(--card-2); border-color: var(--line-strong); }
.doc-tile-top { display: flex; align-items: center; gap: 9px; }
.doc-tile-icon {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.doc-tile-icon .icon { width: 18px; height: 18px; }
.doc-tile-cat {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  text-align: right;
}
.doc-tile-title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.doc-tile-summary { font-size: 13px; color: var(--text-dim); margin: 0; }
.doc-tile-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.doc-tile-min { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }
/* A tile for a family article takes that family’s accent on its icon. */
.doc-tile.kind-persona .doc-tile-icon,
.doc-tile.kind-skill .doc-tile-icon,
.doc-tile.kind-connector .doc-tile-icon {
  background: var(--kind-soft);
  border-color: var(--kind-line);
  color: var(--kind);
}

/* An article: breadcrumb, head, metadata, contents, body, footer. */
.doc-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.doc-crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
}
.doc-crumbs a:hover { color: var(--text); }
.doc-crumb-sep { color: var(--text-faint); }
.doc-head { margin-bottom: 8px; }
.doc-meta { gap: 7px; margin-bottom: 10px; }
.doc-cat-chip { font-size: 12.5px; }
.doc-lede { margin-bottom: 16px; }

.doc-toc {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.doc-toc-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 9px;
}
.doc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.doc-toc li { margin: 0; }
.doc-toc-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--purple-300);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}
.doc-toc-link:hover { text-decoration: underline; }

.doc-h { font-size: 18px; margin: 22px 0 6px; scroll-margin-top: 64px; }
.doc-p { color: var(--text-dim); font-size: 15px; line-height: 1.55; margin: 0 0 10px; }
.doc-p strong, .doc-list strong, .doc-steps strong, .doc-defs strong { color: var(--text); }
.doc-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 5px;
  border-radius: 5px;
}

.doc-list { margin: 0 0 12px; padding-left: 1.35em; color: var(--text-dim); font-size: 15px; line-height: 1.55; }
.doc-list li { margin: 4px 0; }

/* Numbered steps with a drawn marker, so a how-to reads as a sequence. */
.doc-steps {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
  counter-reset: doc-step;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}
.doc-steps li {
  position: relative;
  padding: 0 0 0 34px;
  margin: 0 0 9px;
  counter-increment: doc-step;
}
.doc-steps li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--purple-300);
  font-size: 12.5px;
  font-weight: 700;
}

.doc-code { margin: 0 0 14px; }
.doc-code figcaption {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.doc-code pre {
  margin: 0;
  background: #0d0b14;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  overflow-x: auto;
}
.doc-code code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: none;
  padding: 0;
  color: var(--text);
}

/* A callout carries its tone as a full background tint, not as a coloured left
   rule, so the whole block reads as the aside it is. */
.doc-callout {
  margin: 0 0 14px;
  padding: 11px 14px;
  background: rgba(169, 140, 240, 0.10);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.doc-callout-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.doc-callout-mark { display: inline-grid; place-items: center; color: var(--purple-300); }
.doc-callout-title { font-weight: 650; font-size: 14px; color: var(--text); }
.doc-callout p { color: var(--text-dim); font-size: 14px; margin: 0; }
.doc-callout.tip { background: rgba(70, 177, 123, 0.10); }
.doc-callout.tip .doc-callout-mark { color: var(--ok); }
.doc-callout.warn { background: rgba(226, 163, 60, 0.11); }
.doc-callout.warn .doc-callout-mark { color: var(--warn); }
.doc-callout.note { background: rgba(91, 154, 245, 0.10); }
.doc-callout.note .doc-callout-mark { color: var(--accent-2); }

.doc-table-wrap { overflow-x: auto; margin: 0 0 14px; }
.doc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-table th, .doc-table td {
  border: 1px solid var(--line-strong);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.doc-table th { background: var(--card-2); color: var(--text); font-weight: 600; }
.doc-table td { color: var(--text-dim); }
.doc-table code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 5px;
}

.doc-defs { margin: 0 0 14px; }
.doc-defs dt { font-weight: 650; color: var(--text); margin-top: 10px; }
.doc-defs dt:first-child { margin-top: 0; }
.doc-defs dd { margin: 3px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}
.doc-card {
  display: flex;
  gap: 11px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.doc-card:hover { background: var(--card-2); border-color: var(--line-strong); }
.doc-card-icon {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-300);
}
.doc-card-icon .icon { width: 19px; height: 19px; }
.doc-card-title { font-weight: 650; font-size: 14.5px; margin-bottom: 3px; }
.doc-card-text { color: var(--text-dim); font-size: 13px; margin: 0; }
.doc-card.kind-persona .doc-card-icon,
.doc-card.kind-skill .doc-card-icon,
.doc-card.kind-connector .doc-card-icon {
  background: var(--kind-soft);
  border-color: var(--kind-line);
  color: var(--kind);
}

.doc-related { margin-top: 24px; }

.doc-pnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.doc-pnav-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.doc-pnav-link:hover { background: var(--card-2); border-color: var(--line-strong); }
.doc-pnav-link.next { text-align: right; }
.doc-pnav-dir {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.doc-pnav-title { font-weight: 600; font-size: 14.5px; color: var(--text); }

@media (max-width: 620px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-cards { grid-template-columns: 1fr; }
  .doc-pnav { grid-template-columns: 1fr; }
  .doc-pnav-link.next { text-align: left; }
  .doc-toc ul { gap: 6px 14px; }
}

/* ------------------------------------------------------ public news pages */

/* The news keeps the app's drawer and topbar -- server-rendered, so a release
   never loses the navigation -- but has no JavaScript. One thing follows from
   that: the mobile drawer is driven by a checkbox rather than app.js. */
.view-inner.doc-article { max-width: none; }

/* The drawer sits in flow on desktop. Below 900px it is fixed and slides in when
   the hidden checkbox is ticked; `.only-mobile` hides the toggle above the
   breakpoint, so on desktop the checkbox is never reachable. */
.nav-toggle:checked ~ .drawer { transform: none; }
.nav-scrim { display: none; }
.nav-toggle:checked ~ .nav-scrim {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 4, 10, 0.62);
  backdrop-filter: blur(3px);
}

/* The index hero: a small kicker over the H1, and a lede. */
.doc-hero { margin-bottom: 16px; }
.doc-hero-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-300);
  font-weight: 600;
}
.doc-hero h1 { font-size: 28px; }
.doc-hero-lede { color: var(--text-dim); font-size: 15px; max-width: 64ch; margin: 6px 0 0; }

/* The "N releases match" line above a filtered grid. */
.doc-filter-note { margin: 0 0 14px; font-size: 13px; color: var(--text-faint); }

/* The button inside the search field keeps its size; the field takes the room. */
.search-bar .btn { flex: 0 0 auto; }

/* An empty grid cell facing the previous/next pair, so the pair still lines up. */
.doc-pnav-spacer { display: block; }

/* ------------------------------------------------------- touch: no zoom */

/* iOS Safari ZOOMS the page when a text field with a font-size below 16px takes
   focus, and it does not zoom back out when the field loses it.

   That is the whole of the "the filter window does not fit on mobile" bug. The
   window itself was already measured correctly -- but the zoom changes the
   VISUAL viewport while the layout viewport, which `position: fixed` is measured
   against, stays where it was. The sheet is then drawn against a viewport the
   reader is no longer looking at: it appears too small or half off screen, and
   only resetting the zoom brings it back. Nothing about the layout is wrong; the
   page is simply scaled.

   16px is the threshold, and it is the only reliable cure -- `maximum-scale=1`
   would also stop the zoom, and would also stop a reader who needs to enlarge the
   page, which is a worse trade on a form full of text. The fields are a shade
   larger than they were; the layout absorbs it, and `.filter-pop .cat-search`
   repeats the declaration because its own rule is a two-class selector that would
   otherwise still win. */
@media (pointer: coarse), (hover: none), (max-width: 620px) {
  input:not([type="range"]), select, textarea { font-size: 16px; }
  .filter-pop .cat-search { font-size: 16px; }
}
