/* ─────────────────────────────────────────────────────────────
   Synapsez — a dark, terminal-adjacent workspace.
   Signal green for the assistant, amber for machine activity.
   ───────────────────────────────────────────────────────────── */

:root {
  /* A code block, and words on the amber notice: each theme says its own. */
  --code-bg: #0d1216;
  --code-ink: #dbe4ec;
  --warn-ink: #ffd9a8;
  --bg: #0b0e11;
  --bg-elev: #11161b;
  --surface: #151b21;
  --surface-2: #1b232a;
  --line: #232d36;
  --line-soft: #1a222a;

  --text: #e8eef4;
  --text-dim: #9aa8b5;
  /* 5.2:1 on --bg. Was #64727f — 3.9:1, under the 4.5 WCAG asks for, on a token
     used 119 times at 11.5–12.5px: timestamps, hints, tool durations, the
     disabled send button. Small faint text is the worst case for contrast, not
     the one that earns an exemption. Still clearly fainter than --text-dim. */
  --text-faint: #78868f;

  /**
   * The accent, and the gradient it is the average of.
   *
   * The single green was legible and it was also the whole personality of the
   * app: one flat neon on every focused control, every active row, every
   * primary button. `--accent` stays a solid colour because a great many
   * things need one — an SVG stroke, a border, a caret — and a gradient cannot
   * be any of those. `--galaxy` is the same identity as a moving surface, for
   * the places that are big enough to show it.
   *
   * Violet through magenta to cyan: far enough around the wheel to read as a
   * sky rather than a tint, and all three light enough to carry text.
   */
  --accent: #a78bfa;
  /* Text and icons on an --accent fill. Dark here, 6.96:1 on this light violet:
     white on it was 2.7:1 (ACC-013). The light theme's deep violet takes white. */
  --on-accent: #120d24;
  --accent-dim: #6d5bc4;
  --accent-glow: rgba(167, 139, 250, 0.18);
  --galaxy: linear-gradient(115deg, #7c5cff 0%, #b06aff 22%, #ff6ec7 45%, #6ee7ff 68%, #7c5cff 100%);
  /* The green the app used to be, kept for the one thing that should not
     change: the opening line. See `.empty h2`. */
  --welcome-1: #5ee6a8;
  --welcome-2: #6cb6ff;
  --warn: #ffb454;
  --danger: #ff6b6b;
  --info: #6cb6ff;
  /* Done, on, saved, connected — the colour every other app uses for them. */
  --ok: #3fb950;
  --ok-bg: rgba(63, 185, 80, 0.15);
  --info-bg: rgba(108, 182, 255, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  /* The height of a control in a toolbar row — icon buttons, the context ring.
     A token because the ring has to be exactly as tall as it is wide to be a
     circle, and two hardcoded 38s are two numbers that can drift apart. */
  --control-h: 38px;
  /* What the sidebar is when it is open — the number the drag handle writes,
     inline, on `.app`. `--sidebar-w` is what the grid actually uses, and the
     rail redefines it; keeping them apart is what lets a collapsed sidebar
     beat a remembered drag. See `resize.js`. */
  --sidebar-w-open: 288px;
  --detail-w: 340px;

  /* System first, so nothing is fetched and nothing is render-blocked. The
     named families are still honoured if they happen to be installed. */
  --font: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono',
    monospace;

  --shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.75);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* ── Glass ──────────────────────────────────────────────────
     What floats over the page — menus, sheets, toasts — is frosted rather
     than painted: a near-opaque pane, a blur behind it, and a hairline of
     light along the top edge, because real glass is brightest where it is
     cut. Tokens rather than hand-mixed rgba()s, so a theme restates them
     once and every floating surface follows.

     The docked chrome does not use these. The rail, the header and the
     progress panel have no pane at all — see `.sidebar`. */
  --glass-solid: rgba(14, 19, 25, 0.88);
  /* The writing box: frosted, so the sky and the transcript show through it
     softly, the way a pane of glass does, rather than a grey slab. */
  --composer-glass: rgba(20, 24, 36, 0.52);
  --glass-line: rgba(255, 255, 255, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.08);
  --blur: saturate(1.6) blur(22px);

  /* Hover and selection inside the transparent chrome. A named surface colour
     is opaque, so using one for a hover state paints a solid grey patch onto a
     panel that has no background — the row stops belonging to the page behind
     it. These are ink laid over whatever is there instead. */
  --tint: rgba(255, 255, 255, 0.055);
  --tint-2: rgba(255, 255, 255, 0.1);

  /* The aurora behind the page. Bright on dark, near-invisible on light. */
  --aurora-a: rgba(94, 230, 168, 0.06);
  --aurora-b: rgba(108, 182, 255, 0.05);
  --scrim: rgba(0, 0, 0, 0.55);

  /* The sky behind an empty conversation. Violet and indigo at the top fading
     into the page, three drifting clouds, and stars — see `.galaxy`. */
  --galaxy-wash: rgba(96, 78, 220, 0.3);
  --galaxy-1: rgba(124, 92, 255, 0.55);
  --galaxy-2: rgba(226, 92, 214, 0.36);
  --galaxy-3: rgba(94, 230, 168, 0.28);
  --star-ink: rgba(255, 255, 255, 0.92);
  --star-ink-2: rgba(196, 216, 255, 0.75);
}

/* ─────────────────────────────────────────────────────────────
   Light theme.

   Every colour in this file already came from a token, so a theme is a
   second block of tokens rather than a second stylesheet. It was declared
   in the markup — `data-theme` on <html>, `color-scheme: dark light` in a
   meta tag — and then never actually written, so the switch pointed at
   nothing and anyone in a bright room was simply out of luck.

   Two triggers, and the order matters: the media query is the default for
   somebody who has expressed a preference to their OS, and the explicit
   `data-theme` wins over it in both directions, because a person who
   picked a theme in this app meant it.
   ───────────────────────────────────────────────────────────── */
:root[data-theme='light'] {
  --code-bg: #f1f4f7;
  --code-ink: #1c2630;
  --warn-ink: #7a4a00;
  --bg: #f7f9fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --line: #d9e1e9;
  --line-soft: #e8edf2;

  --text: #101820;
  --text-dim: #4a5866;
  /* 4.7:1 on --bg. Was #74828f — 3.7:1. See the note in the dark palette. */
  --text-faint: #66727e;

  --accent: #6d4ae0;
  --on-accent: #ffffff;
  --accent-dim: #b9a6ff;
  --accent-glow: rgba(109, 74, 224, 0.14);
  --galaxy: linear-gradient(115deg, #5b3fd6 0%, #8a4fd8 22%, #d24aa0 45%, #2b9fc4 68%, #5b3fd6 100%);
  --welcome-1: #10855a;
  --welcome-2: #2a72c9;
  /* 5.1:1 on --bg. Was #b06a00 — 4.05:1, and it carries warnings. */
  --warn: #9a5d00;
  --danger: #c3352f;
  --info: #1b6fc4;
  --ok: #1a7f37;
  --ok-bg: rgba(26, 127, 55, 0.12);
  --info-bg: rgba(27, 111, 196, 0.1);

  --shadow: 0 18px 44px -20px rgba(16, 30, 45, 0.35);
  --aurora-a: rgba(16, 133, 90, 0.05);
  --aurora-b: rgba(27, 111, 196, 0.04);
  --scrim: rgba(16, 30, 45, 0.35);

  /* Frosted white rather than frosted black. */
  --glass-solid: rgba(255, 255, 255, 0.92);
  --composer-glass: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(16, 30, 45, 0.09);
  --glass-hi: rgba(255, 255, 255, 0.7);
  --tint: rgba(16, 30, 45, 0.05);
  --tint-2: rgba(16, 30, 45, 0.09);

  /* A pastel dawn rather than deep space, and no stars: white points on a
     near-white page are invisible at best and grubby at worst. */
  --galaxy-wash: rgba(124, 92, 255, 0.12);
  --galaxy-1: rgba(124, 92, 255, 0.22);
  --galaxy-2: rgba(226, 92, 214, 0.15);
  --galaxy-3: rgba(16, 133, 90, 0.14);
  --star-ink: transparent;
  --star-ink-2: transparent;

  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --code-bg: #f1f4f7;
    --code-ink: #1c2630;
    --warn-ink: #7a4a00;
    --bg: #f7f9fb;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef2f6;
    --line: #d9e1e9;
    --line-soft: #e8edf2;

    --text: #101820;
    --text-dim: #4a5866;
    /* 4.7:1 on --bg. Was #74828f — 3.7:1. See the note in the dark palette. */
  --text-faint: #66727e;

    --accent: #6d4ae0;
    --on-accent: #ffffff;
    --accent-dim: #b9a6ff;
    --accent-glow: rgba(109, 74, 224, 0.14);
    --galaxy: linear-gradient(115deg, #5b3fd6 0%, #8a4fd8 22%, #d24aa0 45%, #2b9fc4 68%, #5b3fd6 100%);
    --welcome-1: #10855a;
    --welcome-2: #2a72c9;
    /* 5.1:1 on --bg. Was #b06a00 — 4.05:1, and it carries warnings. */
  --warn: #9a5d00;
    --danger: #c3352f;
    --info: #1b6fc4;
    --ok: #1a7f37;
    --ok-bg: rgba(26, 127, 55, 0.12);
    --info-bg: rgba(27, 111, 196, 0.1);

    --shadow: 0 18px 44px -20px rgba(16, 30, 45, 0.35);
    --aurora-a: rgba(16, 133, 90, 0.05);
    --aurora-b: rgba(27, 111, 196, 0.04);
    --scrim: rgba(16, 30, 45, 0.35);

    --glass-solid: rgba(255, 255, 255, 0.92);
    --composer-glass: rgba(255, 255, 255, 0.62);
    --glass-line: rgba(16, 30, 45, 0.09);
    --glass-hi: rgba(255, 255, 255, 0.7);
    --tint: rgba(16, 30, 45, 0.05);
    --tint-2: rgba(16, 30, 45, 0.09);

    --galaxy-wash: rgba(124, 92, 255, 0.12);
    --galaxy-1: rgba(124, 92, 255, 0.22);
    --galaxy-2: rgba(226, 92, 214, 0.15);
    --galaxy-3: rgba(16, 133, 90, 0.14);
    --star-ink: transparent;
    --star-ink-2: transparent;

    color-scheme: light;
  }
}

* {
  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.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* A faint aurora so the near-black background has depth rather than looking flat. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, var(--aurora-a), transparent 60%),
    radial-gradient(50rem 35rem at 105% 0%, var(--aurora-b), transparent 55%);
  z-index: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  /* A link drawn as a button (Export data, Privacy) is a button: no underline. */
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
}
.btn:hover { background: color-mix(in srgb, var(--text) 11%, var(--surface)); }
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
/**
 * The one button on a screen that is the thing to press.
 *
 * On the gradient rather than a flat fill, because this is the largest accented
 * surface in the app and the only one big enough for the colour to actually
 * travel across. White text: the gradient runs from violet to cyan and there is
 * no single dark ink that stays legible over all of it.
 */
.btn--primary {
  background-image: var(--galaxy);
  background-size: 300% 100%;
  color: #fff;
  font-weight: 600;
  border-color: transparent;
  animation: galaxy-drift 14s linear infinite;
}
.btn--primary:hover { filter: brightness(1.12); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn--ghost:hover { background: var(--surface); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Its words are dim already: half of that again could not be read. */
.btn--ghost:disabled { opacity: 0.72; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--tint-2); color: var(--text); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 46vw;
  padding: 6px 11px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  /* Translucent, so the chips belong to the frosted header they sit in rather
     than looking like solid buttons dropped onto it. */
  background: var(--tint);
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  background: var(--tint-2);
  border-color: var(--accent-dim);
  color: var(--text);
}
.chip--model { color: var(--accent); }

/* A free model, said on the chip.
 *
 * A new account starts on one without having chosen it, and the way a free model
 * fails — rate-limited partway through a long job — is indistinguishable from
 * the app being broken unless something says which kind of model is answering.
 *
 * Said in the chip's own colour rather than with a dot beside it. The dot was
 * a second mark on a row that already has one for the paired computer, and two
 * small glowing circles side by side read as decoration rather than as two
 * different facts. Colour costs no width — which was the reason for a dot in
 * the first place — and the tooltip still carries the sentence. */
.chip--free {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ── Gate ────────────────────────────────────────────────────── */

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate__card {
  position: relative;
  width: min(380px, 100%);
  padding: 34px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  box-shadow: var(--shadow);
  text-align: center;
}
.gate__mark { color: var(--accent); }
.gate__title {
  margin: 10px 0 4px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.gate__sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 14px;
}
.gate__input {
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  letter-spacing: 0.16em;
  font-family: var(--mono);
}
.gate__input:focus { border-color: var(--accent-dim); outline: none; }
.gate__input--text {
  text-align: left;
  letter-spacing: normal;
  font-family: var(--font);
}
/* A password box and the eye that unhides it. The button sits inside the
   field's own padding, so the text never runs underneath it. */
.gate__field {
  position: relative;
  margin-bottom: 12px;
}
.gate__field .gate__input { margin-bottom: 0; }
.gate__input--secret { padding-right: 46px; }
.gate__reveal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
}
.gate__reveal:hover { color: var(--text); }
.gate__reveal:focus-visible { outline: 1px solid var(--accent-dim); }
.gate__eye {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
/* Show the eye while hidden, the struck-through eye while revealed — the icon
   names the state you would switch back to. */
.gate__eye--shown { display: none; }
.gate__reveal[aria-pressed='true'] .gate__eye--shown { display: block; }
.gate__reveal[aria-pressed='true'] .gate__eye--hidden { display: none; }

.gate__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.gate__remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--info);
  cursor: pointer;
}
.gate__remember:hover { color: var(--text); }
/* The agreement runs to two lines: read from the left like any sentence, the
   box beside its first line. The card centres its text, and that centred the
   second line under the box (owner, 2026-10-26, screenshot 1). */
#gate-consent-row { align-items: flex-start; text-align: left; line-height: 1.5; }
#gate-consent-row input { margin: 2px 0 0; flex: none; }

.gate__error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.gate__note {
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}
.gate__links {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}
.gate__switch {
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.gate__switch:hover { color: var(--accent); }
/* One quiet line at the foot: what the app is, and its policies. */
.gate__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 8px;
  margin: 18px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}
.gate__what {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.gate__about {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.gate__legal,
.gate__terms {
  color: var(--text-dim);
  text-underline-offset: 3px;
}
.gate__what:hover,
.gate__legal:hover,
.gate__terms:hover { color: var(--accent); }
.gate__what:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Sits above the topbar; used for "confirm your email". */
.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 180, 84, 0.35);
  background: rgba(255, 180, 84, 0.09);
  color: var(--warn-ink);
  font-size: 13.5px;
}
.banner .btn { padding: 6px 12px; font-size: 12.5px; }

.banner__form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.banner__form input {
  width: 108px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-align: center;
  outline: none;
}
.banner__form input:focus { border-color: var(--warn); }

/* ── Model browser ───────────────────────────────────────────── */

.sheet--tall {
  width: min(760px, 100%);
  max-height: 90dvh;
}
/* The model list is the scrolling region in this sheet, so it must be allowed
   to shrink for the same reason .sheet__body is. */
#model-results {
  min-height: 0;
}
/**
 * `minmax(0, 1fr)`, not the default `auto`.
 *
 * A grid's automatic column is sized to its widest item's *max-content*, and
 * the vendor chip row is several thousand pixels of chips. That made the whole
 * column that wide — stretching the search box far past the dialog edge and
 * pushing a horizontal scrollbar under everything. The explicit zero minimum
 * is what lets the column be narrower than its contents want to be.
 */
.browser__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search__icon {
  position: absolute;
  left: 13px;
  color: var(--text-faint);
  font-size: 16px;
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 11px 38px 11px 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.search input:focus {
  border-color: var(--accent-dim);
}
.search input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.search__clear:hover { background: var(--surface-2); color: var(--text); }

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  width: fit-content;
}
/* Five providers do not fit a narrow phone, so this one scrolls sideways
   rather than wrapping into a ragged second row. */
.seg--scroll {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg--scroll::-webkit-scrollbar { display: none; }
.seg__btn {
  flex: none;
  padding: 6px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.seg__btn.is-active { background: var(--surface-2); color: var(--text); }

.browser__row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
/* Without `min-width: 0` a flex item refuses to shrink below its content, so a
   long row of vendor chips pushed the whole dialog wider than the screen and
   put a horizontal scrollbar under everything. The chips scroll; the dialog
   does not. */
.chips {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
/* Applied only when there is genuinely more to scroll to, so the last chip
   fades out as an invitation rather than looking clipped by accident. */
.chips.is-scrollable {
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.chip-btn {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.chip-btn:hover { color: var(--text); }
.chip-btn.is-active {
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.mini-select {
  flex: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  outline: none;
}

.model-group__label {
  padding: 14px 2px 8px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.model-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.model-card:hover { border-color: var(--accent-dim); background: var(--surface-2); }
.model-card.is-current { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.model-card__main { flex: 1; min-width: 0; }
.model-card__name {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 500;
}
.model-card__id {
  margin-top: 3px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  word-break: break-all;
}
.model-card__meta {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}
.tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag--free { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.tag--new { color: var(--info); border-color: var(--info); background: var(--info-bg); }
.tag--ending { color: var(--danger); border-color: rgba(255, 107, 107, 0.45); }

.browser__foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
}

.meter {
  height: 7px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
}
.meter__fill.is-high { background: var(--warn); }
.meter__fill.is-full { background: var(--danger); }

.rows { display: grid; gap: 6px; margin-bottom: 14px; }
.rows__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}
.rows__item code { font-family: var(--mono); font-size: 12.5px; }
.rows__item .grow { flex: 1; min-width: 0; }
.rows__item .muted { color: var(--text-faint); font-size: 12px; }
.rows__item button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11.5px;
  cursor: pointer;
}
.rows__item button:hover { color: var(--danger); border-color: var(--danger); }

/* ── Shell ───────────────────────────────────────────────────── */

/**
 * The shell is exactly one screen tall and never scrolls. Only the message
 * thread does.
 *
 * `min-height: 0` on the columns is what makes that true: a grid item defaults
 * to `min-height: auto`, so both the sidebar and the main column grew to fit
 * their contents — 5667px for a long conversation — and pushed a scrollbar onto
 * the whole document. The header and composer scrolled away with it, which is
 * the opposite of what a chat window should do.
 */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  /**
   * Declared here, on the element the drag handle writes to, and not on
   * `:root`.
   *
   * A `var()` is substituted where the property is *declared*, not where it is
   * used. Written at `:root`, this would resolve against `:root`'s own
   * `--sidebar-w-open` and the descendants would inherit that one finished
   * number — so the inline width `resize.js` sets on `.app` would be read by
   * nothing and the sidebar would stop being resizable at all. On `.app` the
   * substitution sees the inline value, and `.app.is-rail` still wins over it
   * on specificity, which is the whole point of splitting the two.
   */
  --sidebar-w: var(--sidebar-w-open);
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 0;
  height: 100dvh;
  overflow: hidden;
  /* Both panels are grid columns, so opening or collapsing either is a change
     to this one property — which means one transition covers the sidebar
     folding to a rail and the detail rail sliding in, and they cannot get out
     of step with each other. */
  transition: grid-template-columns 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* The detail rail is a third column that collapses to nothing rather than
   being display:none, so opening and closing it can animate. */
.app.is-detail {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--detail-w);
}
.app > .sidebar,
.app > .main,
.app > .detail {
  min-height: 0;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}

/**
 * The menu rail: no background of its own.
 *
 * It used to be painted `rgba(11, 14, 17, 0.7)` — a near-black over a near-black
 * that came out a *different* near-black, so the column read as a grey strip
 * bolted to the side of the page. Tinting it slightly less, or frosting it,
 * only moves the shade; it does not stop there being two shades. The fix is to
 * have one: the panels are transparent and the page's own backdrop — aurora,
 * sky and all — runs underneath them, edge to edge.
 *
 * What separates them is the one line each, and nothing else. `::after` rather
 * than a border so it can be a gradient that fades out towards the bottom:
 * present enough to say where the panel ends, not a rule drawn across the
 * window.
 */
.sidebar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  background: transparent;
}
.sidebar::after,
.detail::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--glass-line) 12%, var(--glass-line) 78%, transparent);
}
.sidebar::after { right: 0; }
.detail::before { left: 0; }
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.brand svg { flex: none; }
/* The mark is a bitmap now, so it needs the sizing a drawn glyph carried in its
   own viewBox. `object-fit: contain` keeps a logo that is not exactly square
   from being stretched into one. */
.brand__mark {
  flex: none;
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.gate__mark img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

/* Open, the logo is a logo: no hover-swap, nothing to click. The header's own
   right edge carries the button that closes the menu, which is where a person
   looks for it. Only the collapsed rail, which has no right edge to speak of,
   folds that job back into the mark. */
.brand[disabled] {
  cursor: default;
  opacity: 1;
}
.sidebar__collapse { display: inline-grid; }
.app.is-rail .sidebar__collapse { display: none; }

/* The mark and the toggle share one square.
   Collapsed, the rail is a column of icons and the logo was the only one that
   did nothing — while the button to bring the menu back sat underneath it,
   needing a tooltip to say so. Hovering the logo now swaps in the panel glyph
   in the same place: no second row, nothing to hunt for, and the affordance is
   the picture rather than a label that appears somewhere else. */
.brand__mark,
.brand__toggle {
  transition: opacity 140ms ease;
}
.brand__toggle {
  position: absolute;
  left: 3px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--accent);
  opacity: 0;
}
/* Scoped to the rail: a disabled button still matches :hover, so without this
   the open menu's logo would flicker into a panel glyph that does nothing. */
.app.is-rail .brand:hover .brand__mark,
.app.is-rail .brand:focus-visible .brand__mark {
  opacity: 0;
}
.app.is-rail .brand:hover .brand__toggle,
.app.is-rail .brand:focus-visible .brand__toggle {
  opacity: 1;
}
.sidebar__close { display: none; }

/* ── The rail: one row per destination ───────────────────────── */

.rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rail__item svg { flex: none; }
.rail__item:hover { background: var(--tint); color: var(--text); }
/* The screen you are on — New chat on a blank conversation (paintNewChat) —
   lit the way Claude lights "New": a soft fill and the words at full colour. */
.rail__item[aria-current='page'] {
  background: color-mix(in srgb, var(--text) 9%, transparent);
  color: var(--text);
}
.rail__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/**
 * Collapsed to a rail of icons.
 *
 * Everything stays in the DOM and keeps its `title`, so the icons remain
 * reachable and explain themselves on hover; only the labels and the
 * conversation list go. The width lives on `.app` because it is a grid column
 * there — setting it on `.sidebar` alone would leave a gap where the old
 * column used to be.
 */
.app.is-rail {
  --sidebar-w: 68px;
}
/* Nothing to drag while it is a rail: the handle would write a new open width
   without anything on screen moving, so the sidebar would spring to an
   unexpected size the next time it was opened. */
.app.is-rail #sidebar-grip {
  display: none;
}
/* Hidden outright rather than faded: a label that is still laid out while the
   column narrows wraps into two lines on the way, which looks like a glitch
   rather than a transition. */
.app.is-rail .rail__label,
.app.is-rail .chats,
.app.is-rail .brand span {
  display: none;
}
.app.is-rail .sidebar {
  padding: 14px 10px;
}
.app.is-rail .sidebar__head {
  flex-direction: column;
  gap: 10px;
}
.app.is-rail .rail__item {
  justify-content: center;
  padding: 10px 0;
}
/* Centred in the rail, and mirrored so the glyph reads as "expand". */
.app.is-rail .brand {
  justify-content: center;
}
.app.is-rail .brand__toggle {
  left: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
}

/**
 * The conversation list scrolls; nothing above it does.
 *
 * There are two of these now — scheduled work and conversations — and both
 * claiming `flex: 1` split the sidebar between them, so a long list of
 * conversations squeezed itself into half the height while the other half sat
 * empty. The scheduled list is short by nature and sizes to its content; the
 * conversations take what is left.
 */
.chats {
  min-height: 0;
  overflow-y: auto;
  margin: 2px -6px;
  padding: 0 6px;
}
#chat-list { flex: 1; }

/**
 * A section heading stays put while its own section scrolls past it.
 *
 * Scrolling into the middle of a long list left you looking at rows with no
 * way to tell whether you were inside a project, inside a group, or in the
 * ordinary list — which is the one question a heading exists to answer.
 */
/**
 * The heading scrolls away with its own section, and wears nothing.
 *
 * It used to stick to the top of the list, which is why it needed a background
 * at all: rows passing underneath would otherwise be read through the letters.
 * But the sidebar is transparent on purpose — the galaxy is behind it — so any
 * background the heading painted was a band of flat colour laid over the sky,
 * visible at rest, when there was nothing underneath to hide in the first
 * place. Translucent made it grey; opaque made it black; both were a stripe.
 *
 * Dropping the stickiness removes the reason for the background rather than
 * hunting for a colour that disappears, and nothing can overlap the heading
 * any more. The cost is real and was accepted: scrolled deep into a long list
 * you no longer have a heading pinned above you saying which section you are
 * in — the list order and the project rows are what tell you now.
 */
.chat-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  border-radius: 10px;
  transition: background 0.15s;
}
.chat-row:hover { background: var(--tint); }
.chat-row.is-active {
  position: relative;
  background: var(--tint-2);
}
/* The bar that marks the open conversation, drawn as an element rather than an
   inset shadow so it can carry the gradient — a shadow can only be one colour. */
.chat-row.is-active::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background-image: var(--galaxy);
  background-size: 100% 400%;
  animation: galaxy-drift 14s linear infinite;
}
.chat-row.is-active .chat-item { color: var(--text); }
/**
 * Nothing is the open conversation while a shelf has the screen.
 *
 * The mark means "this is what you are looking at", and on the Projects page or
 * the files shelf you are not looking at any conversation — the transcript is
 * not even on screen. Left lit, it claimed a place the app was not in, and the
 * brightest thing in the sidebar pointed at somewhere you had navigated away
 * from.
 *
 * The row keeps its identity so returning to it is one click and nothing has
 * moved; only the claim goes.
 */
.app.is-on-page .chat-row.is-active { background: transparent; }
.app.is-on-page .chat-row.is-active::before { display: none; }
.app.is-on-page .chat-row.is-active .chat-item { color: var(--text-dim); }

.chat-item {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.chat-row:hover .chat-item { color: var(--text); }

.chat-row__menu {
  flex: none;
  width: 30px;
  height: 30px;
  margin-right: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
}
.chat-row:hover .chat-row__menu,
.chat-row__menu:focus-visible { opacity: 1; }
.chat-row__menu:hover { background: var(--tint-2); color: var(--text); }

/* Touch devices have no hover, so the affordance must always be visible. */
@media (hover: none) {
  .chat-row__menu { opacity: 1; }
}
/* ── Row actions ─────────────────────────────────────────────── */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  /* The lit top edge again, this time as an inset shadow — a popover has no
     spare pseudo-element and the effect is one line either way. */
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.menu__item:hover,
.menu__item:focus-visible {
  background: var(--tint-2);
  outline: none;
}
.menu__item svg { flex: none; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: rgba(255, 107, 107, 0.12); }
/* The shortcut letter, pushed to the right edge like a native menu. */
.menu__key {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11.5px;
}
.menu__sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--line-soft);
}

/* Inline rename: the row becomes its own text field, so renaming never needs a
   dialog that the browser might refuse to show. */
.chat-item--editing {
  padding: 8px 10px;
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
/* A button that has asked and is waiting for the second click. */
.is-armed {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.chat-row__pin {
  flex: none;
  margin-right: 6px;
  color: var(--accent);
  font-size: 11px;
}

/* `.chat-row.is-running` is set while work is happening in a conversation but
   deliberately draws nothing: the dot that used to sit here duplicated the
   active-row bar beside it and the composer's spinner inside it. The class
   stays as the hook for whatever replaces it. */

.chats__label {
  padding: 12px 11px 5px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sidebar__foot {
  display: grid;
  gap: 8px;
  /* At the bottom whatever is above it: open, the conversation list fills the
     room between; collapsed to a rail that list is gone, and the account rose
     to sit under the icons (owner, 2026-10-26). */
  margin-top: auto;
  padding-bottom: var(--safe-b);
}
/* The account, as Claude's sidebar ends: a letter in a circle, the username,
   a chevron; the whole row is the button (owner, 2026-10-26). */
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px 6px 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.account:hover,
.account[aria-expanded='true'] { background: var(--tint); }
.account:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.account__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
/* The name, and under it (billing preview, 2026-11-14) the plan; collapsed to a rail both go. */
.account__who {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.account__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account__plan {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 12px;
}
.account__plan[hidden] { display: none; }
.account__chev { flex: none; color: var(--text-faint); }
.app.is-rail .account { justify-content: center; padding: 6px 0; }
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.dot.is-online {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.dot.is-offline { background: var(--text-faint); }

/* ── Main column ─────────────────────────────────────────────── */

/**
 * Flex, not grid, and deliberately.
 *
 * Grid rows are positional, but three of this column's children — the
 * unverified-email banner, the screen mirror, the approval prompt — are
 * conditionally hidden, and a hidden element leaves the grid entirely. So which
 * child landed on the flexible row depended on what happened to be visible, and
 * with everything hidden the composer got it and was pushed off the bottom of
 * the screen. In a flex column the thread claims the free space by name.
 */
.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.main > * {
  flex: none;
}

/**
 * The composer floats over the transcript.
 *
 * Sitting in the column below it would be simpler, but then the last message
 * stops dead at the composer's top edge and the conversation reads as though it
 * ends there. Overlaid, messages scroll away underneath and fade out, which is
 * what makes a long thread feel like one continuous surface.
 *
 * The gradient itself must not swallow scroll gestures, so the wrapper is
 * transparent to the pointer and only the controls inside it are not.
 */
.dock {
  position: absolute;
  /* Stops short of the transcript's scrollbar.
     The dock is painted over the thread, and a classic scrollbar lives *inside*
     the thread's box — so a dock reaching the right edge covered the one thing
     you need to see to know where you are in a long conversation, exactly when
     the thumb is short and sitting at the bottom. `--sb-w` is measured in JS
     because it is 0 on overlay scrollbars and about 12–17px on the rest, and
     guessing either way is wrong on half the machines. */
  right: var(--sb-w, 0px);
  bottom: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  /* Solid later, so less of the last message is under the fade. */
  background: linear-gradient(180deg, transparent, var(--bg) 58%);
}
.dock > * {
  pointer-events: auto;
}

/* ── Back to the newest message ──────────────────────────────────
 *
 * Claude's round button (owner, 2026-10-13): it rides just above the dock —
 * so it rises with a growing composer and with the approval box — centred on
 * the transcript, and only exists while you are away from the end. Hidden with
 * `visibility` rather than `display` so it can fade, and so a hidden button is
 * out of the tab order and the accessibility tree as well as out of sight.
 */
.jump {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-dim);
  box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.18s,
    transform 0.18s,
    visibility 0s linear 0.18s,
    color 0.15s,
    border-color 0.15s;
}
/* Thumb-sized to press, without looking like a big button: the hit area
   reaches 46px round the 36px circle. */
.jump::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}
.jump.is-shown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
.jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jump__arrow { display: block; }
.jump__dots { display: none; align-items: center; gap: 3px; }
.jump__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: jump-dot 1.2s ease-in-out infinite;
}
.jump__dots i:nth-child(2) { animation-delay: 0.15s; }
.jump__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes jump-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
/* Still answering: the dots. Under the pointer, or reached by keyboard, they
   give way to the arrow — that is when the question is what pressing it does. */
.jump.is-working .jump__dots { display: flex; }
.jump.is-working .jump__arrow { display: none; }
.jump.is-working:focus-visible .jump__dots { display: none; }
.jump.is-working:focus-visible .jump__arrow { display: block; }
/* Hover only where there is a pointer: a tap on a phone leaves `:hover` stuck,
   which would swap the dots for the arrow for good after one use. */
@media (hover: hover) {
  .jump:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .jump.is-working:hover .jump__dots { display: none; }
  .jump.is-working:hover .jump__arrow { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .jump { transition: none; }
  .jump__dots i { animation: none; opacity: 0.8; }
}

/* ── The detail rail ─────────────────────────────────────────── */

/* The progress panel. Same deal as the rail, mirrored: transparent, one line. */
.detail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}
/* Collapsed the column is zero-width, so hide the contents rather than letting
   them spill across the conversation. */
.app:not(.is-detail) .detail {
  visibility: hidden;
  /* Hidden only once the column has finished closing; at once, the panel
     vanished and the slide had nothing left to show. */
  transition: visibility 0s linear 240ms;
}
.detail__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 14px 12px 14px 18px;
  border-bottom: 1px solid var(--glass-line);
}
.detail__title { font-weight: 600; letter-spacing: -0.01em; }
.detail__count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
}
.detail__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

/* ── The plan, ticked off as it goes ─────────────────────────── */

.progress {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.progress:empty { display: none; }
.progress li {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 8px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 13px;
}
.progress .is-done { color: var(--text-faint); }
.progress .is-done .pstep__title { text-decoration: line-through; }
/* The step being worked on is told by its turning ring, its words and the line
   leading to it — no longer by a blue band behind it (owner, 2026-11-09). */
.progress .is-active {
  color: var(--text);
  font-weight: 500;
}

/*
 * The line down the marks, after Claude's (owner, 2026-11-09, screenshot 2): it
 * runs from the fold button through every step, so where the run is reads at a
 * glance. Drawn as one piece per step, from just under its mark to just over the
 * next one, because a line behind the marks would show through their open rings,
 * and the panel is glass, so nothing can paint over it. The part already walked
 * is drawn firmer than the part still to come.
 *
 * The mark is 16px, 8px in from the row and 8px down (7px padding, 1px margin),
 * so its middle is 16px in and the line, 2px wide, starts at 15px.
 */
.ptrack { --pline-done: color-mix(in srgb, var(--text-faint) 70%, transparent); --pline-todo: color-mix(in srgb, var(--text-faint) 32%, transparent); }
.progress li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 27px;
  bottom: -5px;
  width: 2px;
  border-radius: 1px;
  background: var(--pline-todo);
}
.progress li.is-done:not(:last-child)::after { background: var(--pline-done); }

/* "3 earlier steps" / "Hide earlier steps ⌄": its words where the steps' words
   start, the line passing beside them on down to the first step shown. */
.pfold {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
  padding: 4px 8px 4px 34px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.pfold[hidden] { display: none; }
.pfold::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 6px;
  bottom: -5px;
  width: 2px;
  border-radius: 1px;
  background: var(--pline-done);
}
.pfold:hover { color: var(--text-dim); }
.pfold:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pfold__chev { flex: none; }
/* Claude's "2 earlier steps ^": the chevron only on hover or keyboard focus. It
   keeps its width at rest (opacity, not display) so the words never shift. */
.pfold__chev--up {
  opacity: 0;
  transform: rotate(180deg);
  transition: opacity 0.15s ease-out;
}
.pfold:hover .pfold__chev--up,
.pfold:focus-visible .pfold__chev--up { opacity: 1; }
@media (hover: none) {
  /* Nothing to hover on a touch screen, so the cue would never show. */
  .pfold__chev--up { opacity: 0.7; }
}
/* Earlier steps slide in and out (~200 ms). Bottom-aligned while moving, see
   slideProgress() in app.js; the transition itself is cut to nothing for
   prefers-reduced-motion by the global rule, and app.js skips it too. */
#progress-steps {
  transition: height 0.2s ease-out, opacity 0.2s ease-out;
}
#progress-steps.is-sliding {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

/* ── one step: its mark, its title, and what it involves ───────── */

.pstep { display: flex; gap: 10px; align-items: flex-start; }
.pstep__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pstep__detail {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-decoration: none;
}
/* A ring for every state, so the column of marks lines up: dashed for what is
   still to come, turning while it is worked on, filled with a tick when done. */
.pmark { flex: none; margin-top: 1px; }
.pmark--done { color: var(--ok); }
.pmark--pending { color: var(--text-faint); }
.pmark--active { color: var(--info); }
/* It turns only while the turn is running. A plan left at rest when the turn
   ended keeps a still ring, so it never looks like work that is going on. */
.progress.is-live .pmark--active { animation: spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .progress.is-live .pmark--active { animation: none; }
}

/* The panel before there is anything to show. Left as a bare paragraph it read
   as a page that had failed to load; boxed, it reads as a slot waiting to be
   filled — which is what it is. */
#progress-empty {
  margin: 0;
  padding: 14px 15px;
  border: 1px dashed var(--glass-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 34%, transparent);
}

/* ── The browser sandbox, mirrored ────────────────────────────── */

.screen {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.screen__bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 7px 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.screen__live {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
/* Pulses only while frames are actually arriving, so the dot means something. */
.screen__live.is-live {
  background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.35; }
}
.screen__title {
  flex: none;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.screen__title { flex: 1; max-width: none; }
/* Under the frame rather than in the bar: the rail is narrow and a URL is long. */
/* One row per open tab, above the address row, the way a browser stacks them. */
/* Scrollable *and* seen to be.
 *
 * This had `overflow-x: auto` with the scrollbar hidden on both engines, so with
 * five tabs open the row genuinely scrolled and nothing said so — the tabs past
 * the right edge simply did not appear to exist. A thin bar is the whole fix:
 * the strip is 30px tall and 6px of it is a price worth paying for tabs you can
 * reach. `overlay` keeps it off the tab row on engines that support it. */
.screen__tabs {
  display: flex;
  gap: 3px;
  padding: 5px 6px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  scrollbar-gutter: stable;
}
.screen__tabs::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}
.screen__tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line);
}
.screen__tabs::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
.screen__tab {
  flex: none;
  max-width: 140px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  color: var(--text-faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.screen__tab:hover { color: var(--text); }
.screen__tab.is-active {
  border-color: var(--line);
  border-bottom-color: transparent;
  background: var(--bg-elev);
  color: var(--text);
}
.screen.is-collapsed .screen__tabs { display: none; }

/* The address row, above the picture where a browser keeps it. */
.screen__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.screen__navbtn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.screen__navbtn:hover { background: var(--surface-2); color: var(--text); }
.screen__url {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
}
.screen.is-collapsed .screen__nav { display: none; }
.screen__frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05070a;
}
.screen__frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  outline: none;
  /* An <img> is draggable by default, so pressing on the chart and pulling
     started a native image drag — a ghost of the picture following the cursor —
     and the mousedown never became a gesture we could forward. Panning a chart
     was impossible for that reason alone. */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
/* While you hold the controls, say so — a click landing in a page the assistant
   is using should never be a surprise. */
.screen.is-driving {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
/* Grab, not point: the panel takes drags as well as clicks, and the cursor is
   the only thing that says so before you try. */
/* No picture yet: the frame says so, rather than a broken image and its alt text. */
.screen__frame img:not([src]) { display: none; }
.screen__empty {
  margin: 0;
  padding: 26px 16px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}
.screen__frame:has(img[src]) .screen__empty { display: none; }
.screen.is-driving .screen__frame img { cursor: grab; }
.screen.is-driving.is-dragging .screen__frame img { cursor: grabbing; }
/* The cloud browser takes the real press, move and release, so its pointer is
   the page's ordinary arrow, and a finger on it scrolls the page rather than
   the panel around it. */
.screen.is-driving.is-direct .screen__frame img,
.screen.is-driving.is-direct.is-dragging .screen__frame img { cursor: default; }
.screen.is-driving .screen__frame img { touch-action: none; }
.screen__frame { position: relative; }
/* Where typing goes while driving the cloud browser — composed Vietnamese and
   pastes included. Out of sight, never out of the document: a hidden field
   cannot take focus or an input method. */
.screen__keys {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  resize: none;
  pointer-events: none;
}
.icon-btn.is-active { color: var(--accent); background: var(--accent-glow); }
.screen.is-collapsed .screen__frame { display: none; }

/* Full-size view: the frame fills the window so detail is readable.
 *
 * Flex rather than grid, and that is the whole fix. This was
 * `grid-template-rows: auto 1fr` over a panel with *four* children — bar, tab
 * strip, address bar, frame — so the `1fr` landed on the tab strip and the
 * picture was pushed into an implicit auto row with nothing left to occupy.
 * Expanding the panel made the thing you wanted to see disappear. A column that
 * gives the last child the remaining space cannot be miscounted, however many
 * rows the bar grows later. */
.screen.is-expanded {
  position: fixed;
  inset: 0;
  /* Above the sidebar (18) and the composer dock, below the toasts (60).
     While expanded the panel is a child of <body> — see `setExpanded()` — so
     this is compared against the page rather than against the detail rail it
     normally lives in, whose own stacking context used to bury it. */
  z-index: 50;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: #05070a;
}
.screen.is-expanded .screen__bar,
.screen.is-expanded .screen__tabs,
.screen.is-expanded .screen__nav {
  flex: none;
}
.screen.is-expanded .screen__frame {
  flex: 1;
  /* Without this a flex child refuses to shrink below its content, and an image
     taller than the window pushes the whole panel off the bottom. */
  min-height: 0;
}
/* The picture fills whatever is left — grown as well as shrunk — never cropped
   and never overflowing. `width/height: auto` showed it at the size it arrived,
   so a frame made for the rail stayed rail-sized in the middle of the window
   (owner, 2026-10-31). Clicks are placed by the drawn picture (drawnBox). */
.screen.is-expanded .screen__frame img {
  /* Placed over the frame rather than sized in it: the frame is a centring
     grid, whose auto row gives `height: 100%` nothing to be a percentage of —
     the picture took its height from its width and ran off the bottom. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.screen:fullscreen { width: 100vw; height: 100vh; }
.screen__drive:disabled,
#screen-drive:disabled { opacity: 0.45; cursor: not-allowed; }

/**
 * The header, and no line under it.
 *
 * It never needed one. The transcript is a flex sibling *below* this bar with
 * its own scrolling box, so nothing has ever passed underneath it — the blur
 * and the opaque backing were guarding against an overlap that does not happen,
 * and the border was drawing a third seam across a window that already had two.
 * Transparent, the title and the chips simply sit on the page.
 */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
}
.topbar__menu { display: none; }
/* Asked once, under the header, of an account that has not agreed to the
   documents as they are now (2026-10-26). Quiet: the work goes on beside it. */
.legal-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 16px 6px;
  padding: 10px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass-solid);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}
.legal-banner[hidden] { display: none; }
.legal-banner__text { flex: 1 1 320px; margin: 0; }
.legal-banner__text a { color: var(--accent); text-underline-offset: 3px; white-space: nowrap; }
.topbar__title {
  /* An h1, so the chat view has a heading — it had none, and this is the thing
     that names the page. The two resets are what let it be one without looking
     like one: a bare h1 would arrive at 2em with 0.67em of margin and push the
     topbar apart. */
  margin: 0;
  font-size: inherit;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/*
 * The right of the header shrinks, and its chips shrink with it.
 *
 * Without `min-width: 0` a flex item refuses to go below the width of its
 * contents, so on a narrow window this block stayed at its full size, pushed
 * past the edge, and its chips sat on top of the title. The title has always
 * had the same guard; this side never did, and it is the side that grows.
 *
 * Each chip keeps a floor so that shrinking ellipsises the label rather than
 * crushing a chip to a sliver — a 34px stub with no readable text in it is not
 * a smaller control, it is a broken one.
 */
.topbar__right {
  display: flex;
  min-width: 0;
  gap: 7px;
}
/* Centred, so a label shorter than the floor — "Auto" — sits in the middle of
 * the chip rather than against its left edge. */
.topbar__right .chip { min-width: 62px; justify-content: center; }

/* ── Scrollbars that are not furniture ───────────────────────────
 *
 * Windows draws a permanent light-grey trough with stepper arrows. Against a
 * near-black transcript it reads as a panel edge that is part of the design,
 * except it is not — it is a control that only matters for the second you are
 * using it, and the rest of the time it is a pale stripe down a dark page.
 *
 * Why the arrows were still there.
 *
 * This block used to set `scrollbar-width` and `scrollbar-color` *and* the
 * `::-webkit-scrollbar` rules below, on the assumption that the standard
 * properties covered Firefox and the pseudo-elements covered Chrome. They do
 * not coexist: Chromium takes the standard properties as a declaration that
 * you want the *native* scrollbar, and drops every `::-webkit-scrollbar` rule
 * on the element — including `::-webkit-scrollbar-button { display: none }`.
 * What you then get on Windows 11 is Chrome's Fluent scrollbar, which draws a
 * stepper arrow at each end. The rule meant to remove them was the reason they
 * appeared.
 *
 * So the pseudo-elements are the default and the standard properties are
 * fenced behind `@supports not selector(::-webkit-scrollbar)` — true only in
 * engines that have no pseudo-elements to use. The negation is deliberate:
 * a browser too old to evaluate `selector()` at all fails the query, which
 * leaves it on the webkit path it almost certainly wants.
 */

/* Every scrolling region in the app, not only the ones tagged `.scroll-quiet`:
   a sheet body or a code block with steppers on it is the same eyesore. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
/* The track is the page. Anything else is a seam. */
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Drawn inside the padding box, so the transparent border is what turns a
   10px-wide bar into a 6px pill floating clear of the edge. */
::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-faint); }
/* The stepper arrows Windows insists on. There is nowhere for them to go that
   does not look like a button somebody put there on purpose. */
::-webkit-scrollbar-button { display: none; }

/**
 * `.scroll-quiet` goes one further: nothing at all at rest.
 *
 * A thumb is a control that matters for the second you are using it, and the
 * rest of the time it is a pale stripe down a dark page. `.is-scrolling` is
 * put on by a scroll listener and taken off shortly after the scrolling stops,
 * which is also what makes it vanish once you reach the end and let go.
 *
 * Overlay, not inline: `scrollbar-gutter` is deliberately not set, so the thumb
 * floats over the content and the text does not shift sideways when it appears.
 */
.scroll-quiet::-webkit-scrollbar-thumb {
  background-color: transparent;
  transition: background-color 250ms ease;
}
.scroll-quiet:hover::-webkit-scrollbar-thumb,
.scroll-quiet.is-scrolling::-webkit-scrollbar-thumb {
  background-color: var(--line);
}
.scroll-quiet::-webkit-scrollbar-thumb:hover { background-color: var(--text-faint); }

/* Firefox, and anything else without the pseudo-elements. */
@supports not selector(::-webkit-scrollbar) {
  .scroll-quiet {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 250ms ease;
  }
  .scroll-quiet:hover,
  .scroll-quiet.is-scrolling {
    scrollbar-color: var(--line) transparent;
  }
}

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* The bottom pad is the dock's real measured height, kept in step by a
     ResizeObserver — the composer grows as you type and a fixed guess would
     either hide the last message or leave a gap under it. */
  padding: 26px 0 calc(var(--dock-h, 96px) + 14px);
  scroll-behavior: smooth;
}

/* ── The galaxy: what an empty conversation sits under ───────── */

/*
 * A first screen with nothing on it is still a first impression, and a flat
 * near-black rectangle makes the app look switched off. So the empty state gets
 * a sky: a violet wash at the top, three slow clouds, and two layers of stars
 * drifting at different speeds.
 *
 * Everything here is decorative and everything here is conditional. The layer
 * is `aria-hidden`, transparent to the pointer, and both faded out *and* paused
 * once a conversation exists — an animation nobody can see is just a warm
 * laptop. It sits behind the topbar and both side panels, so the colour reaches
 * every edge of the window rather than stopping at a seam.
 */
.galaxy {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: linear-gradient(180deg, var(--galaxy-wash), transparent 58%);
  transition: opacity 700ms ease, visibility 0s linear 700ms;
}
.app.is-fresh .galaxy {
  visibility: visible;
  opacity: 1;
  transition: opacity 900ms ease, visibility 0s;
}
/* Everything above the sky. `.dock` sets its own stacking already. */
.topbar,
.thread {
  position: relative;
  z-index: 1;
}

.galaxy__cloud,
.galaxy__stars {
  position: absolute;
  will-change: transform;
}

.galaxy__cloud {
  border-radius: 50%;
  filter: blur(72px);
  animation: cloud-drift 30s ease-in-out infinite alternate;
}
.galaxy__cloud--a {
  top: -22vh;
  left: -12vw;
  width: 58vw;
  height: 58vh;
  background: radial-gradient(circle, var(--galaxy-1), transparent 68%);
}
.galaxy__cloud--b {
  top: -16vh;
  right: -14vw;
  width: 52vw;
  height: 52vh;
  background: radial-gradient(circle, var(--galaxy-2), transparent 66%);
  animation-duration: 38s;
  animation-direction: alternate-reverse;
}
.galaxy__cloud--c {
  top: 14vh;
  left: 26vw;
  width: 44vw;
  height: 40vh;
  background: radial-gradient(circle, var(--galaxy-3), transparent 70%);
  animation-duration: 46s;
  animation-delay: -12s;
}

/* Two tiled fields at different scales, so the near one slides past the far
   one and the sky has depth. Each travels exactly one tile before repeating,
   which is what makes the loop invisible. */
.galaxy__stars {
  inset: -12%;
  background-repeat: repeat;
}
.galaxy__stars--near {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, var(--star-ink), transparent 62%),
    radial-gradient(1.4px 1.4px at 74% 9%, var(--star-ink), transparent 62%),
    radial-gradient(1.2px 1.2px at 43% 61%, var(--star-ink-2), transparent 62%),
    radial-gradient(1.5px 1.5px at 88% 46%, var(--star-ink), transparent 62%),
    radial-gradient(1.1px 1.1px at 26% 85%, var(--star-ink-2), transparent 62%),
    radial-gradient(1.3px 1.3px at 62% 34%, var(--star-ink), transparent 62%);
  background-size: 420px 420px;
  animation: star-near 150s linear infinite;
}
.galaxy__stars--far {
  background-image:
    radial-gradient(1px 1px at 8% 42%, var(--star-ink-2), transparent 60%),
    radial-gradient(1px 1px at 34% 12%, var(--star-ink-2), transparent 60%),
    radial-gradient(0.9px 0.9px at 57% 78%, var(--star-ink), transparent 60%),
    radial-gradient(1px 1px at 81% 24%, var(--star-ink-2), transparent 60%),
    radial-gradient(0.8px 0.8px at 94% 66%, var(--star-ink-2), transparent 60%);
  background-size: 260px 260px;
  opacity: 0.7;
  animation: star-far 230s linear infinite, twinkle 9s ease-in-out infinite alternate;
}

/* After the shorthands above, not before: `animation: …` resets play-state to
   running, so a paused rule declared earlier is quietly overwritten and the sky
   keeps animating behind a conversation nobody is looking at it through. */
.galaxy__cloud,
.galaxy__stars {
  animation-play-state: paused;
}
.app.is-fresh .galaxy__cloud,
.app.is-fresh .galaxy__stars {
  animation-play-state: running;
}

@keyframes cloud-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(5vw, 4vh, 0) scale(1.16); }
}
@keyframes star-near {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-420px, -420px, 0); }
}
@keyframes star-far {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(260px, -260px, 0); }
}
@keyframes twinkle {
  from { opacity: 0.42; }
  to { opacity: 0.85; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* The global reduce rule collapses durations to almost nothing, which for an
   infinite animation is a loop running flat out. These simply stop. */
@media (prefers-reduced-motion: reduce) {
  .galaxy__cloud,
  .galaxy__stars,
  .empty > *,
  .suggestion {
    animation: none !important;
  }
}

.empty {
  display: grid;
  align-content: center;
  max-width: 660px;
  min-height: min(58vh, 520px);
  margin: 4vh auto 0;
  padding: 0 22px;
  text-align: center;
}
.empty > * {
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.empty p { animation-delay: 90ms; }
.empty .suggestions { animation-delay: 180ms; }
.empty h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4.4vw, 34px);
  letter-spacing: -0.03em;
  /* Deliberately *not* on the accent.
     Everything else moved to the galaxy palette; this line did not, because it
     is the first thing anybody sees and it was already right. Its two colours
     are held in their own tokens so a future change to the accent cannot drag
     the welcome along with it by accident. */
  background: linear-gradient(96deg, var(--text) 18%, var(--welcome-1) 62%, var(--welcome-2));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.empty p {
  margin: 0 auto 26px;
  max-width: 46ch;
  color: var(--text-dim);
}
.suggestions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
/*
 * Glass, on the accent — not a grey card.
 *
 * `color-mix(var(--surface) 62%)` is a named surface colour thinned out, and a
 * thinned-out opaque grey over a violet sky is still grey: it read as four flat
 * tiles laid on the only screen in the app with something behind them. Real
 * glass is three things together — a wash you can see through, a blur so what
 * is behind it is *there* rather than merely visible, and a bright hairline
 * along the cut edge — and the app already has tokens for all three, which
 * every other floating surface uses.
 *
 * At rest the edge is the glass hairline; the neon arrives on the one card
 * being pointed at, or focused from the keyboard. Four lit rings at once made
 * none of them the one about to be chosen — the light is what says "this one".
 */
.suggestion {
  padding: 13px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 46%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: none;
  color: var(--text-dim);
  text-align: left;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s, background 0.15s;
}
/* No blur available — Firefox with the pref off, older WebKit. A transparent
   wash over a busy sky is unreadable without one, so those get the pane. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .suggestion { background: var(--glass-solid); }
}
.suggestion:hover,
.suggestion:focus-visible {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--glass-hi), transparent 46%), var(--tint-2);
  color: var(--text);
  /* No lift: a blurred pane that moves over a moving scene was redrawn every frame of
     the scene, and its square backdrop showed as a grey box blinking behind the card
     (owner, 2026-11-08, screenshot 5). The ring and the glow say "this one" alone. */
  /* The neon: a tight ring of the accent, then its glow. */
  box-shadow: 0 0 0 1px var(--accent-dim), 0 0 22px -4px var(--accent-glow), 0 10px 26px -14px var(--accent-glow);
  outline: none;
}

/* ── Messages ────────────────────────────────────────────────── */

.msg {
  max-width: 780px;
  margin: 0 auto 22px;
  padding: 0 22px;
}
.msg--user {
  /* A column so the copy and edit row can sit under the bubble rather than
     beside it, still hard against the right edge. */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.msg--user .bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface-2);
  white-space: pre-wrap;
  word-break: break-word;
}
/* A long message folded to eight lines (`fillBubble`). The height is in lines so
   it stays eight at any font size; `1.55em` is the same thing for a browser
   without the `lh` unit. The fade only once there is something under it. */
.bubble__text.is-folded {
  max-height: calc(8 * 1.55em);
  max-height: calc(8 * 1lh);
  overflow: hidden;
}
.bubble__text.is-folded.is-faded {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5lh), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5lh), transparent);
}
.bubble__more {
  display: block;
  margin-top: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  /* A drag across the message should copy its words, not this button's. */
  -webkit-user-select: none;
  user-select: none;
}
.bubble__more[hidden] { display: none; }
.bubble__more:hover { color: var(--accent); }
.bubble__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Copy and edit: present only while you are pointing at the message.
   The row keeps its height whether or not it is visible — fading in is one
   thing, but a transcript that shifts under the pointer as you move down it is
   another, and the second is unusable. */
.msg__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  margin-top: 3px;
}
/* The buttons and the time beside them fade in together on hover. A date under
   every turn of a long conversation was a column of furniture to read past;
   it is there the moment you point at the message you want to date. */
.msg__actions .msg__action,
.msg__actions .msg__time {
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s, color 0.14s;
}
.msg--user:hover .msg__actions .msg__action,
.msg--assistant:hover .msg__actions .msg__action,
.msg--user:hover .msg__actions .msg__time,
.msg--assistant:hover .msg__actions .msg__time {
  opacity: 1;
}
/* When it was sent, or when the reply finished — in the device's own zone. */
.msg__time {
  margin-right: 6px;
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* At the left corner of a reply's row, across from its copy button. */
.msg--assistant .msg__time { margin-right: auto; }
/* Hard against the right edge, where the user's own copy button already is.
   Under the left edge of a reply it was the furthest point on the row from
   where the pointer has just been — you finish reading at the right. */
.msg--assistant .msg__actions {
  justify-content: flex-end;
}
/*
 * Keyboard focus reveals them too — but only keyboard focus.
 *
 * This was `:focus-within`, which a mouse click also satisfies: pressing Copy
 * left the button focused, so the row stayed lit after the pointer had moved
 * away, on that message, until something else was clicked. `:focus-visible`
 * is the distinction the browser already draws between "I tabbed here" and "I
 * clicked here", which is exactly the one wanted.
 */
.msg--user:has(.msg__action:focus-visible) .msg__actions .msg__action,
.msg--assistant:has(.msg__action:focus-visible) .msg__actions .msg__action,
.msg--user:has(.msg__action:focus-visible) .msg__actions .msg__time,
.msg--assistant:has(.msg__action:focus-visible) .msg__actions .msg__time {
  opacity: 1;
}
.msg--user.is-editing .msg__actions { visibility: hidden; }

/* What was sent, above the words it came with: the tray's own tiles, so a file
   looks the same waiting and sent. A stored one is a button that opens it. */
.msg__files {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 82%;
  margin-bottom: 6px;
}
.stage--sent { padding: 0; font: inherit; color: var(--text); text-align: left; }
button.stage--sent { cursor: pointer; }
button.stage--sent:hover { border-color: var(--accent-dim); }
button.stage--sent:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage--sent.stage--file { padding: 10px 12px; }
/* A message that is only files has no words to put in a bubble. */
.msg--user .bubble:empty { display: none; }
/* A step whose only work joined the card of the step before (see `webCard`)
   is left with nothing to show, and must not leave a gap where it is. */
.msg--assistant:has(> .msg__body:empty):not(:has(> .msg__actions)) { display: none; }

.msg__action {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.msg__action:hover { background: var(--surface-2); color: var(--text); }
.msg__action.is-done { color: var(--ok); }
/* No hover on a touch screen, so there is nothing to reveal — they simply stay. */
@media (hover: none) {
  .msg__actions .msg__action,
  .msg__actions .msg__time { opacity: 1; }
}

/* The bubble while it is being rewritten. */
.msg--user.is-editing .bubble {
  width: min(680px, 100%);
  max-width: 100%;
}
.bubble__edit {
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  resize: vertical;
  outline: none;
  /* A long message scrolls inside the box, with a thin bar that can be grabbed
     and dragged — hidden, there was no way to see where you were in it. The app's
     own bar, which is why the standard properties are fenced off below. */
  max-height: 55vh;
  overflow-y: auto;
}
.bubble__edit::-webkit-scrollbar-thumb { background-color: var(--text-faint); }
.bubble__edit::-webkit-scrollbar-thumb:hover { background-color: var(--text-dim); }
@supports not selector(::-webkit-scrollbar) {
  .bubble__edit { scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent; }
}
.bubble__editrow {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.msg__role {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.msg__role .dot { width: 6px; height: 6px; background: var(--accent); }

.prose { word-break: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 13px; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin: 22px 0 9px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.prose h1 { font-size: 21px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 16px; }
.prose ul, .prose ol { margin: 0 0 13px; padding-left: 22px; }
.prose li { margin-bottom: 5px; }
.prose a { color: var(--info); text-underline-offset: 3px; }
.prose blockquote {
  margin: 0 0 13px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line);
  color: var(--text-dim);
}
.prose hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.prose code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.88em;
}
.prose table {
  width: 100%;
  margin-bottom: 13px;
  border-collapse: collapse;
  font-size: 14px;
}
.prose th, .prose td {
  padding: 7px 10px;
  border: 1px solid var(--line);
  text-align: left;
}
/* Clear, like everything else drawn in a reply: the heading row is told apart
   by its weight and a stronger rule under it, not by a grey slab. */
.prose th { background: transparent; font-weight: 600; }
.prose thead th { border-bottom-color: var(--text-faint); }

/* Mathematics (see public/js/math.js). KaTeX inherits the text colour, so it
   reads correctly in both themes; a long formula scrolls inside its own box
   rather than widening the conversation on a phone. */
.math .katex { font-size: 1.08em; }
.math--display {
  display: block;
  max-width: 100%;
  margin: 8px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.math--display .katex-display { margin: 0; }
.math-block { margin: 0 0 13px; }
/* While KaTeX loads, or if it cannot, the source is shown as code. */
.math.is-pending {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.prose li > .codeblock { margin: 8px 0; }

.codeblock {
  position: relative;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--code-bg);
  overflow: hidden;
}
.codeblock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 13px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11.5px;
}
.codeblock pre {
  margin: 0;
  padding: 13px;
  overflow-x: auto;
}
/* Its own ink: `.prose code` is written for code among words, on the page's ground. */
.codeblock code {
  padding: 0;
  background: none;
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.6;
}
.copy-btn {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ── Reasoning + tools ───────────────────────────────────────── */

/* The reasoning card. Folded: a window about four lines tall, pinned to the
   newest lines and faded at both edges, so it can be watched without taking
   the screen. Open: the whole trace. Prose, not a code block — it is thought,
   and set in a monospace box it read like a log. */
.think {
  margin: 0 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: var(--bg-elev);
}
.think__head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px 6px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.think__head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
/* A drawn chevron in a square box: turned a quarter it stays in the middle of the row,
   where the typed "›" it replaced sat low once open (owner, 2026-11-10). */
.think__chev {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-faint);
  transition: transform 0.22s ease;
}
.think__chev svg { display: block; }
.think.is-open .think__chev { transform: rotate(90deg); }

/* The title shimmers while the model is still thinking — a light passing
   along the word, the same thing the eye reads as "working". */
.think.is-live .think__title {
  background: linear-gradient(90deg, var(--text-faint) 0%, var(--text) 45%, var(--text-faint) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: think-shimmer 1.8s linear infinite;
}
@keyframes think-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.think__body {
  max-height: 6.4em;
  overflow: hidden;
  padding: 0 14px 12px;
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 1.4em, #000 calc(100% - 1.2em), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 1.4em, #000 calc(100% - 1.2em), transparent 100%);
}
.think.is-open .think__body {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
  color: var(--text-dim);
}
.think__text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Opening and closing glide where the browser can size to the content (calc-size);
   elsewhere it opens at once, as before. Never for anyone asking for less motion. */
@supports (height: calc-size(auto, size)) {
  .think__body { max-height: none; height: calc-size(auto, min(size, 6.4em)); transition: height 0.26s ease; }
  .think.is-open .think__body { height: calc-size(auto, size); }
  .think--inline .think__body { height: calc-size(auto, min(size, 3.3em)); }
  .think--inline.is-open .think__body { height: calc-size(auto, size); }
}
@media (prefers-reduced-motion: reduce) {
  .think__body, .think__chev { transition: none; }
}

/* Open, the trace hangs from a rail: a dot where it starts and a line down
   its length. While the model is still thinking there is no dot yet — only
   the line, with light falling down it like rain; the dot arrives when the
   thought is finished. Folded, none of this shows. */
.think.is-open .think__body { position: relative; padding-left: 36px; }
.think.is-open .think__body::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 20px;
  bottom: 14px;
  width: 1.5px;
  border-radius: 1px;
  background: var(--line);
}
.think.is-open .think__body::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 7px;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: var(--text-dim);
}
.think.is-open.is-live .think__body::after { content: none; }
.think.is-open.is-live .think__body::before {
  top: 4px;
  width: 2px;
  background-color: color-mix(in srgb, var(--accent) 22%, transparent);
  /* Two streams of drops at different spacings, moved the same distance
     as their own tile each cycle, so they fall at different speeds and
     the loop never shows a seam. Each drop has a bright head at the bottom
     and a tail fading upward — the direction reads as falling. */
  background-image:
    linear-gradient(180deg, transparent 0 45%, var(--accent) 88%, #fff 94%, transparent 95%),
    linear-gradient(180deg, transparent 0 60%, var(--accent) 92%, #fff 96%, transparent 97%);
  background-size: 100% 110px, 100% 170px;
  background-repeat: repeat-y;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 6px var(--accent));
  animation: think-rain 1.1s linear infinite;
}
@keyframes think-rain {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 110px, 0 170px; }
}

/* Words that just arrived glow, then settle into the rest. */
.think__new { animation: think-glow 1.4s ease-out forwards; }
@keyframes think-glow {
  from { color: var(--text); text-shadow: 0 0 10px var(--accent), 0 0 2px var(--text); }
  to { color: inherit; text-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .think.is-live .think__title { animation: none; color: var(--text-dim); background: none; }
  .think__new { animation: none; }
  .think.is-open.is-live .think__body::before { animation: none; background-image: none; background-color: var(--accent); }
}

/* ── Tool cards ─────────────────────────────────────────────────
 *
 * One quiet line per tool, after Claude's (owner, 2026-10-25): no box round
 * the card, and none round what it holds. At rest the line is the whole card —
 * the tool's icon, what was done, the one argument that matters, how long it
 * took — and opening it shows the call and its answer as text on the page, the
 * way a command's output already was (2026-10-19). Twelve calls used to read
 * as twelve boxes, each holding two more. */
details.block {
  margin: 0 0 6px;
  border: 0;
  background: transparent;
}
details.block > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 5px 0;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14.5px;
  cursor: pointer;
  list-style: none;
  transition: color 0.15s;
}
details.block > summary:hover { color: var(--text); }
details.block > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.block > summary::-webkit-details-marker { display: none; }
/* The chevron follows the words, as on Claude's rows, rather than waiting at
   the far edge of the column. */
details.block > summary::after {
  content: '›';
  flex: none;
  color: var(--text-faint);
  font-size: 16px;
  transition: transform 0.18s;
}
details.block[open] > summary::after { transform: rotate(90deg); }
/* Under the line, indented to its words. `minmax(0, 1fr)` so nothing inside —
   a long argument, a wide output — can push the column wider than the reply. */
details.block .block__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 2px 0 10px 26px;
  color: var(--text-dim);
  font-size: 13.5px;
}
/* A finished line shows the tool's icon, quiet; a failed one its red cross. */
details.block > summary > .mark,
details.block > summary > .step__mark { color: var(--text-faint); }
.mark--icon svg { display: block; }
/* What a call was given and what it answered: text on the page, monospace,
   with no box (owner, 2026-10-25). Long output still scrolls in place rather
   than making the transcript a page long. */
details.block pre {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-height: 320px;
  overflow: auto;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The headline of a tool card: what was done, in words. Not monospace — it is
   a sentence, not a function name — and not bold: it is a line in a column of
   them, the way Claude sets its rows. */
.tool__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-weight: 400;
  font-size: 14.5px;
}
/* The argument that matters — a path, a URL, a query. Still monospace, because
   this half really is a literal value and the difference between `l` and `1` in
   a path is worth being able to see.

   `min-width: 0` is what makes the ellipsis work at all: a flex item will not
   shrink below its content, so without it a long path widens the row instead of
   being cut, and on a phone the chevron leaves the screen. */
.tool__arg {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool__time { color: var(--text-faint); font-size: 11.5px; }
/* A call still being written: the same line, before it can be opened. */
.tool--draft { margin: 0 0 6px; }
.tool__draft {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 0;
  color: var(--text-dim);
  font-size: 14.5px;
}
.tool__draft .tool__time { font-variant-numeric: tabular-nums; }
/* A failed line says so in its words and its mark. */
.tool--error .tool__name { color: var(--danger); }
details.block.tool--error > summary > .mark,
.tool--error .mark { color: var(--danger); }

/* The exact call's arguments, inside the card. The function's name is on the
   node as `data-tool-name` — not a badge nobody read, nor a tooltip in the
   pointer's way (owner, 2026-10-26). */
.tool__call { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.tool__call:empty { display: none; }
/* The call is the quieter half: what it was asked, fainter than what it answered
   — and framed, so the command and what came back are two things at a glance,
   not one run of monospace (owner, 2026-10-31). The answer stays unboxed.
   Two classes deep on purpose: `details.block pre` and `.step__out pre` both set
   a size, and this has to outrank them without reaching for `!important`. */
.block .tool__args,
.step__out .tool__args {
  margin: 0 0 2px;
  padding: 9px 12px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  color: var(--text-faint);
  font-size: 11.5px;
}

/* ── a run of steps ──────────────────────────────────────────────────
 *
 * Eight browser actions in one card, because that is one piece of work rather
 * than eight. The row is deliberately not monospace: this is the half of the
 * transcript written for the person, and `browser_click {"ref":"7"}` was the
 * problem it exists to fix.
 */
/* The title is what is happening now, and the model's own words for a command
   can run long: it gives way with an ellipsis rather than pushing the chevron
   off a phone's screen. The detail beside it — the file, the command — takes
   the room left over… */
.steps__title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-weight: 400;
  font-size: 14.5px;
}
/* …but never all of it while there is a command beside it: the title is the
   model's word for what ran and the command is what ran, so the command keeps
   a share of the line however long the title is (security review, 2026-10-13). */
.steps__title:has(+ .steps__detail:not([hidden])) { max-width: 62%; }
.steps__detail {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12px;
}
/* How long the run has been at it, ticking — digits of one width, so the
   title does not shuffle sideways every second. */
.steps__clock {
  flex: none;
  color: var(--text-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.steps__clock:empty,
.steps__tally:empty { display: none; }
.steps__tally { flex: none; color: var(--text-faint); font-size: 12.5px; }
.steps--error .steps__title { color: var(--danger); }
/* One step of several failed: the run still did its work, so the title stays
   as it is and only the count of failures says so. */
.steps--partial .steps__tally { color: var(--warn); }

/* The reasoning between two steps, inside the run's card: a quiet row hung
   from a thin rule, a line or two tall until it is opened. */
.step.step--thought { display: block; padding: 2px 0 2px 24px; }
.think.think--inline {
  margin: 2px 0;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0;
  background: none;
}
.think--inline .think__head { padding: 3px 10px 2px; font-size: 12.5px; font-weight: 500; }
.think--inline .think__body { max-height: 3.3em; padding: 0 10px 4px; font-size: 12.5px; }
.think--inline.is-open .think__body { max-height: none; }

.steps__list {
  margin: 0;
  padding: 8px 14px 12px;
  list-style: none;
  display: grid;
  /* A row can never widen the card, whatever it holds. */
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
/* A browsing session's rows, open, in the same light box as a run of commands. */
details.block.steps:not([data-family='work']) > .steps__list {
  margin: 2px 0 6px;
  padding: 6px 14px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.step {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.step__mark {
  display: flex;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
}
.step--error .step__mark { color: var(--danger); }
/* A sum: the working, then its answer. The numbers line up, because they get compared. */
.step.step--calc { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 3px 0; }
.step.step--calc:has(> .step__mark) { grid-template-columns: 16px minmax(0, 1fr) auto; }
.calc__expr {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  background: none;
  overflow-wrap: anywhere;
}
.calc__eq { color: var(--text-faint); font-size: 12px; }
.calc__value {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: none;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.calc__why { grid-column: 1 / -1; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
/* A lookup: what was asked, and what it found under it, a screenful at most. */
.step.step--lookup { display: block; padding: 5px 0; }
.step--lookup > .step__mark { display: inline-block; width: 16px; vertical-align: top; }
.lookup__asked { color: var(--text-faint); font-size: 12.5px; overflow-wrap: anywhere; }
.lookup__out {
  max-height: 16em;
  margin-top: 3px;
  overflow: auto;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lookup__why { display: block; margin-top: 2px; color: var(--danger); font-size: 12.5px; overflow-wrap: anywhere; }
/* The metric twin of Calibri, so a sheet is the same width on a phone with no Calibri. Fetched only if a cell asks. */
@font-face { font-family: Carlito; src: url('/api/office-fonts/Carlito-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Carlito; font-weight: 700; src: url('/api/office-fonts/Carlito-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Carlito; font-style: italic; src: url('/api/office-fonts/Carlito-Italic.ttf') format('truetype'); font-display: swap; }
/* A workbook, as Excel draws one: the sheet is always paper, whatever the theme. */
.xlv-host { height: 100%; min-height: 420px; }
.xlv { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg-elevated, var(--surface)); }
.xlv__modes { display: flex; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--line); }
.xlv__mode { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-dim); font: inherit; font-size: 14px; cursor: pointer; }
.xlv__mode:hover { color: var(--text); }
.xlv__mode.is-active { border-bottom-color: var(--accent); color: var(--text); }
.xlv__mode:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xlv__count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--tint-2); font-size: 12px; text-align: center; }
.xlv__bar { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 3px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.xlv__ref { flex: none; min-width: 44px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.xlv__fx { flex: none; color: var(--text-faint); font-style: italic; }
.xlv__formula { flex: 1; min-width: 0; overflow: hidden; color: var(--text); font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.xlv__scroll { position: relative; flex: 1; min-height: 0; overflow: auto; background: #fff; color: #000; outline: none; }
.xlv__scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.xlv__scroll.is-loading { opacity: 0.6; }
.xlv__sheet { position: relative; }
.xlv__body { position: absolute; }
.xlv__lines, .xlv__cells, .xlv__pictures { position: absolute; inset: 0; pointer-events: none; }
.xlv__vline { position: absolute; top: 0; width: 1px; background: #e1e4e8; }
.xlv__hline { position: absolute; left: 0; height: 1px; background: #e1e4e8; }
.xlv__band { position: absolute; left: 0; }
.xlv__cell { position: absolute; display: flex; box-sizing: border-box; padding: 0 2px; overflow: hidden; color: #000; font-family: Carlito, Calibri, Arial, sans-serif; font-size: 14.67px; line-height: 1.2; white-space: pre; }
.xlv__text { position: relative; min-width: 0; }
.xlv__bar-fill { position: absolute; top: 1px; bottom: 1px; left: 1px; }
.xlv__picture { position: absolute; object-fit: fill; }
.xlv__selected { position: absolute; border: 2px solid #1a73e8; box-sizing: border-box; pointer-events: none; }
.xlv__cols, .xlv__rows { position: sticky; z-index: 2; color: #59616b; font-size: 12px; font-family: var(--font, inherit); }
.xlv__cols { top: 0; height: 22px; margin-left: 46px; background: #f1f3f5; border-bottom: 1px solid #c5cad1; }
.xlv__col { position: absolute; top: 0; height: 100%; display: grid; place-items: center; box-sizing: border-box; border-right: 1px solid #c5cad1; }
.xlv__rows { left: 0; width: 46px; margin-top: 0; background: #f1f3f5; border-right: 1px solid #c5cad1; }
.xlv__row { position: absolute; left: 0; right: 0; display: grid; place-items: center; box-sizing: border-box; border-bottom: 1px solid #c5cad1; overflow: hidden; }
.xlv__corner { position: sticky; top: 0; left: 0; z-index: 4; box-sizing: border-box; width: 46px; height: 22px; margin-bottom: -22px; background: #e6e9ec; border-right: 1px solid #c5cad1; border-bottom: 1px solid #c5cad1; }
.xlv__frozen { position: sticky; z-index: 1; pointer-events: none; }
.xlv__frozen.is-over, .xlv__frozen--both { background: #fff; }
.xlv__frozen--top { top: 22px; border-bottom: 1px solid #6b7280; }
.xlv__frozen--left { border-right: 1px solid #6b7280; }
.xlv__frozen--both { top: 22px; z-index: 2; }
.xlv__frozen[hidden] { display: none; }
.xlv--no-heads .xlv__cols, .xlv--no-heads .xlv__rows, .xlv--no-heads .xlv__corner { visibility: hidden; }
.xlv__note { margin: 0; padding: 6px 10px; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 12.5px; }
.xlv__sheets { display: flex; gap: 2px; align-items: center; padding: 4px 8px; overflow-x: auto; border-top: 1px solid var(--line); }
.xlv__tab { flex: none; padding: 5px 12px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.xlv__tab:hover { background: var(--tint-2); color: var(--text); }
.xlv__tab.is-active { border-color: var(--line); background: var(--tint-2); color: var(--text); }
.xlv__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.xlv__hidden { flex: none; margin-left: 8px; color: var(--text-faint); font-size: 12px; }
.xlv__charts { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 12px; overflow: auto; }
.xlv__chart-tabs { display: flex; flex: none; gap: 6px; padding-bottom: 8px; overflow-x: auto; }
.xlv__chart-tab { display: grid; flex: none; gap: 1px; max-width: 280px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text-dim); font: inherit; text-align: left; cursor: pointer; }
.xlv__chart-tab:hover { background: var(--tint-2); }
.xlv__chart-tab.is-active { background: var(--text); color: var(--bg); }
.xlv__chart-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.xlv__chart-name { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.xlv__chart-sheet { font-size: 12px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xlv__chart { flex: 1; margin: 4px 0 0; padding: 10px; border-radius: 10px; background: #fff; }
.xlv__chart img { display: block; width: 100%; max-width: 1000px; max-height: 72vh; height: auto; margin: 0 auto; object-fit: contain; }
.xlv__chart-title { padding: 2px 4px 8px; color: #444; font-size: 13px; }
/* A deck as it looks. */
.slides.slides--drawn { gap: 14px; padding: 8px 16px 24px; }
.slides .slide.slide--drawn { padding: 0; overflow: hidden; aspect-ratio: auto; }
.slide__picture { display: block; width: 100%; height: auto; background: #fff; }
.slides .slide--drawn .slide__no { top: 6px; right: auto; left: 6px; z-index: 1; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; }
.slides .slide--drawn .slide__notes { margin: 0; padding: 10px 12px; }
.viewer__alt { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 16px 0; }
.viewer__alt-note { margin-right: auto; color: var(--text-faint); font-size: 12.5px; }
.viewer__alt button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
.viewer__alt button:hover { background: var(--tint-2); color: var(--text); }
.viewer__alt button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.viewer__alt button:disabled { cursor: progress; opacity: 0.72; }
.viewer__media { display: grid; place-items: center; padding: 24px; }
.viewer__media video { max-width: 100%; max-height: 70vh; }
.viewer__media audio { width: min(100%, 520px); }
/* While a command runs, its last lines. */
.step__live { max-height: 12em; overflow: hidden; opacity: 0.85; }
/* That the model was shown the file it wrote, on the row of the write. */
.tool__looked { color: var(--text-faint); font-size: 11.5px; }
.step__label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.step__verb { color: var(--text-dim); white-space: nowrap; }
.step__detail {
  color: var(--text-faint);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/**
 * The same line, when it is an address you can follow.
 *
 * Quiet at rest — it is a record of what happened, not a call to action, and a
 * transcript of twenty steps lit up in accent colour is a wall. It only takes
 * the accent and the underline under the pointer, which is where the question
 * "can I click this?" is actually being asked.
 */
.step__link {
  text-decoration: none;
  cursor: pointer;
}
.step__link:hover {
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.step__time { color: var(--text-faint); font-size: 11.5px; }

/* The thumbnail and the raw output both belong under their step rather than
   beside it, so they span the whole row instead of squeezing the label. */
.step__shot,
.step__out { grid-column: 1 / -1; }

.step__shot {
  margin: 4px 0 2px 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
  width: max-content;
  max-width: calc(100% - 24px);
}
.step__shot img {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
}
.step__shot:hover { border-color: var(--accent); }

/* A row of a run of commands is a disclosure of its own, like Claude Code's:
   the row is the button, and opening it shows the command it ran and what it
   printed. The grid moves from the row to its head. */
.step.step--work { display: block; padding: 0; }
.step__fold > summary {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto 10px;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 0;
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
}
.step__fold > summary::-webkit-details-marker { display: none; }
.step__fold > summary::after {
  content: '›';
  justify-self: center;
  color: var(--text-faint);
  transition: transform 0.18s;
}
.step__fold[open] > summary::after { transform: rotate(90deg); }
.step__fold > summary:hover { background: var(--tint); }
.step__fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The model's title for a step keeps its width, up to its share below; the
   command beside it takes what is left and is cut short first. Both shrinking
   together cut a title to "Tải và lọ…" beside a long curl (owner, 2026-10-26):
   the title is what a person reads, and the whole command is one click away. */
.step--work .step__verb {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The same share for the command as in the card's title — and only beside a
   command does the title hold its width; alone it gives way with an ellipsis. */
.step--work .step__verb:has(+ .step__detail) { flex-shrink: 0; max-width: 62%; }
.step--work .step__detail { flex: 1 1 0; font-family: var(--mono); font-size: 12px; }
.step__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 4px 0 8px 24px; }
.step__body .tool__call { margin: 0; }
/* What a command printed sits on the page itself, as in Claude Code — the
   command keeps its box, the output has none (owner, 2026-10-19). Two classes
   deep, to outrank `details.block pre`. */
.step__body .step__output {
  padding: 2px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
}
/* "Running… 12s" under a command still going. */
.step__running {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px 2px 0;
  color: var(--text-dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.step__running::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  animation: running-pulse 1.2s ease-in-out infinite;
}
@keyframes running-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .step__running::before { animation: none; }
}

.step__out { margin-left: 24px; }
.step__out > summary {
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}
.step__out > summary::-webkit-details-marker { display: none; }
/* A browsing step's output, like every tool's: text on the page, no box. */
.step__out pre {
  margin: 4px 0 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── the commands card, after Claude's (owner, 2026-10-19) ─────────────────
 *
 * Folded, one grey line — "Read 36 files, ran 34 commands (1 failed) ›" — and
 * on the right the pictures it looked at. Open, its rows in a box with a
 * hairline between each: the verb grey, the file bright, a thumbnail at the
 * end. No border round the card and no tick on it: the words say what was
 * done, a failure says so in them, a spinner says it is still going. Since
 * 2026-10-25 every card is a line with no border (see "Tool cards"); what is
 * scoped here is this family's: no mark at all on the line, and its rows. */
details.block.steps[data-family='work'] > summary > .mark:not(.mark--pending) { display: none; }
/* The chevron follows the words; the pictures take the far end. */
details.block.steps > summary::after { order: 5; margin-left: -2px; }
details.block.steps[data-family='work'] .steps__title { position: relative; }
details.block.steps.steps--error[data-family='work'] .steps__title { color: var(--danger); }
/* The old title fades up and away as the new one comes in. */
details.block.steps[data-family='work'] .steps__title.is-changing { animation: steps-title-in 0.24s ease-out; }
details.block.steps[data-family='work'] .steps__title[data-was]::after {
  content: attr(data-was);
  position: absolute;
  inset: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: steps-title-out 0.24s ease-out forwards;
}
@keyframes steps-title-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes steps-title-out { from { opacity: 1; transform: translateY(4px); } to { opacity: 0; transform: translateY(-4px); } }

.steps__thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
  padding-left: 12px;
}
.steps__thumbs[hidden],
details.block.steps[open] > summary > .steps__thumbs { display: none; }
details.block.steps > summary > .steps__thumbs { order: 6; }
.steps__more { margin-right: 4px; color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.pic-thumb {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
  transition: border-color 0.15s;
}
.pic-thumb[hidden] { display: none; }
.pic-thumb:hover { border-color: var(--accent); }
.pic-thumb:focus-visible,
.step__path:focus-visible,
.step__image:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pic-thumb--head,
.pic-thumb--row { display: block; flex: none; min-width: 24px; }
.pic-thumb--head { height: 36px; max-width: 64px; }
.pic-thumb--row { height: 30px; max-width: 54px; margin-left: auto; }
/* On a phone the words need the room: the same three, smaller. */
@media (max-width: 520px) {
  .steps__thumbs { gap: 4px; padding-left: 8px; }
  .pic-thumb--head { height: 28px; max-width: 40px; }
}
.pic-thumb--head img,
.pic-thumb--row img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: cover; }

/* Open: the rows in one box, a hairline between each. */
details.block.steps[data-family='work'] > .steps__list {
  gap: 0;
  margin: 2px 0 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
details.block.steps[data-family='work'] > .steps__list > li + li { border-top: 1px solid var(--line); }
details.block.steps[data-family='work'] .step.step--thought { padding: 6px 14px; }
details.block.steps[data-family='work'] .step__fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 0;
}
details.block.steps[data-family='work'] .step__fold > summary::after { content: none; }
details.block.steps[data-family='work'] .step__mark { flex: none; width: 14px; }
details.block.steps[data-family='work'] .step__mark:empty { display: none; }
details.block.steps[data-family='work'] .step__label { flex: 0 1 auto; align-items: center; gap: 6px; font-size: 14.5px; }
details.block.steps[data-family='work'] .step__label::after {
  content: '›';
  flex: none;
  color: var(--text-faint);
  transition: transform 0.18s;
}
details.block.steps[data-family='work'] .step__fold[open] .step__label::after { transform: rotate(90deg); }
details.block.steps[data-family='work'] .step__verb { color: var(--text-dim); }
details.block.steps[data-family='work'] .step--error .step__verb { color: var(--danger); }
/* Sized to its words, so the chevron sits right after them. */
details.block.steps[data-family='work'] .step__detail { flex: 0 1 auto; }
/* A file is the bright half of the line; a command stays quiet monospace. */
details.block.steps[data-family='work'] .step[data-kind='read'] .step__detail,
details.block.steps[data-family='work'] .step[data-kind='write'] .step__detail,
details.block.steps[data-family='work'] .step[data-kind='edit'] .step__detail,
details.block.steps[data-family='work'] .step[data-kind='list'] .step__detail {
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
}
details.block.steps[data-family='work'] .step__body { margin: 0 14px 12px; }
/* One command is the card: opened, its command and what it printed, not its
   line again — the header above already is that line (settleSingle). */
details.block.steps[data-single] .step--work > .step__fold > summary { display: none; }
details.block.steps[data-single] .step--work .step__body { margin-top: 12px; }
.step__took { margin: 0; color: var(--text-faint); font-size: 12px; }
.step__picture { display: grid; gap: 8px; }
.step__where { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin: 0; }
/* The argument's name, plain — not the boxed `code` of prose. */
details.block .step__key {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12.5px;
}
.step__path {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--info);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.step__path:hover { text-decoration: underline; text-underline-offset: 3px; }
.step__image {
  width: max-content;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
}
.step__image img { display: block; max-width: 100%; max-height: 480px; width: auto; height: auto; }
@media (prefers-reduced-motion: reduce) {
  details.block.steps[data-family='work'] .steps__title.is-changing { animation: none; }
  details.block.steps[data-family='work'] .steps__title[data-was]::after { display: none; }
}

/* ── the pictures a run looked at: the preview and the lightbox ──────────
 *
 * After Claude's (owner, 2026-10-19). The lightbox is the dark of a photo
 * viewer whatever the theme — a picture is judged against black — with the
 * tool's word bottom left and "2 of 3" between two arrows in the middle.
 * Pictures sit on white: a diagram exported with no background is dark lines
 * on nothing, and would vanish on the dark theme. */
.gallery-open { overflow: hidden; }
.gallery {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: rgb(0 0 0 / 0.86);
  color: #ececec;
}
.gallery__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 60px 24px 8px;
  overflow: hidden;
  /* Every touch is the lightbox's own: a pinch zooms the picture, not the page. */
  touch-action: none;
}
.gallery__frame { display: grid; place-items: center; min-height: 0; max-height: 100%; margin: 0; }
.gallery__img {
  display: block;
  max-width: min(92vw, 1600px);
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}
.gallery__frame.is-from-right { animation: gallery-in-right 0.24s ease-out; }
.gallery__frame.is-from-left { animation: gallery-in-left 0.24s ease-out; }
@keyframes gallery-in-right { from { opacity: 0.15; transform: translateX(56px); } }
@keyframes gallery-in-left { from { opacity: 0.15; transform: translateX(-56px); } }
.gallery__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 24px max(20px, var(--safe-b, 0px));
}
.gallery__label { grid-column: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Each in its own column, so the tools keep the right when the arrows are hidden. */
.gallery__nav { grid-column: 2; }
.gallery__tools { grid-column: 3; }
.gallery__nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gallery__nav button,
.gallery__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f4f4f4;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.gallery__close { position: absolute; top: 12px; right: 16px; z-index: 1; font-size: 20px; }
.gallery__nav button:hover:not(:disabled),
.gallery__close:hover { background: rgb(255 255 255 / 0.12); }
.gallery__nav button:disabled { opacity: 0.28; cursor: default; }
.gallery__nav button:focus-visible,
.gallery__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gallery__nav[hidden] { display: none; }

/* Zoom and take it away, bottom right, without leaving the picture (owner,
   2026-10-25). A zoomed picture is dragged by its hand. */
.gallery__img { transform-origin: center; will-change: transform; }
.gallery.is-zoomed .gallery__img { cursor: grab; }
.gallery.is-zoomed .gallery__img:active { cursor: grabbing; }
.gallery__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.gallery__tool {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #f4f4f4;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.gallery__zoom { min-width: 58px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.gallery__tool:hover:not(:disabled) { background: rgb(255 255 255 / 0.12); }
.gallery__tool:disabled { opacity: 0.28; cursor: default; }
.gallery__tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gallery__sep { width: 1px; height: 22px; margin: 0 6px; background: rgb(255 255 255 / 0.22); }

/* Under the pointer, a larger look before anything is clicked. */
.pic-preview {
  position: fixed;
  z-index: 70;
  width: min(440px, calc(100vw - 16px));
  padding: 8px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-solid);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.pic-preview__img {
  display: block;
  width: 100%;
  height: 280px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
.pic-preview__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 2px;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .gallery__frame.is-from-right,
  .gallery__frame.is-from-left { animation: none; }
}
@media (max-width: 640px) {
  .gallery__stage { padding: 60px 8px 4px; }
  /* The word on a line of its own; the arrows and the tools share the next. */
  .gallery__bar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: 'label label' 'nav tools';
    row-gap: 4px;
    padding: 8px 12px max(16px, var(--safe-b, 0px));
  }
  .gallery__label { grid-area: label; font-size: 13.5px; }
  .gallery__nav { grid-area: nav; gap: 6px; }
  .gallery__tools { grid-area: tools; gap: 0; }
  .gallery__tool { min-width: 36px; height: 36px; padding: 0 6px; }
  .gallery__zoom { min-width: 50px; }
  .gallery__sep { margin: 0 2px; }
}

/* A small button beside a line of prose, where a full-size one would tower
   over the sentence. */
.btn--tiny {
  padding: 1px 7px;
  font-size: 11.5px;
  border-radius: 6px;
  vertical-align: middle;
}

.spinner {
  width: 11px;
  height: 11px;
  border: 2px solid var(--line);
  border-top-color: var(--warn);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* The mark at the head of a card. One turn can have four cards open at once —
   a reasoning block, a run of steps, two tool calls — and each used to spin its
   own ring while the status line under the transcript was already saying, in
   words, which one was working. A card still in progress is now simply the one
   with no tick: a hollow ring, the same size as the tick so nothing shifts when
   it arrives, and nothing moving. */
.mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  /* Done is green, the one colour nobody has to learn. */
  color: var(--ok);
  font-size: 11px;
  line-height: 1;
}
.mark--pending {
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .mark--pending { animation: none; }
}
/* A tool line's icon (icons.js), and one 18px slot for every state of a line —
   ring, icon, cross — so its words do not move when the ring becomes an icon. */
.mark.mark--icon { width: 18px; height: 18px; color: var(--text-faint); }
details.block > summary > .mark:not(.mark--pending) { width: 18px; }
details.block > summary > .mark--pending { margin: 0 3.5px; }

.plan {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--bg-elev);
}
.plan h4 {
  margin: 0 0 9px;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plan li {
  margin-bottom: 6px;
  list-style: none;
  font-size: 13.5px;
}
.plan ul { margin: 0; padding: 0; }
.plan .is-done { color: var(--text-faint); }
.plan .is-done .pstep__title { text-decoration: line-through; }
.plan .is-active { color: var(--text); }

/* The card an update leaves in the transcript: what it changed, and opened,
   the steps it touched with their detail. */
.plancard__list { margin: 0; padding: 4px 2px 2px; }
.plancard__list li { margin-bottom: 8px; list-style: none; font-size: 13.5px; color: var(--text); }
.plancard__list li:last-child { margin-bottom: 0; }
.plancard__list .is-done .pstep__title { text-decoration: line-through; color: var(--text-faint); }

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 780px;
  margin: 0 auto 18px;
  padding: 0 22px;
  color: var(--text-faint);
  font-size: 13px;
}
.status-line .spinner { border-top-color: var(--accent); }

/* Folding the conversation up: a glass strip above the composer with a bar
   that fills, then turns green at the end. */
.compactbar {
  max-width: 780px;
  margin: 0 auto 10px;
  padding: 10px 16px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 50%), var(--composer-glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.compactbar[hidden] { display: none; }
.compactbar__row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--text-dim); }
.compactbar__pct { margin-left: auto; font-variant-numeric: tabular-nums; }
.compactbar__spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.compactbar.is-done .compactbar__spin { animation: none; border-color: var(--ok); background: var(--ok); }
.compactbar.is-done .compactbar__say { color: var(--ok); }
.compactbar__track { height: 6px; border-radius: 999px; background: var(--tint-2); overflow: hidden; }
.compactbar__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--galaxy);
  transition: width 0.3s ease-out, background 0.3s;
}
.compactbar.is-done .compactbar__fill { background: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .compactbar__spin { animation: none; }
  .compactbar__fill { transition: none; }
}
.menu__item:disabled { opacity: 0.5; cursor: not-allowed; }
.menu__item:disabled:hover { background: none; }
/**
 * The travelling stripe, for work with no countable steps.
 *
 * Indeterminate on purpose — see `statusLine`. It says "this is running and
 * has not hung", which is the true and useful half of what a progress bar
 * usually claims, without the half that would have to be made up.
 */
.status-line__bar {
  position: relative;
  flex: 1;
  min-width: 60px;
  max-width: 220px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}
.status-line__bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 2px;
  background-image: var(--galaxy);
  background-size: 300% 100%;
  animation: status-sweep 1.5s ease-in-out infinite, galaxy-drift 14s linear infinite;
}
@keyframes status-sweep {
  from { left: -40%; }
  to { left: 102%; }
}
@media (prefers-reduced-motion: reduce) {
  /* Still there, still says "running", just not travelling. */
  .status-line__bar i { animation: none; left: 0; width: 100%; opacity: 0.5; }
}

/* ── Approval ────────────────────────────────────────────────── */

.approval {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 820px;
  margin: 0 auto;
  padding: 13px 22px;
  border: 1px solid var(--warn);
  border-radius: 14px;
  background: rgba(255, 180, 84, 0.07);
}
.approval__list {
  margin-top: 6px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12.2px;
}
.approval__actions { display: flex; gap: 8px; }
.warn-text { color: var(--warn); }

/* ── A question with buttons on it ───────────────────────────────
 *
 * Deliberately not dressed like the approval box above. That one is amber
 * because it is a warning — something is about to happen that you may not
 * want. This is the assistant asking which way to go, which is an ordinary
 * part of a conversation and should look like one: the same surface and line
 * as everything else in the transcript, sitting where the composer's own
 * shape would sit.
 * ─────────────────────────────────────────────────────────────── */
.question {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto 10px;
  padding: 16px 18px;
  /* Glass, like the composer it sits above — not a grey slab over the stars. */
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--composer-glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.question__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.question__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
}
.question__nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}
.question__count {
  min-width: 34px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.icon-btn--tiny {
  width: 26px;
  height: 26px;
  font-size: 15px;
}
.question:focus { outline: none; }
.question__options {
  display: flex;
  flex-direction: column;
  max-height: min(56vh, 520px);
  overflow-y: auto;
}
/* A picker's rows, the way people now expect one: a number, the words, a thin
   rule between rows, and the whole row as the target. */
.question__opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid transparent;
  border-bottom-color: var(--line-soft);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.question__opt:hover,
.question__opt.is-focus { background: var(--surface-2); }
.question__opt.is-focus { border-color: var(--info); }
.question__opt:focus-visible { outline: none; border-color: var(--info); }
.question__opt[aria-checked='true'] {
  border-color: var(--info);
  background: var(--info-bg);
}
/* A number for "one of these", a tick box for "as many as you like". */
.question__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.question__opt--many .question__mark {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: transparent;
  font-size: 12px;
}
.question__opt[aria-checked='true'] .question__mark { background: var(--info); color: #fff; }
.question__opt--many[aria-checked='true'] .question__mark { border-color: var(--info); }
.question__label { min-width: 0; }
.question__desc {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 12.5px;
}
/* The row with a pencil: an answer the list did not think of, typed in place. */
.question__otherrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding: 6px 6px 6px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.question__otherrow:focus-within { border-color: var(--info); }
.question__otherrow[hidden] { display: none; }
.question__pencil {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text-dim);
}
.question__otherrow input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.question__send {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.question__send[hidden] { display: none; }
.question__foot {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* With previews, Claude Code's two panes: the choices on the left, what the
   one in hand looks like on the right (owner, 2026-11-01). Wider, so a layout
   sketch has room; the panes stack on a narrow screen. */
.question--preview { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); column-gap: 16px; max-width: 1040px; }
.question--preview > .question__head,
.question--preview > .question__foot { grid-column: 1 / -1; }
.question--preview > .question__options { grid-column: 1; }
.question__preview { grid-column: 2; min-width: 0; max-height: min(56vh, 520px); overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.question__preview[hidden] { display: none; }
.question__preview-head { margin: 0 0 10px; color: var(--text-dim); font-size: 13px; }
.question__preview-body { margin: 0; color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre; overflow-x: auto; }
.question__preview-none { margin: 0; color: var(--text-faint); font-family: var(--mono); font-size: 13px; font-style: italic; }
@media (max-width: 760px) {
  .question--preview { grid-template-columns: minmax(0, 1fr); }
  .question--preview > .question__options,
  .question__preview { grid-column: 1; }
  .question__preview { max-height: 34vh; }
}
.question__keys { flex: 1; color: var(--text-faint); font-size: 12.5px; }
.question__keys[hidden] { display: none; }
.question__foot .btn { flex: none; margin-left: auto; }

/* The form layout: every question at once, and one solid button at the foot —
   white on a dark page, as the primary action is drawn everywhere. */
.question--form .question__foot .btn {
  flex: 1;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.question--form .question__foot .btn:hover { opacity: 0.9; }
.qform__sec { padding: 14px 2px; }
.qform__sec + .qform__sec { border-top: 1px solid var(--line-soft); }
.qform__q { margin-bottom: 8px; font-weight: 600; font-size: 15px; }
.qform__opts { display: flex; flex-direction: column; gap: 2px; }
.qform__opts .question__opt { padding: 8px 10px; border-bottom-color: transparent; font-size: 14.5px; }
/* In a form a choice is a radio, round, as in any form. */
.qform__opts .question__opt:not(.question__opt--many) .question__mark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-faint);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0;
}
.qform__opts .question__opt:not(.question__opt--many)[aria-checked='true'] .question__mark {
  border: 5px solid var(--text);
  background: var(--bg);
}
.qform__opts .question__opt[aria-checked='true'] { border-color: transparent; background: transparent; }
.qform__input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  /* Set into the glass, not a solid slab on it. */
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  outline: none;
}
.qform__input:focus { border-color: var(--info); }
.qform__input--other { margin-top: 6px; }
.qform__hint { margin-top: 6px; color: var(--text-faint); font-size: 12.5px; }
@media (max-width: 560px) {
  .question__keys { display: none; }
}

/* ── Composer ────────────────────────────────────────────────── */

/* No background of its own — the dock above supplies the fade, and a second
   gradient here would show as a hard seam across it. */
.composer {
  position: relative;
  padding: 10px 22px calc(14px + var(--safe-b));
}
.composer__box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 780px;
  margin: 0 auto;
  /* Even on both sides now that the left holds two controls rather than one. */
  padding: 8px;
  /* A hairline of glass, and the same width it has when focused.
     A grey ring read as a second, squarer edge around a shape that is already
     drawn by its own surface and shadow; reserving the pixel here is what
     stops the box jumping when the galaxy ring arrives.

     One pixel, not two. At two the lit ring was thick enough to read as a
     frame around the field rather than as an edge on it — the eye kept
     catching on it while typing, which is the one place in this app where
     nothing should be competing for attention. */
  position: relative;
  border: 1px solid var(--glass-line);
  border-radius: 26px;
  /*
   * Glass, not a grey slab.
   *
   * It used to be the opaque surface colour, chosen so the transcript would not
   * show through — and on the opening screen it sat on the sky as the one flat
   * grey thing on it. Frosted instead: a translucent wash, a strong blur so
   * whatever scrolls behind is a soft colour rather than readable text, a
   * highlight along the top edge, and an inner line of light where the glass is
   * cut. The blur is what keeps text readable; without it there is a fallback.
   */
  background: linear-gradient(180deg, var(--glass-hi), transparent 55%), var(--composer-glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 var(--glass-hi);
  transition: border-color 0.15s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .composer__box { background: var(--glass-solid); }
}
/**
 * The galaxy ring, drawn as its own layer.
 *
 * It used to be painted as the box's background underneath an opaque inner
 * layer, which only works while the inside is opaque — through glass the whole
 * gradient would show. So the ring is a pseudo-element holding the gradient,
 * masked down to the one-pixel border: the inside stays glass.
 */
.composer__box::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--galaxy);
  background-size: 300% 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 exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.composer__box:focus-within { border-color: transparent; }
.composer__box:focus-within::before {
  opacity: 1;
  animation: galaxy-drift 14s linear infinite;
}
/* The textarea's own ring is off at the foot of this file, with every other
   text field and with the reasoning. It used to be turned off here, which did
   nothing: the guarantee down there is `!important` and won regardless, so the
   hard rectangle inside the rounded box was drawn anyway for years. */

/**
 * The sky, moving.
 *
 * One keyframe reused by everything that wears the gradient, so the whole app
 * drifts in step rather than each piece running its own clock. Slow on purpose:
 * this is a surface with weather, not an animation anybody should notice.
 */
@keyframes galaxy-drift {
  to { background-position: 300% 0; }
}
@media (prefers-reduced-motion: reduce) {
  /* Still a gradient, just a still one. */
  .composer__box:focus-within::before,
  .btn--primary,
  .chat-row.is-active::before { animation: none; }
}
.composer textarea {
  flex: 1;
  max-height: 42vh;
  /* Matched to the round controls beside it. The box aligns on `flex-end` so
     the buttons stay at the bottom as the text grows — but at rest a 38.5px
     textarea against 36px buttons left the whole row a couple of pixels out of
     true, which reads as the buttons sitting high rather than as the text
     sitting low. */
  min-height: 36px;
  padding: 6px 0;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: 15px;
  line-height: 1.5;
  /* A bar only when the words really run past `max-height`, and `autosize` is what
     says so: `auto` here would draw one on an empty box, because `scrollHeight` is
     a rounded integer and a 22.5px line leaves the element half a pixel short. */
  overflow-y: hidden;
}
/* The app's own clear bar, with no arrows: see the block above `.thread`. A long
   message is the one place somebody grabs this, so the thumb is easy to find. */
.composer textarea::-webkit-scrollbar-thumb { background-color: var(--text-faint); }
.composer textarea::-webkit-scrollbar-thumb:hover { background-color: var(--text-dim); }
@supports not selector(::-webkit-scrollbar) {
  .composer textarea { scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent; }
}
/* The hint never wraps: an empty box is one straight line, whatever the width.
   `fitPlaceholder` swaps in the short hint when the long one would be cut. */
.composer textarea:placeholder-shown {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer__actions { display: flex; gap: 6px; }
/* Round, and quiet until there is something to send.
   A permanently lit button is a permanently lit button: it stops meaning
   "ready" and becomes part of the furniture. Grey while the box is empty and
   green the moment it is not turns the control into an answer to "will this
   do anything if I press it". */
.icon-btn--send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 17px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, transform 0.06s;
}
.icon-btn--send.is-ready {
  background: var(--accent);
  color: var(--on-accent);
}
.icon-btn--send.is-ready:hover { background: #74f0b8; color: #06231a; }
.icon-btn--send:active { transform: scale(0.94); }
.icon-btn--send:disabled { background: var(--surface-2); color: var(--text-faint); cursor: not-allowed; }

.icon-btn--stop {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--danger);
}

/* The attachment button, on the other side of the box. */
.icon-btn--attach {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
}
.icon-btn--attach svg { display: block; }
.icon-btn--attach:hover { background: var(--surface-2); color: var(--accent); }

/* The context ring, beside the attach button rather than up in the header.
   Sized to match it: two round controls of different diameters sitting next to
   each other is the kind of thing you cannot name but can see. */
.composer__box .gauge {
  width: 36px;
  height: 36px;
  padding: 3px;
  border-color: transparent;
  background: transparent;
}
.composer__box .gauge.has-number {
  width: auto;
  padding: 3px 10px 3px 6px;
  border-color: var(--line);
  background: var(--surface-2);
}
.composer__box .gauge:hover { border-color: var(--accent-dim); }

.composer__meta {
  max-width: 780px;
  margin: 7px auto 0;
  color: var(--text-faint);
  font-size: 11.5px;
  text-align: center;
  min-height: 16px;
}

/* ── Settings sheet ──────────────────────────────────────────── */

/**
 * One dialog, one scrollbar.
 *
 * A <dialog> carries `overflow: auto` from the browser's own stylesheet, so a
 * sheet whose contents were taller than its max-height grew a scrollbar of its
 * own — on top of the one on the scrolling region inside it, and a horizontal
 * one whenever a flex row refused to shrink. Making the sheet a flex column
 * that never scrolls leaves exactly one scrolling element: the body.
 */
.sheet {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: 88dvh;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
/* A closed <dialog> is hidden by the browser's own `display: none`, which any
   author rule — including the `display: flex` above — silently overrides. Put
   it back, or every closed sheet keeps its full height in the layout and drags
   a scrollbar onto the whole page. */
.sheet:not([open]) {
  display: none;
}
/* Everything except the body keeps its natural height and never shrinks. */
.sheet__head,
.sheet__tabs,
.browser__controls,
.browser__foot {
  flex: none;
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet__head h2 { margin: 0; font-size: 17px; }
/* Nine tabs do not fit a narrow sheet, so this scrolls sideways — deliberately,
   and without a scrollbar sitting under the row. The fade is the affordance. */
.sheet__tabs {
  display: flex;
  gap: 3px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.sheet__tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-faint);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
/* `min-height: 0` is what actually lets this scroll: a flex child defaults to
   min-height:auto and would otherwise grow to fit its content instead. */
.sheet__body {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel { display: none; }
.panel.is-active { display: block; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.field input,
.field select,
.field textarea,
.row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent-dim); }
.field textarea { resize: vertical; font-family: var(--font); }

/* Settings → Languages: one card per language, a real radio inside each so
   arrow keys and screen readers get the native group behaviour. */
.lang-choice { border: 0; margin: 0 0 15px; padding: 0; min-width: 0; }
.lang-choice legend {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.lang-choice__list { display: grid; gap: 8px; margin-bottom: 10px; }
.field .lang-choice__item,
.lang-choice__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.lang-choice__item:has(input:checked) { border-color: var(--accent-dim); background: var(--accent-glow); }
.field .lang-choice__item input,
.lang-choice__item input { width: auto; margin: 0; padding: 0; accent-color: var(--info); }
.lang-choice__item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-choice__native { font-weight: 600; }
.lang-choice__english { margin-left: auto; color: var(--text-faint); font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.row select { flex: 1; }

.hint { color: var(--text-faint); font-size: 12.5px; line-height: 1.6; }
/* `.steps` was a numbered list of setup instructions here, long gone; its gap
   under every item and its box round every <pre> reached the run card that
   took the name — the black band under a hovered row (owner, 2026-10-26). */
.hint code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
}

.provider {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}
.provider__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.provider__name { font-weight: 600; }
.badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  color: var(--text-faint);
}
.badge--ok { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.provider__row { display: flex; gap: 8px; }
.provider__row input {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12.5px;
  outline: none;
}

/* ── Toasts ──────────────────────────────────────────────────── */

/* Anchored to the top: the bottom of the screen belongs to the composer, and a
   stack of messages down there covers the send button exactly when you want it. */
.toasts {
  position: fixed;
  left: 50%;
  top: 14px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(560px, calc(100vw - 28px));
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}
/* The assertive region sits directly under the polite one so the two read as a
   single stack. Separate elements only because a live region's urgency is a
   property of the container, and an error must not queue behind a notice. */
.toasts--alert {
  top: 58px;
}
/* Inside an open modal dialog the regions are manual popovers (render.js seatToasts): the browser's own
   popover look is taken off, and they stay where they were — at the top of the viewport. */
.toasts[popover] {
  inset: auto;
  left: 50%;
  top: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: none;
  color: inherit;
}
.toasts--alert[popover] {
  top: 58px;
}
.toast {
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  font-size: 13.5px;
  line-height: 1.45;
  animation: drop 0.2s ease-out;
}
.toast--error { border-color: var(--danger); color: #ffd4d4; }
.toast--ok { border-color: var(--ok); }
@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
}

/* ── Getting started ──────────────────────────────────────────────
 *
 * Six steps, each with a short clip recorded from the app itself (2026-10-20).
 * Still plain where it matters: the clip illustrates, the words say everything,
 * and the two decisions — carry on, or skip — stay in reach however tall a step
 * is: the body scrolls, the foot does not. */
.sheet--onb { width: min(860px, 100%); }
.onb {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 0;
}
.onb__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.onb__head h2 {
  flex: 1;
  margin: 0;
  font-size: 17px;
}
.onb__count {
  flex: none;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* The seven steps by name: a sense of how far there is to go, and a way to jump.
   One line, each as wide as its name — equal columns put "Model & giới hạn" on
   two lines beside "API key" with room to spare, and its underline below
   everybody else's (owner, 2026-10-26). When they do not all fit, the row
   scrolls inside itself rather than cutting a name short or widening the
   sheet (owner, 2026-11-16): a thin bar on a transparent track, and a soft
   fade at the edge that has more behind it. */
.onb__steps {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.onb__steps::-webkit-scrollbar { height: 6px; }
.onb__steps::-webkit-scrollbar-track { background: transparent; }
.onb__steps::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--line); }
/* Both fades are one mask whose stops move in when there is more that way. */
.onb__steps.has-before { --onb-fade-start: 28px; }
.onb__steps.has-after { --onb-fade-end: 28px; }
.onb__steps.has-before,
.onb__steps.has-after {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--onb-fade-start, 0px), #000 calc(100% - var(--onb-fade-end, 0px)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--onb-fade-start, 0px), #000 calc(100% - var(--onb-fade-end, 0px)), transparent 100%);
}
.onb__dot { flex: 0 0 auto; }
.onb__dot button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 8px;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.onb__dot button:hover { color: var(--text-dim); }
.onb__dot button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.onb__dot-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
/* The short name, on one line, whole: a narrow window scrolls the row instead. */
.onb__dot-label { white-space: nowrap; }
.onb__dot.is-current button { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.onb__dot.is-current .onb__dot-n { background: var(--accent); color: var(--on-accent); }
.onb__dot.is-done button { border-bottom-color: var(--ok); color: var(--text-dim); }
.onb__dot.is-done .onb__dot-n { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
/* The clip: 16:10, the shape it was recorded in, so nothing is cropped. */
.onb__media {
  position: relative;
  flex: none;
  /* No taller than about two fifths of the screen, so a laptop's short window
     still shows the step's words under the clip. */
  width: min(100%, 42vh * 1.6);
  margin: 0 auto 14px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.onb__media[hidden] { display: none; }
.onb__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.onb__play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  cursor: pointer;
}
.onb__play:hover { background: rgb(0 0 0 / 0.72); }
.onb__play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.onb__body { padding-bottom: 6px; }
/* Getting a key, inside the guide (onboarding-keys.js). */
.onbk { display: grid; gap: 12px; margin-bottom: 12px; }
.onbk__choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.onbk__card { display: grid; gap: 3px; justify-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.onbk__card:hover { border-color: var(--accent-dim); }
.onbk__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.onbk__card.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-glow); }
.onbk__why { color: var(--text-dim); font-size: 12.5px; line-height: 1.4; }
.onbk__how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 14px; align-items: start; }
.onbk__steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.onbk__step { display: flex; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 13.5px; line-height: 1.45; text-align: left; cursor: pointer; }
.onbk__step:hover { background: var(--tint); }
.onbk__step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.onbk__step.is-at { background: var(--tint-2); color: var(--text); }
.onbk__n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint-2); font-size: 12px; font-weight: 600; }
.onbk__step.is-at .onbk__n { background: var(--accent); color: var(--on-accent); }
/* The recording of the provider's real page (onboarding-keys.js). The size is on the
   element, so the room is kept before the file arrives. */
.onbk__clip { display: grid; gap: 4px; margin: 0; }
.onbk__video { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.onbk__video video { display: block; width: 100%; height: auto; }
.onbk__sample { margin: 0; color: var(--text-faint); font-size: 11.5px; line-height: 1.4; }
.onbk__do { display: flex; flex-wrap: wrap; gap: 8px; }
.onbk__do .btn { text-decoration: none; }
.onbk__keys { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.onbk__row { display: grid; gap: 4px; }
.onbk__row label { color: var(--text-dim); font-size: 13px; }
.onbk__box { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font-family: var(--mono, monospace); font-size: 13px; }
.onbk__box:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.onbk__box[readonly] { color: var(--text-dim); }
.onbk__row.is-ok .onbk__box { border-color: var(--ok); }
.onbk__row.is-bad .onbk__box { border-color: var(--danger); }
.onbk__note { min-height: 0; margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
.onbk__note:empty { display: none; }
.onbk__row.is-ok .onbk__note { color: var(--ok); }
.onbk__row.is-bad .onbk__note { color: var(--danger); }
.onbk__rule { margin: 0; color: var(--text-faint); font-size: 12px; line-height: 1.45; }
@media (max-width: 640px) { .onbk__how { grid-template-columns: minmax(0, 1fr); } }
/* The models suggested for the keys held. */
.onb__models { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.onb__model { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.onb__model.is-on { border-color: var(--accent); background: var(--accent-glow); }
.onb__model-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 240px; }
.onb__model-role { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.onb__model-why { color: var(--text-dim); font-size: 12.5px; line-height: 1.4; }
.onb__title {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 600;
}
/* A heading inside a step, where it holds two things (Automations, Bot). */
.onb__sub {
  margin: 12px 0 4px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.onb__body p { margin: 0 0 10px; line-height: 1.55; }
.onb__list {
  margin: 0 0 12px;
  padding-left: 18px;
  line-height: 1.55;
}
.onb__list li { margin-bottom: 7px; }
/* The sentences that state a limit or a trade-off. Marked, because the honest
   caveat is the one people skim past, and it is the one that saves them an afternoon. */
.onb__tip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
}
ul.onb__facts { padding-left: 28px; }
.onb__facts li { margin-bottom: 6px; }
.onb__facts li:last-child,
.onb__levels li:last-child { margin-bottom: 0; }
.onb__levels { font-size: 13.5px; }
.onb__badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 20%, transparent);
  color: var(--ok);
  font-size: 11px;
  font-weight: 600;
}
.onb__state {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
}
.onb__state.is-done { border-color: var(--ok); }
.onb__state.is-todo { border-color: var(--warn); }
.onb__state.is-free { border-color: var(--ok); }
/* Six things to try, two to a row where there is room for sentences of
   different lengths, one where there is not. */
.onb__tries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.onb__try {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.onb__try:hover {
  border-color: var(--accent-dim);
  background: var(--tint);
}
.onb__try:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.onb__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -24px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--line-soft);
  /* The sheet's glass over the page's own colour: the same shade, but solid.
     Glass alone let the step's words show through the buttons as they
     scrolled under them (owner, 2026-10-26, screenshot 2). */
  background: linear-gradient(var(--glass-solid), var(--glass-solid)), var(--bg);
}
.onb__spacer { flex: 1; }

@media (max-width: 860px) {
  .onb { padding: 16px 16px 0; }
  .onb__foot { margin: 0 -16px; padding: 10px 16px 14px; }
}


/* ── Suggested MCP servers ────────────────────────────────────────
 *
 * A grid of cards rather than a dropdown: each one needs a sentence to be
 * choosable at all, and a <select> cannot carry one. */
.mcp-cat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mcp-cat__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mcp-cat__item:hover { border-color: var(--accent-dim); background: var(--surface-2); }
.mcp-cat__name { font-size: 13.5px; font-weight: 600; }
.mcp-cat__blurb { color: var(--text-dim); font-size: 11.5px; line-height: 1.45; }
.mcp-cat__needs {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 10.5px;
}


/* ── A picture drawn into the transcript ──────────────────────────
 *
 * The height is the awkward part. The frame is sandboxed with no scripting on
 * purpose, so nothing inside it can measure itself and report back — which means
 * the height has to be decided from out here. A generous default with room to
 * grow beats a scrollbar around a diagram: a cropped picture is worse than a tall
 * box, and most of what lands here is one screenful of SVG. */
.widget {
  margin: 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  /* Clear with an edge, like the tool cards: the grey fill made every card in a
     reply a slab over the glass. */
  background: transparent;
  overflow: hidden;
}
.widget__caption {
  padding: 7px 11px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
}
.widget__frame {
  display: block;
  width: 100%;
  /* Tall enough for an ordinary diagram, and it scrolls rather than crops if the
     content genuinely exceeds it. */
  height: 340px;
  max-height: 70vh;
  border: 0;
  background: transparent;
}
@media (max-width: 860px) {
  .widget__frame { height: 260px; }
}

/* Copy and download, in a picture's top-right corner, while it is pointed at. */
.widget,
.media { position: relative; }
.media-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.widget:hover .media-tools,
.widget:focus-within .media-tools,
.media:hover .media-tools,
.media:focus-within .media-tools {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
/* A touch screen has no hover: the buttons are simply there. */
@media (hover: none) {
  .media-tools { opacity: 1; transform: none; pointer-events: auto; }
}
.media-tools__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  background: var(--glass-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: var(--text-dim);
  cursor: pointer;
}
.media-tools__btn:hover { color: var(--text); border-color: var(--accent-dim); }
.media-tools__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The caption bar is where the buttons land on a widget; keep its text clear of them. */
.widget__caption { padding-right: 84px; }

/* A picture the assistant made, shown rather than only listed. */
.media {
  margin: 10px 0 6px;
  max-width: min(100%, 560px);
}
.media__open {
  display: block;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: none;
  overflow: hidden;
  cursor: zoom-in;
}
.media__open img { display: block; width: 100%; height: auto; }

/* An interactive chart: the tool's own drawing, in the page, read by hovering. */
.chart__stage {
  position: relative;
  padding: 10px;
  outline: none;
}
.chart__stage:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-dim); }
.chart__stage svg { display: block; width: 100%; height: auto; max-height: 70vh; }
.chart__stage .hit { cursor: crosshair; }
/* The drawing's ink follows the theme: it is drawn for a dark surface, and on
   the light one its near-white labels would vanish. CSS outranks the
   presentation attributes the server wrote, so only the page's copy changes —
   an exported PNG keeps the ground it was designed for. */
.chart__stage svg text { fill: var(--text-dim); }
.chart__stage svg text[fill='#ffffff'] { fill: var(--text); }
.chart__stage svg line[stroke='#3a3a38'] { stroke: var(--line); }
/* The ring that keeps overlapping marks apart is the colour of what they sit on. */
.chart__stage .dot, .chart__stage .slice { stroke: var(--bg-elev); }
.chart__stage .bar,
.chart__stage .dot,
.chart__stage .slice,
.chart__stage polyline { transition: opacity 0.15s; }
/* Reading one label dims the rest, so the eye lands on the right bars. */
.chart__stage svg.is-reading .bar:not(.is-active),
.chart__stage svg.is-reading .slice:not(.is-active) { opacity: 0.45; }
.chart__stage .dot.is-active { stroke-width: 3; r: 6; }
.chart__guide { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart__stage .legend-item { cursor: pointer; }
.chart__stage .legend-item:focus-visible { outline: 2px solid var(--accent-dim); }
.chart__stage .legend-item.is-off { opacity: 0.35; }
.chart__stage .is-off:not(.legend-item) { opacity: 0.08; }
.chart__stage .hit--pt.is-off { pointer-events: none; }

/* ── A conversation shared by link (share.html) ─────────────────── */
body.sharepage { min-height: 100dvh; overflow: auto; background: var(--bg); }
.sharepage__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px max(16px, calc((100% - 780px) / 2));
  border-bottom: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}
.sharepage__brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; text-decoration: none; }
.sharepage__ident { min-width: 0; }
.sharepage__title { margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sharepage__meta { margin: 2px 0 0; color: var(--text-faint); font-size: 12px; }
.sharepage__thread { padding: 24px 0 140px; }
.sharepage__loading { max-width: 780px; margin: 40px auto; padding: 0 22px; color: var(--text-dim); }
.sharepage__foot {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.sharepage__foot[hidden] { display: none; }
.sharepage__note { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ── Maps, galleries and ready-made cards (public/js/cards.js) ─────── */

.xcard { max-width: 100%; }
.xcard__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.xcard__head > div { flex: 1; min-width: 0; }
.xcard__title { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; }
.xcard__sub { margin-top: 2px; color: var(--text-dim); font-size: 12.5px; }
.xcard__kind {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 11px;
}
.xcard__body { padding: 12px 14px 14px; color: var(--text); font-size: 14px; line-height: 1.55; }
.xcard__h { margin: 14px 0 6px; color: var(--text-dim); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.xcard__h:first-child { margin-top: 0; }
.xcard__verdict { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--tint); }
.xcard__source { margin: 10px 0 0; color: var(--text-faint); font-size: 11px; text-align: right; }
.xcard__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.xchip { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; }

/* Market data (server/finance): the price large, a sparkline, the figures in a grid, and a
   footer that carries the source, its credit and "for reference only" — the terms of the
   sources are met by the card even when the reply leaves them out. Up and down carry a
   sign and an arrow, never colour alone. */
.xmarket__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.xmarket__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.xmarket__what { flex-basis: 100%; color: var(--text-dim); font-size: 12px; }
.xmarket__value { color: var(--text); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.xmarket__per { color: var(--text-dim); font-size: 12.5px; }
.xmarket__change { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.xmarket__change.is-up, .xmarket__sub.is-up, .xmarket__spark.is-up { color: var(--ok); }
.xmarket__change.is-down, .xmarket__sub.is-down, .xmarket__spark.is-down { color: var(--danger); }
.xmarket__spark { flex: none; display: block; }
.xmarket__rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
}
.xmarket__row { min-width: 0; }
.xmarket__row dt { color: var(--text-dim); font-size: 12px; }
.xmarket__row dd { margin: 1px 0 0; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xmarket__sub { margin-left: 6px; color: var(--text-dim); font-size: 12px; }
.xmarket__foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.xmarket__foot p { margin: 2px 0 0; color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
.xmarket__disclaimer { font-style: italic; }
.xmarket__link { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.xmarket__link:hover { color: var(--text); }
.xmarket__link:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; border-radius: 2px; }

.xbtn {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.xbtn:hover:not(:disabled) { border-color: var(--accent-dim); }
.xbtn:disabled { opacity: 0.4; cursor: default; }
.xbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.xbtn--primary { border-color: var(--accent-dim); color: var(--accent); }

/* recipe */
.xrecipe { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px; }
.xcheck, .xtips { margin: 0; padding: 0; list-style: none; }
.xcheck li { padding: 3px 0; }
.xcheck label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.xcheck input { margin-top: 4px; accent-color: var(--accent); }
.xcheck input:checked + span { color: var(--text-faint); text-decoration: line-through; }
.xtips li { position: relative; padding: 2px 0 2px 16px; color: var(--text-dim); }
.xtips li::before { content: '•'; position: absolute; left: 3px; color: var(--accent); }
.xsteps, .xhowto { margin: 0; padding: 0; list-style: none; counter-reset: xstep; }
.xsteps li, .xhowto__step { position: relative; padding: 2px 0 10px 34px; counter-increment: xstep; }
.xsteps li::before, .xhowto__step::before {
  content: counter(xstep);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.xhowto__step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11.5px;
  top: 28px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.xhowto__title { font-weight: 600; }
.xhowto__detail { margin-top: 2px; color: var(--text-dim); }

/* itinerary */
.xday + .xday { margin-top: 14px; }
.xday__label { margin: 0 0 8px; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.xtimeline { margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); list-style: none; }
.xtimeline__item { position: relative; display: flex; gap: 10px; padding: 0 0 10px 12px; }
.xtimeline__item::before {
  content: '';
  position: absolute;
  left: -16.5px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.xtimeline__time { flex: none; min-width: 48px; color: var(--text-dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.xtimeline__text { min-width: 0; }
.xtimeline__title { font-weight: 600; }
.xtimeline__place { display: inline-block; margin-top: 1px; color: var(--text-dim); font-size: 12.5px; text-decoration: none; }
.xtimeline__place:hover { color: var(--accent); }
.xtimeline__detail { color: var(--text-dim); font-size: 13px; }

/* comparison and tables */
.xcompare { overflow-x: auto; margin: 0 -2px; }
.xcompare__table, .xtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xcompare__table th, .xcompare__table td, .xtable th, .xtable td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.xcompare__table thead th { color: var(--text); font-weight: 600; white-space: nowrap; }
.xcompare__table tbody th { color: var(--text-dim); font-weight: 500; white-space: nowrap; }
.xcompare__table .is-best { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.xcompare__badge {
  display: block;
  width: max-content;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
}
.xtable th { color: var(--text-faint); font-size: 11.5px; font-weight: 600; }
.xtable td { font-variant-numeric: tabular-nums; }
.xtable__rank { color: var(--text-dim); width: 28px; }
.xtable__team { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.xtable__pts { font-weight: 700; }

/* quiz and flashcards */
.xquiz__progress, .xflash__count { color: var(--text-faint); font-size: 12px; }
.xquiz__q { margin: 6px 0 12px; font-size: 15px; font-weight: 600; }
.xquiz__options { display: grid; gap: 8px; }
.xquiz__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.xquiz__opt:hover:not(:disabled) { border-color: var(--accent-dim); background: var(--tint); }
.xquiz__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.xquiz__opt:disabled { cursor: default; }
.xquiz__opt.is-right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.xquiz__opt.is-wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.xquiz__key {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}
.xquiz__verdict { margin: 12px 0 0; font-weight: 600; }
.xquiz__verdict.is-right { color: var(--ok); }
.xquiz__verdict.is-wrong { color: var(--danger); }
.xquiz__why { margin: 4px 0 0; color: var(--text-dim); }
.xquiz__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.xquiz__score { color: var(--text-dim); font-size: 13px; }
.xflash {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 0.25s, background 0.25s;
}
.xflash.is-back { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.xflash:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xflash:active { transform: scale(0.99); }
.xflash__side { color: var(--text-faint); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.xflash__text { font-size: 18px; font-weight: 600; line-height: 1.4; text-align: center; white-space: pre-wrap; }
.xflash__hint { margin: 6px 0 0; color: var(--text-faint); font-size: 12px; text-align: center; }

/* translation */
.xtrans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xtrans__side { position: relative; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.xtrans__side.is-target { border-color: var(--accent-dim); }
.xtrans__lang { color: var(--text-faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; }
.xtrans__text { margin: 6px 0 0; font-size: 15px; white-space: pre-wrap; }
.xtrans__say { margin: 6px 0 0; color: var(--text-dim); font-style: italic; }
.xtrans__copy { margin-top: 10px; min-height: 30px; padding: 3px 10px; font-size: 12px; }

/* scores */
.xscore {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.xscore:last-of-type { border-bottom: 0; }
.xscore__side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xscore__side--home { justify-content: flex-end; text-align: right; }
.xscore__name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.xscore__crest { flex: none; width: 24px; height: 24px; object-fit: contain; }
.xscore__mid { display: grid; justify-items: center; min-width: 78px; }
.xscore__result { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.xscore__when { color: var(--text-faint); font-size: 11.5px; }
.xscore__meta { grid-column: 1 / -1; color: var(--text-faint); font-size: 11.5px; text-align: center; }
.xcard__head .xscore__crest { width: 32px; height: 32px; }

/* gallery */
.xgallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 8px;
}
.xgallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--surface-2);
  color: #fff;
  text-decoration: none;
}
.xgallery__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xgallery__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.xgallery__item:hover .xgallery__img { transform: scale(1.04); }
.xgallery__item.is-missing .xgallery__img { visibility: hidden; }
.xgallery__cap {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  font-size: 11.5px;
}
.xgallery__n { flex: none; font-weight: 700; }
.xgallery__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xgallery__lic { flex: none; opacity: 0.75; font-size: 10px; }

/* map */
.xmap { position: relative; height: 300px; overflow: hidden; background: #aad3df; }
.xmap__tiles { position: absolute; inset: 0; }
.xmap__tile { position: absolute; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }
.xmap__overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.xmap__line { fill: none; stroke: #6d4de0; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }
.xmap__pin path { fill: #e0463b; stroke: #fff; stroke-width: 1.5; }
.xmap__pin circle { fill: #fff; }
.xmap__pin text { fill: #e0463b; font: 700 9px system-ui, sans-serif; }
.xmap-list .xmap__pin text { font-size: 8.5px; }
.xmap__controls { position: absolute; top: 8px; right: 8px; display: grid; gap: 4px; }
.xmap__zoom {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.xmap__zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.xmap__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 12px; font-size: 13px; }
.xmap__places { flex: 1; min-width: 0; display: grid; gap: 2px; }
.xmap__place { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); }
.xmap__place > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xmap__letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0463b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
/* Where a nearby search was centred: a dot, not a pin. */
.xmap__here circle { fill: #2f7cf6; stroke: #fff; stroke-width: 2; }
.xmap__here .xmap__here-halo { fill: rgba(47, 124, 246, 0.22); stroke: none; }
.xmap__pin.is-lit path { fill: #6d4de0; stroke-width: 2.5; }
.xmap__pin.is-lit text { fill: #6d4de0; }

/* The results of a nearby search, beside the map where there is room for both,
   under it where there is not — the way a map app lists what it found. */
.xmap__body { display: grid; grid-template-columns: minmax(0, 1fr); }
.xmap__side { border-top: 1px solid var(--line); max-height: 300px; overflow-y: auto; }
@container (min-width: 620px) {
  .xmap__body { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
  .xmap__body .xmap { height: 340px; }
  .xmap__side { border-top: 0; border-left: 1px solid var(--line); max-height: 340px; }
}
.xcard--map.xmap-list { container-type: inline-size; }
.xmap__results { list-style: none; margin: 0; padding: 4px 0; }
.xmap__result { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; }
.xmap__result:hover,
.xmap__result:focus-within { background: var(--surface-2); }
.xmap__result-body { display: grid; gap: 2px; min-width: 0; }
.xmap__result-name { color: var(--text); font-weight: 600; font-size: 13.5px; text-decoration: none; overflow-wrap: anywhere; }
.xmap__result-name[href]:hover { color: var(--accent); text-decoration: underline; }
.xmap__result-meta,
.xmap__result-addr { color: var(--text-faint); font-size: 12px; overflow-wrap: anywhere; }
.xmap__result-meta { color: var(--text-dim); }
.xmap__open { color: var(--accent); font-size: 12.5px; text-decoration: none; }
.xmap__open:hover { text-decoration: underline; }
.xmap__credit { color: var(--text-faint); font-size: 10.5px; }

@media (max-width: 560px) {
  .xrecipe, .xtrans { grid-template-columns: minmax(0, 1fr); }
  .xmap { height: 240px; }
  .xgallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xscore__mid { min-width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .xflash, .xgallery__img { transition: none; }
}
.chart__tip {
  position: absolute;
  z-index: 2;
  min-width: 140px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elev);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  pointer-events: none;
}
.chart__tip-head { margin-bottom: 4px; color: var(--text); font-weight: 600; }
.chart__tip-row { display: flex; align-items: center; gap: 7px; color: var(--text-dim); }
.chart__tip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart__tip-value { color: var(--text); font-variant-numeric: tabular-nums; }
.chart__tip-total { margin-top: 3px; padding-top: 3px; border-top: 1px solid var(--line-soft); }
.chart__swatch { flex: none; width: 9px; height: 9px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  .chart__stage .bar, .chart__stage .dot, .chart__stage .slice, .chart__stage polyline { transition: none; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .app,
  .app.is-detail { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    /* The open width, not the width in force: here the sidebar is a drawer
       that slides over the conversation, so there is no column to collapse and
       the rail means nothing. Reading `--sidebar-w` would hand a phone a 68px
       drawer whenever the rail had been left on from a desktop, because the
       setting is remembered per account rather than per screen. */
    width: min(84vw, var(--sidebar-w-open));
    /* Opaque here, unlike the docked column. On a phone the drawer slides over
       the conversation rather than sitting beside it, and a transparent panel
       with a transcript legible through it is not a panel. */
    background: var(--bg-elev);
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    /* `visibility` as well as the transform, and this is not decoration.
       A transform moves a panel off screen and leaves every control inside it
       in the tab order and in the accessibility tree — so with the drawer shut
       on a phone, tabbing out of the header walked through New chat, Search,
       Projects, Artifacts, Scheduled, Workflows, Workspace, Settings and every
       conversation row plus its ⋯ button, all invisible. The right-hand rail
       already does exactly this; the drawer was simply missed.
       Delayed on close so it does not blank mid-slide, immediate on open. */
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .app.is-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease, visibility 0s;
  }

  /* No room for a third column on a phone, so the rail slides over from the
     right the way the sidebar slides in from the left. */
  .detail {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 380px);
    background: var(--bg-elev);
    box-shadow: var(--shadow);
    transform: translateX(102%);
    transition: transform 0.22s ease;
  }
  .app.is-detail .detail {
    transform: none;
    visibility: visible;
  }
  /* The desktop rule that delays hiding would otherwise replace the slide's own transition. */
  .app:not(.is-detail) .detail { transition: transform 0.22s ease, visibility 0s linear 0.22s; }
  .sidebar__close { display: inline-grid; }
  /* The drawer either is or is not; collapsing it to a rail on a phone would
     leave a column of icons over the conversation for no gain. */
  .sidebar__collapse { display: none; }

  .topbar__menu { display: inline-grid; }
  .msg, .status-line { padding-inline: 16px; }
  .composer { padding-inline: 14px; }
  .chip { max-width: 34vw; }
  .sheet { max-height: 92dvh; border-radius: 18px 18px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* The progress panel is hidden at once on close: its 240 ms visibility delay only waits for a slide that does not happen. */
  .app:not(.is-detail) .detail { transition-delay: 0s !important; }
}

/* ─────────────────────────────────────────────────────────────
   "There is a new model"

   A modal, because it asks a question with two different answers —
   and centred, because a corner toast is something you dismiss by
   reflex rather than read. Narrower than the other sheets: it holds
   one thing to decide about, and a wide column of facts is harder to
   scan than a short one.
   ───────────────────────────────────────────────────────────── */
.sheet--news {
  width: min(460px, 100%);
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.news {
  padding: 26px 26px 22px;
}

.news__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.news__badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news__vendor {
  color: var(--text-dim);
  font-size: 13px;
}

.news__title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.25;
}

.news__id {
  margin: 0 0 18px;
}
.news__id code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  word-break: break-all;
}

/* Label above value rather than beside it: the values are long enough that two
   columns would wrap into a mess on a phone. */
.news__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 16px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}
.news__facts dt {
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.news__facts dd {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text);
}

.news__body {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
  /* Vendor blurbs run long; keep the buttons above the fold. */
  max-height: 10.5em;
  overflow-y: auto;
}

.news__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.news__actions .btn { flex: 1; }

.news__small {
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

/* ── paired computers ──────────────────────────────────────── */

/* The status dot sits inside a row here rather than in the sidebar, so it needs
   to hold its size against a flex parent that would otherwise squash it. */
.rows__item > .dot {
  flex: none;
}

.rows__item .tag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
}

/* "Use this one" is an ordinary action; only Unpair is destructive, and the
   shared `.rows__item button:hover` rule turns everything red. */
.rows__item button[data-use-device]:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* A collapsed escape hatch for the manual token path. */
.fold {
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}
.fold > summary {
  padding: 11px 14px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  user-select: none;
}
.fold > summary:hover { color: var(--text); }
.fold[open] > summary { border-bottom: 1px solid var(--line-soft); }
.fold > :not(summary) { padding: 0 14px; }
.fold > :last-child { padding-bottom: 14px; }

/* ─────────────────────────────────────────────────────────────
   Attached photos and files

   Above the composer rather than inside it. A thumbnail strip that
   grows sideways inside the box would fight the text for room, and
   the whole point of a preview is being able to see the thing.
   ───────────────────────────────────────────────────────────── */
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 780px;
  margin: 0 auto 8px;
}

/* One thing waiting to go. A picture or a PDF is shown as itself — its name
   and size told nobody anything the picture did not; anything else is its name
   and its type. Square, like the composer's own buttons are round. */
.stage {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.stage--file {
  display: flex;
  flex-direction: column;
  width: 150px;
  padding: 10px 12px;
  gap: 4px;
}
.stage.is-failed { border-color: var(--danger); }
.stage__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
/* White behind a picture, so a transparent PNG shows its lines rather than the
   dark tile through them. An opaque picture covers it and looks the same. */
.stage__img { display: block; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.stage__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-dim, var(--surface-2));
  color: var(--text);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
}
.stage__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12.5px;
  line-height: 1.3;
  word-break: break-word;
}
.stage__type { margin-top: auto; color: var(--text-faint); font-size: 11px; letter-spacing: 0.04em; }
.stage__err {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3px 6px;
  overflow: hidden;
  background: var(--danger);
  color: #0b0e11;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage__spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
}
.stage.is-uploading .stage__img { opacity: 0.55; }
/* 26px hit area on a small glyph: WCAG 2.5.8 asks for 24 as a floor. */
.stage__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.72);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.stage__remove:hover { background: var(--danger); color: #0b0e11; }
.stage:not(:hover):not(:focus-within) .stage__remove { opacity: 0.85; }

/* A long paste (pasted.js): the opening of its words, what it is, and a pencil to
   have it back in the box. One tile waiting and sent. */
.stage--pasted {
  width: 148px;
  height: 148px;
}
.stage--sent.stage--pasted,
.stage__paste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.stage__paste:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.stage__excerpt {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.4;
  /* Cut anywhere, the way a tile this small has to be: a long word or address
     pushed the rest out of it. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.stage__badge {
  flex: none;
  align-self: flex-start;
  padding: 1px 6px;
  border: 1px solid var(--glass-line);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.stage__pencil {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.stage__pencil:hover { background: var(--accent-dim, var(--surface-2)); }
.stage__pencil:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Along the top on this tile: an upload that failed is exactly when the pencil at
   the foot is wanted, to have the words back, and the strip must not cover it. */
.stage--pasted .stage__err {
  inset: 0 0 auto 0;
  padding-right: 34px;
}

/* The window that shows the whole of one, as Claude's does. */
.pasted {
  width: min(760px, 94vw);
  height: min(80dvh, 860px);
}
.pasted__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 4px;
}
.pasted__head h2 { margin: 0; font-size: 17px; }
.pasted__facts {
  margin: 0;
  padding: 0 20px 12px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.pasted__body {
  flex: 1;
  min-height: 0;
  margin: 0 20px 20px;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.pasted__body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A conversation on its way: a ring in the middle of where it will be. */
.chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--text-faint);
  font-size: 13px;
  /* Past the quickest answers: a local database replies before this could be
     read, and a ring blinking for a tenth of a second is only a flicker. */
  animation: chat-loading-in 0.2s ease 0.12s both;
}
.chat-loading[hidden] { display: none; }
.chat-loading__ring {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes chat-loading-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Still a ring, and the words under it say what it means. */
@media (prefers-reduced-motion: reduce) {
  .chat-loading,
  .chat-loading__ring { animation: none; }
}

/* ── drawing on a picture before it goes ─────────────────────── */
.sketch {
  width: min(1200px, 96vw);
  max-width: none;
  height: min(900px, 94vh);
  max-height: none;
  padding: 16px 20px 20px;
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: var(--glass-solid);
  color: var(--text);
}
.sketch[open] { display: flex; flex-direction: column; gap: 14px; }
.sketch::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(4px); }
.sketch__top { display: flex; align-items: center; gap: 8px; }
.sketch__spacer { flex: 1; }
.sketch__save { min-width: 96px; }
/* The track is held to the stage (`minmax(0, 1fr)`) and the stage clips: an auto
   track grew to a tall picture's own height, the canvas spilled down over the
   colours and tools — the stage is positioned, so it painted above them — and
   every press on a colour or on Text landed on the picture instead. */
.sketch__stage {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}
.sketch__colors,
.sketch__tools { position: relative; z-index: 1; }
.sketch__canvas {
  max-width: 100%;
  max-height: 100%;
  /* A transparent picture is drawn over white (see sketch.js), so dark lines on
     nothing read as lines rather than vanishing into the dark dialog. */
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: crosshair;
  touch-action: none;
}
.sketch__canvas.is-text { cursor: text; }
.sketch__type {
  position: absolute;
  min-width: 140px;
  padding: 4px 8px;
  border: 1px dashed currentColor;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.55);
  font: 600 18px system-ui, sans-serif;
  outline: none;
}
.sketch__colors { display: flex; justify-content: center; gap: 12px; }
.sketch__color {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
}
.sketch__color[aria-checked='true'] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.sketch__tools { display: flex; justify-content: center; gap: 22px; }
.sketch__tool {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sketch__toolmark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 20px;
}
.sketch__tool[aria-checked='true'] { color: var(--text); }
.sketch__tool[aria-checked='true'] .sketch__toolmark { background: var(--text); color: var(--bg); }

/* Dragging a file anywhere over the window is the other way people attach one,
   so the whole app acknowledges it rather than one small target. */
.app.is-dropping .composer__box {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── words inside a sent message ─────────────────────────────── */

.bubble__text { white-space: pre-wrap; word-break: break-word; }
/* An address you typed, inside your own bubble. It keeps the bubble's text
   colour rather than taking the accent the way a link in a reply does: the
   bubble has a surface of its own, and a violet line on it reads as something
   the assistant wrote. The underline is what says it can be pressed. */
.bubble__text a {
  color: inherit;
  text-underline-offset: 3px;
}
.bubble__text a:hover { color: var(--info); }

/* The composer's "this model cannot see images" line.
   Amber rather than red: nothing has failed yet, and it is still perfectly
   reasonable to send the message and let the assistant say so. */
/* "Setting up a workflow" — the shelf a message begun from one is for. */
.composer__mode {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: min(780px, 100%);
  margin: 0 auto 8px;
  padding: 6px 8px 6px 13px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 55%), var(--tint);
  color: var(--accent);
  font-size: 12.5px;
}
.composer__mode[hidden] { display: none; }
.composer__mode-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.composer__mode-clear:hover { background: var(--tint-2); color: var(--text); }

.composer__warn {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto 8px;
  padding: 8px 12px;
  border: 1px solid var(--warn);
  border-radius: 10px;
  background: rgba(255, 180, 84, 0.08);
  color: var(--warn);
  font-size: 12.5px;
}
.composer__warn button {
  flex: none;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: transparent;
  color: var(--warn);
  font-size: 12px;
  cursor: pointer;
}
.composer__warn button:hover { background: rgba(255, 180, 84, 0.16); }

/* "sees images" in the model picker. The one capability whose absence fails the
   whole request rather than just answering worse. */
.tag--vision {
  border-color: var(--info);
  color: var(--info);
}

/* ─────────────────────────────────────────────────────────────
   The context gauge

   A ring rather than a number, because the shape reads without
   being read: a quarter full is obviously fine. The number joins
   in past halfway, which is when it starts to matter.
   ───────────────────────────────────────────────────────────── */
/*
 * Round while it is only a ring.
 *
 * The padding used to lean right to leave room for a number that is absent most
 * of the time, and the row stretches its controls to a common height — so the
 * quiet state came out 36 wide by 38 tall with the ring 6px from one edge and
 * 10px from the other. Small numbers, but a circle inside a not-quite-circle is
 * exactly the kind of thing the eye catches without being able to name.
 *
 * So: symmetric padding, centred contents, and a square the size of every other
 * control in the row. `aspect-ratio` cannot do this job — the row stretches its
 * items, so the height is not definite when the width is being resolved and the
 * ratio is quietly ignored. The number state stops being square and pads for
 * text instead.
 */
.gauge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: var(--control-h);
  height: var(--control-h);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.gauge.has-number {
  width: auto;
  /* Less on the ring's side than the number's: a stroked circle reads as
     lighter than digits do, so equal padding would look lopsided. */
  padding: 4px 11px 4px 7px;
}
.gauge:hover { border-color: var(--accent-dim); color: var(--text); }

.gauge__track { stroke: var(--line); }
.gauge__fill {
  /* The brand colour while there is room; amber, then red, as it fills. */
  stroke: var(--accent);
  /* The dash length is the value; animating it makes the ring fill rather than
     jump, which is what makes it read as a gauge at all. */
  transition: stroke-dasharray 400ms cubic-bezier(0.4, 0, 0.2, 1), stroke 300ms;
}
.gauge.is-warm .gauge__fill { stroke: var(--warn); }
.gauge.is-warm { color: var(--warn); border-color: rgba(255, 180, 84, 0.4); }
.gauge.is-hot .gauge__fill { stroke: var(--danger); }
.gauge.is-hot { color: var(--danger); border-color: rgba(255, 107, 107, 0.45); }

.gauge__label:empty { display: none; }

/* ── projects ────────────────────────────────────────────────── */

.project-card {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-bottom: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.project-card:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.project-card__name { font-weight: 600; }
.project-card__meta {
  color: var(--text-faint);
  font-size: 12px;
}
.project-card__note {
  color: var(--text-dim);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One source, or one of a project's conversations. */
.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 6px;
  color: var(--text);
  text-align: left;
  font-size: 13.5px;
}
.source-row--chat { cursor: pointer; }
.source-row--chat:hover { border-color: var(--accent-dim); }
.source-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-row__meta {
  flex: none;
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.btn--small { padding: 5px 9px; font-size: 12px; }
.btn--back { margin-bottom: 14px; }
.section-head {
  margin: 22px 0 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── the approval policy, beside send ──────────────────────── */

.policy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.policy:hover { border-color: var(--accent-dim); color: var(--text); }
/* Only the policy that runs everything looks like it. An amber control is a
   reminder, and a reminder that is always lit stops being one. */
.policy.is-loud { border-color: rgba(255, 180, 84, 0.5); color: var(--warn); }
.policy.is-quiet { color: var(--text-faint); }
.policy__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
}

/* On a narrow screen the word goes and the glyph carries the meaning — which
   is only true if the glyph itself stays, so this names the label rather than
   every span in the chip. */
@media (max-width: 560px) {
  .policy #policy-label { display: none; }
  .policy { padding: 0 10px; }
}

/* ── menus with a description under each choice ────────────── */

.menu--policy,
.menu--context {
  width: min(440px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
}

/* ── what the window is spent on (context-panel.js) ──────────────────────
 * Across rather than down (owner, 2026-10-19): one bar split into its parts,
 * the parts in two columns beneath, and the parts that have parts of their own
 * opening in place. Mid-tone colours, legible on both themes. */
.ctx {
  --ctx-messages: #6d8dff;
  --ctx-mcp: #ff8a4c;
  --ctx-tools: #3fcf8e;
  --ctx-system: #98a2b3;
  --ctx-skills: #b48cff;
  --ctx-memory: #2fc3d1;
  --ctx-project: #f0c24b;
  --ctx-used: var(--accent);
  display: grid;
  gap: 10px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.ctx__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.ctx__title { font-weight: 600; font-size: 13.5px; }
.ctx__used { font-size: 13px; }
.ctx__total { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.ctx__bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--tint-2);
}
.ctx__seg { flex: none; height: 100%; min-width: 2px; }
.ctx__seg + .ctx__seg { border-left: 1px solid var(--glass-solid); }
.ctx__seg--free { flex: 1 1 auto; min-width: 0; background: transparent; border-left: 0 !important; }
.ctx--messages { background: var(--ctx-messages); }
.ctx--mcp { background: var(--ctx-mcp); }
.ctx--tools { background: var(--ctx-tools); }
.ctx--system { background: var(--ctx-system); }
.ctx--skills { background: var(--ctx-skills); }
.ctx--memory { background: var(--ctx-memory); }
.ctx--project { background: var(--ctx-project); }
.ctx--used { background: var(--ctx-used); }
/* The reply's room is held back, not spent: hatched, so it does not read as a part. */
.ctx--reserve { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }
.ctx--free { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ctx__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}
.ctx__key {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.ctx__swatch { width: 9px; height: 9px; border-radius: 3px; }
.ctx__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx__num { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ctx__pct { min-width: 38px; color: var(--text-faint); text-align: right; }
.ctx__more { display: grid; gap: 2px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.ctx__foldhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}
.ctx__foldhead::-webkit-details-marker { display: none; }
.ctx__foldhead::before {
  content: '›';
  width: 10px;
  color: var(--text-faint);
  transition: transform 0.18s;
}
.ctx__fold[open] > .ctx__foldhead::before { transform: rotate(90deg); }
.ctx__foldhead:hover { background: var(--tint); }
.ctx__foldhead:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctx__foldcount { margin-left: auto; color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.ctx__rows {
  display: grid;
  gap: 3px;
  max-height: 168px;
  overflow-y: auto;
  margin: 2px 0 6px;
  padding: 0 4px 0 22px;
  list-style: none;
  font-size: 12px;
}
.ctx__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.ctx__rowname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.ctx__rowmeta { color: var(--text-faint); }
.ctx__row--more .ctx__rowname { font-family: inherit; color: var(--text-faint); }
.ctx__note { margin: 0; color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
/* A phone keeps the two columns and gives the names the room: the share is in
   each row's tooltip, and below 340px the list goes to one column. */
@media (max-width: 480px) {
  .ctx__pct { display: none; }
  .ctx__key { grid-template-columns: 9px minmax(0, 1fr) auto; }
}
@media (max-width: 340px) {
  .ctx__legend { grid-template-columns: minmax(0, 1fr); }
}
.menu__head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.menu__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.menu__hint {
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.45;
  white-space: normal;
}
.menu__item.is-active { color: var(--accent); }
.menu__item.is-active .menu__hint { color: var(--accent-dim); }

/* The glyph sits in its own column so the descriptions under each label all
   start on the same line, however tall the row above it grew. */
.menu__icon {
  display: grid;
  place-items: center;
  flex: none;
  align-self: start;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--text-dim);
}
.menu__item.is-active .menu__icon { color: var(--accent); }
.menu__check {
  margin-left: auto;
  align-self: start;
  color: var(--accent);
  font-size: 13px;
}

/* A setting rather than a choice, so it is fenced off below the modes. */
.menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  padding: 9px 12px 4px;
  border-top: 1px solid var(--line-soft);
}
.menu__foot-name {
  color: var(--text-dim);
  font-size: 12.5px;
}
.effort-dots {
  display: flex;
  align-items: center;
  gap: 0;
}
/* The effort row stacks: the name and dots on one line, what the level does on
   the next. */
.menu__foot--effort { flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 8px; }
.menu__foot-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu__foot-hint { margin: 0; max-width: 34ch; color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
/* Five steps drawn as five dots: the ones you have passed stay lit but small,
   so the row reads as a level and not as five unrelated buttons.

   The button is 24px square — a finger's worth — and invisible; the dot is
   drawn by ::before and is all that changes. It used to be the button's own
   padded background, and the state rules below set `background`, whose
   shorthand resets the clip: every lit dot became a 24px disc, and the chosen
   one, scaled 1.5×, a 36px ball that pushed the row about. */
.effort-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.effort-dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.effort-dot:hover::before { background: var(--text-dim); }
.effort-dot.is-under::before { background: var(--accent-dim); }
.effort-dot.is-on::before {
  background: var(--accent);
  transform: scale(1.45);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.effort-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* ── where a conversation was folded up ────────────────────── */

.compacted {
  max-width: 780px;
  margin: 18px auto;
}
/* A rule with the reason written into it, rather than a gap that looks like
   something went missing — because something did, and this says what. */
.compacted__line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 11.5px;
  text-align: center;
  white-space: nowrap;
}
.compacted__line::before,
.compacted__line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.compacted__fold { margin-top: 10px; }

/* ─────────────────────────────────────────────────────────────
   Why a reply stopped short.

   Drawn into the transcript, not toasted, because the question it
   answers — "was this answer cut off?" — is asked while scrolling
   back, long after any toast is gone. Amber for the recoverable
   ones (truncated: ask it to continue), red for the ones where the
   provider refused outright. Both tokens already flip per theme.
   ───────────────────────────────────────────────────────────── */
.stopnote {
  max-width: 780px;
  margin: 10px auto 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}
.stopnote--refused,
.stopnote--filtered {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.stopnote__line {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
/* The way on, where the explanation is — see stopNote(). */
.stopnote {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stopnote__line { flex: 1; min-width: 200px; }
/* The way on: a solid button, the strongest thing in the note, so nobody has
   to work out that typing "continue" would have done the same. */
.stopnote__go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.14s;
}
.stopnote__go::before { content: '↻'; font-size: 15px; }
.stopnote__go:hover { opacity: 0.88; }
.stopnote__go:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ─────────────────────────────────────────────────────────────
   Documents: the cards, and the viewer that opens them

   A Word file, a spreadsheet and a deck cannot be drawn by a
   browser, so the server reads them and hands over structure.
   Everything below is how that structure looks: a page, a grid,
   a stack of slides. Nothing here fetches or renders a foreign
   stylesheet — the markup is built from escaped text.
   ───────────────────────────────────────────────────────────── */

/* ── standing work set up in the transcript ─────────────────── */

/* A confirmation laid out the way people now expect one: a heading, then a
   card — name and state, time, how often and where, what it will do — and
   under it a round grey pill that opens it in the panel beside the chat. The
   pill is the one control; the card is text somebody may want to copy. */
.schedcard { margin: 14px 0 6px; max-width: 620px; }
.schedcard__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.schedcard__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  /* Done is green, the convention every other app keeps. */
  background: var(--ok);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
/* Already there: the card is the subject of a question, not a success, so it
   does not wear the tick of one. */
.schedcard--existing .schedcard__mark { background: var(--warn); }
.schedcard__box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 4px 18px;
}
.schedcard__box > * + * { border-top: 1px solid var(--line-soft); }
.schedcard__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
}
.schedcard__icon { flex: none; color: var(--text); margin-top: 2px; }
.schedcard__who { flex: 1; min-width: 0; }
.schedcard__name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.schedcard__sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.schedcard__state {
  flex: none;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}
.schedcard__state.is-off { background: var(--surface-2); color: var(--text-faint); }
/* Not active yet: amber, the colour of something waiting on you. */
.schedcard__state.is-pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.qform__preview { margin: 2px 0 8px; }
.schedcard__rows {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
}
.schedcard__rows li { display: flex; align-items: center; gap: 11px; min-width: 0; }
.schedcard__rows li > :last-child { min-width: 0; overflow-wrap: anywhere; }
.schedcard__ri { flex: none; display: inline-grid; color: var(--text-dim); }
.schedcard__content { padding: 14px 0 12px; font-size: 14px; }
.schedcard__label { font-weight: 600; margin-bottom: 8px; }
.schedcard__para { margin: 0; color: var(--text); line-height: 1.55; overflow-wrap: anywhere; }
.schedcard__points { margin: 0; padding-left: 20px; display: grid; gap: 5px; line-height: 1.5; }
.schedcard__points li { overflow-wrap: anywhere; }
/* A solid white pill with dark bold text — the primary action on a dark
   page, the way a "Continue" button is drawn everywhere; inverted on a light
   page so it is still the strongest thing on the card. */
.schedcard__pill {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s;
}
.schedcard__when,
.schedcard__what { color: inherit; }
.schedcard__pill:hover { opacity: 0.88; }
.schedcard__pill:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ── a file the assistant made, in the transcript ───────────── */

.filecard {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 10px 0 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.filecard:hover { border-color: var(--accent-dim); }

.filecard__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.filecard__body { min-width: 0; flex: 1; }
.filecard__name {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filecard__meta {
  display: block;
  color: var(--text-faint);
  font-size: 11.5px;
}
/* Small and quiet: the card itself is the affordance, and two loud buttons on
   every document would compete with the conversation around them. */
.filecard__btn {
  flex: none;
  padding: 6px 11px;
  font-size: 12.5px;
  text-decoration: none;
}
.filecard { flex-wrap: wrap; }
.filecard__share {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  cursor: default;
}
.filecard__share-note { flex: 1 0 100%; color: var(--text-dim); font-size: 12px; }
.filecard__link {
  flex: 1;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font: 12.5px var(--mono);
}
.filecard__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filecard__share-error { flex: 1 0 100%; color: var(--danger); font-size: 12px; }


/* ── the chip that lists them ───────────────────────────────── */

.chip--files::before {
  content: '';
  width: 12px;
  height: 13px;
  flex: none;
  background: currentColor;
  /* A page with a folded corner, drawn rather than shipped as an image. */
  clip-path: polygon(0 0, 66% 0, 100% 32%, 100% 100%, 0 100%);
  opacity: 0.55;
}

/* ── the viewer ─────────────────────────────────────────────── */

.viewer__ident { min-width: 0; }
.viewer__ident h2 {
  overflow: hidden;
  font-size: 15.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer__meta {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11.5px;
}
.viewer__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}
.viewer__actions .btn { padding: 7px 13px; font-size: 12.5px; text-decoration: none; }

.viewer__body { padding: 0; }
.viewer__loading {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 40px 22px;
  color: var(--text-dim);
  font-size: 13.5px;
}
.viewer__empty { padding: 40px 22px; color: var(--text-dim); font-size: 13.5px; }
.viewer__note {
  padding: 10px 22px 18px;
  color: var(--text-faint);
  font-size: 12px;
}
.viewer__code {
  margin: 0;
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.viewer__frame {
  display: block;
  width: 100%;
  height: 78dvh;
  border: 0;
  background: #fff;
}
.viewer__image {
  display: grid;
  place-items: center;
  padding: 22px;
}
.viewer__image img { max-width: 100%; max-height: 74dvh; border-radius: 10px; background: #fff; }

/* ── a Word document, as a page ─────────────────────────────── */

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 34px 30px 60px;
  font-size: 14.5px;
  line-height: 1.72;
}
.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
  margin: 1.7em 0 .5em;
  line-height: 1.3;
}
.doc h1 { margin-top: 0; font-size: 1.75em; }
.doc h2 { font-size: 1.35em; }
.doc h3 { font-size: 1.15em; }
.doc p, .doc ul, .doc ol, .doc table, .doc pre, .doc blockquote { margin: 0 0 1em; }
.doc ul, .doc ol { padding-left: 1.5em; }
.doc li { margin: .25em 0; }
.doc li > ul, .doc li > ol { margin: .25em 0; }
.doc blockquote {
  margin-left: 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--line);
  color: var(--text-dim);
  font-style: italic;
}
.doc code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: .9em;
}
.doc pre {
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--surface-2);
  overflow-x: auto;
}
.doc pre code { padding: 0; background: none; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 1.8em 0; }
.doc a { color: var(--info); }
.doc table { border-collapse: collapse; width: 100%; font-size: .94em; }
.doc th, .doc td {
  padding: 7px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--surface-2); }
/* Where a page ended in the original, kept visible rather than silently
   flattened — it is the difference between one page and four. */
.doc .pagebreak {
  height: 0;
  margin: 1.8em 0;
  border-top: 1px dashed var(--line);
  break-after: page;
}

/* ── a spreadsheet, as a grid ───────────────────────────────── */

.grid-wrap { overflow: auto; max-height: 74dvh; }
.grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.grid th, .grid td {
  min-width: 96px;
  max-width: 380px;
  padding: 5px 9px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grid td.is-number { text-align: right; font-family: var(--mono); font-size: 12px; }
/* The header row and the row numbers stay put, because a spreadsheet whose
   column letters scroll away is a wall of values with no addresses. */
.grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 0;
  background: var(--surface-2);
  color: var(--text-faint);
  font-weight: 500;
  text-align: center;
}
.grid__rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 44px;
  width: 44px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-weight: 500;
  text-align: right;
}
.grid__corner {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 44px;
  width: 44px;
  background: var(--surface-2);
}

/* The sheet tabs, along the top of a workbook. */
.viewer__sheets {
  display: flex;
  gap: 3px;
  flex: none;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.viewer__sheets::-webkit-scrollbar { display: none; }
.sheet-tab {
  padding: 7px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-faint);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.sheet-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── a deck, as slides ──────────────────────────────────────── */

.slides {
  display: grid;
  gap: 16px;
  padding: 20px 22px 30px;
}
.slide {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  /* The shape of the thing being previewed, so a deck reads as a deck. */
  aspect-ratio: 16 / 9;
  overflow: auto;
}
.slide__no {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
}
.slide h3 { margin: 0 0 14px; font-size: 19px; line-height: 1.3; }
.slide ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.slide li { margin: 5px 0; }
.slide li.lvl-1 { margin-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.slide li.lvl-2 { margin-left: 36px; color: var(--text-dim); font-size: 13px; }
.slide li.lvl-3, .slide li.lvl-4 { margin-left: 54px; color: var(--text-faint); font-size: 12.5px; }
.slide__table { margin-top: 12px; border-collapse: collapse; font-size: 13px; }
.slide__table th, .slide__table td { padding: 5px 9px; border: 1px solid var(--line); text-align: left; }
.slide__notes {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.6;
}
.slide__notes span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── printing, which is also how a PDF gets made ────────────── */

/* There is no PDF writer on the server: one that got Vietnamese right would
   need a Unicode font embedded, and a document with boxes where the diacritics
   were is worse than no document at all. The browser already has the fonts and
   a perfectly good PDF exporter behind its print dialog, so that is the road —
   and this is what makes what comes out of it the document rather than the
   application around it. */
@media print {
  body.is-printing > *:not(#filepane),
  body.is-printing .filepane__bar,
  body.is-printing .filepane__versions,
  body.is-printing .viewer__sheets,
  body.is-printing .toasts {
    display: none !important;
  }
  /* Every one of these undoes something that would otherwise cost pages.
     `position: fixed` prints the first screenful and stops — the element is
     pinned to the viewport, and a viewport is one page. `height: 100dvh`
     does the same by another route, and every `overflow` in the chain
     clips whatever did not fit. A document that printed page one and
     silently dropped the other eleven is the failure this prevents. */
  /* Ink for paper, whatever the theme. Everything inside the pane colours
     itself from these variables, and in the dark theme they are near-white:
     a document printed 37 pages of white text on white paper. */
  body.is-printing,
  body.is-printing #filepane {
    --text: #111 !important;
    --text-dim: #333 !important;
    --text-faint: #555 !important;
    --line: #c8c8c8 !important;
    --line-soft: #dddddd !important;
    --surface: #ffffff !important;
    --surface-2: #f3f3f3 !important;
    --bg: #ffffff !important;
    --bg-elev: #ffffff !important;
    --tint: #f5f5f5 !important;
    --accent: #3b2dbf !important;
    --on-accent: #ffffff !important;
    --info: #1a56b0 !important;
    background: #fff !important;
    color: #111 !important;
  }
  body.is-printing #filepane * {
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor;
  }
  body.is-printing #filepane {
    position: static !important;
    inset: auto !important;
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: #000;
    overflow: visible !important;
  }
  body.is-printing .filepane__body {
    height: auto !important;
    max-height: none;
    padding: 0;
    background: #fff;
    overflow: visible !important;
  }
  body.is-printing .doc { max-width: none; padding: 0; color: #000; }
  body.is-printing .grid-wrap { max-height: none; overflow: visible !important; }

  /* Repeat a table's header on every page it spans, and never split a row
     across the fold. Both are what makes a printed spreadsheet readable. */
  body.is-printing .grid thead { display: table-header-group; }
  body.is-printing .grid tr,
  body.is-printing .doc table tr { break-inside: avoid; }
  body.is-printing .doc table thead { display: table-header-group; }

  /* A heading alone at the bottom of a page, or one orphaned line at the top
     of the next, is the difference between a document and a printout. */
  body.is-printing .doc h1,
  body.is-printing .doc h2,
  body.is-printing .doc h3 { break-after: avoid; }
  body.is-printing .doc p,
  body.is-printing .doc li { orphans: 2; widows: 2; }

  /* Links keep their colour but lose the underline-blue that reads as broken
     on paper; the address itself is not printed, because a footnote after
     every link in a quotation is noise. */
  body.is-printing .doc a { color: #000; text-decoration: underline; }

  /* The running page and the editor cannot be printed usefully — a frame is
     a live document this stylesheet does not reach into, and a textarea
     prints its first visible rows and nothing else. Saying so beats handing
     somebody a blank sheet. */
  body.is-printing .viewer__frame,
  body.is-printing .editor { display: none !important; }
  body.is-printing .grid th,
  body.is-printing .grid td { border-color: #bbb; color: #000; }
  body.is-printing .grid thead th,
  body.is-printing .grid__rownum,
  body.is-printing .grid__corner { position: static; background: #eee; }
  body.is-printing .slide {
    page-break-after: always;
    border-color: #bbb;
    background: #fff;
    color: #000;
  }
  body.is-printing .viewer__code { color: #000; }
}

/* ── what is waiting to be sent ─────────────────────────────── */

/* Typed while the assistant was working. It sits above the composer rather than
   going straight in: most of what people type during a long turn is the next
   thing, not a correction, and having it land mid-task derails work that was
   going fine. Visible, because a message that has silently gone nowhere is
   indistinguishable from one that was lost. */
/**
 * Its own card, with a gap — not tucked under the composer.
 *
 * It used to overlap the box by 18px so the two would read as one control, and
 * that trick broke the moment the box was focused. `.composer__box:focus-within`
 * draws `0 0 0 3px` of glow around **every** edge including the top, and that
 * ring landed on top of the queue: a bright line cutting horizontally through
 * the middle of the waiting messages, with the panel's bottom edge clipped
 * behind an opaque surface. Which is to say the join only looked like a join
 * while nobody was typing, and typing is when the queue is on screen.
 *
 * A gap has no seam to hide, so there is nothing left to go wrong. It also says
 * the truer thing: these messages have not been sent, and drawing them as the
 * top of the box implied they were already in it.
 */
.queue {
  display: grid;
  gap: 6px;
  max-width: 780px;
  margin: 0 auto 8px;
  padding: 9px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/**
 * Three columns, and the middle one is `minmax(0, 1fr)` rather than `1fr`.
 *
 * That single token is the bug the user hit. A grid item's automatic minimum is
 * its *min-content* width, so `1fr` is really "at least as wide as the longest
 * thing inside me". One long pasted message grew this row to 1729px inside a
 * 780px container and carried "Send now" and the delete button around 900px off
 * the right-hand edge of the screen. Both controls were rendered the whole time
 * and neither could be reached, which is indistinguishable from their not
 * existing — and that is exactly how it was reported.
 *
 * `minmax(0, 1fr)` lets the column shrink below its content, so the text clamps
 * and the buttons stay where they belong.
 */
.queue__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 13px;
}

/* A slow pulse: this is waiting, not working. */
.queue__wait {
  width: 7px;
  height: 7px;
  flex: none;
  /* The row aligns on `start` now that the text can be two lines, so the dot
     needs nudging down to sit on the first line rather than above it. */
  margin-top: 7px;
  border-radius: 50%;
  background: var(--warn);
  animation: queue-wait 1.8s ease-in-out infinite;
}
@keyframes queue-wait {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .queue__wait { animation: none; opacity: .8; }
}

.queue__body { min-width: 0; }

/**
 * Two lines, then a control.
 *
 * It used to be one line with an ellipsis, which reads as truncation but is
 * really concealment: a paragraph you typed became "đảm bảo tất cả các file…"
 * with no way to check what you had actually queued. Two lines is enough to
 * recognise it, and the rest is one press away.
 *
 * `pre-wrap` keeps the line breaks that were typed; `anywhere` is what stops a
 * pasted path or URL with no spaces in it from becoming a single unbreakable
 * word and re-creating the overflow this component just got fixed for.
 */
.queue__text {
  margin: 0;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text-dim);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.queue__item.is-open .queue__text {
  display: block;
  /* Long enough to read, short enough that the composer never leaves the
     screen — the point of expanding is not to lose the box you type in. */
  max-height: 38vh;
  overflow: auto;
}

.queue__more {
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.queue__more:hover { color: var(--accent); }
.queue__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.queue__actions { display: flex; align-items: center; gap: 6px; }
.queue__files { color: var(--text-faint); font-size: 11.5px; }

.queue__now {
  flex: none;
  white-space: nowrap;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-faint);
  font-size: 11.5px;
  cursor: pointer;
}
.queue__now:hover { border-color: var(--accent-dim); color: var(--accent); }

/* 26px, not 22. WCAG 2.5.8 asks for 24 as a floor and this is a phone-first
   app; the glyph stays small, the hit area does not. */
.queue__drop {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
}
.queue__drop:hover { background: var(--surface-2); color: var(--danger); }

/* ── several keys for one provider ──────────────────────────── */

/* Shown as a list because they are used as one: tried in order, first one that
   is not refused answers. The key itself never reaches the browser — the last
   four characters and the date are enough to tell one from another, which is
   the only thing this screen has to help you do. */
.keylist {
  display: grid;
  gap: 5px;
  margin-bottom: 4px;
}

.keyrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--bg);
  font-size: 12.5px;
}

.keyrow__no {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 10.5px;
}
.keyrow__hint { font-family: var(--mono); color: var(--text-dim); }
.keyrow__when { margin-left: auto; color: var(--text-faint); font-size: 11px; }
.keyrow__badge {
  padding: 1px 7px;
  border: 1px solid var(--ok);
  border-radius: 999px;
  color: var(--ok);
  font-size: 10.5px;
}
.keyrow__drop {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
}
.keyrow__drop:hover { background: var(--surface-2); color: var(--danger); }

/* ── artifacts ──────────────────────────────────────────────── */

/* Everything the assistant has made, across every conversation. The card in
   the transcript covers the next five seconds; this covers next week, when the
   file is what you remember and the chat it came from is not. */
.artifact {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.artifact:hover { border-color: var(--accent-dim); }

.artifact__ext {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}
.artifact__body { min-width: 0; flex: 1; }
.artifact__name {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact__meta {
  display: block;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact__btn { flex: none; padding: 6px 11px; font-size: 12.5px; text-decoration: none; }
.artifact__drop {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
}
.artifact__drop:hover { background: var(--surface-2); color: var(--danger); }
.artifact__drop.is-armed {
  width: auto;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--danger);
  color: #0b0e11 !important; /* the global .is-armed paints text danger-red, which on this fill was invisible */
  font-size: 11px;
}

/* ── an artifact, running ───────────────────────────────────── */

/* White behind it: a page written for the web expects a page's background, and
   the app's dark surface showing through unstyled markup is not what the author
   of the artifact saw. */
.viewer__run { background: #fff; }

/* ── editing one ────────────────────────────────────────────── */

.editor {
  display: flex;
  flex-direction: column;
  height: 72dvh;
}
.editor__box {
  flex: 1;
  min-height: 0;
  padding: 16px 20px;
  border: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  resize: none;
  outline: none;
  white-space: pre;
  tab-size: 2;
}
.editor__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
}
.editor__hint { flex: 1; color: var(--text-faint); font-size: 11.5px; }
.editor__save { flex: none; padding: 7px 15px; font-size: 12.5px; }

/* ── which models actually run ──────────────────────────────── */

.audit {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.audit:last-child { border-bottom: 0; }
.audit__id { font-family: var(--mono); font-size: 12px; }
.audit__why {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge--bad { color: var(--danger); border-color: var(--danger); }

/* ─────────────────────────────────────────────────────────────
   Shelves: Projects, Artifacts, Scheduled

   Pages rather than dialogs. You go to a shelf, look through what
   is on it, and pick one — a sheet floating over the transcript is
   the wrong shape for that: small, temporary, and implying you were
   in the middle of something.

   One shell for all three. The header is identical in each — a
   title, a way to search, a way to order, and the one button that
   makes a new thing — and three copies of it would drift apart.
   ───────────────────────────────────────────────────────────── */

.page {
  flex: 1;
  min-height: 0;
  padding: 34px 40px 80px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page__head {
  display: flex;
  flex-wrap: wrap; /* the title keeps its words together beside a side panel */
  align-items: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto 6px;
}

/**
 * A serif title, and the only one in the application.
 *
 * The chat is a working surface and reads in the interface font; a shelf is a
 * place you arrive at, and the change of voice at the top of it is what says
 * so without a word of explanation.
 */
.page__title {
  flex: 1 1 12ch;
  min-width: 0;
  margin: 0;
  /*
     Georgia is not on this list, and that is the fix.
     
     Georgia stops at Latin Extended-A. Vietnamese lives in Latin Extended
     Additional (U+1EA0–U+1EF9), so every letter carrying a Vietnamese tone mark
     — ố, ế, ậ, ộ, ệ — fell out of it and was drawn by whatever the browser
     found next. A project called "luật thương mại quốc tế" rendered with five
     letters in a different typeface, at a different weight, sitting off the
     baseline: it reads as broken text, and it was the only serif in the app,
     which is why nothing else showed it.
     
     Everything below covers Vietnamese. */
  font-family: 'Noto Serif', Cambria, 'Times New Roman', ui-serif, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.page__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.page__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  color: var(--text-dim);
  cursor: pointer;
}
.page__icon:hover { background: var(--tint-2); color: var(--text); }


/* The sort and filter control: a pill that opens a menu, never a <select>,
   because a native dropdown is a different piece of furniture on every
   platform and this row has to read as one thing. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--tint);
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}
.pill:hover { background: var(--tint-2); color: var(--text); }
.pill strong { color: var(--text); font-weight: 500; }
.pill::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.7;
}

/* The one button that makes a new thing. White, because there is exactly one
   of them per shelf and it should be obvious which. */
.page__new {
  flex: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
}

/* The menus these controls open. Anchored under the row rather than positioned
   by script: there is only ever one open, and it belongs to this header. */
.page__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.page__menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.page__menu button:hover { background: var(--tint); }
.page__menu button.is-active { color: var(--accent); }

.page__lede {
  max-width: 1120px;
  margin: 0 auto 22px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}
.page__lede code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

.page__body { max-width: 1120px; margin: 0 auto; }

/* ── the grid of cards ──────────────────────────────────────── */

.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.cards--wide { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 22px 24px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  /* Drawn by its edge, not by a fill. A shelf of filled tiles sits on top of
     the page as a second surface; an outline lets the galaxy behind it stay
     the background of the whole app, and the border is enough to say where one
     card ends and the next begins. The hover fill below is what makes a card
     feel like something you can press. */
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* Glass, with light along its top edge — the same pane as the rest of the
   shelves — and it lifts a little under the pointer. */
.cards > .card {
  border-color: var(--glass-line);
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.card:hover { border-color: var(--line); background: var(--surface-2); }
.cards > .card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--glass-line));
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--tint-2);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.75);
}
@media (prefers-reduced-motion: reduce) { .cards > .card:hover { transform: none; } }

.card__name {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}
/* The date sits at the foot of the card whatever else is in it, so a row of
   cards of different heights still reads along one line. */
.card__when {
  margin-top: auto;
  padding-top: 12px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.card__facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 12px;
}

/* ── an artifact card, which leads with what is in it ───────── */

.card--artifact { padding: 0; overflow: hidden; min-height: 250px; }

/* A window onto the thing itself, cut off rather than scaled: a shrunken
   screenshot of a document is unreadable, while its first four lines at their
   real size tell you which document it is. */
.card__peek {
  height: 150px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
.card__peek--code {
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: pre;
  word-break: break-all;
}
.card__peek--empty {
  display: grid;
  place-items: center;
  color: var(--text-faint);
  mask-image: none;
}
.card__peek h1, .card__peek h2, .card__peek h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card__peek p, .card__peek li { margin: 0 0 5px; }
.card__peek table { border-collapse: collapse; font-size: 11px; }
.card__peek td, .card__peek th { border: 1px solid var(--line-soft); padding: 2px 5px; }
/* A picture is its own preview: the whole card's window, on white so a
   transparent one reads, and unmasked — there is no "more below" to hint at. */
.card__peek--image {
  padding: 0;
  background: #fff;
  mask-image: none;
}
.card__peek--image img,
.card__peek--image iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  pointer-events: none;
}

.card__foot { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 18px; }

/* ── an empty shelf ─────────────────────────────────────────── */

.blank {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 70px 20px 60px;
  text-align: center;
}
.blank__ring {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  /* Clear, not a grey disc: these pages sit on the sky, and an opaque circle
     behind the mark was the one flat patch on it. The line drawing carries
     itself. */
  background: transparent;
  color: var(--text-faint);
}
.blank__say { color: var(--text-dim); font-size: 14.5px; }

/* The rule under an empty state, before the suggestions: a soft edge rather
   than a hard one, because what follows is an offer and not a section. */
.blank__rule {
  height: 1px;
  margin: 46px 0 34px;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
}

/* ── things you could schedule ──────────────────────────────── */

.ideas {
  display: grid;
  gap: 26px 40px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.idea {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.idea__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  color: var(--text-dim);
}
.idea:hover .idea__mark { border-color: var(--accent-dim); color: var(--accent); }
.idea__name { font-size: 14.5px; font-weight: 600; }
.idea__what { margin: 3px 0 6px; color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.idea__when { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 12px; }

/* ── the notice above a shelf ───────────────────────────────── */

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding: 15px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  font-size: 13.5px;
}
.notice__say { flex: 1; color: var(--text-dim); }
/* Work on a clock that will not run with the web closed: amber, with the three
   steps to set it up. Nothing is shown when all is well. */
.notice--warn {
  flex-direction: column;
  align-items: stretch;
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line-soft));
}
.notice--warn strong { color: var(--text); }
.notice__steps {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* ── a row on a shelf that has things on it ─────────────────── */

/* Glass, the same pane as the suggestions on a new conversation, so a shelf
   over the sky reads as part of the same surface rather than solid slabs. */
.task,
.wf {
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 46%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  margin-bottom: 10px;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .task,
  .wf { background: var(--glass-solid); }
}
.task {
  display: flex;
  flex-wrap: wrap; /* buttons move under the text rather than squeezing it to a word a line */
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}
.task__edit { flex: none; }

/* "Suggested", below a list that already has things in it. */
.suggested__label {
  margin: 40px 0 22px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.task__body { flex: 1 1 220px; min-width: 0; }
.task__name { font-size: 14.5px; font-weight: 600; }
/* An archived conversation is opened by pressing anywhere on its card. */
.task.archived { cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.task.archived:hover { border-color: var(--line); background: color-mix(in srgb, var(--surface) 80%, var(--tint)); }
/* The keyboard target: dot and title, beside — not around — the row's buttons (ACC-010). */
.task__main { display: flex; flex: 1 1 220px; align-items: center; gap: 14px; min-width: 0; border-radius: 10px; }
.task__main:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.task__what {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task__when { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--text-faint); font-size: 12px; }
.task__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.task--off .task__dot { background: var(--text-faint); }
.task__act {
  flex: none;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.task__act:hover { border-color: var(--accent-dim); color: var(--accent); }
.task__act.is-armed { border-color: var(--danger); background: var(--danger); color: #0b0e11 !important; } /* dark on the fill: the global .is-armed red made it red on red */

/* ── a workflow, and the state of each of its steps ─────────── */
/*
 * A card rather than a row, because the question this screen answers is "which
 * step stopped, and what did it say" — and that does not fit on one line.
 * Colour is never the only signal: every step carries a mark and a word, so it
 * reads the same to someone who cannot tell the red one from the green one.
 */

.wf { padding: 16px 20px; }
.wf--off { opacity: 0.62; }
.wf__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.wf__head > div:first-child { flex: 1 1 220px; min-width: 0; }
.wf__name { font-size: 14.5px; font-weight: 600; }
.wf__when { margin-top: 6px; color: var(--text-faint); font-size: 12px; }
.wf__acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.wf__flag {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn, var(--accent));
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.wf__steps { margin: 12px 0 0; padding: 0; list-style: none; }
.wf__step { display: flex; gap: 10px; padding: 5px 0; align-items: baseline; }
.wf__step-mark {
  flex: none;
  width: 1.1em;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}
.wf__step-text { min-width: 0; font-size: 13px; line-height: 1.5; }
.wf__step-say {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
}

.wf__step--done .wf__step-mark { color: var(--ok); }
.wf__step--running .wf__step-mark { color: var(--info); }
.wf__step--failed .wf__step-mark { color: var(--danger); }
.wf__step--failed .wf__step-say { color: var(--danger); }
/* Interrupted is not failure and must not read as it: the step may well have
   done its work, and the point is that nobody can say. */
.wf__step--unknown .wf__step-mark,
.wf__step--unknown .wf__step-say { color: var(--warn, var(--text-dim)); }

@media (max-width: 640px) {
  .wf__head { flex-direction: column; }
  .wf__acts { justify-content: flex-start; }
}

/* ── the Automations page: workflows and scheduled tasks as two tabs ── */
/*
 * Owner, 2026-11-08. The rail's one Automations item carries a count of what needs the
 * person; the page has a tab switch, a pill of state on every row, and a ⋯ menu.
 * The pills are words first: the colour only repeats what the word says. Each
 * colour is the theme's own semantic one, which holds 4.5:1 on both themes.
 */
.rail__glyph { position: relative; display: inline-flex; flex: none; }
.rail__badge {
  position: absolute;
  top: -7px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  /* The page colour on the red: dark on the dark theme's light red, light on the light theme's deep one. */
  background: var(--danger);
  color: var(--bg);
  box-shadow: 0 0 0 2px var(--bg);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.page__notice { max-width: 1120px; margin: 0 auto 14px; }
/* Under the title and level with it, at the shelf's own width. */
.auto__tabs { display: flex; margin: 4px max(0px, calc((100% - 1120px) / 2)) 18px; }
.auto__tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.auto__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.autopills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.autopill {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.autopill--running { color: var(--info); }
.autopill--needs { color: var(--warn); }
.autopill--failed,
.autopill--overdue { color: var(--danger); }
.autopill--done { color: var(--ok); }

/* A paused workflow dims its steps, not the words that say it is paused: a
   whole row at 62% took the pill under 4.5:1. */
.wf--off.autorow { opacity: 1; }
.wf--off.autorow .wf__steps { opacity: 0.62; }

.autorow__more { flex: none; font-size: 18px; }
.task__act--stop { border-color: var(--danger); color: var(--danger); }
.task__act:disabled { opacity: 0.6; cursor: default; }

/* The side panel's History: when, how it ended, how far it got. */
h3.spane__label { margin: 14px 0 -2px 4px; font-weight: 400; }
h3.spane__label:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.spane__history { display: grid; gap: 8px; margin: 0; padding: 0 4px; list-style: none; }
.spane__run { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12.5px; }
.spane__runwhen { min-width: 0; overflow-wrap: anywhere; }

/* ── a switch, for the one setting a shelf carries ──────────── */

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.16s ease, background 0.16s ease;
}
.switch[aria-pressed='true'] { background: var(--ok); }
.switch[aria-pressed='true']::after { background: #fff; transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) {
  .switch::after { transition: none; }
}

/* ── a form in a sheet: the two create dialogs ──────────────── */

.sheet--form { width: min(560px, 100%); }
.sheet--form .sheet__body { padding: 22px 26px 26px; }
.form__label {
  display: block;
  margin: 0 0 7px;
  font-size: 13.5px;
  font-weight: 600;
}
.form__label span { color: var(--danger); }
.form__group { margin-bottom: 18px; }
.form__group input,
.form__group textarea,
.form__group select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.form__group textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.form__group input:focus,
.form__group textarea:focus,
.form__group select:focus { border-color: var(--accent-dim); }
.form__row { display: flex; gap: 10px; align-items: center; }
.form__row .form__group { flex: 1; margin-bottom: 0; }
.form__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.form__foot .btn { padding: 10px 20px; border-radius: 10px; }
.form__aside { margin-top: -8px; color: var(--text-faint); font-size: 12.5px; line-height: 1.6; }

/* ── narrow screens ─────────────────────────────────────────── */

@media (max-width: 720px) {
  .page { padding: 22px 18px 90px; }
  .page__title { font-size: 26px; }
  .page__head { flex-wrap: wrap; gap: 10px; }
  .page__tools { width: 100%; justify-content: flex-end; }
  .find { width: 100%; order: -1; }
  .cards { grid-template-columns: 1fr; }
  .ideas { grid-template-columns: 1fr; }
}

/* ── the search field a shelf grows when you ask for one ────── */

/* One affordance, not two: pressing the magnifier replaces it with this, and
   clearing puts the magnifier back. Both on screen at once read as two
   different searches. */
.find {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(320px, 42vw);
  padding: 0 12px;
  /* The ordinary line at rest, the accent only while you are typing in it.
     This wore the accent permanently, so every page carried a violet box that
     looked focused when nothing was — and when focus did land there was
     nothing left for it to change. */
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.find:focus-within {
  border-color: var(--accent-dim);
}
.find__mark { flex: none; color: var(--text-faint); }
.find input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.find__clear {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
}
.find__clear:hover { background: var(--surface-2); color: var(--text); }

/* ── what a project card offers on hover ────────────────────── */

.card { position: relative; }

/* A project card is a div with `role="button"` rather than a real one, because
   it has a button of its own inside it and a button cannot nest. That costs the
   free focus ring, so it is put back by hand. */
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Room at the top right for the pin and the ⋮, so a long name does not run
   underneath them. */
.cards--wide .card__name { padding-right: 76px; }

.card__more {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  /* No fill of its own: on a glass card a filled square reads as a hole. */
  background: transparent;
  color: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
/* Hidden until the card is under the pointer — a menu button on every card is
   furniture on a shelf whose whole job is to be scanned. Focus reveals it too,
   or it would be reachable by keyboard and invisible. */
.card:hover .card__more,
.card__more:focus-visible { color: var(--text-dim); }
.card__more:hover { background: var(--tint-2); color: var(--text); }

.card__pin {
  position: absolute;
  top: 18px;
  right: 52px;
  color: var(--accent);
  font-size: 12px;
}

/* The menu it opens. Positioned by script against the card it belongs to. */
.cardmenu {
  position: fixed;
  /* Above a full-size viewer (50), whose own ⋯ menu otherwise opened underneath
     it; below the toasts (60). */
  z-index: 55;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.cardmenu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.cardmenu button:hover { background: var(--tint); }
.cardmenu button.is-danger { color: var(--danger); }
.cardmenu hr { margin: 5px 8px; border: 0; border-top: 1px solid var(--line-soft); }

/* ── one project, opened ────────────────────────────────────── */

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-size: 13px;
}
.crumb button {
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.crumb button:hover { color: var(--text); }

/* A pin that is set has to look set, or the menu entry that says "Unpin" is the
   only way to find out. */
.page__icon.is-on { background: var(--tint); color: var(--accent); }

.project__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 26px;
}
.project__name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: 'Noto Serif', Cambria, 'Times New Roman', ui-serif, serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Laid out by the room the page actually has, not the window: with the side
   panel open the page can be half the screen, and two columns in that
   squeezed the work column to a sliver. */
#project-page { container-type: inline-size; }
@container (max-width: 760px) {
  .project__grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Two columns: what you do here, and what this project knows. */
.project__grid {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

/* The box that starts a conversation in this project. */
.starter {
  padding: 18px 20px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--composer-glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow), 0 1px 0 var(--glass-hi) inset;
}
.starter:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-line)); }
.starter textarea {
  width: 100%;
  min-height: 72px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  outline: none;
}
.starter__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.starter__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--text-dim);
  font-size: 12.5px;
}
.starter__send {
  margin-left: auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  cursor: pointer;
}
.starter__send:disabled { background: var(--surface-2); color: var(--text-faint); cursor: default; }
/* The project box's +: the composer's, the same size and the same menu. */
.starter__plus {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
}
.starter__plus:hover,
.starter__plus[aria-expanded="true"] { background: var(--surface-2); color: var(--accent); }
.starter__plus:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.starter .attachments,
.starter .skillchips { margin: 0 0 10px; max-width: none; justify-content: flex-start; }

/* ── the + menu (plus-menu.js) ───────────────────────────────────
 *
 * Claude's: a column of rows, each an icon and its words, a › where another
 * panel opens beside it. Panels are fixed to the window so a scrolling page
 * cannot clip them, and a long list scrolls inside its own panel.
 */
.plusmenu {
  position: fixed;
  z-index: 56;
  min-width: 248px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.plusmenu[hidden] { display: none; }
.plusmenu hr { margin: 5px 8px; border: 0; border-top: 1px solid var(--line-soft); }
.plusmenu__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.plusmenu__item:hover,
.plusmenu__item:focus-visible,
.plusmenu__item[aria-expanded="true"] { background: var(--tint); outline: none; }
.plusmenu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.plusmenu__item[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.plusmenu__icon {
  display: grid;
  place-items: center;
  width: 20px;
  flex: none;
  color: var(--text-dim);
}
.plusmenu__icon svg { display: block; }
.plusmenu__text { display: grid; flex: 1; min-width: 0; }
.plusmenu__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plusmenu__detail { color: var(--text-faint); font-size: 12px; line-height: 1.45; white-space: normal; }
.plusmenu__tag { flex: none; color: var(--text-faint); font-size: 12px; }
.plusmenu__tag:empty { display: none; }
.plusmenu__tag.is-warn { color: var(--warn); }
.plusmenu__more { flex: none; color: var(--text-faint); font-size: 16px; line-height: 1; }
.plusmenu__ext { flex: none; display: grid; color: var(--text-faint); }
.plusmenu__ext svg { display: block; }
/* The account menu (account-menu.js): a row with no icon of its own — Learn
   more's pages, the languages — starts at the edge, as Claude's do; the email
   heads it on one line. */
.plusmenu--account { min-width: 264px; }
.plusmenu--account .plusmenu__item > .plusmenu__icon:empty { display: none; }
.plusmenu--account > .plusmenu__note:first-child { padding: 8px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* About Synapsez, and the list of shortcuts — from Learn more. */
.about { display: grid; justify-items: center; gap: 12px; text-align: center; }
.about__mark { display: block; }
.about__what { margin: 0; color: var(--text-dim); line-height: 1.6; }
.about__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 0; }
.about__links a { color: var(--accent); text-underline-offset: 3px; }
.shortcuts { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.shortcuts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.shortcuts__row:last-child { border-bottom: 0; }
.shortcuts__keys { display: flex; flex: none; gap: 4px; }
.shortcuts__keys kbd {
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: center;
}
.plusmenu__tick { flex: none; width: 14px; color: var(--accent); text-align: center; }
.plusmenu__warn { flex: none; color: var(--warn); }
.plusmenu__item.is-warn .plusmenu__label { color: var(--text-dim); }
/* An on/off switch in the row, drawn from the row's own aria-checked. */
.plusmenu__switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.15s;
}
.plusmenu__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.15s, background 0.15s;
}
[aria-checked="true"] > .plusmenu__switch { background: var(--accent); box-shadow: none; }
[aria-checked="true"] > .plusmenu__switch::after { transform: translateX(14px); background: var(--on-accent); }
.plusmenu__mono {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.plusmenu__note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 41px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.plusmenu__note.is-loading,
.plusmenu__drive .plusmenu__note { padding-left: 10px; }
.plusmenu__back .plusmenu__label { font-weight: 600; }
.plusmenu__drive { display: grid; gap: 4px; min-width: 300px; }
.plusmenu__search {
  width: 100%;
  margin: 2px 0 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.plusmenu__search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.plusmenu__drivelist { display: grid; }
@media (prefers-reduced-motion: reduce) {
  .plusmenu__switch,
  .plusmenu__switch::after { transition: none; }
}

/* Skills picked for the message being written, and the ones a sent message carried. */
.skillchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 780px;
  margin: 0 auto 8px;
}
.skillchips[hidden] { display: none; }
.skillchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: var(--tint);
  color: var(--accent);
  font-size: 12.5px;
}
.skillchip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skillchip__drop {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
}
.skillchip__drop:hover { background: var(--surface-2); }
.skillchip__drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.skillchip--sent { padding-right: 11px; }
.msg__skills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }

/* How full a project's shelf is, as Claude's projects show it. */
.capacity { margin: 4px 0 14px; }
.capacity__track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.capacity__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--info, var(--accent));
}
.capacity.is-over .capacity__fill { background: var(--warn); }
.capacity__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.capacity__mode { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.capacity__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.capacity.is-over .capacity__dot { background: var(--warn); }

/* The memory card, Claude's way: its name, who can see it, the way in, one line. */
.panel-card__lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.panel-card__link {
  padding: 4px 6px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.panel-card__link:hover { background: var(--tint); }
.panel-card__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.project__empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-faint);
  text-align: center;
}

/* The cards down the right: instructions, memory, context. */
.panel-card {
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-line);
}
.panel-card:last-child { border-bottom: 0; }
.project__side {
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 30%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 var(--glass-hi) inset;
  overflow: hidden;
}
.panel-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.panel-card__name { flex: 1; font-size: 15px; font-weight: 600; }
.panel-card__add {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.panel-card__add:hover { background: var(--tint); color: var(--text); }
.panel-card__say { color: var(--text-faint); font-size: 12.5px; line-height: 1.6; }
.panel-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 11px;
}

.panel-card textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.panel-card__foot { display: flex; gap: 8px; margin-top: 10px; }
.panel-card__foot .btn { padding: 7px 14px; font-size: 12.5px; }

/* A source on the shelf, and the dashed target you can drop one onto. */
.source {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.source:last-of-type { border-bottom: 0; }
.source__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source__size { flex: none; color: var(--text-faint); font-size: 11.5px; }

/* ── what a project produced ──────────────────────────────────────────
 *
 * Cards, in the work column, for the same reason the shelf of sources uses
 * cards: a column of filenames tells you a project made four documents and
 * nothing about which one you want. The kind goes first and large, because
 * "the spreadsheet" is how somebody remembers a file they made last week.
 */
.outrail__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 26px 0 12px;
}
.outrail__nav {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--tint);
  color: var(--text);
  cursor: pointer;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: background 0.15s;
}
.outrail__nav:hover { background: var(--tint-2); }
.outrail__nav[hidden] { display: none; }
/* One row, scrolled sideways, snapping to a card. Padded top and bottom so a
   card lifting on hover is not clipped by the scroller's own edge. */
.outrail {
  display: flex;
  gap: 14px;
  margin: 0 -4px;
  padding: 10px 4px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
}
.outrail::-webkit-scrollbar { display: none; }
.outcard {
  position: relative;
  /* Never wider than the column: on a narrow one a card is most of the row. */
  flex: 0 0 min(240px, 82%);
  display: flex;
  flex-direction: column;
  height: 236px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 40%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 1px 0 var(--glass-hi) inset;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s, border-color 0.22s;
}
/* Lifts toward you, the way a thing you can pick up does. */
.outcard:hover,
.outcard:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-line));
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 1px 0 var(--glass-hi) inset;
  outline: none;
}
/* The picture: a page, drawn on paper. */
.outcard__peek {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 10px 10px 0;
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
}
.outcard__peek.is-page,
.outcard__peek.is-doc { background: #fff; }
.outcard__ext {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.08em;
}
.outcard__peek.is-page .outcard__ext,
.outcard__peek.is-doc .outcard__ext { display: none; }
/* A page run at four times the card's size and shrunk, so it lays out as a
   page rather than as a phone. Never clickable: the card is the button. */
.outcard__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 400%;
  border: 0;
  transform: scale(0.25);
  transform-origin: 0 0;
  pointer-events: none;
  background: #fff;
}
.outcard__img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: #fff; }
.outcard__doc { padding: 12px 13px; color: #1f2328; }
.outcard__doctitle {
  margin-bottom: 6px;
  font-family: 'Noto Serif', Cambria, 'Times New Roman', ui-serif, serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.outcard__docbody {
  color: #444c56;
  font-size: 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Fades the page into the card, so a clipped page reads as continuing. */
.outcard__peek::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 34px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}
.outcard__foot { display: grid; gap: 3px; padding: 10px 14px 12px; }
.outcard__kind {
  color: var(--info);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}
.outcard__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outcard__meta { color: var(--text-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .outcard, .outcard:hover { transition: none; transform: none; }
}

/* ── one remembered note, in full ─────────────────────────────────────
 *
 * The card on the project page clips each note to a line; this is the sheet
 * behind it, where the whole note is readable and where it can be thrown away.
 * The key is set in the mono face because it is an identifier the assistant
 * uses, not prose — "house-style" is a handle, and it reads as one.
 */
.note {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.note:last-of-type { border-bottom: 0; }
.note__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}
.note__key {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note__when { flex: none; color: var(--text-faint); font-size: 11.5px; }
.note__body {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
/* Armed: the first press said what would happen, the second does it. */
.note__head .btn.is-armed {
  border-color: var(--danger);
  color: var(--danger);
}

/* Which memory a note lives in. Two words, because "project" and "account" are
   the whole distinction and a colour alone would not survive being colour-blind
   or printed. */
.note__scope {
  flex: none;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10.5px;
  white-space: nowrap;
}
.note__scope--here {
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* ── a project's shelf ────────────────────────────────────────────────
 *
 * Cards rather than rows. A list of filenames told you a project had four PDFs
 * and nothing about which one was the rubric; a first page tells you at a
 * glance, and that is the whole argument for the extra space it costs.
 *
 * Two columns, and two at every width: the panel is narrow to begin with, and
 * a single column of cards is the row list again with more scrolling. */
/* Scoped under .shelf: `.card` is also the project card on the Projects page,
   and these rules — a clamped name with its own padding, a glass fill — used
   to leak onto it, indenting its title and exposing its menu button. */
.shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.shelf .card {
  position: relative;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 45%), var(--tint);
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.shelf .card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--glass-line));
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.7);
}
.shelf .card.is-picked { border-color: var(--accent); }

/* The whole card is the button. A card with a small target somewhere inside it
   is a card people click and nothing happens. */
.shelf .card__open {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 132px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.shelf .card__shot {
  display: block;
  flex: 1;
  min-height: 0;
  /* White, because a page and a scanned photograph are both drawn on paper and
     a dark strip around them reads as part of the document. */
  background: #fff;
  overflow: hidden;
}
.shelf .card__shot img {
  display: block;
  width: 100%;
  height: 118px;
  /* `cover` from the top: the first thing on a page is its title, and letting
     the bottom fall away keeps that visible at this size. */
  object-fit: cover;
  object-position: top center;
}

/* A source with nothing to draw — a .docx, a text file — keeps the name it
   always had, which is what the whole shelf used to be. */
/* Drawn as a page the same size as a thumbnail, so the grid lines up, with the
   name centred on it. A name with no spaces — "Tong_hop_cong_cu.docx" — breaks
   anywhere rather than running off the tile. */
.shelf .card__name {
  display: grid;
  place-items: center;
  height: 118px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shelf .card__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
}
.shelf .card__badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--tint);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.shelf .card__facts {
  min-width: 0;
  color: var(--text-faint);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The tick sits on the card and stays out of the way until it is wanted: shown
   on hover, on focus, and always once anything is selected. */
.shelf .card__tick {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: transparent;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.shelf .card:hover .card__tick,
.shelf .card__tick:focus-visible,
.shelf .card__tick.is-on { opacity: 1; }
.shelf .card__tick.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.shelf__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.shelf__all {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.shelf__all.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.shelf__count { flex: 1; color: var(--text-dim); font-size: 12.5px; }
.shelf__del,
.shelf__done {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
}
.shelf__del:hover:not(:disabled) { background: var(--surface-2); color: var(--danger); }
.shelf__done:hover { background: var(--surface-2); color: var(--text); }
.shelf__del:disabled { opacity: 0.4; cursor: default; }

/* ── one source, large ──────────────────────────────────────────────── */
.sheet--view .sheet__body { display: grid; gap: 12px; justify-items: center; }

.sourceview__figure {
  position: relative;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}
/* A page gets the paper edge a photograph does not want. */
.sourceview__figure.is-paper { box-shadow: 0 6px 22px rgb(0 0 0 / 0.45); }
.sourceview__figure img {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  width: auto;
  height: auto;
}

/* The download is on the picture and appears when the pointer is. The page is
   a preview rather than a toolbar, so the action waits to be looked for —
   but never for a keyboard, which cannot hover and gets it on focus. */
.sourceview__get {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.78), transparent);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.14s;
}
.sourceview__figure:hover .sourceview__get,
.sourceview__get:focus-visible { opacity: 1; }
@media (hover: none) {
  /* Nothing hovers on a phone, so an action that waits for a pointer is an
     action that does not exist there. */
  .sourceview__get { opacity: 1; }
}

.sourceview__facts { margin: 0; color: var(--text-faint); font-size: 12px; }
.sourceview__plainget { text-decoration: none; }

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px 16px;
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-dim); color: var(--text-dim); }

.chatline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-hi), transparent 50%), var(--tint);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.chatline:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--glass-line)); background: linear-gradient(180deg, var(--glass-hi), transparent 50%), var(--tint-2); }
.chatline__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.chatline__when { flex: none; color: var(--text-faint); font-size: 12px; }

@media (max-width: 900px) {
  .project__grid { grid-template-columns: 1fr; }
}

/* ── a file, open in the rail ───────────────────────────────── */

/* The panel takes the whole rail rather than stacking under the plan: a
   document and a checklist sharing a 380px column is neither of them. The rail
   keeps its own header for Progress, so this one is hidden while a file is up. */
/* An open file takes the whole panel, over everything else in it — the
   Outputs and Context lists included. They were left showing, so the preview
   was pushed down to the bottom of the column under them, cramped and easy to
   miss. The task pane already hid them; this matches it. */
.app.is-filepane .detail__head,
.app.is-filepane .detail__body > .ptrack,
.app.is-filepane .detail__body > .hint,
.app.is-filepane .detail__body > .screen,
.app.is-filepane .detail__body > .rail-extra { display: none; }
.app.is-filepane .detail__body { padding: 0; overflow: hidden; }

/* A scheduled task takes the rail the same way a file does. */
.app.is-taskpane .detail__head,
.app.is-taskpane .detail__body > .ptrack,
.app.is-taskpane .detail__body > .hint,
.app.is-taskpane .detail__body > .screen,
.app.is-taskpane .detail__body > .rail-extra { display: none; }
.app.is-taskpane .detail__body { padding: 0; overflow: hidden; }

.taskpane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
}
.taskpane[hidden] { display: none; }
/* What a tool did sits on the panel's own ground, as the progress panel does —
   not on a grey card. Everything else in the panel is hidden while it is open
   (see `.is-taskpane` above), so nothing shows through. */
#toolpane { background: transparent; }
.taskpane__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 9px 10px 9px 16px;
  border-bottom: 1px solid var(--glass-line);
}
.taskpane__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taskpane__body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 24px; }
/* The rail is narrow: the Run button goes under the state rather than
   pushing it into a wrap. */
.taskpane .taskpage__head { flex-wrap: wrap; }

/* The editor needs room for a label and a menu on one line; the rail widens
   while it holds one, and still honours a wider width somebody dragged it to. */
.app.is-detail.is-taskpane {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) max(var(--detail-w), min(520px, 42vw));
}

/* ── the schedule editor in the rail ──
   Grouped rows, label left and control right, the way a settings sheet reads:
   Details, then Frequency, then when it stops. Each control saves itself. */
.spane { display: grid; gap: 14px; }
.spane[hidden], .spane [hidden] { display: none !important; }
.spane__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spane__status.is-ok { color: var(--ok); }
.spane__acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.spane__title {
  width: 100%;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
}
.spane__title:hover { border-bottom-color: var(--line); }
.spane__title:focus { outline: none; border-bottom-color: var(--accent); }
.spane__prompt {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.spane__prompt:focus { outline: none; border-color: var(--accent); }
.spane__label { margin: 6px 0 -6px 4px; color: var(--text-faint); font-size: 13px; }
.spane__group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  overflow: hidden;
}
.spane__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 6px 14px;
  font-size: 14px;
}
.spane__row + .spane__row { border-top: 1px solid var(--line-soft); }
.spane__row > span:first-child { color: var(--text); flex: none; }
.spane__value { color: var(--text); text-align: right; }
.spane__row select,
.spane__row input[type='date'] {
  min-width: 0;
  max-width: 62%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: right;
  cursor: pointer;
  color-scheme: light dark;
}
.spane__row select:hover,
.spane__row input[type='date']:hover { background: var(--surface-2); }
/* The border, not a ring: rings on fields are switched off app-wide by the
   owner's exception further down, which left these with no focus mark at all
   (ACC-009). The border is how every other field shows focus. */
.spane__row select:focus,
.spane__row input[type='date']:focus { border-color: var(--accent); }
.spane__row select option { background: var(--surface); color: var(--text); }
.spane__meta { display: grid; gap: 6px; color: var(--text-dim); font-size: 13px; justify-items: start; }
.spane__meta strong { color: var(--text); font-weight: 600; }
.spane__status { min-height: 1.2em; color: var(--text-faint); }
.spane__status.is-error { color: var(--danger); }

/* One state, beside the buttons that change it, centred on them. */
.spane__state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--ok) 55%, transparent);
  border-radius: 999px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}
.spane__state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.spane__state.is-off { border-color: var(--line); color: var(--text-faint); }
.spane__state.is-manual { border-color: color-mix(in srgb, var(--info) 55%, transparent); color: var(--info); }

/* A number with its unit, right-aligned like the menus beside it. */
.spane__num { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); }
.spane__num input,
.spane__row input[type='time'],
.spane__times input[type='time'] {
  width: 5.5em;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: right;
  color-scheme: light dark;
}
.spane__num input:focus,
.spane__times input:focus,
.spane__row input[type='time']:focus { border-color: var(--accent); }

/* Rows whose control is a set rather than one value sit under their label. */
.spane__row--stack { flex-direction: column; align-items: stretch; gap: 10px; padding-block: 12px; }
.spane__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.spane__chips--month { display: grid; grid-template-columns: repeat(7, 1fr); }
.spane__chip {
  min-width: 36px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.spane__chip:hover { border-color: var(--accent-dim); color: var(--text); }
.spane__chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.spane__chip--wide { grid-column: span 4; }
.spane__times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spane__timeitem { display: inline-flex; align-items: center; gap: 2px; }
.spane__x {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.spane__x:hover { color: var(--danger); }
.spane__add {
  min-height: 32px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.spane__add:hover { border-color: var(--accent); color: var(--text); }
.spane__hint { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); }

@media (max-width: 900px) {
  .taskpane {
    position: fixed;
    inset: 0;
    z-index: 50;
    height: 100dvh;
  }
}

.filepane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.filepane__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid var(--glass-line);
}

/* Eye / code, the way Claude's panel switches between what a file *is* and what
   it is made of. Icons rather than words because the bar also has to hold a
   filename and an action. */
.filepane__modes {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--surface-2);
}
.fmode {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.fmode:hover { color: var(--text); }
.fmode.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }

.filepane__ident {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.filepane__name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filepane__kind {
  flex: none;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

/* One button that does the obvious thing, and an arrow for the rest. Pressing
   "Open in Word" should not first require choosing it from a list. */
.filepane__act {
  display: flex;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.filepane__do,
.filepane__more {
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.filepane__do { padding: 6px 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepane__more { padding: 6px 7px; border-left: 1px solid var(--line); font-size: 10px; }
.filepane__do:hover, .filepane__more:hover { background: var(--line); }
.filepane__do:disabled { color: var(--text-faint); cursor: default; }

/* Which saved draft is on screen. */
.filepane__versions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.filepane__versions::-webkit-scrollbar { display: none; }
.filepane__vlabel { flex: none; color: var(--text-faint); font-size: 11px; }
.vchip {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.vchip:hover { border-color: var(--accent-dim); color: var(--text); }
.vchip.is-active { border-color: var(--accent); color: var(--accent); }
.vchip--restore { margin-left: auto; border-color: var(--accent-dim); color: var(--accent); }

.filepane__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg);
}

/* Full size. The panel is moved to <body> first — see `expand()` — because
   `.detail` has a transform and is therefore a containing block for `fixed`,
   which is what used to draw an expanded panel underneath the sidebar. */
.filepane.is-full {
  position: fixed;
  inset: 0;
  /* Above the sidebar (18) and the dock, below the toasts (60). */
  z-index: 50;
  height: 100dvh;
  border-radius: 0;
}
.filepane.is-full .filepane__body { padding: 0; }
.filepane.is-full .viewer__frame { height: 100%; }
.filepane.is-full .doc { max-width: 52rem; }

/* In the rail the frame gets whatever is left rather than a fixed slice of the
   viewport — 78dvh inside a panel that is not the window overflows it. */
.filepane .viewer__frame { height: 100%; min-height: 320px; }
.filepane .viewer__image img { max-height: none; }
.filepane .doc { padding: 26px 22px 50px; }
.filepane .viewer__sheets { flex: none; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.filepane .editor { height: 100%; }

/* A narrow window has no room for two columns, so the panel takes the screen —
   which is what the expanded state already is. */
@media (max-width: 900px) {
  .filepane {
    position: fixed;
    inset: 0;
    z-index: 50;
    height: 100dvh;
  }
}

/* ── figures in a document ──────────────────────────────────── */

/* A picture out of a .docx. Centred and given room, because a figure in a
   report is a paragraph-level thing rather than something inline — and capped
   by height as well as width, or one tall diagram fills the panel and hides
   the text it belongs to. */
.doc .figure {
  margin: 22px 0;
  text-align: center;
}
.doc .figure img {
  max-width: 100%;
  max-height: 60vh;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
.doc .figure figcaption {
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.5;
}

/* A picture whose bytes could not be served — an external one, or a format
   that is not an image at all. Said plainly rather than left as a broken icon. */
.doc .figure__missing {
  margin: 16px 0;
  color: var(--text-faint);
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
}

/* Printed, a figure must not be sliced across the fold. */
@media print {
  body.is-printing .doc .figure { break-inside: avoid; }
  body.is-printing .doc .figure img { max-height: none; }
}

/* ─────────────────────────────────────────────────────────────
   Focus is never invisible.

   The base rule near the top of this file gives every control a
   `:focus-visible` ring, and seventeen later declarations of
   `outline: none` — the API-key fields, the workspace editor, the
   project composer, the find box, the inline message editor —
   quietly took it back without offering a substitute. Where one
   *was* offered it failed anyway: `.field input:focus` tints the
   border to --accent-dim, which is 1.77:1 against white, well
   under the 3:1 WCAG asks of a focus indicator.

   So the guarantee lives here, last and `!important`. This is the
   case that justifies it: a keyboard user who cannot see where
   they are cannot use the application at all, and no individual
   component's styling preference outranks that.

   `:focus-visible` and not `:focus`, so a mouse click still
   leaves no ring — the reason those rules were written in the
   first place.
   ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────
   Except where you are typing. This is a deliberate exception to
   the guarantee directly above, made by the owner of this app
   after being shown what the rule is for and why it was written.
   It is not an oversight, and it should not be "fixed" by
   deleting it.

   What was traded away: a browser treats a text field as
   `:focus-visible` however it was focused — clicking counts, not
   just tabbing — so this ring appeared for everyone, on every
   search box, every time. The comment above claims a mouse click
   leaves no ring; for text fields that has never been true, and
   that is the thing that made it read as noise rather than help.

   What is left in its place, per field:
     · the composer — a 2px galaxy ring on the rounded box plus a
       4px glow, ~9:1 on the dark theme. A real indicator.
     · search boxes, form fields, the gate, the find box — their
       border turns `--accent-dim`. Visible, but about 1.8:1,
       which is under the 3:1 WCAG asks of a focus indicator.

   So keyboard-only users are worse off here than they were, on
   every field in the second group. That is the known cost.
   ───────────────────────────────────────────────────────────── */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none !important;
}

/* ─────────────────────────────────────────────────────────────
   And not on a container that is only focusable so code can put
   the caret in it.

   `#thread` carries `tabindex="-1"` so the transcript can be
   scrolled and focused programmatically. A negative tabindex is
   not reachable by tabbing, so a ring drawn on it points at
   nothing a keyboard user can act on — but the guarantee above
   is `!important`, so once the browser was in keyboard mode and
   focus landed there, a 2px violet rectangle was drawn around
   the entire conversation. Reproduced directly: focus `#thread`
   after any key press and the whole column lights up.

   This is not the trade-off above. Nothing that a person can tab
   to loses its ring here.
   ───────────────────────────────────────────────────────────── */
[tabindex="-1"]:focus-visible {
  outline: none !important;
}

/* A file picker drawn as its label, a button (ACC-014). Tab reaches the input,
   which is `.sr-only` and, as an input, ringless by the exception above — so
   focus went somewhere nobody could see. The ring goes on the button instead;
   Space or Enter then opens the picker as before. */
label.btn:has(+ input[type='file']:focus-visible) {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

/* ── a scheduled task: the form, the rows, the page ───────────────────
 *
 * The form asks two questions with menus rather than with a time typed in
 * words. A label on the left and the menu on the right, because each is one
 * decision and stacking a label above a 140px dropdown wastes the whole row. */
.taskform__row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}
.taskform__label {
  flex: none;
  width: 108px;
  color: var(--text-dim);
  font-size: 13px;
}
.taskform__pick {
  flex: none;
  min-width: 190px;
  max-width: 100%;
}

/* One task in the project that owns it. A whole-row button, because a card
   with a small target somewhere inside it is a card people click at and
   nothing happens. */
.ptask {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ptask:hover { background: var(--tint); border-color: var(--line); }
.ptask__mark { flex: none; color: var(--ok); line-height: 0; }
.ptask--off .ptask__mark { color: var(--text-faint); }
.ptask__body { flex: 1; min-width: 0; }
.ptask__name {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptask__when { display: block; color: var(--text-faint); font-size: 11.5px; }
.ptask__state {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 10.5px;
}
.ptask--off .ptask__state { border-color: var(--line); color: var(--text-faint); }

/* The sidebar's own list. `chat-row` already draws the shape; this only adds
   how often it repeats, and dims one that is paused. */
.chat-row__when {
  flex: none;
  padding-right: 9px;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}
.chat-row.is-muted .chat-item { color: var(--text-faint); }

/* One task, on its own page. */
.taskpage { max-width: 760px; }
.taskpage__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.taskpage__state {
  flex: 1;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 3px 11px;
  flex-grow: 0;
  /* One line, always: squeezed by the buttons beside it, "Đang bật" broke
     onto two lines inside a pill. */
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
}
.taskpage__state.is-off { border-color: var(--line); background: none; color: var(--text-faint); }
.taskpage__acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* A description list, because that is what this is: a fixed set of facts about
   one thing. The label above its value rather than beside it — the values are
   whole sentences and a two-column grid would leave the prompt in a gutter. */
.taskpage__facts { margin: 0; display: grid; gap: 4px; }
.taskpage__facts dt {
  margin-top: 22px;
  color: var(--text-faint);
  font-size: 12px;
}
.taskpage__facts dt:first-child { margin-top: 0; }
.taskpage__facts dd { margin: 0; color: var(--text); font-size: 14px; }
.taskpage__prompt { white-space: pre-wrap; line-height: 1.55; }
.taskpage__project {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── every source in a project, searchable ───────────────────────────
 *
 * A list on the left and the file on the right. The cards are right up to
 * about twenty sources and wrong after that: past that point nobody is
 * browsing, they are looking for the one called something. */
.sheet--browse { width: min(1100px, 94vw); }
.browse {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 0 18px 18px;
  min-height: min(620px, 70vh);
}
.browse__side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.browse__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.browse__row {
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browse__row:hover { background: var(--tint); color: var(--text); }
.browse__row.is-on { background: var(--tint-2); color: var(--text); }

.browse__view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
  overflow-y: auto;
}
.browse__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.browse__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browse__figure { max-width: 100%; border-radius: 8px; overflow: hidden; line-height: 0; }
.browse__figure.is-paper { box-shadow: 0 6px 22px rgb(0 0 0 / 0.45); }
.browse__figure img { display: block; max-width: 100%; max-height: 46vh; width: auto; height: auto; }
.browse__facts { margin: 0; color: var(--text-faint); font-size: 12px; }
.browse__empty {
  margin: auto;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  /* One column on a phone: the list first, then whatever is chosen. Side by
     side at this width gives neither half enough room to be read. */
  .browse { grid-template-columns: minmax(0, 1fr); }
  .browse__list { max-height: 34vh; }
}

/* ── a project, in the sidebar ────────────────────────────────────────
 *
 * A project's conversations sit under the project rather than mixed into one
 * flat list. Mixed together, a project was a folder you could put things in
 * and never see the inside of: the shelf knew what was filed where, and the
 * sidebar — the thing actually used to move between conversations — did not. */
.proj-row {
  display: flex;
  align-items: center;
  border-radius: 8px;
}
.proj-row:hover { background: var(--tint); }
.proj-row__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px 7px 9px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.proj-row__name > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-row:hover .proj-row__name { color: var(--text); }
.proj-row__mark { flex: none; line-height: 0; color: var(--text-faint); }
.proj-row.is-open .proj-row__mark { color: var(--accent); }

.proj-row__open {
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 5px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
}
.proj-row:hover .proj-row__open,
.proj-row__open:focus-visible { opacity: 1; }
.proj-row__open:hover { background: var(--tint-2); color: var(--text); }

/* A conversation inside a project, or inside a group. Indented, and with the
   hairline that makes the nesting readable rather than merely implied. */
.chat-row--nested { padding-left: 14px; }
.chat-row--nested::before {
  content: '';
  flex: none;
  width: 0;
  align-self: stretch;
  margin: 4px 8px 4px 0;
  border-left: 1px solid var(--line-soft);
}

/* Not finished with. Nothing sets it automatically — opening the conversation
   is what clears it — so it is a note somebody left themselves. */
.chat-row__unread {
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── the conversation's own menu, in the header ─────────────────────── */
.topbar__crumb {
  flex: none;
  max-width: 180px;
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  background: var(--tint);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__crumb:hover { background: var(--tint-2); color: var(--text); }

.topbar__chev {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.topbar__chev:hover { background: var(--tint); color: var(--text); }
.topbar__chev[aria-expanded='true'] { background: var(--tint-2); color: var(--text); }

/* ── the panel a menu entry opens beside itself ─────────────────────── */
.menu--sub {
  position: fixed;
  z-index: 60;
  width: 260px;
  max-height: min(420px, 70vh);
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.menu__more { margin-left: auto; color: var(--text-faint); }
/* The chevron takes the slot the keyboard hint would have used, so an item
   with both would push its own label out of the row. */
.menu__more + .menu__key { display: none; }
.menu__tick { margin-left: auto; color: var(--accent); }

.menu__find {
  width: 100%;
  margin-bottom: 4px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.menu__find:focus { outline: 1px solid var(--accent); outline-offset: -1px; }
.menu__list { flex: 1; min-height: 0; overflow-y: auto; }
.menu__item--make { color: var(--accent); }
.menu__empty { margin: 8px 9px; color: var(--text-faint); font-size: 12.5px; }

/* "View all", at the foot of the conversation list.
   The sidebar shows the twenty most recent because past that it stops being a
   thing you glance at; the rest are one press away rather than hidden. */
.chats__more {
  display: block;
  width: 100%;
  margin: 4px 0 2px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.chats__more:hover { background: var(--tint); color: var(--text-dim); }

/* ── dragging a panel wider ───────────────────────────────────────────
 *
 * A four-pixel target on the panel's own edge, invisible until the pointer is
 * near it. Wider than it looks — the visible line is one pixel and the thing
 * you have to hit is not, because a one-pixel drag target is a thing people
 * miss three times before they find it.
 *
 * Double-click puts the panel back; see public/js/resize.js. */
.grip {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  z-index: 20;
  cursor: col-resize;
  /* The panel it belongs to has its own padding; this sits over the edge. */
  touch-action: none;
}
.grip--right { right: -4px; }
.grip--left { left: -4px; }

/* The line itself: centred in the target, and only visible once wanted. */
.grip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background-image: var(--galaxy);
  background-size: 100% 400%;
  opacity: 0;
  transition: opacity 0.14s;
}
.grip:hover::after,
.grip:focus-visible::after,
.is-resizing .grip::after {
  opacity: 1;
  animation: galaxy-drift 14s linear infinite;
}
.grip:focus-visible {
  outline: none;
}

/* While dragging: no transition on the grid, or the panel lags a frame behind
   the cursor and feels broken; and no text selection anywhere, because a drag
   across a transcript otherwise highlights the whole conversation. */
.app.is-resizing {
  transition: none;
  user-select: none;
  cursor: col-resize;
}

@media (max-width: 900px) {
  /* The sidebar is a sheet at this width and the detail rail is not shown, so
     neither has an edge to drag. */
  .grip { display: none; }
}


/* ── Outputs and Context, under the plan ────────────────────────────── */
.rail-extra[hidden] { display: none; }
.railsec { border-top: 1px solid var(--glass-line); padding: 12px 0 6px; }
.railsec__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.railsec__count { color: var(--text-faint); font-weight: 500; font-size: 13px; }
.railsec__chev { color: var(--text-faint); transition: transform 0.18s; }
.railsec__head[aria-expanded='false'] .railsec__chev { transform: rotate(-90deg); }
/* No height of its own: the panel scrolls as one. A 340px box with its own
   scrollbar cut the last row of tools in half, with the panel's padding showing
   as a dark band below it, and a scroll inside a scroll is easy to miss. */
.railsec__body { display: grid; gap: 2px; padding: 4px 0 6px; }
.railsec__body[hidden] { display: none; }
.railrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.railrow:hover:not(:disabled) { background: var(--tint-2); }
.railrow:disabled { cursor: default; }
.railrow__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  color: var(--text-dim);
}
.railrow__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "Used in this session": a paperclip, "Uploads", the first name cut to fit and
   "+N" — one line, as Claude has it (owner, 2026-11-09). */
.railrow--uploads { gap: 8px; }
.railrow--uploads:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.railrow__clip { display: inline-grid; place-items: center; flex: none; width: 22px; color: var(--text-dim); }
.railrow__label { flex: none; color: var(--text-dim); }
.railrow__first { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-faint); font-size: 12.5px; }
.railrow__more { flex: none; color: var(--text-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ── The files one message brought (uploads-view.js) ───────────────────
   After Claude's "Uploaded files" (owner, 2026-11-09, screenshots 8 and 9): the
   message's files down the left on a lighter ground, the chosen one lit; on the
   right its name and type, download and close, and the viewer's own drawing of
   it filling what is left. Only the direction changes from `.sheet`, so a closed
   one is still hidden by `.sheet:not([open])`. */
.sheet.upv {
  flex-direction: row;
  width: min(1400px, calc(100vw - 48px));
  height: min(86dvh, 920px);
  max-height: none;
  /* Centred at every width above a phone's, so rounded all round — not the
     bottom sheet `.sheet` turns into below 900px. */
  border-radius: 18px;
}
.upv__side {
  display: flex;
  flex-direction: column;
  flex: 0 0 clamp(240px, 34%, 440px);
  min-height: 0;
  border-right: 1px solid var(--line-soft);
  background: var(--tint);
}
.upv__title { flex: none; margin: 0; padding: 20px 22px 14px; font-size: 16px; font-weight: 600; }
.upv__list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; }
.upv__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
/* A hairline between rows, none on either side of the lit one. */
.upv__item + .upv__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  border-top: 1px solid var(--line-soft);
}
.upv__item.is-chosen::before,
.upv__item.is-chosen + .upv__item::before { display: none; }
.upv__item:hover { background: var(--tint); }
.upv__item.is-chosen { background: var(--tint-2); }
.upv__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.upv__icon { display: inline-grid; place-items: center; flex: none; color: var(--text-dim); }
.upv__fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.upv__badge,
.upv__type { flex: none; color: var(--text-faint); font-size: 12px; letter-spacing: 0.03em; }
.upv__main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.upv__bar { display: flex; align-items: center; gap: 4px; flex: none; padding: 12px 12px 10px 22px; }
.upv__ident { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.upv__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.upv__btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
}
.upv__btn:hover { background: var(--tint-2); color: var(--text); }
.upv__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.upv__body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.upv__body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The viewer's drawings were sized for the side panel; here they fill the window. */
.upv__body > .viewer__image { flex: 1; min-height: 0; padding: 24px; }
.upv__body > .viewer__image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upv__body > .viewer__frame { flex: 1; height: auto; min-height: 0; }
.upv__body > .xlv-host { flex: 1; height: auto; min-height: 0; }
.upv__body > .viewer__media { flex: 1; }
.upv__body > .viewer__loading,
.upv__body > .viewer__empty { margin: auto; }

/* A phone: the window is the screen, the list over the file, ✕ in the corner. */
@media (max-width: 640px) {
  .sheet.upv {
    flex-direction: column;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .upv__side { flex: none; max-height: 34dvh; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .upv__title { padding: 14px 64px 8px 16px; }
  .upv__list { padding: 0 6px 8px; }
  .upv__bar { padding: 8px 8px 6px 16px; }
  #uploads-close { position: absolute; top: 6px; right: 8px; }
  .upv__body > .viewer__image { padding: 12px; }
}
.railgrp + .railgrp { margin-top: 10px; }
.railgrp__name { padding: 2px 8px 6px; color: var(--text-faint); font-size: 12.5px; }
.railchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.railchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--tint);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.railchip:hover { background: var(--tint-2); }

/* ── what a tool did: every search, grouped by the message that asked ── */
.toolpane__count {
  margin: 0 2px 12px;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toolgrp {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  overflow: hidden;
}
.toolgrp__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.toolgrp__head::-webkit-details-marker { display: none; }
.toolgrp__head:hover { background: var(--tint-2); }
.toolgrp__asked { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.toolgrp__n { flex: none; color: var(--text-faint); font-size: 12.5px; }
.toolgrp__chev { flex: none; color: var(--text-faint); transition: transform 0.18s; }
.toolgrp:not([open]) .toolgrp__chev { transform: rotate(-90deg); }
.toolgrp__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 0 8px 10px; max-height: 380px; overflow: hidden auto; }
.toolq {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 4px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.toolq > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolq__n { flex: none; color: var(--text-faint); }

/* ── a site the assistant searched or read ─────────────────────── */
/* One row, in the web card and in the side panel: icon, title cut to fit, domain. */
.webrow {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}
.webrow:hover { background: var(--tint-2); }
.webrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.webrow__mark { position: relative; display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-faint); }
.webrow__icon { width: 16px; height: 16px; border-radius: 3px; object-fit: contain; }
.webrow__globe { display: none; }
.webrow__mark.is-bare .webrow__icon { display: none; }
.webrow__mark.is-bare .webrow__globe { display: grid; }
.webrow__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webrow__site { color: var(--text-faint); font-size: 12.5px; white-space: nowrap; }
.webrow.is-pending .webrow__title { color: var(--text-dim); }
.webrow.is-pending .webrow__mark::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.webrow.is-failed .webrow__title { color: var(--text-faint); text-decoration: line-through; }

/* ── the web, and earlier conversations, as Claude draws them ─────────────
 *
 * (owner, 2026-10-25, screenshots 2 and 3.) A search is a line — a globe, the
 * query, "10 results" at the far end — and the sites under it in a box a few
 * rows tall that scrolls. Searches one after another hang from one thread down
 * the left, from globe to globe. "Relevant chats" is the same shape, with a
 * row per conversation. No tick, no chevron: the count is at the end. */
.webrun { margin: 0 0 8px; }
.webrun > .block.web { position: relative; margin: 0; padding-bottom: 12px; }
.webrun > .block.web:last-child { padding-bottom: 0; }
/* The thread, from under this line's globe down to the next one's. */
.webrun > .block.web:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 8.5px;
  top: 32px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
details.block.web > summary::after,
details.block.recall > summary::after { content: none; }
.web__mark,
.recall__mark { flex: none; display: grid; place-items: center; width: 18px; }
.web--error .web__mark,
.web--error .web__mark .mark,
.recall.tool--error .recall__mark .mark { color: var(--danger); }
.web__title { flex: none; color: var(--text-dim); font-size: 14.5px; }
/* A search line's query says what it did; the words stay for a screen reader. */
.web--search .web__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.web__query { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; font-size: 14.5px; }
.web__count,
.recall__count { flex: none; margin-left: auto; padding-left: 12px; color: var(--text-faint); font-size: 13px; white-space: nowrap; }
.web__count:empty,
.recall__count:empty { display: none; }
.recall__title { flex: 0 1 auto; min-width: 0; color: inherit; font-size: 14.5px; }
.web__list,
.recall__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 2px 0 0 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden auto;
}
/* Four and a half 40px rows (with the box's padding and edge), so it is plain
   there are more to scroll to. */
.web__list { max-height: 190px; }
.recall__list { max-height: 280px; }
.recall__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
}
.recall__row > svg { flex: none; color: var(--text-faint); }
.recall__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.recall__row { cursor: pointer; }
button.recall__row:hover { background: var(--tint-2); }
button.recall__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.recall__note { margin: 2px 0 0 28px; color: var(--text-faint); font-size: 13px; }

/* ── Citations ────────────────────────────────────────────────
   The chip after a sourced sentence (drawn by markdown.js) and the card it
   opens (cite.js). Grey and quiet: a source is something you can check, not
   something the sentence is about. */
.cite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(18em, 100%);
  margin-left: 4px;
  padding: 1px 9px 1px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  /* A fixed height, centred on the line. `inline-flex` takes its baseline from
     its first item, and when that is a logo that failed to load — or nothing —
     the whole chip dropped below the words around it. `middle` centres it on
     the lower-case letters, which is what the eye reads as level. */
  height: 22px;
  box-sizing: border-box;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: -2px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
/* No logo loaded at all: no empty gap where it would have been. */
.cite__marks:not(:has(> :not(.is-bare))) { display: none; }
.cite:not(:has(.cite__marks > :not(.is-bare))) { padding-left: 9px; }
.cite:hover,
.cite[aria-expanded='true'] { background: var(--tint-2); color: var(--text); }
.cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cite__marks { display: inline-flex; align-items: center; flex: none; }
/* Overlapped like a stack of avatars, each ringed so neighbours stay apart. */
.cite__marks > .cite__icon + .cite__icon { margin-left: -4px; }
.cite__marks > .cite__icon { box-shadow: 0 0 0 1.5px var(--surface-2); }
.cite__icon {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}
.cite__icon.is-bare { display: none; }
.cite__icon--glyph { padding: 1px; background: var(--surface); color: var(--text-dim); }
.cite__file { border-radius: 3px; background: transparent; }
.cite__marks > .cite__file { box-shadow: none; }
.cite__file--pdf { color: #e5484d; }
.cite__file--doc { color: #3e7bfa; }
.cite__file--sheet { color: #2f9e5b; }
.cite__file--slides { color: #e8702a; }
.cite__file--image { color: #9b6cf0; }
.cite__file--text { color: #7b8794; }
.cite__name { overflow: hidden; text-overflow: ellipsis; }
.cite__name--file { letter-spacing: 0.02em; }
.cite__more { flex: none; color: var(--text-faint); }
.cite:hover .cite__more,
.cite[aria-expanded='true'] .cite__more { color: var(--text-dim); }

.cite-pop {
  position: fixed;
  z-index: 900;
  max-height: min(380px, 60vh);
  padding: 6px;
  overflow: hidden auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  overscroll-behavior: contain;
}
.cite-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.cite-item + .cite-item { border-top: 1px solid var(--line-soft); }
a.cite-item:hover,
a.cite-item:focus-visible { background: var(--surface-2); outline: none; }
a.cite-item:hover .cite-item__title,
a.cite-item:focus-visible .cite-item__title { text-decoration: underline; text-underline-offset: 3px; }
.cite-item__site {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-dim);
  font-size: 12.5px;
}
.cite-item__site > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cite-item__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cite-item__snip {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.cite-item__snip:empty { display: none; }
.cite-item__url {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cite-item--file { cursor: default; }
.cite-item__where { color: var(--text-dim); font-size: 13px; }
.cite-item--note { cursor: default; }

/* A source the conversation cannot account for: said in the card, and hinted
   on the chip with an amber dot so it is noticed before anyone opens it. */
.cite--unseen::after {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-left: -1px;
  border-radius: 50%;
  background: var(--warn);
}
.cite-item__warn {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.4;
}
.cite-item__warn::before { content: '⚠'; flex: none; }
.cite-item--note .cite-item__snip { color: var(--text); -webkit-line-clamp: 6; }

/* ── pictures and videos inside a reply ───────────────────────────
   A row of photos the way a search answer shows them: square-cornered
   tiles of one height, scrolling sideways on a narrow window rather than
   wrapping into a wall. A single picture is shown larger. */

.mdgallery {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.mdgallery__item {
  position: relative;
  flex: none;
  width: min(260px, 70vw);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  scroll-snap-align: start;
}
.mdgallery--one .mdgallery__item { width: min(520px, 100%); aspect-ratio: 16 / 10; }
.mdgallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.mdgallery__item:hover img { transform: scale(1.03); }
.mdgallery__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 10px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mdgallery__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mdimg { max-width: 100%; border-radius: 10px; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) {
  .mdgallery__item img { transition: none; }
}

/* A YouTube link on its own line: thumbnail, title, and play in place. */
.mdvideos { display: flex; gap: 12px; margin: 12px 0 16px; overflow-x: auto; }
.mdvideos .mdvideo { margin: 0; flex: none; width: min(320px, 78vw); }
.mdvideo {
  margin: 12px 0 16px;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}
.mdvideo__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}
.mdvideo__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.mdvideo__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 40px;
  margin: -20px 0 0 -29px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  transition: background 0.15s ease;
}
.mdvideo__play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -6px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}
.mdvideo__thumb:hover .mdvideo__play,
.mdvideo__thumb:focus-visible .mdvideo__play { background: #f00; }
.mdvideo__thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mdvideo__frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.mdvideo__meta { display: flex; flex-direction: column; gap: 3px; padding: 10px 13px 12px; }
.mdvideo__title {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mdvideo__title:hover { text-decoration: underline; }
.mdvideo__src { color: var(--text-faint); font-size: 12px; }

/* ── Memory & privacy, the account's data, incognito ─────────────────────── */
/* A checkbox with its label beside it — the settings' on/off rows. The box
   keeps a 20px target and the whole label is pressable. */
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* A destructive action reads as one before it is pressed. */
.btn--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger); color: #fff; }
.provider--danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line-soft)); }
#panel-account .provider__row { flex-wrap: wrap; align-items: center; }
#panel-account .provider__row input { min-width: 12rem; }

/* One saved note: its name and where it applies, what it says, and the two
   things that can be done to it. The text wraps rather than scrolls sideways. */
.note-group { margin: 6px 0 14px; }
.note-group__head { color: var(--text-dim); font-size: 12.5px; font-weight: 600; margin: 0 0 6px; }
.note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
}
.note__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.note__key { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.note__date { color: var(--text-faint); font-size: 12px; }
.note__body { color: var(--text-dim); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.note__edit {
  width: 100%;
  min-height: 5.5rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.note__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note__actions button { min-height: 32px; }

/* The security record: one line per event, newest first. */
.activity__when { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.activity__where { color: var(--text-faint); font-size: 12px; overflow-wrap: anywhere; }

/* Incognito: the toggle shows its state, and the conversation says what it is. */
.incognito-toggle[aria-pressed='true'] { color: var(--accent); background: var(--surface-2); }
.incognito-toggle:disabled { opacity: 1; cursor: default; }
.incognito-banner {
  margin: 12px auto 0;
  max-width: 46rem;
  padding: 8px 14px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
}
/* The banner says it, so the composer is left alone. A `border-style` here on
   `.composer`, which has no border of its own, drew a 3px white dashed frame —
   the browser's default width and the text colour — around the whole dock. */

/* ── Settings → Usage (usage-panel.js; owner, 2026-10-31) ─────────────
 *
 * Claude's page: a line saying how things stand, a bar per limit with its
 * share used, then where the requests went, the week as a grid of hours, the
 * pace as a line, and the money. Blue bars, as Claude draws them — a limit is
 * not the accent colour's business. */
/* The settings sheet widens for Usage: a label, a bar and a share on one line. */
/* ── Settings, after Claude's (owner, 2026-10-31) ─────────────────────────
   The sections down the left, a search above them, each section as rows: what
   it is on the left, its switch or choice on the right. One height whichever
   section is open, so the sheet does not jump; the list and the section each
   scroll on their own, and never sideways. */
.sheet--settings { width: min(1100px, 100%); height: min(88dvh, 860px); }
.settings { display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; }
.settings__nav { display: flex; flex-direction: column; min-height: 0; padding: 14px 8px 10px 14px; border-right: 1px solid var(--line-soft); }
.settings__search { position: relative; display: flex; align-items: center; margin: 0 6px 10px 0; }
.settings__search svg { position: absolute; left: 11px; color: var(--text-dim); pointer-events: none; }
.settings__search input { width: 100%; padding: 8px 10px 8px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.settings__search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* No `scrollbar-width` here: it makes Chromium draw Windows' own bar — a grey
   track and stepper arrows — in place of the app's floating pill (owner,
   2026-10-31, see the scrollbar notes above). */
.sheet__tabs.settings__tabs { flex-direction: column; flex: 1; min-height: 0; gap: 2px; padding: 0 6px 8px 0; border-bottom: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: auto; mask-image: none; -webkit-mask-image: none; }
/* Both of the sheet's scrolling parts float their thumb over nothing: no track. */
#settings .settings__tabs::-webkit-scrollbar-track,
#settings .settings__body::-webkit-scrollbar-track,
#settings .settings__tabs::-webkit-scrollbar-corner,
#settings .settings__body::-webkit-scrollbar-corner { background: transparent; }
#settings .settings__tabs::-webkit-scrollbar,
#settings .settings__body::-webkit-scrollbar { width: 10px; background: transparent; }

/* A box to write in, as Claude's: darker than the sheet, its own scrollbar, a
   blue edge while it is being written in. The browser's own dark default was
   a flat light-grey slab (owner, 2026-10-31). */
#settings .sarea {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 440px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
  overflow-y: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#settings .sarea--short { min-height: 88px; }
#settings .sarea::placeholder { color: var(--text-faint); }
#settings .sarea:hover { border-color: color-mix(in srgb, var(--text) 20%, var(--line)); }
#settings .sarea:focus { border-color: #4c8df6; box-shadow: 0 0 0 1px #4c8df6; outline: none; }
.settings__group { margin: 16px 10px 6px; color: var(--text-faint); font-size: 12.5px; }
.settings__group:first-child { margin-top: 4px; }
.settings__tabs .tab { display: flex; flex: none; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: 9px; color: var(--text); font-size: 14.5px; text-align: left; }
.settings__tabs .tab:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.settings__tabs .tab.is-active { background: color-mix(in srgb, var(--text) 11%, transparent); color: var(--text); border-bottom-color: transparent; }
.settings__tabs .tab__icon { flex: none; color: var(--text-dim); }
.settings__tabs .tab.is-active .tab__icon { color: var(--text); }
.settings__tabs .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings__tabs .tab[hidden], .settings__group[hidden], .tab.is-filtered, .settings__group.is-filtered { display: none; }
.settings__none { margin: 8px 10px; color: var(--text-dim); font-size: 13px; }
/* Positioned, so anything placed absolutely inside a section — the hidden file
   input of Import — is held and scrolled by it, not by the sheet. */
.settings__body { position: relative; padding: 22px 30px 30px; }

.settings__title { margin: 30px 0 6px; font-size: 16px; font-weight: 600; }
.panel > .settings__title:first-child, .settings__headrow .settings__title { margin-top: 0; }
.settings__lede { margin: 0 0 10px; max-width: 80ch; color: var(--text-dim); font-size: 13.5px; line-height: 1.55; }
.settings__lede strong { color: var(--text); }
.settings__status { min-height: 1.2em; margin: 6px 0 0; color: var(--ok); font-size: 13px; }
.settings__status:empty { min-height: 0; margin: 0; }
.settings__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.settings__actions .sinput { flex: 1 1 220px; }
.settings__headrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings__browse { margin: 6px 0 18px; }
.settings__empty { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; color: var(--text-dim); text-align: center; }
.settings__empty p { margin: 0; font-size: 15px; }
.settings__avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #6f8f5f; color: #fff; font-size: 18px; font-weight: 700; }
#settings .btn--small { flex: none; padding: 7px 14px; border-radius: 9px; font-size: 13.5px; white-space: nowrap; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--info); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* A row: what it is, and its control. */
.srow { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.srow__text { flex: 1 1 auto; min-width: 0; }
.srow__label { display: block; color: var(--text); font-size: 14.5px; }
.srow__desc { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.srow__control { display: flex; flex: none; align-items: center; gap: 10px; max-width: 55%; }
.srow__value { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.srow--stack { flex-direction: column; align-items: stretch; gap: 10px; }
.srow__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.srow__fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.srow__fields .sinput { flex: 1 1 200px; }
.srow--stack textarea, .srow__fields textarea, .srow--stack > .sinput { width: 100%; }
.srow--link { color: inherit; text-decoration: none; }
.srow--link:hover .srow__label { text-decoration: underline; text-underline-offset: 3px; }
.srow--link svg { flex: none; color: var(--text-dim); }
.sinput { min-width: 220px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
/* The number in the middle of its box, and Chrome's up/down arrows without the
   dark plate it draws them on (owner, 2026-11-01): the arrows are drawn here as
   two chevrons on the field's own background. They show on hover and focus, as
   Chrome's do, but keep their room either way, so the number never moves; the
   left padding matches that room, so the middle is the box's middle. Clicking
   the top or the bottom half still steps the value — it is still the browser's
   own spin button, only painted. */
.sinput--num { width: 90px; min-width: 0; padding-left: 26px; padding-right: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.sinput--num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 22px;
  margin: 0 0 0 4px;
  background-color: var(--text-dim);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 22'><path d='M3 8.5 6 5.5l3 3M3 13.5l3 3 3-3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 12px 22px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 22'><path d='M3 8.5 6 5.5l3 3M3 13.5l3 3 3-3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 12px 22px no-repeat;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.12s;
}
.sinput--num:hover::-webkit-inner-spin-button,
.sinput--num:focus::-webkit-inner-spin-button { opacity: 1; }
.sinput--num::-webkit-inner-spin-button:hover { background-color: var(--text); }
.sinput:focus-visible, .sselect:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Claude's choice: the value and a chevron, no box. */
.sselect { max-width: 320px; padding: 7px 30px 7px 12px; border: 0; border-radius: 8px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' width='16' height='16' fill='none' stroke='%239aa8b5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center; color: var(--text); font: inherit; font-size: 14px; text-align: right; cursor: pointer; appearance: none; -webkit-appearance: none; }
.sselect:hover { background-color: color-mix(in srgb, var(--text) 6%, transparent); }
/* A choice whose words matter in full: a box the width of the row, read left to right. */
.sselect--wide { width: 100%; max-width: none; padding: 9px 34px 9px 12px; border: 1px solid var(--line); background-color: var(--surface-2); text-align: left; }
.sselect option { background: var(--surface); color: var(--text); }
/* Claude's switch, from a checkbox — still a checkbox to a screen reader and a click. */
.switch { position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: color-mix(in srgb, var(--text) 22%, transparent); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.switch:checked { background: #4c8df6; }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:disabled { opacity: 0.5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
/* One box, faces side by side, the chosen one lit: the theme's icons, the languages. */
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.seg--icons button { display: grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-dim); cursor: pointer; }
.seg--icons button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg--icons button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#language.seg { display: inline-flex; margin: 0; }
#language.seg .lang-choice__item { position: relative; padding: 5px 12px; border: 0; border-radius: 7px; background: none; color: var(--text-dim); font-size: 13.5px; cursor: pointer; }
#language.seg .lang-choice__item input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
#language.seg .lang-choice__item:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
#language.seg .lang-choice__native { font-weight: 500; }
#language.seg .lang-choice__english { display: none; }
.scard { display: flex; align-items: flex-start; gap: 14px; margin-top: 30px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; }
.scard > svg { flex: none; margin-top: 2px; color: var(--text-dim); }
.scard__title { margin: 0 0 4px; font-weight: 600; }
.scard .btn { margin-top: 12px; }

/* Customize: Yours as rows, Discover as cards, as Claude lists them. */
.cust__head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.cust__title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.cust__search { width: min(280px, 100%); margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.cust__form { margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; }
.cust__group { margin: 18px 0 6px; font-size: 15px; font-weight: 600; }
.cust__count { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-size: 12px; font-weight: 500; }
.cust__empty { margin: 14px 0; color: var(--text-dim); font-size: 13.5px; }
.crow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 34px; align-items: center; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--line-soft); border-radius: 12px; }
.crow:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.crow[hidden], .ccard[hidden], .ctable__row[hidden] { display: none; }
.crow--wrap { grid-template-columns: 44px minmax(0, 1fr) auto; }
.crow__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); color: var(--text-dim); }
.crow__mono { color: var(--text); font-size: 16px; font-weight: 700; }
.crow__text { min-width: 0; }
.crow__name { margin: 0; overflow: hidden; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.crow__tag { display: inline-block; margin-left: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim); font-size: 11.5px; font-weight: 500; vertical-align: 1px; }
.crow__desc { margin: 2px 0 0; overflow: hidden; color: var(--text-dim); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.crow--wrap .crow__desc { white-space: normal; overflow-wrap: anywhere; }
.crow__warn { color: var(--warn); }
.crow__meta { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.crow__more { width: 32px; height: 32px; }
.crow__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.ccard { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 34px; align-items: start; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface-2); }
.ccard__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--bg); color: var(--text-dim); }
.ccard__text { min-width: 0; }
.ccard__name { margin: 0; font-weight: 600; }
.ccard__desc { display: -webkit-box; margin: 4px 0; overflow: hidden; color: var(--text-dim); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ccard__by { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.ccard__add { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); cursor: pointer; }
.ccard__add:hover { background: color-mix(in srgb, var(--text) 17%, transparent); }
.ccard__add:focus-visible, .crow__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctable { display: grid; }
.ctable__head, .ctable__row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.5fr) 34px; align-items: center; gap: 12px; padding: 10px 6px; }
.ctable__head { border-bottom: 1px solid var(--line-soft); color: var(--text-dim); font-size: 13px; }
.ctable__row { border-bottom: 1px solid var(--line-soft); }
.ctable__name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ctable__name .crow__mono { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.ctable__name > span:last-child { display: grid; min-width: 0; }
.ctable__ok { color: var(--text-dim); }
.ctable__detail { grid-column: 1 / -1; padding: 6px 0 4px; }
.ctable--sessions .ctable__head, .ctable--sessions .ctable__row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) auto; }
/* A row's ⋯ menu — a popover, so it is drawn above the sheet rather than clipped by it. */
.cmenu { inset: auto; min-width: 180px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6); }
.cmenu__item { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cmenu__item:hover, .cmenu__item:focus-visible { background: color-mix(in srgb, var(--text) 9%, transparent); outline: none; }
.cmenu__item.is-danger { color: var(--danger); }

/* Memory's notes, as Claude's rows: the name, what it says, when, and edit and delete on the row in hand. */
#memory-list .note { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) auto 96px; align-items: center; gap: 16px; margin: 0; padding: 13px 12px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 10px; background: none; }
#memory-list .note:hover, #memory-list .note:focus-within { background: color-mix(in srgb, var(--text) 5%, transparent); }
#memory-list .note__key { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
#memory-list .note__body { overflow: hidden; color: var(--text-dim); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
#memory-list .note__date { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
#memory-list .note__actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; }
#memory-list .note:hover .note__actions, #memory-list .note:focus-within .note__actions { opacity: 1; }
#memory-list .note__edit { grid-column: 1 / -1; }
#memory-list .note-group__head { margin: 22px 0 4px; color: var(--text); font-size: 15px; }
/* Kinds, where a note was saved, and its earlier versions (owner, 2026-11-12). Colour is never
   the only sign: every badge is a word. */
.note__kind { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim); font-size: 11.5px; font-weight: 500; vertical-align: 1px; }
.note__kind--rule { border-color: var(--accent); color: var(--text); }
.note__kind.is-past { border-style: dashed; }
#memory-list .note.is-removed .note__body, #memory-list .note.is-past .note__body { font-style: italic; }
#memory-list .note__saved { grid-column: 1 / -1; margin: -8px 0 0; color: var(--text-faint); font-size: 12px; overflow-wrap: anywhere; }
#memory-list .note__history { grid-column: 1 / -1; margin: -6px 0 0; font-size: 13px; }
#memory-list .note__history summary { min-height: 32px; padding: 6px 0; color: var(--text-dim); cursor: pointer; }
.note__versions { display: grid; gap: 8px; margin: 4px 0 8px; padding: 0; list-style: none; }
.note__version { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--tint); }
.note__version-text { color: var(--text-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.note__version-meta { grid-column: 1; color: var(--text-faint); font-size: 12px; }
.note__version .btn { grid-column: 2; grid-row: 1 / span 2; min-height: 32px; }
/* The monthly tidy's suggestions, each waiting for Accept or Reject. */
.tidy { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.tidy__item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.tidy__what { margin: 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.tidy__where, .tidy__why { color: var(--text-dim); font-size: 13px; }
.tidy__why { margin: 4px 0 0; }
.tidy__text { margin: 8px 0 0; padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--tint); color: var(--text-dim); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tidy__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tidy__acts .btn { min-height: 36px; }
.note__edit-kind { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.note__edit-kind select, .note__edit-kind input { min-height: 32px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }

/* A phone: the list runs across the top and the rows stack. */
@media (max-width: 760px) {
  /* minmax(0, …): the list's row of names must not widen the column past the sheet. */
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .settings__nav { min-width: 0; padding: 10px 12px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  /* A thin bar rather than none: on a phone it is the only sign there are more tabs to the right (UI-017). */
  .sheet__tabs.settings__tabs { flex-direction: row; flex: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scrollbar-width: thin; }
  .settings__tabs .tab { width: auto; padding: 7px 10px; white-space: nowrap; }
  .settings__group { display: none; }
  .settings__body { padding: 16px; }
  .srow { flex-direction: column; align-items: stretch; gap: 10px; }
  .srow__control { max-width: 100%; }
  .sinput { width: 100%; min-width: 0; }
  .sselect { max-width: 100%; text-align: left; }
  .crow { grid-template-columns: 40px minmax(0, 1fr) 34px; }
  .crow__meta { display: none; }
  .ctable__head { display: none; }
  .ctable__head, .ctable__row, .ctable--sessions .ctable__row { grid-template-columns: minmax(0, 1fr) auto; }
  #memory-list .note { grid-template-columns: minmax(0, 1fr) auto; }
  #memory-list .note__body { grid-column: 1 / -1; grid-row: 2; }
  #memory-list .note__date { display: none; }
  #memory-list .note__actions { opacity: 1; }
  .cust__search { width: 100%; margin-left: 0; }
}
.usage { --bar: #4c8df6; --bar-track: color-mix(in srgb, var(--text) 10%, transparent); display: grid; gap: 22px; min-width: 0; }
.usage > *, .usage section > * { min-width: 0; }
.usage section { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.usage__lead { display: grid; gap: 6px; }
.usage__head.is-close { color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.usage__head.is-out { color: color-mix(in srgb, var(--danger) 75%, var(--text)); }
.usage__insight { max-width: 70ch; font-size: 13.5px; }
.usage__lead .usage__actions { margin-top: 6px; }
.usage__actions a.btn { text-decoration: none; }
.usage h4 { margin: 0; font-size: 15px; font-weight: 600; }
.usage p { margin: 0; line-height: 1.55; }
.usage__head { font-size: 15px; font-weight: 600; }
.usage__muted { color: var(--text-dim); font-size: 13px; }
.usage__strong { font-weight: 600; }
.usage__note { color: var(--text-dim); font-size: 13.5px; }
.usage__note a, .usage__foot a { color: var(--info); text-underline-offset: 3px; }
.usage__limits { display: grid; gap: 16px; }
/* The last column fits what it says — "0,00 US$ / 50,00 US$" is wider than a percentage. */
.usage__limit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(84px, max-content); align-items: center; gap: 16px; }
.usage__limit-text { display: grid; gap: 2px; min-width: 0; }
.usage__limit-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.usage__limit-sub { color: var(--text-dim); font-size: 12.5px; }
.usage__bar { height: 8px; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.usage__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--bar); }
.usage__bar.is-close > span { background: var(--warn); }
.usage__bar.is-out > span { background: var(--danger); }
.usage__pct { color: var(--text-dim); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage__seg { display: inline-flex; flex-wrap: wrap; gap: 2px; width: max-content; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.usage__seg button { padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 13.5px; cursor: pointer; }
.usage__seg button[aria-selected="true"] { border-color: var(--line); background: var(--surface); color: var(--text); }
.usage__seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.usage__resets { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.usage__resets li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.usage__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 140px; }
.usage__day { display: grid; grid-template-rows: 1fr auto; align-items: end; height: 100%; gap: 6px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 12.5px; text-align: center; cursor: default; }
.usage__day.is-today { font-weight: 600; }
.usage__day.is-at { color: var(--text); }
.usage__day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.usage__col { display: block; align-self: end; width: 100%; min-height: 3px; border-radius: 6px; background: var(--bar); opacity: 0.55; transition: opacity 0.12s ease; }
.usage__day.is-at .usage__col, .usage__day:hover .usage__col { opacity: 1; }
.usage__dayname { margin: 14px 0 2px; color: var(--text); font-size: 13px; font-weight: 600; }
.usage__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.usage__tile { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.usage__tile span { color: var(--text-dim); font-size: 12px; }
.usage__tile strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.usage__tablebox { overflow-x: auto; }
.usage__models { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage__models th { padding: 6px 10px 6px 0; color: var(--text-dim); font-weight: 500; text-align: right; white-space: nowrap; }
.usage__models td { padding: 7px 10px 7px 0; border-top: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage__models th:first-child, .usage__models td:first-child { text-align: left; }
.usage__month { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; height: 96px; margin: 8px 0 4px; }
.usage__mday { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.usage__mday span { display: block; border-radius: 2px; }
.usage__mday .is-ok { background: var(--bar); }
.usage__mday .is-bad { background: var(--danger, #e5484d); }
.usage__axis { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 12px; }
.usage__key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; color: var(--text-dim); font-size: 12.5px; }
.usage__key i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: var(--bar); }
.usage__key i.is-bad { background: var(--danger, #e5484d); }
.usage__device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
/* As far below the last device's line as the next section's line is below it. */
.usage__device-hint { padding-top: 22px; }
.usage__badge { display: inline-block; margin-left: 6px; padding: 0 8px; border: 1px solid var(--info); border-radius: 999px; color: var(--info); font-size: 11.5px; line-height: 1.6; vertical-align: 1px; }
/* Claude's switch: one rounded box, two faces, the chosen one lit — set apart from the grid it switches. */
.usage__views { display: flex; justify-self: end; gap: 2px; margin: 6px 0 10px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; }
.usage__views button { display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text-dim); cursor: pointer; }
.usage__views button:hover { color: var(--text); }
.usage__views button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.usage__views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.usage__week { display: grid; gap: 12px; min-width: 0; }
.usage__heat { display: grid; grid-template-columns: auto repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.usage__heat-day { padding-right: 8px; color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.usage__heat-hour { color: var(--text-dim); font-size: 11.5px; padding-top: 4px; }
.usage__cell { display: block; aspect-ratio: 1.15; min-height: 10px; border-radius: 3px; background: var(--bar-track); }
/* Pointing at an hour, after Claude's: the cell ringed, its line beside it. */
.usage__heatwrap { position: relative; }
.usage__heat:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.usage__cell[data-d] { cursor: default; }
.usage__cell.is-at { outline: 2px solid var(--text); outline-offset: 1px; }
.usage__tip { position: absolute; z-index: 3; min-width: 150px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6); font-size: 13.5px; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.usage__tip[hidden] { display: none; }
.usage__tip p { margin: 0; }
.usage__tip-when { margin-bottom: 8px !important; color: var(--text-dim); }
.usage__tip-total { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.usage__tip-total .usage__cell { width: 12px; min-height: 12px; aspect-ratio: 1; }
.usage__tip-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
.usage__tip-part { margin-top: 6px !important; padding-left: 20px; color: var(--text-dim); }
.usage__tip-part span { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }
.usage__cell.l1 { background: #1f3f7a; }
.usage__cell.l2 { background: #2b5bb4; }
.usage__cell.l3 { background: #3c79e6; }
.usage__cell.l4 { background: #6ea2f5; }
.usage__cell.l5 { background: #a9c9fb; }
.usage__legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.usage__legend p { flex: 1 1 260px; margin-right: 12px; }
.usage__legend .usage__cell { width: 14px; min-height: 12px; }
.usage__scale { display: inline-flex; align-items: center; gap: 4px; }
/* Claude's table of the week: a day a row, an hour a column, in a box of its
   own that scrolls both ways while the day and the hour stay in view. */
.usage__tablewrap { max-height: 236px; overflow: auto; border-radius: 10px; background: var(--surface); overscroll-behavior: contain; }
.usage__tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.usage__hours { border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage__hours th, .usage__hours td { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.usage__hours td { min-width: 52px; text-align: right; }
.usage__hours td.is-zero { color: var(--text-dim); }
.usage__hours thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-dim); font-weight: 500; text-align: right; }
.usage__hours th[scope="row"], .usage__hours thead th:first-child { position: sticky; left: 0; min-width: 120px; text-align: left; font-weight: 500; }
.usage__hours th[scope="row"] { z-index: 1; background: var(--surface-2); color: var(--text); }
.usage__hours thead th:first-child { z-index: 2; }
.usage__hours tbody tr:last-child > * { border-bottom: 0; }
.usage__pace { width: 100%; height: auto; overflow: visible; }
.usage__pace text { fill: var(--text-dim); font-size: 12px; }
.usage__grid { stroke: var(--line); stroke-width: 1; }
.usage__usual { fill: none; stroke: var(--text-faint); stroke-width: 1.6; stroke-dasharray: 4 4; }
.usage__now { fill: none; stroke: var(--bar); stroke-width: 2.2; }
.usage__area { fill: color-mix(in srgb, var(--bar) 14%, transparent); stroke: none; }
.usage__dot { fill: var(--bar); stroke: var(--surface); stroke-width: 2; }
.usage__label { fill: var(--text) !important; font-weight: 600; }
.usage__label--usual { fill: var(--text-dim) !important; font-weight: 400; }
.usage__credit { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
/* The free share's rows say "Cloud computer: 35 min of 2 h 10 min" in their label, so it wraps instead of being cut off. */
.usage__credit .usage__limit-label { white-space: normal; }

/* Near a limit, above the composer, after Claude's: amber from 80%, red at the
   limit, tucked behind the top of the box so the two read as one piece. */
.usage-alert {
  position: relative;
  max-width: 780px;
  margin: 0 auto -24px;
  padding: 9px 40px 32px 20px;
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  border-radius: 20px 20px 0 0;
  background: color-mix(in srgb, var(--warn) 15%, var(--bg, #0f1115));
  color: color-mix(in srgb, var(--warn) 78%, var(--text));
  font-size: 13.5px;
  line-height: 1.5;
}
.usage-alert[hidden] { display: none; }
.usage-alert.is-out {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, var(--bg, #0f1115));
  color: color-mix(in srgb, var(--danger) 72%, var(--text));
}
.usage-alert__text { margin: 0; }
.usage-alert__link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.usage-alert__link:hover { color: var(--text); }
.usage-alert__close { position: absolute; top: 6px; right: 10px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: inherit; cursor: pointer; }
.usage-alert__close:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.usage-alert__link:focus-visible, .usage-alert__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The box sits over the banner's lower edge. */
.usage-alert:not([hidden]) + .composer__box { z-index: 1; }
.usage__spend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.usage__spend div { display: grid; gap: 2px; }
.usage__spend strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.usage__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.usage__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.usage__foot a { margin-left: auto; }
@media (max-width: 640px) {
  .usage__limit { grid-template-columns: 1fr auto; }
  .usage__limit .usage__bar { grid-column: 1 / -1; grid-row: 2; }
  .usage__spend { grid-template-columns: 1fr; }
  .usage__heat-day { font-size: 10.5px; padding-right: 4px; }
}

/* ── Give feedback (feedback.js) — Claude's form, two pages ─────────── */
.fb { width: min(600px, 100%); }
.fb__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 4px; }
.fb__head h2 { margin: 0; font-size: 17px; }
.fb__body { display: grid; gap: 10px; padding: 8px 22px 6px; overflow-y: auto; }
.fb__q { margin: 8px 0 2px; font-size: 14.5px; font-weight: 600; }
.fb__req { color: var(--danger); }
.fb__topics { display: grid; }
.fb__topic { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.fb__topic:hover, .fb__topic:focus-visible { background: var(--tint); outline: none; }
.fb__topic--other { cursor: default; border-bottom: 0; }
.fb__topic--other input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
.fb__icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--text-dim); }
.fb__chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fb__change, .fb__link { padding: 0; border: 0; background: none; color: var(--info); font: inherit; cursor: pointer; }
.fb__link { text-decoration: underline; text-underline-offset: 3px; color: var(--text-dim); }
.fb__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb__chip { padding: 7px 14px; border: 1px solid transparent; border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.fb__chip[aria-checked="true"] { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.fb__chip:focus-visible, .fb__switch:focus-visible, .fb__pick-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb__text { width: 100%; min-height: 120px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.fb__text:focus { border-color: var(--info); outline: none; }
.fb__include { display: grid; gap: 10px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.fb__include-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fb__strong { margin: 0; font-weight: 600; }
.fb__muted { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }
/* Why a send failed (UX-018). */
.fb__error { margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.fb__note { margin: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.fb__switch { position: relative; flex: none; width: 46px; height: 26px; border: 0; border-radius: 999px; background: var(--surface-2); cursor: pointer; }
.fb__switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.fb__switch[aria-checked="true"] { background: #4c8df6; }
.fb__switch[aria-checked="true"]::after { transform: translateX(20px); }
.fb__switch:disabled { opacity: 0.5; cursor: not-allowed; }
.fb__pick { position: relative; width: max-content; max-width: 100%; }
.fb__pick-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
/* In the flow rather than floating: the sheet scrolls, and a floating list was cut off at its edge. */
.fb__list { position: static; margin-top: 6px; min-width: 100%; max-height: 240px; overflow-y: auto; margin: 0; padding: 6px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--glass-solid); box-shadow: var(--shadow); list-style: none; }
.fb__list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.fb__list li:hover, .fb__list li:focus { background: var(--tint); outline: none; }
.fb__check { color: var(--info); }
.fb__foot { display: flex; align-items: center; gap: 8px; padding: 12px 22px 18px; }
.fb__spacer { flex: 1; }
.fb__pager { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.fb__go { display: inline-flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); border: 0; }
.fb__go:disabled { opacity: 0.5; }
.fb__keys { display: inline-flex; gap: 3px; }
.fb__keys kbd { padding: 0 5px; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); border-radius: 5px; font: inherit; font-size: 12px; }

/* ── What's new (changelog.js) ─────────────────────────────────────── */
.whatsnew { width: min(640px, 100%); }
.whatsnew__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.whatsnew__head h2 { margin: 0; font-size: 17px; }
.whatsnew__body { padding: 12px 22px 22px; overflow-y: auto; }
.whatsnew__date { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.whatsnew__date h3 { margin: 0; font-size: 18px; }
.whatsnew__pick { position: relative; }
.whatsnew__version { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font-family: var(--mono); font-size: 13px; cursor: pointer; }
.whatsnew__version:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.whatsnew__versions { position: absolute; z-index: 2; right: 0; top: calc(100% + 6px); min-width: 220px; max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--glass-solid); box-shadow: var(--shadow); list-style: none; }
.whatsnew__versions li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-family: var(--mono); font-size: 13px; }
.whatsnew__versions li[aria-selected="true"], .whatsnew__versions li:hover, .whatsnew__versions li:focus { background: var(--tint); outline: none; }
.whatsnew__muted { color: var(--text-dim); font-family: var(--font); }
.whatsnew__section { margin: 20px 0 6px; color: var(--text-dim); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.whatsnew__list { margin: 0; padding-left: 20px; line-height: 1.6; }
.whatsnew__list li { margin-bottom: 8px; }

/* ── Feedback, for an administrator (Settings → People) ─────────────── */
.fbadmin { display: grid; gap: 10px; }
.fbadmin__item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.fbadmin__item.is-unread { border-color: var(--info); }
.fbadmin__item p { margin: 0; }
.fbadmin__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fbadmin__tags span { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-size: 12px; }
.fbadmin__body { white-space: pre-wrap; line-height: 1.55; }
.fbadmin__chat summary { cursor: pointer; color: var(--text-dim); font-size: 13px; }
.fbadmin__line { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; }
.fbadmin__actions { display: flex; gap: 8px; }


/* ── Connectors to connect (Claude's connector search; owner, 2026-11-01) ──
   A list the width of a reading column: each connector's icon, its name and
   what it does, and Connect on the right. Connected is said, not offered. */
.widget.consug { max-width: 620px; border-radius: 14px; }
.consug__why { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text-dim); font-size: 13px; }
.consug__row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.consug__row + .consug__row { border-top: 1px solid var(--line-soft); }
.consug__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-2);
  overflow: hidden;
}
.consug__icon img { width: 20px; height: 20px; object-fit: contain; }
.consug__icon.is-letter { color: var(--text); font-size: 15px; font-weight: 700; }
.consug__text { flex: 1 1 auto; min-width: 0; }
.consug__name { margin: 0; color: var(--text); font-size: 14.5px; font-weight: 600; }
.consug__blurb { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.consug__connect {
  flex: none;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.consug__connect:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 9%, var(--surface-2)); }
.consug__connect:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.consug__connect.is-connected { border-color: transparent; background: transparent; color: var(--ok); cursor: default; }
.consug__connect.is-connected::before { content: '✓ '; }
@media (max-width: 520px) {
  .consug__row { flex-wrap: wrap; }
  .consug__connect { margin-left: 48px; }
}
/* ── Privacy → Your data → Manage (owner, 2026-11-01, after Claude's) ──
   A page inside Privacy: back to it, then what anybody can reach, then the
   rest with a search and a count. The table is Claude's: name underlined as a
   link, the visibility as a pill with a chevron, the date, and ⋯ on a tile. */
.data__back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 4px 8px 4px 2px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.data__back:hover { background: var(--tint-2); }
.data__back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.data__part + .data__part { margin-top: 36px; }
.data__title { margin: 0; color: var(--text); font-size: 16px; font-weight: 650; }
.data__hint { margin: 8px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.data__list { margin-top: 10px; }
.data__empty { margin: 0; padding: 36px 0 32px; color: var(--text-dim); font-size: 14.5px; text-align: center; }
.data__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.data__search { flex: 0 1 440px; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.data__search:focus { border-color: #4c8df6; outline: none; box-shadow: 0 0 0 1px #4c8df6; }
.data__count { flex: none; color: var(--text-dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.data__pager { display: flex; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.data__page:disabled { opacity: 0.4; cursor: default; }

.dtable { display: grid; }
.dtable__head, .dtable__row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px 36px; align-items: center; gap: 14px; padding: 11px 2px; }
.dtable--two .dtable__head, .dtable--two .dtable__row { grid-template-columns: minmax(0, 1fr) 120px 36px; }
.dtable__head { border-bottom: 1px solid var(--line-soft); color: var(--text-dim); font-size: 13.5px; }
.dtable__row { border-bottom: 1px solid var(--line-soft); }
.dtable__name { display: grid; gap: 3px; min-width: 0; }
.dtable__link {
  justify-self: start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text) 45%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.dtable__link:hover { text-decoration-color: var(--text); }
.dtable__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.dtable__label { color: var(--text); font-size: 14.5px; }
.dtable__sub { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtable__when { color: var(--text-dim); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable__end { display: flex; justify-content: flex-end; }
.dtable__more { width: 32px; height: 32px; background: var(--surface-2); }
.dtable__more:hover { background: color-mix(in srgb, var(--text) 12%, var(--surface-2)); }
.dvis { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px 6px 4px 4px; border: 0; border-radius: 10px; background: none; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
.dvis:hover, .dvis[aria-expanded='true'] { background: var(--tint-2); }
.dvis:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dvis__state, .dvis--fixed { padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 13px; }
.dvis.is-public .dvis__state, .dvis--fixed.is-public { border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: var(--ok); }
.dvis--fixed { justify-self: start; cursor: default; }
.cmenu__item--check { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.cmenu__item--check[aria-checked='true']::after { content: '✓'; color: #4c8df6; font-weight: 700; }
@media (max-width: 640px) {
  .data__bar { flex-wrap: wrap; }
  .data__search { flex-basis: 100%; }
  .dtable__head { display: none; }
  .dtable__head, .dtable__row { grid-template-columns: minmax(0, 1fr) auto 36px; gap: 10px; }
  .dtable--two .dtable__row { grid-template-columns: minmax(0, 1fr) 36px; }
  .dtable__when { display: none; }
}
/* ── Extensions, Skills: Claude's heads, menus and pages (owner, 2026-11-01) ── */
.cust__tool { width: 36px; height: 36px; color: var(--text-dim); }
.cust__tool[aria-expanded='true'] { background: var(--tint-2); color: var(--text); }
/* Claude's + Add, with its chevron: the page's text colour as its fill, so it
 * is light on the dark theme and dark on the light one (UI-015). */
.cust__add { gap: 6px; background: var(--text); background-image: none; color: var(--surface); animation: none; }
.cust__add:hover { background: color-mix(in srgb, var(--text) 86%, var(--surface)); filter: none; }
.cust__search + .cust__tool { margin-left: -4px; }
.cust__grouprow { display: flex; align-items: center; justify-content: space-between; }
.cust__count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text-dim); font-size: 12px; font-weight: 500; }

/* The popover menus: a heading row, icons before labels, and a › for a menu beside. */
.cmenu__heading { margin: 0; padding: 6px 12px 4px; color: var(--text-dim); font-size: 13px; }
.cmenu__item { display: flex; align-items: center; gap: 10px; }
.cmenu__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmenu__icon { display: grid; flex: none; place-items: center; color: var(--text-dim); }
.cmenu__item:hover .cmenu__icon, .cmenu__item:focus-visible .cmenu__icon { color: var(--text); }
.cmenu__item--sub::after { content: '›'; color: var(--text-dim); font-size: 18px; line-height: 1; }
.cmenu__item--sub[aria-haspopup]:has(+ .cmenu), .cmenu__item--sub:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.cmenu--sub { min-width: 220px; max-height: min(70vh, 640px); overflow-y: auto; }

/* Discover in Extensions: Claude's connector cards — the logo on a tile, the
   name and its maker's mark, two lines of what it does, "by", and + or ✓. */
.cgrid--ext { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ccard--ext { grid-template-columns: 60px minmax(0, 1fr) 38px; padding: 20px; }
.ccard__icon--logo { width: 60px; height: 60px; border: 1px solid var(--line-soft); border-radius: 12px; background: #f6f6f4; }
/* A light tile, so a black logo (GitHub's, Notion's) reads as well as a coloured one. */
.ccard__icon--logo .crow__mono { color: #222; }
.ccard__icon--logo img { width: 30px; height: 30px; object-fit: contain; }
.ccard--ext .ccard__name { display: flex; align-items: center; gap: 6px; font-size: 15.5px; }
.ccard__badge { display: inline-grid; color: var(--text-dim); }
.ccard--ext .ccard__desc { font-size: 14px; }
.ccard--ext .ccard__by { font-size: 13.5px; }
.ccard--ext .ccard__add { width: 38px; height: 38px; border-radius: 9px; }
.ccard__add.is-added { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); cursor: default; }
/* Why a shared skill somebody added no longer works: said in full, not cut to one line. */
.crow__desc--wrap { white-space: normal; overflow-wrap: anywhere; }
/* An administrator's Take off Discover / Put back, on a shared skill's card. */
.ccard__mod { margin-top: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 12.5px; cursor: pointer; }
.ccard__mod:hover { color: var(--text); }
.ccard__mod:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* A page inside a section: its title, its parts, and labels over fields. */
.page__title { margin: 0 0 14px; color: var(--text); font-family: inherit; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.page__section { margin: 26px 0 4px; color: var(--text); font-size: 16px; font-weight: 650; }
.page__label { margin: 22px 0 10px; color: var(--text); font-size: 15px; font-weight: 600; }

/* Extensions → Advanced settings. */
.ext-tools { gap: 8px; }
.ext-tools__line { margin: 0; color: var(--text-dim); font-size: 14.5px; }
.ext-tools__line strong { color: var(--text); font-weight: 500; }
.ext-tools__check { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.ext-warn { display: flex; gap: 14px; margin: 14px 0 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; }
.ext-warn > svg { flex: none; margin-top: 2px; color: var(--danger); }
.ext-warn__title { margin: 0 0 4px; color: var(--text); font-weight: 600; }
.ext-warn__text { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; }
.ext-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ext-actions__file { cursor: pointer; }
#ext-form-host { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.btn--light { background: #f2f2f0; color: #141414; font-weight: 600; }
.btn--light:hover { background: #ffffff; }
.btn--light:disabled { background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text-dim); opacity: 1; }

/* Skills → Upload a skill: a dashed place to drop files, the rules under it,
   what each chosen file holds and what the scan found, and the scan's row. */
.dropzone { display: grid; place-items: center; gap: 12px; padding: 44px 20px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--text-dim); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.is-over { border-color: color-mix(in srgb, var(--text) 40%, transparent); background: var(--tint-2); }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone svg { color: var(--text); }
.dropzone__rules { margin: 12px 0 0; padding-left: 22px; color: var(--text-dim); font-size: 13.5px; line-height: 1.7; }
.skpick { display: grid; gap: 10px; margin-top: 16px; }
.skpick:empty { display: none; }
.skpick__item { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.skpick__item.is-refused { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.skpick__name { margin: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.skpick__desc { margin: 3px 0 0; color: var(--text-dim); font-size: 13px; }
.skpick__finding { margin: 6px 0 0; font-size: 13px; }
.skpick__finding.is-block { color: var(--danger); }
.skpick__finding.is-warn { color: var(--warn); }
.skpick__finding.is-note { color: var(--text-dim); }
.scanrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 18px; padding: 18px 22px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.scanrow__state { color: var(--text-dim); font-size: 14px; }
.scanrow__state.is-warn { color: var(--warn); }

/* Create a skill: Claude's sheet — fields on a dark card, an editor with line
   numbers and files as tabs, Copy in its corner (always while you are in it,
   on pointing otherwise), and the draft's state at the foot. */
.skc { width: min(1180px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px 26px 24px; overflow-y: auto; background: var(--surface-2); }
.skc__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.skc__head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.skc__label { display: block; margin: 12px 0 8px; color: var(--text); font-size: 15px; font-weight: 600; }
.skc__input, .skc__area { width: 100%; padding: 12px 16px; border: 1px solid transparent; border-radius: 10px; background: color-mix(in srgb, var(--text) 7%, var(--surface-2)); color: var(--text); font: inherit; font-size: 15px; }
.skc__area { min-height: 96px; resize: vertical; line-height: 1.5; }
.skc__input:focus, .skc__area:focus { border-color: #4c8df6; outline: none; box-shadow: 0 0 0 1px #4c8df6; }
.skc__input[readonly] { color: var(--text-dim); }
.skc__saved { margin: 8px 0 0; color: var(--text-dim); font-size: 13.5px; }
.skedit { position: relative; margin-top: 18px; border: 1px solid transparent; border-radius: 14px; background: var(--bg); }
.skedit:focus-within { border-color: #4c8df6; box-shadow: 0 0 0 1px #4c8df6; }
.skedit__bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px 0 18px; }
.skedit__tabs { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; }
.skedit__tab { display: inline-flex; align-items: center; border: 1px solid var(--line-soft); border-radius: 8px; color: var(--text-dim); font-size: 13px; }
.skedit__tab.is-on { border-color: var(--line); background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.skedit__tab button { padding: 4px 10px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.skedit__tab .skedit__untab { padding: 4px 8px 4px 0; font-size: 15px; line-height: 1; }
.skedit__tabs:has(> .skedit__tab:only-child) { visibility: hidden; }
.skedit__add { display: inline-flex; flex: none; align-items: center; gap: 6px; margin-left: auto; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.skedit__add:hover { background: var(--tint-2); }
.skedit__body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 380px; padding: 18px 54px 18px 0; }
.skedit__lines, .skedit__text { margin: 0; font-family: ui-monospace, SFMono-Regular, Consolas, 'Cascadia Mono', monospace; font-size: 14px; line-height: 1.6; }
.skedit__lines { min-width: 52px; padding: 0 14px 0 18px; overflow: hidden; color: var(--text-dim); text-align: right; user-select: none; white-space: pre; }
.skedit__text { width: 100%; min-height: 360px; padding: 0; border: 0; background: transparent; color: var(--text); resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.skedit__text:focus { outline: none; }
.skedit__copy { position: absolute; top: 12px; right: 12px; opacity: 0; transition: opacity 0.12s; }
.skedit:hover .skedit__copy, .skedit:focus-within .skedit__copy, .skedit__copy:focus-visible { opacity: 1; }
.skc__status:empty { display: none; }
/* Share to Discover, under the editor; whose a shared skill is, under the title (2026-11-09). */
.skc__share { margin-top: 14px; padding: 12px 0 0; border-bottom: 0; }
.skc__share-note { color: var(--warn); }
.skc__by { margin: -4px 0 8px; color: var(--text-dim); font-size: 13.5px; }
.skedit__text[readonly] { cursor: default; }
.skc__foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.skc__spacer { flex: 1 1 auto; }
.skc__draft { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
.skc__draft:hover { color: var(--text); }
.skc-confirm { width: min(560px, calc(100vw - 32px)); padding: 22px 24px; background: var(--surface-2); }
.skc-confirm h3 { margin: 0 0 8px; font-size: 17px; font-weight: 650; }
.skc-confirm p { margin: 0 0 18px; color: var(--text); font-size: 15px; }
.skc-confirm__actions { display: flex; justify-content: flex-end; gap: 10px; }
.skc-confirm__keep:focus-visible { outline: 2px solid #4c8df6; outline-offset: 2px; }
.skc-confirm__discard { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.skc-confirm__discard:hover { background: color-mix(in srgb, var(--danger) 28%, transparent); }
@media (max-width: 640px) {
  .skc { padding: 18px 16px 20px; }
  .skedit__body { min-height: 260px; padding-right: 44px; }
  .cgrid--ext { grid-template-columns: 1fr; }
}
/* ── Connectors, as Claude's (owner, 2026-11-01): the table of yours, cards to
   discover, and a page for each — a band with its logo and the button, what it
   does, its tools as chips, who makes it, and what is related. ── */
.clogo { display: grid; place-items: center; overflow: hidden; }
.clogo img { object-fit: contain; }
.clogo--sm { width: 28px; height: 28px; border-radius: 7px; background: #f6f6f4; }
.clogo--sm img { width: 18px; height: 18px; }
.clogo--md img { width: 30px; height: 30px; }
.clogo--lg img { width: 58px; height: 58px; }
.ctable--conn .ctable__head, .ctable--conn .ctable__row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.6fr) minmax(150px, 0.6fr); }
.ctable__row--open { cursor: pointer; transition: background 0.12s; }
.ctable__row--open:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
/* A connector's name: the button that opens its page from the keyboard (UI-012). */
.cname { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.cname:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ctable__status { display: flex; align-items: center; gap: 10px; }
.ctable__paused { color: var(--warn); font-size: 13px; }
.ccard--open { cursor: pointer; transition: background 0.12s; }
.ccard--open:hover { background: color-mix(in srgb, var(--text) 9%, var(--surface-2)); }
.ccard--open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cpage__bar { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.cpage__copy { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.cpage__copy:hover { background: var(--tint-2); }
.cpage__hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; margin: 18px -8px 0; padding: 22px 8px 26px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.cpage__logo { width: 110px; height: 110px; border-radius: 18px; }
.cpage__title h3 { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-family: inherit; font-size: 28px; font-weight: 500; letter-spacing: -0.01em; }
.cpage__title p { margin: 6px 0 0; color: var(--text-dim); font-size: 16px; }
.cpage__actions { display: flex; align-items: center; gap: 10px; }
.cpage__state { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 14.5px; }
.cpage__more { width: 38px; height: 38px; background: var(--surface-2); }
.cpage__form { margin: 18px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.cpage__note { margin: 14px 0 0; color: var(--text-dim); font-size: 13.5px; }
.cpage__about { margin: 26px 0 0; color: var(--text); font-size: 15.5px; line-height: 1.75; }
.cpage__toolsrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 34px 0 14px; }
.cpage__toolsrow h4, .cpage__related { margin: 0; color: var(--text); font-family: inherit; font-size: 24px; font-weight: 500; }
.cpage__chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; justify-items: start; }
.cpage__chip { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 14px; }
.cpage__trust { display: flex; gap: 12px; margin: 26px 0 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); }
.cpage__trust svg { flex: none; margin-top: 2px; color: var(--text-dim); }
.cpage__trust p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.cpage__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; margin: 30px 0 0; padding-top: 30px; border-top: 1px solid var(--line-soft); }
.cpage__meta dt { margin: 0 0 6px; color: var(--text-dim); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cpage__meta dd { margin: 0; color: var(--text); font-size: 15px; }
.cpage__meta a { display: inline-flex; align-items: center; gap: 4px; color: #6aa6ff; text-decoration: underline; text-underline-offset: 3px; }
.cpage__mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px !important; overflow-wrap: anywhere; }
.cpage__cat { display: inline-block; padding: 4px 12px; border-radius: 8px; background: color-mix(in srgb, var(--text) 10%, transparent); font-size: 14px; }
.cpage__links { display: grid; gap: 6px; }
.cpage__related { margin: 34px 0 16px; padding-top: 30px; border-top: 1px solid var(--line-soft); }
.cpage__foot { margin: 28px 0 4px; color: var(--text-dim); font-size: 13px; text-align: center; }
.cperm { min-width: 260px; max-height: min(60vh, 520px); overflow-y: auto; }
.cperm__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 7px 12px; font-size: 13.5px; }
.cperm__name { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.cperm__rule { color: var(--ok); font-size: 12.5px; }
.cperm__rule.is-asks { color: var(--warn); }
@media (max-width: 760px) {
  .cpage__hero { grid-template-columns: auto minmax(0, 1fr); }
  .cpage__actions { grid-column: 1 / -1; }
  .cpage__logo { width: 72px; height: 72px; }
  .cpage__meta { grid-template-columns: 1fr; }
  .ctable--conn .ctable__head, .ctable--conn .ctable__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ctable--conn [role='cell']:nth-child(2), .ctable--conn [role='columnheader']:nth-child(2) { display: none; }
}

/* ── Feedback on one answer (owner, 2026-11-02): Claude's "Give negative
   feedback" — a thumb beside the copy button, then a dialog with a list of
   problems that opens over everything below it, the words, and the line that
   says what is sent. ─────────────────────────────────────────────────── */
.msg__action.is-sent { color: var(--accent); }
.afb {
  width: min(620px, calc(100% - 32px));
  max-height: none;
  padding: 22px 24px 20px;
  overflow: visible;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: var(--glass-solid);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.afb::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
.afb__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.afb__label { display: block; margin: 16px 0 8px; font-size: 14.5px; font-weight: 600; }
.afb__select { position: relative; }
.afb__pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.afb__pick:hover { border-color: var(--text-faint); }
.afb__pick svg { flex: none; color: var(--text-dim); transition: transform 0.15s; }
.afb__pick[aria-expanded="true"] svg { transform: rotate(180deg); }
.afb__value.is-empty { color: var(--text-faint); }
.afb__list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: min(340px, 50dvh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  outline: none;
}
.afb__list:focus-visible { box-shadow: var(--shadow), 0 0 0 2px var(--accent-glow); }
.afb__list li { padding: 8px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.afb__list li.is-active { background: color-mix(in srgb, var(--text) 11%, transparent); }
.afb__list li[aria-selected="true"] { font-weight: 600; }
.afb__text {
  display: block;
  width: 100%;
  min-height: 104px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.afb__text::placeholder { color: var(--text-faint); }
.afb__note { margin: 14px 0 0; color: var(--text-dim); font-size: 12.5px; font-style: italic; line-height: 1.55; }
.afb__note a { color: var(--info); text-decoration: underline; }
.afb__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.afb__submit { border-color: transparent; background: var(--text); color: var(--bg); }
.afb__submit:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
@media (max-width: 560px) {
  .afb { padding: 18px 16px 16px; }
}

/* What a report on an answer carries, for an administrator: each step of the
   turn, its tool calls and results as text, failures marked. */
.fbadmin__step, .fbadmin__result { margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--line); }
.fbadmin__result.is-error { border-left-color: var(--danger); }
.fbadmin__meta { margin: 0 0 4px; color: var(--text-dim); font-size: 12px; }
.fbadmin__pre {
  max-height: 280px;
  margin: 4px 0 0;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Moving a picture in the composer's tray (owner, 2026-11-02): it follows
   the pointer, and the one it would take the place of shows a bar on the side
   it would land. ─────────────────────────────────────────────────────── */
.stage--movable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage--movable .stage__open { cursor: grab; }
.stage.is-dragging { z-index: 4; cursor: grabbing; opacity: 0.92; box-shadow: var(--shadow); }
.stage.is-target-before { box-shadow: -4px 0 0 0 var(--accent); }
.stage.is-target-after { box-shadow: 4px 0 0 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .attachments.is-sorting .stage:not(.is-dragging) { transition: box-shadow 0.12s; }
}

/* ── Free allowances, for an administrator (server/freeTier.js) ───────── */
.ctable--free .ctable__head, .ctable--free .ctable__row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 0.6fr); }
.freetier__used { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.freetier__bar { position: relative; flex: none; width: 72px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.freetier__bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); }
.freetier__bar.is-near > span { background: var(--danger); }
@media (max-width: 560px) {
  .ctable--free .ctable__head, .ctable--free .ctable__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .ctable--free [role="columnheader"]:last-child, .ctable--free .ctable__row > :last-child { display: none; }
}
/* The keys behind a service that takes several: a button on its row opens them (public/js/free-allowances.js). */
.freepool__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.freepool__chip { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.freepool__toggle { margin-left: 6px; }
.freepool__note { display: block; margin-top: 2px; font-weight: 400; }
.freepool__keys { padding: 6px 0 14px 12px; border-bottom: 1px solid var(--line-soft); }
.freepool__keys[hidden], .freepool__add[hidden] { display: none; }
.freepool__set { margin: 0; padding: 0; border: 0; min-width: 0; }
.freepool__list { margin: 0; padding: 0; list-style: none; }
.freepool__key { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 0.9fr) auto; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.freepool__name, .freepool__state { min-width: 0; overflow-wrap: anywhere; }
.freepool__plan { color: var(--text-faint); font-size: 12px; }
.freepool__state.is-ok { color: var(--ok); }
.freepool__state.is-invalid { color: var(--danger); }
.freepool__state.is-exhausted, .freepool__state.is-cooling { color: var(--warn); }
.freepool__error { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 13px; }
.freepool__acts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.freepool__paid, .freepool__cap { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.freepool__badge { padding: 1px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 12px; }
.freepool__paidbox { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.freepool__paidbox .hint { flex-basis: 100%; margin: 0; }
.freepool__cap input { width: 8em; }
/* Plain inputs took the browser's white in the dark theme; give them the app's own surface. */
.freepool__cap input, .freepool__add input[type="password"], .freepool__add input[type="text"], .freepool__add input[type="number"] { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; }
/* A key's usage line wraps rather than running under the state beside it. */
.freepool__key .freetier__used > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.freepool__key .crow__desc { white-space: normal; overflow: visible; text-overflow: clip; }
.freepool__add { display: grid; grid-template-columns: max-content minmax(0, 24em); align-items: center; gap: 8px 12px; margin-top: 10px; }
.freepool__add .freepool__acts { grid-column: 2; }
.freepool__warn { color: var(--warn); }
@media (max-width: 560px) {
  .freepool__keys { padding-left: 0; }
  .freepool__key { grid-template-columns: minmax(0, 1fr); }
  .freepool__add { grid-template-columns: minmax(0, 1fr); }
  .freepool__add .freepool__acts { grid-column: 1; }
}

/* ── Settings → Providers, redrawn (owner, 2026-11-02): a card per provider
   with its logo, what it is for and where it stands; each key with what its
   provider said of it (paid credit, or the free tier); one box to paste into;
   and the model suggested for these keys above them all. ───────────────── */
.psuggest {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.psuggest__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.psuggest__icon svg { width: 18px; height: 18px; }
.psuggest__text { flex: 1; min-width: 0; }
.psuggest__title { margin: 0; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.psuggest__why { margin: 3px 0 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }
.psuggest__used { display: inline-flex; flex: none; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; font-weight: 600; }

.pcard {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.2s;
}
.pcard--on { border-color: color-mix(in srgb, var(--ok) 32%, var(--line)); }
.pcard__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pcard__logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--surface-2);
}
.pcard__logo img { width: 22px; height: 22px; border-radius: 4px; }
.pcard__title { min-width: 0; }
.pcard__title h4 { margin: 0; font-size: 15.5px; font-weight: 600; }
.pcard__title p { margin: 2px 0 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }
.pcard__status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.pcard__status.is-on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.pcard__status.is-shared { border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); }
.pcard__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pcard__status.is-off .pcard__dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pcard__note { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.pcard .keylist { gap: 6px; margin: 0; }
.pcard .keyrow { gap: 10px; padding: 9px 10px 9px 12px; border-radius: 11px; font-size: 13px; }
.pcard .keyrow__no { width: 22px; height: 22px; font-size: 11px; }
.pcard .keyrow__hint { color: var(--text); letter-spacing: 0.02em; }
.pcard .keyrow__when { font-size: 12px; }
.pcard .keyrow__drop { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; }
.keyrow__plan { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.keyrow__plan.is-paid { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-glow); color: var(--accent); }
.pcard__add { display: flex; gap: 8px; margin: 0; }
.pcard__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pcard__input::placeholder { color: var(--text-faint); }
.pcard__input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.pcard__save { flex: none; min-width: 92px; }
.pcard__foot { margin: -4px 0 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }
.pcard__foot a { color: var(--info); text-decoration: none; }
.pcard__foot a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .pcard.is-flash { animation: pcard-flash 1.6s ease-out 1; }
}
@keyframes pcard-flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--accent-glow); border-color: var(--accent); }
  100% { box-shadow: none; }
}
@media (max-width: 560px) {
  .pcard { padding: 14px; }
  .pcard__head { flex-wrap: wrap; }
  .pcard__status { margin-left: 50px; }
  .psuggest { flex-wrap: wrap; }
  .psuggest .btn { width: 100%; }
}

/* The administrators' two suggestions (Settings → People). */
.rec { display: grid; gap: 14px; margin-bottom: 8px; }
.rec__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 18px; }
.rec__label label { font-weight: 600; }
.rec__label p { margin: 2px 0 0; color: var(--text-dim); font-size: 12.5px; }
@media (max-width: 640px) {
  .rec__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
/* The select and what became of its save sit in one cell, so the grid keeps two columns. */
.rec__field { display: grid; gap: 4px; min-width: 0; }
.rec__note { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.rec__note:empty { display: none; }
.rec__note--error { color: var(--danger); }

/* Settings → People: the ten busiest, then the full list a page at a time (public/js/users-dialog.js). */
.users__all { justify-self: start; }
.admins__search { width: 100%; max-width: 420px; }
.admins__add .admins__note--error { color: var(--danger); }
.admins__note:empty { display: none; }
.users__limit { width: 9rem; }
.users-all {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.users-all__pager {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.users-all__pager [aria-disabled='true'] { opacity: 0.4; cursor: default; }
.users-all__page { min-width: 8em; text-align: center; font-size: 13.5px; }
/* A long address or a row of buttons wraps inside the row rather than widening the dialog past a phone. */
.users-all .rows__item { flex-wrap: wrap; }
.users-all .rows__item .grow { overflow-wrap: anywhere; }

/* A suggested model, marked in the picker. */
.tag--suggested { background: var(--accent-glow); color: var(--accent); }

/* ── A choice, drawn by this app (picker.js) ────────────────────────
   The select stays underneath with the value; this is what is seen. */
.picker { position: relative; display: inline-block; max-width: 100%; min-width: 0; vertical-align: middle; }
.picker__native {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.picker__btn {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  line-height: 1.4;
  cursor: pointer;
}
.picker__btn:disabled { opacity: 0.55; cursor: not-allowed; }
.picker__btn.sselect { text-align: right; }
.picker__btn.sselect--wide { text-align: left; }
.picker__btn.mini-select { padding-right: 26px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' width='16' height='16' fill='none' stroke='%239aa8b5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 6px center; }
.picker__btn:not(.sselect):not(.mini-select) {
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' width='16' height='16' fill='none' stroke='%239aa8b5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text);
}
.picker__btn:not(.sselect):not(.mini-select):hover { border-color: var(--accent-dim); }
.picker:has(> .sselect--wide),
.field .picker,
.form__group .picker,
.row .picker { display: block; width: 100%; }
.row .picker { flex: 1; }
.spane__row .picker { max-width: 62%; }
.spane__row .picker__btn:not(.sselect):not(.mini-select) { padding: 5px 26px 5px 8px; border-color: transparent; background-color: transparent; text-align: right; }
.picker:has(> .taskform__pick) { flex: none; min-width: 190px; }
.picker__menu {
  position: fixed;
  inset: auto;
  z-index: 900;
  box-sizing: border-box;
  width: max-content;
  margin: 0;
  padding: 6px;
  overflow: hidden auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-align: left;
}
.picker__list { display: flex; flex-direction: column; gap: 2px; }
.picker__find {
  position: sticky;
  top: -6px;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.picker__find:focus { border-color: var(--accent-dim); }
.picker__group { margin: 8px 10px 3px; color: var(--text-faint); font-size: 11.5px; font-weight: 600; }
.picker__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  outline: none;
}
.picker__opt:hover,
.picker__opt:focus-visible,
.picker__opt:focus { background: var(--tint-2); }
.picker__opt.is-selected { background: var(--tint); }
.picker__opt[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.picker__words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.picker__name { overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.picker__desc { color: var(--text-faint); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.picker__tick { flex: none; display: flex; color: var(--accent); }
.picker__empty { margin: 8px 10px; color: var(--text-faint); font-size: 13px; }

/* ── Administrators, for the owner (Settings → People) ───────────── */
.admins { display: flex; flex-direction: column; gap: 10px; }
.admins__row { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admins__row:not(details) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admins__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
details > summary.admins__who { cursor: pointer; }
.admins__tag { flex: none; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--tint-2); color: var(--text-dim); font-size: 11.5px; }
.admins__add { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admins__title { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.admins__label { display: block; margin: 10px 0 6px; color: var(--text-dim); font-size: 13px; }
.admins__powers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.admins__power { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.admins__power input { flex: none; margin-top: 3px; }
.admins__power-name { display: block; font-size: 13.5px; }
.admins__power-hint { display: block; color: var(--text-faint); font-size: 12px; line-height: 1.4; }
.admins__note { margin: 10px 0 0; color: var(--text-faint); font-size: 12px; line-height: 1.45; }
.admins__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ── Themes: a scene behind the app (themes-panel.js, scenes.js; owner, 2026-11-04) ───
   The chrome in this app has no panes of its own, so over a moving picture words
   need something under them. Panes here are plain alpha, never a blur: a blur over
   a canvas that changes fourteen times a second is the most expensive thing a page
   can ask for, and these alphas alone hold the contrast. */
#scene-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Over the last one until the next has its first frame, so changing theme never flashes empty. */
#scene-layer canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; transition: opacity 0.28s ease; }
#scene-layer canvas.is-in { opacity: 1; }
#scene-layer canvas.is-smooth, .scene-live.is-smooth { image-rendering: auto; }
@media (prefers-reduced-motion: reduce) { #scene-layer canvas { transition: none; } }
html[data-scene] body::before, html[data-scene] .galaxy { display: none; }
/* Light or dark is the person's setting, on any scene (owner, 2026-11-06). Dark unless
   they chose light, or left it to a system that is light. */
html[data-scene] {
  --scene-column: rgba(11, 13, 19, 0.8);
  --scene-side: rgba(11, 13, 19, 0.74);
  --composer-glass: rgba(14, 18, 26, 0.86);
  --text-faint: #98a5ae;
  --glass-solid: rgba(14, 19, 25, 0.95);
}
html[data-scene][data-theme='light'] {
  --scene-column: rgba(250, 251, 253, 0.84);
  --scene-side: rgba(250, 251, 253, 0.78);
  --composer-glass: rgba(255, 255, 255, 0.88);
  --text-faint: #56626d;
  --glass-solid: rgba(255, 255, 255, 0.96);
}
@media (prefers-color-scheme: light) {
  html[data-scene]:not([data-theme]) {
    --scene-column: rgba(250, 251, 253, 0.84);
    --scene-side: rgba(250, 251, 253, 0.78);
    --composer-glass: rgba(255, 255, 255, 0.88);
    --text-faint: #56626d;
    --glass-solid: rgba(255, 255, 255, 0.96);
  }
}
html[data-scene] body { background: var(--bg); }
/* The picture shows in the margins; words get a soft-edged pane as wide as the reading
   column, and the top bar, which sits in those margins, gets one of its own. */
html[data-scene] .main { background: linear-gradient(90deg, transparent calc(50% - 620px), var(--scene-column) calc(50% - 410px), var(--scene-column) calc(50% + 410px), transparent calc(50% + 620px)); }
html[data-scene] .sidebar, html[data-scene] .detail, html[data-scene] .topbar { background: var(--scene-side); }
/* Signed out, nothing of a theme shows: the gate covers the whole window, and with no canvas under it. */
html[data-scene] .gate { background: var(--bg); }
@media (max-width: 900px) {
  html[data-scene] .main { background: var(--scene-column); }
}

.themes { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 22px; align-items: start; }
.themes__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; flex: 1; min-width: 0; }
/* A page of twelve with an arrow either side, centred on the rows (owner, 2026-11-08). */
.themes__pager { display: flex; align-items: center; gap: 8px; }
.themes__turn { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
.themes__turn:hover { border-color: var(--accent); color: var(--accent); }
.themes__turn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.themes__turn[hidden] { display: grid; visibility: hidden; }
.themes__pages { margin: 6px 0 0; min-height: 1em; text-align: center; color: var(--text-faint); font-size: 12px; }
.themes__titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.themes__titlebar .settings__title { margin-bottom: 0; }
.themes__sort select { font: inherit; }
.facts { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; color: var(--text-dim); font-size: 13px; }
@media (max-width: 720px) { .themes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .themes__turn { width: 30px; height: 30px; } }
.themes__tile { display: grid; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.themes__frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.themes__still { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A moving copy over the picture, in once it has its first frame. */
.scene-live { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; transition: opacity 0.16s ease; }
.scene-live.is-in { opacity: 1; }
.themes__plain { position: absolute; inset: 0; background: radial-gradient(70% 90% at 15% 0, var(--accent-glow), transparent 70%), var(--bg); }
.themes__tile:hover .themes__frame { box-shadow: 0 0 0 1px var(--accent-dim); }
.themes__tile:focus-visible { outline: none; }
.themes__tile:focus-visible .themes__frame { box-shadow: 0 0 0 2px var(--accent); }
.themes__tile.is-chosen .themes__frame { box-shadow: 0 0 0 2px var(--accent); }
.themes__tile.is-current .themes__name::after { content: ' ✓'; color: var(--accent); }
.themes__tile.is-locked .themes__frame :is(img, canvas) { opacity: 0.45; filter: saturate(0.7); }
.themes__tile.is-locked .themes__name { color: var(--text-dim); }
.themes__lock { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; transform: translate(-50%, -50%); color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); pointer-events: none; }
.themes__lock svg { display: block; width: 100%; height: 100%; }
.themes__lock--big { width: 56px; height: 56px; }
.themes__detail { position: sticky; top: 0; display: grid; gap: 8px; min-width: 0; }
.themes__stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.themes__stage.is-locked :is(img, canvas) { opacity: 0.45; filter: saturate(0.7); }
.themes__title { margin: 6px 0 0; font-size: 16px; }
.themes__badge { justify-self: start; margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--tint-2); color: var(--text); font-size: 12px; font-weight: 600; }
.themes__badge[data-kind='none'] { background: var(--tint); color: var(--text-dim); font-weight: 500; }
.themes__badge[data-kind='top_quarter'], .themes__badge[data-kind='top_year'] { background: var(--accent); color: var(--on-accent); }
.themes__desc { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }
.themes__standing { margin: 0; color: var(--text-faint); font-size: 12.5px; }
.themes__sub { margin: 22px 0 2px; font-size: 14px; }
.themes__hint { margin: 0 0 10px; color: var(--text-dim); font-size: 12.5px; }
.themes__mascots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.themes__pet { display: grid; justify-items: center; gap: 2px; min-height: 44px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.themes__pet:hover { border-color: var(--accent-dim); }
.themes__pet:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.themes__pet.is-chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.themes__pet-art { display: grid; place-items: center; height: 44px; }
.themes__pet-art img { display: block; max-height: 44px; max-width: 72px; image-rendering: auto; }
/* A title's creature on each tile: one screen pixel per grid pixel, or two on a dense screen (mascots/stage.js). */
.themes__pet-art--pixel { height: 64px; }
.themes__pet-art canvas { display: block; }

/* The whale stands on the box's top edge, at the right, and takes no room. */
/* About one and a half times the box's own height across the whale, the size the owner
   pointed at (2026-11-06). The picture has room around the animal, so the frame is
   larger than what is seen; a state with something above it needs that room. */
/* The whale's pictures are 260 pixels drawn at 128: pixelated at a scale that is not whole
   drops rows, so it is smoothed instead (2026-11-08). */
.mascot { position: absolute; right: 14px; bottom: calc(100% - 22px); z-index: 1; height: 128px; width: auto; image-rendering: auto; pointer-events: none; user-select: none; }
@media (max-width: 720px) { .mascot { height: 96px; right: 8px; bottom: calc(100% - 16px); } }
@media (max-width: 420px) { .mascot { height: 72px; right: 4px; bottom: calc(100% - 12px); } }
/* A title's creature (owner, 2026-11-08): mascots/stage.js sizes the canvas near
   --mascot-size, at a whole number of screen pixels per grid pixel, so it stays sharp
   at any zoom. Its feet are five grid rows above the canvas's foot. */
.mascot--pixel { --mascot-size: 128px; height: auto; bottom: calc(100% - var(--mascot-size) * 0.16); }
@media (max-width: 720px) { .mascot--pixel { --mascot-size: 96px; } }
@media (max-width: 420px) { .mascot--pixel { --mascot-size: 72px; } }

/* `/theme` in the box: the themes in a row above it (theme-picker.js). */
.tpick { position: absolute; left: 50%; bottom: calc(100% - 6px); z-index: 6; width: min(780px, calc(100% - 28px)); transform: translateX(-50%); padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-solid, var(--bg-elev)); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.tpick[hidden] { display: none; }

/* What the checks said about an answer: a note from the app, under it, not part of it. */
.qc-notes { margin-top: 10px; display: grid; gap: 2px; user-select: none; -webkit-user-select: none; }
.qc-note { margin: 0; color: var(--text-faint); font-size: 12.5px; font-style: italic; }
.tpick__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.tpick__chip { padding: 2px 8px; border-radius: 6px; background: var(--tint-2); font-family: var(--mono, monospace); font-size: 12px; }
.tpick__title { color: var(--text); font-weight: 600; }
.tpick__keys { margin-left: auto; color: var(--text-faint); font-size: 12px; white-space: nowrap; }
/* The track is the box behind it; only the thumb shows (owner, 2026-11-08). */
.tpick__row { display: flex; gap: 10px; overflow-x: auto; padding: 3px 3px 6px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 32%, transparent) transparent; }
.tpick__row::-webkit-scrollbar { height: 8px; background: transparent; }
.tpick__row::-webkit-scrollbar-track { background: transparent; }
.tpick__row::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 32%, transparent); border-radius: 99px; }
.tpick__row::-webkit-scrollbar-button { display: none; }
.tpick__tile { flex: 0 0 112px; display: grid; gap: 5px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.tpick__frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.tpick__tile[aria-selected='true'] .tpick__frame, .tpick__tile:hover .tpick__frame { box-shadow: 0 0 0 2px var(--accent); }
.tpick__tile.is-current .tpick__name::after { content: ' ✓'; color: var(--accent); }
.tpick__tile.is-locked .tpick__frame :is(img, canvas) { opacity: 0.45; filter: saturate(0.7); }
.tpick__tile.is-locked .tpick__name { color: var(--text-dim); }
.tpick__tile .themes__lock { width: 20px; height: 20px; }
.tpick__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .tpick__keys { display: none; } .tpick__tile { flex-basis: 96px; } }

.ranking { display: grid; gap: 14px; min-width: 0; }
.ranking__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ranking__closes { margin: 0; color: var(--text-faint); font-size: 12.5px; }
.ranking__scope { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; }
.ranking__scope button { min-height: 32px; padding: 3px 14px; border: 0; border-radius: 7px; background: none; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
.ranking__scope button:hover { background: var(--tint); color: var(--text); }
.ranking__scope button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ranking__scope button[aria-checked='true'] { background: var(--tint-2); color: var(--text); font-weight: 600; }
.ranking__boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ranking__board { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.ranking__board h4 { margin: 0 0 8px; font-size: 14px; }
.ranking__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ranking__row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.ranking__row.is-me { box-shadow: inset 0 0 0 1px var(--accent-dim); }
/* The three who win: gold, silver, bronze, each with an edge as well as a tint, so the
   place is read from the medal and the number as much as from the colour. */
.ranking__row.is-place-1 { background: rgba(245, 184, 0, 0.16); box-shadow: inset 3px 0 0 #f5b800; }
.ranking__row.is-place-2 { background: rgba(160, 174, 192, 0.18); box-shadow: inset 3px 0 0 #a0aec0; }
.ranking__row.is-place-3 { background: rgba(205, 127, 50, 0.16); box-shadow: inset 3px 0 0 #cd7f32; }
.ranking__medal { font-size: 16px; text-align: center; }
.ranking__who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.ranking__name { overflow-wrap: anywhere; font-weight: 600; }
.ranking__chip { padding: 1px 8px; border-radius: 999px; background: var(--tint-2); color: var(--text-dim); font-size: 11.5px; }
.ranking__value { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.ranking__empty { padding: 6px 8px; color: var(--text-dim); font-size: 13px; }
.ranking__me { margin: 0; font-size: 13.5px; }
.ranking__anon { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.ranking__sub { margin: 10px 0 0; font-size: 14px; }
.ranking__titles { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 22px; align-items: start; }
.ranking__chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.ranking__detail { position: sticky; top: 0; display: grid; gap: 8px; min-width: 0; }
.ranking__stage { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #070a12; box-shadow: 0 0 0 1px var(--line); }
.ranking__stage .scene-live { image-rendering: pixelated; }
.ranking__stage.is-locked canvas { opacity: 0.6; filter: saturate(0.75); }
.ranking__stage .themes__lock { z-index: 1; width: 44px; height: 44px; }
.ranking__stage--none { display: grid; place-items: center; }
.ranking__stage--none img { width: 60%; image-rendering: auto; }
.ranking__stage .pixel-creature { position: absolute; }
.ranking__petname { margin: 0; color: var(--text-dim); font-size: 13px; font-weight: 600; }
@media (max-width: 900px) { .ranking__titles { grid-template-columns: minmax(0, 1fr); } .ranking__detail { position: static; max-width: 320px; } }
.ranking__title { min-height: 34px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ranking__title:hover { border-color: var(--accent-dim); }
.ranking__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ranking__title.is-on { border-color: var(--accent); background: var(--accent-glow); font-weight: 600; }
.ranking__title.is-on::after { content: ' ✓'; color: var(--accent); }
.ranking__title.is-locked { opacity: 0.55; }
.ranking__title.is-locked:hover, .ranking__title.is-locked:focus-visible { opacity: 0.85; }
.ranking__title.is-looking { box-shadow: 0 0 0 2px var(--accent); opacity: 1; }

.adminthemes__list { display: grid; gap: 6px; }
.adminthemes__row { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.adminthemes__row > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; cursor: pointer; }
.adminthemes__body { display: grid; gap: 12px; margin-top: 10px; }
.adminthemes__badge, .adminthemes__give { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.adminthemes__badge label, .adminthemes__give label { display: grid; gap: 3px; font-size: 12.5px; color: var(--text-dim); }
.adminthemes__holders { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.adminthemes__holders li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

@media (max-width: 760px) {
  .themes { grid-template-columns: minmax(0, 1fr); }
  .themes__detail { position: static; order: -1; }
}

/* A reply's shield, and the page that explains it (owner, 2026-11-05). */
.route-btn.is-warn { color: var(--warn-ink); }
.route-note {
  margin: 6px 0 0;
  padding: 10px 12px;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}
.route-note p { margin: 0 0 4px; }
.route-note__head { color: var(--text); font-weight: 500; }
.route-note__warn { color: var(--warn-ink); }
.route-note__more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.think__note { margin: 8px 0 0; font-size: 12px; font-style: italic; color: var(--text-dim); }
.think:not(.is-open) .think__note { display: none; }
.tag--warn { color: var(--warn-ink); border-color: currentColor; }
.srow--page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-inline: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.srow--page .srow__desc { display: block; }
.cloak__section { margin-top: 24px; }
.cloak__title { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.cloak__sub { margin: 16px 0 6px; font-size: 13px; font-weight: 600; }
.cloak__section p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.cloak__section p.cloak__note { font-size: 12px; }
.cloak__list { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.cloak__list li { margin-bottom: 6px; overflow-wrap: anywhere; }
.cloak__link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cloak__now { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.cloak__state { color: var(--text-dim); }
.cloak__state.is-on { color: var(--text); font-weight: 600; }
.cloak__table { overflow-x: auto; margin-bottom: 10px; }
.cloak__table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.cloak__table th { text-align: left; font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cloak__table td { vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.cloak__table td:first-child { color: var(--text); }

/* ── Settings → System: whether the site's address is safe from spoofing (2026-11-09) ── */
.domain-checks { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 10px; }
.domain-checks__row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.domain-checks__mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel-2, rgba(255, 255, 255, 0.06)); color: var(--text-dim); }
.domain-checks__row.is-ok .domain-checks__mark { color: var(--ok); }
.domain-checks__row.is-warn .domain-checks__mark { color: var(--warn, #e0b341); }
.domain-checks__row.is-fail .domain-checks__mark { color: var(--danger, #ef6b6b); }
.domain-checks__said { margin: 2px 0 0; color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.domain-checks__fix { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.domain-checks__busy, .domain-checks__when { color: var(--text-dim); font-size: 13px; }

/* ── the Bot page (owner, 2026-11-09) ─────────────────────────────── */
/*
 * Three columns, as DS Bot lays its team out: the list, the open conversation, its
 * details. In this app's own look — the dark surfaces, the accent, the radii. A
 * bot's colour comes from its creature (`--ink`), always mixed with the text colour
 * so a name keeps its contrast on both themes; the colour never says anything the
 * name beside it does not.
 */
/* Three columns, the last 0 wide while the details are closed, so opening them is a width the browser moves through (owner, 2026-11-10). */
.botpage { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr) 0px; overflow: hidden; background: transparent; transition: grid-template-columns 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
.botpage[hidden] { display: none; }
.botpage.has-details { grid-template-columns: 272px minmax(0, 1fr) 320px; }
.botface { display: inline-block; flex: none; width: var(--face, 28px); height: var(--face, 28px); background: center / contain no-repeat; image-rendering: pixelated; vertical-align: middle; }
.botfaces { display: inline-flex; flex: none; align-items: center; }
.botfaces .botface + .botface { margin-left: -7px; }
.bottag { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); font-size: 11.5px; font-weight: 500; vertical-align: 1px; }

/* A light pane over the theme, not a dark slab (owner, 2026-11-10): a thin wash, a hairline of glass. */
.botlist { position: relative; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-right: 1px solid var(--glass-line); background: color-mix(in srgb, var(--bg-elev) 26%, transparent); padding: 14px 10px 24px; }
.botlist__head { display: flex; align-items: center; gap: 6px; padding: 0 4px 10px; }
.botlist__title { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
.botmenu { position: absolute; top: 52px; right: 12px; z-index: 5; display: grid; min-width: 180px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.botmenu button { padding: 9px 12px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.botmenu button:hover, .botmenu button:focus-visible { background: var(--surface-2); outline: none; }
.botchief { position: relative; display: grid; justify-items: center; gap: 4px; width: 148px; margin: 4px auto 14px; padding: 14px 10px 12px; border: 1px solid var(--glass-line); border-radius: var(--radius); background: var(--tint); color: var(--text); font: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.botchief:hover { background: var(--tint-2); }
.botchief.is-open { border-color: color-mix(in srgb, var(--text) 16%, transparent); background: var(--tint-2); }
.botchief__star { position: absolute; top: 58px; left: 92px; color: var(--warn); font-size: 16px; }
.botchief__name { font-weight: 600; }
.botchief__role { padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); font-size: 12px; }
.botlist__rows { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.botrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 7px 9px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.botrow { transition: background 0.15s; }
.botrow:hover { background: var(--tint); }
.botrow.is-open { background: var(--tint-2); box-shadow: inset 0 0 0 1px var(--glass-line); }
.botrow__text { display: grid; flex: 1; min-width: 0; }
.botrow__name { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.botrow__last { overflow: hidden; color: var(--text-dim); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.botchief:focus-visible, .botrow:focus-visible, .botchat__pill:focus-visible, .botlink:focus-visible, .botcard:focus-visible, .botset__row:focus-visible, .botset__navitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.botchat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.botchat__head { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px 6px; }
.botchat__back { display: none; }
.botchat__pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.botchat__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botchat__chev { display: inline-block; color: var(--text-faint); font-weight: 400; transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
.botchat__pill[aria-expanded="true"] .botchat__chev { transform: rotate(180deg); }
.botchat__log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px max(16px, calc((100% - 860px) / 2)) 16px; }
.botstamp { margin: 14px 0 10px; color: var(--text-faint); font-size: 12.5px; text-align: center; }
.botempty { max-width: 460px; margin: 18vh auto 0; color: var(--text-dim); text-align: center; line-height: 1.6; }
/*
 * A group's line in the home chat's own look (owner, 2026-11-10): the classes are the home
 * chat's (.msg, .msg--user .bubble, .msg--assistant .msg__body, .msg__actions), so a bot's reply
 * is prose over the theme with no bubble and the person's line is the home bubble. What is
 * the Bot page's own: the face and name over a bot's reply, and the files it made.
 */
.botchat__log .msg { margin-bottom: 18px; padding: 0; }
.botline__who { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 13.5px; }
.botline__who .botmsg__face { flex: none; }
.botline--bot .msg__body { line-height: 1.6; overflow-wrap: anywhere; }
.botline--bot .msg__body > :first-child { margin-top: 0; }
.botline--bot .msg__body > :last-child { margin-bottom: 0; }
.botline--ask .msg__body { padding-left: 12px; border-left: 3px solid var(--accent); }
.botline__asks { color: var(--accent); font-size: 12.5px; font-weight: 500; }
.botline__files { display: grid; gap: 8px; width: min(520px, 100%); margin-top: 8px; }
/* At work: the small ring the working line has, where the dot was, saying so on hover. */
.botbusy.spinner { flex: none; width: 13px; height: 13px; }
.botchief .botbusy { position: absolute; top: 10px; right: 10px; }
.botnotice__go { margin-left: 8px; vertical-align: baseline; }
.botmsg__name, .botmention, .botworking__who { color: color-mix(in srgb, var(--ink, var(--text)) 70%, var(--text)); font-weight: 600; }
.botmention { display: inline-flex; align-items: baseline; gap: 2px; }
.botmention .botface { align-self: center; }
.botnotice { margin: 10px auto; max-width: 560px; color: var(--text-dim); font-size: 13px; text-align: center; }
/* A bot a notice names, by its face: "[face] Writer joined the group." (owner, 2026-11-10). */
.botnotice__who { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 500; vertical-align: -3px; }
/* The face of whom a team step in the transcript made or changed, before its name. */
.stepface { display: inline-flex; align-items: center; margin: 0 2px 0 4px; vertical-align: -4px; }
.stepface:empty { display: none; }
.botchat__working { display: grid; gap: 4px; padding: 0 max(16px, calc((100% - 860px) / 2)); }
.botchat__working[hidden], .botchat__log[hidden] { display: none; }
.botworking { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.botworking .spinner { flex: none; }
/*
 * The home chat's transcript and box, lent here (app.js lendHome). For a bot they fill
 * the column and behave as at home: the box floats over the transcript's foot. For a
 * group only the box comes, below the group's own log, in the flow.
 */
.botchat__home { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.botchat__home > .thread { flex: 1; }
.botpage.is-group .botchat__home { flex: none; }
.botpage.is-group .botchat__home > .dock { position: relative; right: auto; left: auto; bottom: auto; background: none; }
.botchat__home > .atpick { bottom: calc(100% + 6px); z-index: 6; }
/* The welcome cards in a bot's chat are a still wash, not live glass: a blurred pane over the
   moving scene was redrawn as the box beside it changed and flashed pale behind the lower two
   while somebody typed (owner, 2026-11-10). */
.botchat__home .suggestion { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, var(--glass-hi), transparent 46%), color-mix(in srgb, var(--bg-elev) 62%, transparent); }
/* "@Name" bold in a group's box (bots.js syncMentions): the box's own letters go clear over a
   layer that draws the same words, a name that calls somebody in its bot's colour. Bold by a
   stroke, not a heavier face, so every letter stays exactly where the caret thinks it is. */
.composer textarea.has-mentions { position: relative; z-index: 1; color: transparent; caret-color: var(--text); }
.mentionlay { position: absolute; z-index: 0; box-sizing: border-box; margin: 0; border: 0; overflow: hidden; color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; }
.mentionlay__at { color: color-mix(in srgb, var(--ink, var(--accent)) 72%, var(--text)); -webkit-text-stroke: 0.045em currentColor; border-radius: 4px; background: color-mix(in srgb, var(--ink, var(--accent)) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink, var(--accent)) 16%, transparent); }
/* Saving: the button stays pressed until the server answers, so a second press makes nothing twice. */
.botform .btn.is-busy { opacity: 0.7; cursor: progress; }
/* A ring while the details load, never a row of dots. */
.botloading { display: flex; justify-content: center; padding: 18px 0; }
.botloading .spinner { width: 18px; height: 18px; }
.bottasks { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.bottask { display: flex; align-items: center; gap: 6px; }
.bottask__text { display: grid; flex: 1; min-width: 0; }
.bottask__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottask__when { color: var(--text-dim); font-size: 12.5px; }
.bottask__form { display: grid; gap: 8px; }
.bottask__form input, .bottask__form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.botform__note { margin: 0; }
.botworking__text { overflow: hidden; color: var(--text-faint); text-overflow: ellipsis; white-space: nowrap; }
.atpick { position: absolute; bottom: calc(100% + 6px); left: 8px; z-index: 6; display: grid; min-width: 220px; max-width: calc(100% - 16px); max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.atpick__item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.atpick__item.is-on, .atpick__item:hover { background: var(--surface-2); }
.atpick__name { color: color-mix(in srgb, var(--ink, var(--text)) 70%, var(--text)); font-weight: 600; }
.atpick__role { color: var(--text-dim); font-size: 12.5px; }

.botdetails { width: 320px; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg-elev) 70%, transparent); padding: 12px 18px 28px; opacity: 0; transform: translateX(24px); transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
.botpage.has-details .botdetails { opacity: 1; transform: none; }
.botdetails[hidden] { display: none; }
.botdetails__head { display: flex; justify-content: flex-end; }
.botdetails__who { display: grid; justify-items: center; gap: 4px; margin: 4px 0 18px; text-align: center; }
.botdetails__who .botfaces .botface { --face: 40px !important; }
.botdetails__name { margin: 8px 0 0; font-size: 20px; }
.botdetails__role { margin: 0; color: var(--text-dim); }
.botsec { position: relative; margin: 0 0 18px; }
.botsec__label { margin: 0 0 8px; color: var(--text-dim); font-size: 13px; font-weight: 500; }
.botsec__stop { position: absolute; top: -4px; right: 0; }
.botselect { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.botlink { display: block; width: 100%; padding: 8px 0; border: 0; background: none; color: var(--text-dim); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.botlink:hover { color: var(--text); }
.botlink--center { margin: -4px 0 14px; text-align: center; }
.botlink--danger { color: var(--danger); }
.botlink--danger:hover { color: var(--danger); text-decoration: underline; }
.botnoticebox { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }
.botsec--reset { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.botconfirm { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.botconfirm::backdrop { background: rgb(0 0 0 / 0.45); }
.botconfirm__title { margin: 0 0 8px; font-size: 17px; }
.botconfirm__text { margin: 0 0 18px; color: var(--text-dim); line-height: 1.55; }
.botconfirm__acts { display: flex; justify-content: flex-end; gap: 8px; }
.botcard { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.botcard__more { display: inline-flex; align-items: center; gap: 4px; color: var(--text-dim); font-size: 13px; }
.botcard__chev { display: inline-block; transition: transform 0.2s ease; }
.botcard[aria-expanded="true"] .botcard__chev { transform: rotate(90deg); }
/* The memory list, folded: rows that grow from 0 to their own height (owner, 2026-11-10). */
.botmemory-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease; }
.botmemory-fold.is-open { grid-template-rows: 1fr; }
.botmemory-fold__in { min-height: 0; overflow: hidden; }
.botmemory { margin-top: 10px; }
.botmemory__list { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.botmemory__list li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--tint); font-size: 13.5px; }
.botmemory__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.botmemory__forget { flex: none; min-height: 28px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--text-dim); font: inherit; font-size: 12px; cursor: pointer; }
.botmemory__forget[data-armed="1"] { border-color: var(--danger); color: var(--danger); }
.botmemory__acts { display: inline-flex; flex: none; flex-wrap: wrap; gap: 4px; }
.botmemory__list li.is-pinned { box-shadow: inset 2px 0 0 var(--accent); }
.botmemory__pin { margin-right: 4px; font-size: 12px; }
.botmemory__gone { justify-content: space-between; color: var(--text-dim); }
/* Who saved an entry and where, its earlier versions, and what the bot forgot (owner, 2026-11-12). */
.botmemory__main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.botmemory__meta { color: var(--text-faint); font-size: 12px; overflow-wrap: anywhere; }
.botmemory__earlier summary, .botmemory__forgotten summary { min-height: 28px; padding: 4px 0; color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.botmemory__earlier ul { display: grid; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; }
.botmemory__earlier li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-dim); font-size: 12.5px; }
.botmemory__forgotten { margin: 0 0 10px; }
.botmemory__edit { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; }
.botmemory__edit input { flex: 1 1 160px; min-width: 0; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.botmemory__add { display: flex; gap: 6px; }
.botmemory__add input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.botusage, .botmembers { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.botusage li { display: flex; justify-content: space-between; gap: 10px; }
.botusage li span:first-child { color: var(--text-dim); }
.botmembers li { display: flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--ink, var(--text)) 70%, var(--text)); }

/* Bot settings: a dialog with its own pages. */
.botset { width: min(1040px, calc(100vw - 32px)); max-width: none; height: min(760px, calc(100vh - 48px)); padding: 0; }
.botset__frame { position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; }
.botset__nav { display: flex; flex-direction: column; gap: 2px; padding: 18px 10px; border-right: 1px solid var(--line-soft); background: var(--bg-elev); }
.botset__title { margin: 0 8px 12px; font-size: 16px; }
.botset__navitem { min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--text-dim); font: inherit; text-align: left; cursor: pointer; }
.botset__navitem[aria-current="true"] { background: var(--surface-2); color: var(--text); }
.botset__main { min-height: 0; overflow-y: auto; padding: 22px 26px 34px; }
.botset__close { position: absolute; top: 12px; right: 12px; }
.botset__head { display: flex; align-items: center; gap: 12px; margin: 0 40px 12px 0; }
.botset__h { flex: 1; margin: 0; font-size: 18px; }
.botset__h4 { margin: 18px 0 12px; font-size: 15px; }
.botset__list { display: grid; gap: 2px; margin: 0 0 8px; padding: 0; list-style: none; }
.botset__row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.botset__row:hover, .botset__row.is-on { background: var(--surface-2); }
.botset__row > span:last-child { display: grid; }
.botset__sub { color: var(--text-dim); font-size: 12.5px; }
.botform { max-width: 620px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.botform .field { display: grid; gap: 6px; }
.botform .field > span, .botform legend { color: var(--text-dim); font-size: 12.5px; }
.botform input:not([type]), .botform select, .botform textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.botform input:focus-visible, .botform select:focus-visible, .botform textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.botform fieldset { margin: 0 0 15px; padding: 0; border: 0; }
.botform__creatures { display: flex; flex-wrap: wrap; gap: 6px; }
.botform__creature { position: relative; display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.botform__creature input { position: absolute; opacity: 0; }
.botform__creature:has(input:checked) { border-color: var(--accent); background: var(--accent-glow); }
.botform__creature:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.botform__members { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.botform__member { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.botform__error { min-height: 1.2em; margin: 0 0 8px; color: var(--danger); font-size: 13px; }
.botform__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Bot settings → Usage. */
.botuse__ranges { margin-bottom: 12px; }
.botuse__custom { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 12px; }
.botuse__custom label { display: grid; gap: 4px; color: var(--text-dim); font-size: 12.5px; }
.botuse__custom input { min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.botuse__tiles { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.botuse__tile { display: grid; align-content: center; gap: 4px; padding: 16px 18px; }
.botuse__tile + .botuse__tile { border-left: 1px solid var(--line); }
.botuse__k { color: var(--text-dim); font-size: 13px; }
.botuse__v { font-size: 26px; font-weight: 600; }
.botuse__tile--big .botuse__v { font-size: 36px; }
.botuse__unit { margin-left: 6px; color: var(--text-dim); font-size: 14px; font-weight: 400; }
.botuse__card { margin: 0 0 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.botuse__card h3 { margin: 0 0 10px; font-size: 15px; }
.botuse__cardhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.botuse__sub { margin-left: 6px; color: var(--text-faint); font-size: 12.5px; font-weight: 400; }
.botuse__chart { display: block; width: 100%; height: auto; }
.botuse__grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.botuse__chart text { fill: var(--text-faint); font-size: 11px; }
.botuse__legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.botuse__legend li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--tint); }
.botuse__swatch { width: 9px; height: 9px; border-radius: 50%; }
.botuse__lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.botuse__rows { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.botuse__row { display: flex; align-items: center; gap: 10px; }
.botuse__label { display: grid; flex: 1; min-width: 0; gap: 3px; }
.botuse__label .botuse__sub { margin: 0; }
.botuse__bar { display: block; height: 4px; border-radius: 2px; background: var(--tint-2); }
.botuse__bar > span { display: block; height: 100%; border-radius: 2px; }
.botuse__num { display: grid; justify-items: end; font-weight: 600; }
.botuse__mark { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.botuse__note { margin-top: 4px; }

@media (max-width: 1100px) {
  /* Narrower: the details lie over the conversation and slide in from the right; the list keeps its width. */
  .botpage, .botpage.has-details { grid-template-columns: 240px minmax(0, 1fr); }
  .botpage .botdetails { position: absolute; inset: 0 0 0 auto; z-index: 8; width: min(340px, 100%); box-shadow: var(--shadow); opacity: 1; transform: translateX(100%); }
  .botpage.has-details .botdetails { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .botpage, .botdetails, .botchat__chev, .botcard__chev, .botmemory-fold { transition: none; }
}
@media (max-width: 760px) {
  .botpage, .botpage.has-details { grid-template-columns: minmax(0, 1fr); }
  .botpage .botchat { display: none; }
  .botpage.is-chatting .botlist { display: none; }
  .botpage.is-chatting .botchat { display: flex; }
  .botchat__back { display: inline-grid; position: absolute; left: 10px; }
  .botset__frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .botset__nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 10px; }
  .botset__title { width: 100%; }
  .botuse__tiles { grid-template-columns: 1fr 1fr; }
  .botuse__tile:nth-child(3) { border-left: 0; }
  .botuse__tile:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .botuse__lists { grid-template-columns: minmax(0, 1fr); }
}

/* ── The Bot page's team features (spec B, 2026-11-11) ──────────────────────── */
/* Needs you: above the rows, only when something waits. */
.botneeds { margin: 10px 2px 12px; padding: 10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.botneeds__title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.botneeds__n { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #1a1100; font-size: 12px; text-align: center; }
.botneeds__rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.botneed { display: flex; align-items: center; gap: 6px; }
.botneed__open { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.botneed__open:hover { background: var(--tint); }
.botneed__open:focus-visible, .botrow__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.botneed__text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.botneed__act { flex: none; }
/* A row and its ⋯ button; the marks at its end. */
.botrowwrap { position: relative; display: flex; align-items: center; }
.botrowwrap .botrow { padding-right: 38px; }
.botrow__more { position: absolute; right: 4px; width: 30px; height: 30px; opacity: 0; transition: opacity 0.15s; }
.botrowwrap:hover .botrow__more, .botrow__more:focus-visible, .botrow__more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .botrow__more { opacity: 0.7; } }
.botrow__pin { margin-right: 4px; font-size: 11px; }
.botrow.is-paused .botrow__name, .botrow.is-paused .botrow__last { opacity: 0.6; }
.bottag--paused { margin-left: 6px; }
.botmark { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.botmark--unread { background: var(--accent); }
.botmark--needs { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.botchief .botmark { position: absolute; top: 12px; left: 12px; }
.botrowmenu { position: fixed; top: 0; left: 0; z-index: 30; }
.botrowmenu .is-danger { color: var(--danger); }
/* Who a group's message called, and how each is doing. */
.botcalled { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.botcalled__chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 9px 2px 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font-size: 12px; }
.botcalled__chip .spinner { width: 11px; height: 11px; }
.botcalled__name { color: color-mix(in srgb, var(--ink, var(--text)) 75%, var(--text)); font-weight: 600; }
.botcalled__how { color: var(--text-dim); }
.botcalled__chip--answered { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.botcalled__chip--failed { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.botcalled__chip--waiting { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
/* A paused bot, said above the box. */
.botpaused { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; max-width: 760px; margin: 0 auto 6px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 8%, transparent); font-size: 13px; }
/* The first-run card. */
.botfirst-wrap { max-height: 62vh; overflow-y: auto; padding: 4px 16px; }
.botfirst { max-width: 720px; margin: 8px auto 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.botfirst__title { margin: 0 0 4px; font-size: 18px; }
.botfirst__goals { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; border: 0; }
.botfirst__goal { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; font-size: 13.5px; cursor: pointer; }
.botfirst__goal:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.botfirst__goal:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.botfirst__bots { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.botfirst__bot { display: grid; gap: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--tint); }
.botfirst__row { display: flex; flex-wrap: wrap; gap: 6px; }
.botfirst__row input { flex: 1 1 160px; }
.botfirst input, .botfirst textarea, .botaside textarea, .botport textarea { min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elev); color: var(--text); font: inherit; font-size: 13.5px; }
.botfirst textarea, .botport textarea { width: 100%; resize: vertical; }
.botfirst__acts { display: flex; gap: 8px; margin-top: 6px; }
/* Ask aside: a card over the conversation's right edge. */
.botchat__aside { position: absolute; top: 12px; right: 16px; }
.botaside { position: absolute; top: 52px; right: 16px; bottom: 120px; z-index: 6; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 32px)); padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow); }
.botaside[hidden] { display: none; }
.botaside__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.botaside__title { margin: 0; font-size: 15px; }
.botaside__note { margin: 0; font-size: 12px; }
.botaside__list { display: grid; flex: 1; gap: 12px; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.botaside__q { margin: 0 0 4px; color: var(--text-dim); font-size: 13px; }
.botaside__a { font-size: 13.5px; }
.botaside__wait { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-dim); font-size: 13px; }
.botaside__wait .spinner { width: 12px; height: 12px; }
.botaside__form { display: flex; align-items: flex-end; gap: 6px; margin-top: auto; }
.botaside__form textarea { flex: 1; resize: none; }
/* The team file dialog. */
.botport { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.botport::backdrop { background: rgb(0 0 0 / 0.45); }
.botport__form { display: grid; gap: 4px; padding: 18px 20px 22px; }
.botport__head { display: flex; align-items: center; justify-content: space-between; }
.botport__head h2 { margin: 0; font-size: 17px; }
.botport__sec { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.botport__sec h3 { margin: 0 0 4px; font-size: 14px; }
.botport__sec summary { font-size: 14px; font-weight: 600; cursor: pointer; }
.botport__acts { display: flex; gap: 8px; margin: 8px 0; }
.botport__file { display: inline-flex; margin: 6px 0; cursor: pointer; }
.botport__plan { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.botport__ok { color: var(--ok); }
.botport__no { color: var(--danger); }
.botport__refused { color: var(--text-dim); font-size: 12.5px; }
/* A scheduled run with nothing new, folded in the home chat. */
.quietrun { margin: 6px 0; }
.quietrun__head { width: fit-content; padding: 4px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.quietrun__body { margin-top: 6px; opacity: 0.85; }
@media (max-width: 760px) {
  .botaside { inset: 56px 8px 96px; width: auto; }
  .botchat__aside { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .botrow__more { transition: none; }
}

/* The Bot settings' Usage: the span before, cost, and a bot opened (spec B.8). */
.botuse__cmp { display: block; margin-top: 4px; color: var(--text-dim); font-size: 12.5px; }
.botuse__open { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.botuse__open:hover { background: var(--tint); }
.botuse__open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.botuse__drill { display: grid; gap: 10px; margin: 4px 0 12px 38px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--tint); }
.botuse__drillsec h4 { margin: 0 0 6px; color: var(--text-dim); font-size: 12px; font-weight: 600; }
/* A bot's colour, chosen in its form (spec B.5). */
.botform__hues { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; }
.botform__hue { position: relative; display: inline-grid; padding: 3px; border: 2px solid transparent; border-radius: 10px; cursor: pointer; }
.botform__hue input { position: absolute; opacity: 0; pointer-events: none; }
.botform__hue:has(input:checked) { border-color: var(--accent); }
.botform__hue:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Triggers from outside (spec C): a task's webhook, a bot's waits, Telegram to Chief. */
.bottask__trigger { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bottask__trigger select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.bothook { display: block; }
.bothook__once, .bothook__panel { display: grid; gap: 8px; margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--tint); font-size: 13px; }
.bothook__once { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.bothook__once p, .bothook__panel h4 { margin: 0; }
.bothook__panel h4 { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.bothook__field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bothook__field > span { min-width: 64px; color: var(--text-dim); }
.bothook__field code, .bothook__url code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.bothook__receipts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.bothook__receipts li { display: flex; flex-wrap: wrap; gap: 8px; }
.bothook__status { font-weight: 600; }
.bothook__status--ran { color: var(--ok); }
.bothook__status--failed { color: var(--danger); }
.bothook__status--ignored, .bothook__status--busy { color: var(--text-dim); }
.bothook__filters { display: grid; gap: 6px; }
.bothook__filters input { min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; }
.bothook__match { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bothook__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.botwaits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; margin: 0 auto 6px; padding: 0 12px; list-style: none; }
.botwait { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 12.5px; }
.botwait__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botwait__x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 12px; background: none; color: var(--text-dim); cursor: pointer; }
.botwait__x:hover { background: var(--tint); color: var(--text); }
.botwait__x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tgin { display: grid; gap: 8px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tgin__title { margin: 0; font-size: 14px; }
.tgin__switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tgin__line, .tgin__code { margin: 0; }
.tgin__code code { padding: 2px 6px; border-radius: 6px; background: var(--tint); }
.tgin__others { display: grid; gap: 6px; max-width: 520px; }

/* The plans sheet and the checkout (billing preview, 2026-11-14). The cards step 1 / 2 / 4 columns by the width of the sheet's body (a container query), so they fall to one column on a phone and 360 px never scrolls sideways; the checkout and the QR rows stack under 700 px. */
.plans { width: min(980px, 100%); }
.plans__body { display: grid; gap: 14px; align-content: start; container-type: inline-size; container-name: plans; }
.plans__preview { margin: 0; padding: 6px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--text-dim); font-size: 12.5px; }
.plans__muted { margin: 0; color: var(--text-dim); font-size: 13px; }
.plans__error { margin: 0; color: var(--danger, #e5484d); }
.plans__audience { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-self: center; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); max-width: 100%; }
.plans__audience [role='radio'] { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 40px; padding: 6px 22px; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.plans__audience [aria-checked='true'] { background: var(--accent); color: var(--on-accent); }
.plans__audience [role='radio']:focus-visible, .checkout__card:focus-visible, .plans__toggle [role='radio']:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plans__save { font-size: 11.5px; opacity: 0.9; }
/* One column on a phone, two when medium, four when wide. Explicit steps on the body's own width (the sheet is a dialog, so the viewport is the wrong ruler); an auto-fit grid gave three plus one in between. */
.plans__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container plans (min-width: 520px) { .plans__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container plans (min-width: 860px) { .plans__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plans__cards.plans__cards--team { grid-template-columns: minmax(0, 520px); justify-content: center; }
.plans__card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.plans__card.is-current { border-color: var(--accent); }
.plans__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plans__head h3 { margin: 0; font-size: 17px; }
.plans__icon { flex: none; color: var(--accent); }
.plans__badge { margin-left: auto; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim); font-size: 11.5px; white-space: nowrap; }
.plans__tagline { margin: 0; min-height: 2.8em; color: var(--text-dim); font-size: 13.5px; line-height: 1.4; }
/* A smaller segmented switch than the page's: one state for all three paid cards, shown inside each. */
.plans__toggle { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.plans__toggle [role='radio'] { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 4px 6px; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.plans__toggle [aria-checked='true'] { background: var(--accent); color: var(--on-accent); }
.plans__price, .plans__billed { margin: 0; }
.plans__amount { font-size: 26px; font-weight: 650; }
.plans__per, .plans__billed { color: var(--text-dim); font-size: 13px; }
/* The paid button is filled with the text colour and written in the page colour; Free is the reverse. Both follow the theme's tokens, so the pair inverts with the theme and keeps its contrast in each. The hover states are set here too: .btn:hover (higher specificity) would otherwise paint a grey under text of the same lightness. */
.plans__cta { width: 100%; min-height: 40px; justify-content: center; font-weight: 600; }
.plans__cta--paid { background: var(--text); color: var(--bg); border-color: var(--text); }
.plans__cta--free { background: var(--bg); color: var(--text); border-color: var(--line); }
.plans__cta--paid:hover:not(:disabled), .plans__cta--paid:active:not(:disabled) { background: color-mix(in srgb, var(--text) 82%, var(--bg)); color: var(--bg); border-color: var(--text); }
.plans__cta--free:hover:not(:disabled), .plans__cta--free:active:not(:disabled) { background: color-mix(in srgb, var(--text) 8%, var(--bg)); color: var(--text); border-color: var(--line); }
/* A disabled button keeps its resting colours on hover: .btn:hover (0,2,0) would otherwise lighten the fill under the paid label's page-coloured text. */
.plans__cta--paid:disabled:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.plans__cta--free:disabled:hover { background: var(--bg); color: var(--text); border-color: var(--line); }
.plans__cta:disabled { opacity: 0.55; cursor: default; }
.plans__cta[aria-disabled='true'] { opacity: 0.55; cursor: default; }
.plans__cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plans__terms { margin: 0; text-align: center; color: var(--text-dim); font-size: 12.5px; }
.plans__note { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.45; }
.plans__rule { width: 100%; margin: 4px 0 0; border: 0; border-top: 1px solid var(--line); }
.plans__lead { margin: 0; font-size: 13px; font-weight: 600; }
.plans__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--text-dim); font-size: 13.5px; line-height: 1.45; }
.plans__lines li { display: flex; align-items: flex-start; gap: 8px; }
.plans__lines li span { min-width: 0; }
.plans__tick { flex: none; margin-top: 2px; color: var(--ok); }
.plans__teamstatus { min-height: 1.4em; }
.plans__payg, .plans__rate, .plans__scheduled { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.plans__rate a { color: var(--accent); }
.plans__confirm { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.plans__confirm p { margin: 0 0 8px; }
.plans__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.plans__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.checkout h3 { margin: 0 0 8px; font-size: 16px; }
.checkout__lines { margin: 12px 0 0; }
.checkout__lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.checkout__lines dt, .checkout__lines dd { margin: 0; }
.checkout__total { font-weight: 650; }
.checkout__balance { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkout .field input { width: 100%; box-sizing: border-box; }
/* "Configure your plan" (2026-11-17): the choices, the form and the way to pay on the left; the summary card with the renewal notice, the consent box and Subscribe on the right, under them on a phone. */
.checkout__bar { display: flex; align-items: center; }
.checkout__main { display: grid; gap: 18px; align-content: start; min-width: 0; }
.checkout__period { display: grid; gap: 10px; }
.checkout__card { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-width: 0; box-sizing: border-box; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.checkout__card[aria-checked='true'] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.checkout__card:disabled { background: var(--surface-2); color: var(--text-dim); cursor: not-allowed; }
.checkout__dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--text-dim); border-radius: 50%; box-sizing: border-box; }
.checkout__card[aria-checked='true'] .checkout__dot, .checkout__dot.is-on { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 38%, transparent 42%); }
.checkout__cardtext { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.checkout__cardtitle { font-weight: 600; }
.checkout__cardbilled, .checkout__why { color: var(--text-dim); font-size: 13px; }
.checkout__badge { flex: none; align-self: flex-start; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.checkout__qrmethod { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.checkout__summary { align-self: start; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.checkout__summary h3 { margin-bottom: 0; }
.checkout__summary p { margin: 0 0 3px; overflow-wrap: anywhere; }
.checkout__summary .checkout__renew { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; line-height: 1.5; }
.checkout__consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; }
.checkout__consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.checkout__consent a { color: var(--accent); text-decoration: underline; }
.checkout__subscribe { width: 100%; justify-content: center; min-height: 44px; }
.checkout__summary .checkout__hint { margin: 8px 0 0; }
.pay { display: grid; gap: 14px; }
.pay__lead, .pay__status, .pay__time { margin: 0; }
.pay__note { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.pay__status { font-weight: 600; }
.pay__grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
/* White in both themes on purpose: a QR code needs a light quiet zone around it, or a dark page makes it unreadable to a scanner. */
.pay__qr { padding: 8px; border-radius: 12px; background: #fff; }
.pay__qr img { display: block; width: 220px; height: 220px; max-width: 100%; }
.pay__rows { margin: 0; display: grid; gap: 8px; }
.pay__rows > div { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.pay__rows dt { color: var(--text-dim); font-size: 13px; }
.pay__rows dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); }
.pay__timer { font-family: var(--mono); font-weight: 600; }
/* Cancel sits bottom right with the danger outline; its hover is a tint, not a red fill, so the words keep their contrast in both themes. */
.pay__foot { justify-content: flex-end; }
.pay__cancel:hover, .pay__ask .btn--danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pay__ask { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 12px; background: var(--surface-2); }
.pay__ask p { margin: 0; line-height: 1.5; }
.pay__done { display: grid; justify-items: center; gap: 6px; padding: 24px 0; text-align: center; }
.pay__tick { display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 26px; }
.pay__donetext { margin: 0; font-size: 20px; font-weight: 650; }
@media (max-width: 700px) {
  .checkout, .pay__grid { grid-template-columns: minmax(0, 1fr); }
  .pay__qr { justify-self: center; }
  .pay__rows > div { grid-template-columns: minmax(0, 1fr) auto; }
  .pay__rows dt { grid-column: 1 / -1; }
}

/* Settings → Billing and Administration → Billing (billing preview, 2026-11-15). Cards are plain blocks that stack, rows are grids that fall to one column under 560 px, so 360 px never scrolls sideways. */
.bill__card { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.bill__card[hidden] { display: none; }
.bill__card h4, .adm__h { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.bill__card h4:focus, .adm__h:focus { outline: none; }
.bill__card h4:focus-visible, .adm__h:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.bill__card p { margin: 0 0 8px; }
/* The order that is still waiting for its transfer: what it is for, how much, how long it has, and the way back to its QR. */
.bill__pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.bill__pending-what { margin: 0; min-width: 0; }
.bill__pending-what p { margin: 0; overflow-wrap: anywhere; }
.bill__pending-left { font-family: var(--mono); }
.bill__card .field { display: grid; gap: 4px; margin: 0 0 8px; }
.bill__card .field input { width: 100%; max-width: 360px; box-sizing: border-box; }
.bill__name { font-size: 18px; font-weight: 650; }
.bill__line, .bill__info { overflow-wrap: anywhere; }
.bill__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bill__switch { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; }
.bill__switch input { width: 18px; height: 18px; flex: none; }
.bill__total { display: grid; gap: 2px; margin-bottom: 4px; }
.bill__total-label { color: var(--text-dim); font-size: 13px; }
.bill__total-amount { font-size: 32px; font-weight: 650; line-height: 1.15; }
.bill__form, .bill__promo { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.bill__presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bill__presets [aria-pressed='true'], .bill__chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.bill__promo { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.bill__promo .field { margin: 0; flex: 1 1 200px; }
.bill__promo + p { margin-top: 8px; }
.bill__kind { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.bill__kindhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 550; }
.bill__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bill__tx, .bill__receipts, .adm__list { margin: 0; padding: 0; list-style: none; }
.bill__tx li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.bill__tx li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bill__tx-what { display: flex; flex-direction: column; min-width: 0; }
.bill__tx-amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill__tx-bal { grid-column: 2; text-align: right; font-size: 12.5px; }
.bill__receipts li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.bill__receipts a, .bill__card a { color: var(--accent); }
.bill__num { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.adm__facts { display: grid; gap: 4px; margin: 0 0 12px; }
.adm__facts > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 12px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.adm__facts dt { color: var(--text-dim); }
.adm__facts dd { margin: 0; overflow-wrap: anywhere; }
#admin-billing .adm__h { margin-top: 18px; }
.adm__cap { margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--line); }
.adm__cap.is-warn { border-left-color: var(--warn); }
.adm__cap.is-bad { border-left-color: var(--danger); }
.adm__caphead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.adm__hint { margin: 6px 0 0; font-size: 13px; }
.usage__bar.is-warn > span { background: var(--warn); }
.usage__bar.is-bad > span { background: var(--danger); }
.adm__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.adm__list li[data-transfer] { display: block; }
.adm__tline, .adm__content { margin: 0 0 6px; }
.adm__content { padding: 6px 8px; border-radius: 8px; background: var(--tint); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.adm__assign { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adm__assign label { flex: 1 1 100%; font-size: 13px; color: var(--text-dim); }
.adm__assign input { flex: 1 1 200px; min-width: 0; }
.adm__status { font-size: 12.5px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
.adm__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; margin-top: 12px; }
.adm__form .field { display: grid; gap: 4px; margin: 0; }
.adm__form input { width: 100%; box-sizing: border-box; }
.adm__sim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adm__sim label { flex: 1 1 100%; font-size: 13px; color: var(--text-dim); }
.adm__sim select { flex: 1 1 220px; min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
  .adm__facts > div { grid-template-columns: minmax(0, 1fr); }
  .bill__total-amount { font-size: 28px; }
}
