/* Agellia app — shared design kit.
   Every app page links this. Page-specific rules go in the page's own <style>.
   Keep the tokens in sync with the marketing site's /brand.css: one product,
   one palette, and a person who signs in should not cross a colour boundary.

   ── One red, three neutrals ───────────────────────────────────────────────
   The app used to be sea blue while the marketing site was grass green. Both
   are gone. What is left is a single brand red and a warm neutral ramp, which
   is what a product with one accent and no decorative colour needs:
     BRAND       #C8102E  structure, primary buttons, links, focus rings
     BRAND DEEP  #9E0C24  the pressed/hover ground; white on it is 8.3:1
     PALE WASH   #FBEAED  tinted surfaces, selected rows, empty states

   Every text/background pair was checked against WCAG AA. The muted ink is
   #6B575C, NOT #5A4A4E — the lighter one measured 5.9:1 on white, this one
   6.68:1, and this file has already been caught once shipping a caption at
   4.47:1, just under the 4.5 minimum. Do not lighten it without re-checking.

   The three data colours are NOT brand colours and must not become red: the
   stress tone moved from #C1351B to a burnt orange #C2410C specifically so
   that "high stress" is not the same pigment as "Agellia". If someone asks
   why the stress bar is not flag red, this is the answer. */

:root {
  /* Dark, like the site. The app is the same room as the hero: one red light
     on near-black, surfaces you can see through. Measured on the ground
     (#1A0E12): ink 18.9:1, soft ~11:1, muted ~6.6:1, --brand-text 6.7:1. */
  --bg: #2F1A22;
  /* The sticky bar at full strength. The bar is glass on a wide screen, but it
     is chrome over whatever happens to scroll under it — on the operator page
     that was a table, and at 72% the rows read through the wordmark. On a phone
     it is this colour and nothing else. */
  --nav-solid: #221319;
  --surface: rgba(255, 247, 246, 0.06);
  --surface-elevated: rgba(255, 247, 246, 0.10);
  --ink: #FFF7F6;
  --ink-soft: rgba(255, 244, 242, 0.80);
  --ink-muted: rgba(255, 244, 242, 0.60);
  --brand: #E01B3C;
  /* The red that is read rather than seen. #E01B3C is 4.1:1 on this ground. */
  --brand-text: #FF7180;
  --brand-deep: #B8122C;
  --brand-pale: rgba(224, 27, 60, 0.18);
  --brand-glow: rgba(224, 27, 60, 0.22);
  --brand-line: rgba(224, 27, 60, 0.34);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.26);
  --amber: #E0A468;
  --amber-pale: rgba(143, 82, 16, 0.20);
  --amber-ink: #F2C79B;

  /* Energy, sleep and stress. Lifted for a dark ground; the washes are tints
     of the tone, never pastels. Stress stays burnt orange — a high reading
     must not be the same pigment as the brand. */
  --energy-tone: #3FBE81;
  --sleep-tone:  #6AA6EE;
  --stress-tone: #E8794A;
  /* 12%, not 16%: a tint of a colour on a dark ground lifts the ground toward
     the colour, which costs the text contrast. At 16% the stress orange fell to
     4.37:1 on its own wash after the page was lightened; at 12% it is 4.70:1. */
  --energy-wash: rgba(63, 190, 129, 0.12);
  --sleep-wash:  rgba(106, 166, 238, 0.12);
  --stress-wash: rgba(232, 121, 74, 0.12);
  --ocean: #FFD9DE;
  --tide: #FF7180;
  --foam: rgba(255, 113, 128, 0.20);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.30);

  /* ── motion and depth ────────────────────────────────────────────────────
     Three durations and two curves, for the same reason there are three tones.

     Before this there were SEVEN transition timings in the app — 0.14s, 0.15s,
     0.18s, 0.2s, 0.3s, 0.4s, 0.5s — each chosen in the moment, so nothing quite
     matched anything else and the interface felt assembled rather than designed.
     The differences were too small to name and large enough to feel.

     --dur-1  a press, a hover. Must feel instant, so it is barely a transition.
     --dur-2  the default: a panel opening, a card lifting.
     --dur-3  something arriving on its own, like a revealed list.                    */
  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 420ms;
  --ease-out: cubic-bezier(0.22, 0.68, 0.32, 1);   /* starts fast, settles */
  --ease-in-out: cubic-bezier(0.45, 0.05, 0.35, 1);

  /* Depth as a scale rather than a pile of one-off values. Eleven different
     shadows were in use; these three cover every case they were reaching for.
     Shadow colour is the ink tone, never pure black — black shadows on a warm
     ground read as grey dirt. */
  --lift-1: 0 1px 2px rgba(26, 17, 19, 0.05), 0 2px 6px rgba(26, 17, 19, 0.05);
  --lift-2: 0 4px 10px rgba(26, 17, 19, 0.07), 0 12px 26px -8px rgba(26, 17, 19, 0.12);
  --lift-3: 0 10px 22px rgba(26, 17, 19, 0.10), 0 26px 50px -14px rgba(26, 17, 19, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── touch ────────────────────────────────────────────────────────────────
   All three of these matter only on a phone, and all three were missing.

   tap-highlight: the grey flash the browser paints over a tapped element. It
   arrives after the press and looks like a rendering fault beside the press
   states in the interaction layer, which are the feedback now.

   touch-action: stops a quick double-tap on a button being read as a zoom
   gesture. On a page people use one-handed, that is the difference between a
   button and a coin toss.

   text-size-adjust: iOS inflates body text in landscape unless told not to,
   which silently breaks any layout measured against a fixed line height. */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button, a, .btn-primary, .btn-quiet, [role="button"], summary, input[type="range"] {
  touch-action: manipulation;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; line-height: 1.2; }
a { color: var(--brand-text); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ── the ground ────────────────────────────────────────────────────────────
   One fixed gradient behind every page. It does not scroll with the content,
   so a section that happens to sit mid-page passes over the same field the hero
   did — the page keeps one colour scheme from the first pixel to the footer
   instead of going flat putty after the first screen.

   Five blooms, all the same two pigments: the brand red at 4–12% and a warm
   amber at 6–8%. At those alphas the brightest point is about four percent
   lighter than the base, which is why the contrast table in BRAND.md still
   holds; this is colour, not light.

   Cards are glass and blur what is behind them, so the ground shows through
   the surfaces that sit on it. privacy.html and learn.html opt out: the legal
   page is a document and the library is parchment. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 12% 6%,  rgba(224, 27, 60, 0.12) 0%, rgba(224, 27, 60, 0) 62%),
    radial-gradient(38% 34% at 94% 16%, rgba(224, 27, 60, 0.09) 0%, rgba(224, 27, 60, 0) 60%),
    radial-gradient(42% 38% at 52% 46%, rgba(224, 27, 60, 0.06) 0%, rgba(224, 27, 60, 0) 66%),
    radial-gradient(44% 40% at 86% 88%, rgba(194, 65, 12, 0.08) 0%, rgba(194, 65, 12, 0) 62%),
    radial-gradient(48% 44% at 4% 94%,  rgba(224, 27, 60, 0.07) 0%, rgba(224, 27, 60, 0) 64%),
    var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  /* Nothing moves; the declaration exists only to keep the layer on the
     compositor while it is repainted under backdrop-filter. */
  body::before { will-change: transform; }
}

/* ── chrome ─────────────────────────────────────────────────────────── */
.crisis-bar {
  background: var(--amber-pale);
  border-bottom: 1px solid rgba(196, 130, 50, 0.2);
  font-size: 0.84rem;
  color: var(--amber-ink, #F2C79B);
  padding: 10px 0;
  text-align: center;
}
.crisis-bar a { color: var(--amber-ink, #F2C79B); font-weight: 700; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; width: 100%; }

/* ══════════════════════════════════════════════════════════════════════════
   Thumb-sized controls.
   ══════════════════════════════════════════════════════════════════════════
   A deliberate pass at 390px wide on 2026-10-11, after four separate "it does
   not work on a phone" bugs turned up in one session. Layouts held up — nothing
   scrolled sideways on any page, including the ones with tables — but a lot of
   things were built to the thickness of their text rather than to the thickness
   of a thumb.

   44px is the usual floor. It is not a guideline for its own sake: below it,
   people miss, and the things people miss here are the three sliders that ARE
   the product, the Assistant toggle, and a close button. */

/* Every button in this app is a control somebody has to hit with a thumb, so the
   rule is on the element rather than on a list of classes I have to keep adding
   to. `<a>` dressed as a button still needs naming, which is the other half. */
button,
input[type="submit"],
.btn-primary,
.btn-quiet,
.btn-danger {
  min-height: 44px;
}

/* The three sliders, which ARE the product. They were 16-30px tall.
   Deliberately min-height and nothing else: the pages style these with
   `accent-color` and the native thumb, which is already a good thumb on a phone.
   Restyling the track and thumb here would strip the colour that tells energy
   from sleep from stress — a worse outcome than the small target it fixes.
   Height on the INPUT is the tap area; the track stays as drawn. */
input[type="range"] {
  min-height: 44px;
  width: 100%;
}

/* Icon-only close buttons were 17-21px, which is a coin toss with a thumb. */
[id$="-x"], [id$="-close"], .side-close, .x {
  min-width: 44px;
  min-height: 44px;
}

/* The crisis number. It is an inline link in a sentence, which is why it was
   exempt from the usual rule — but this is the one link on the site somebody may
   be trying to hit while upset, and 15px of text is not a target.

   inline-flex with a real 44px box, and a negative vertical margin so the banner
   does not grow to accommodate it: the target gets bigger, the layout does not. */
.crisis-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  margin: -13px 0;
}

/* 988 appears in body copy too, not only in the banner — on the peer page it is
   the link a member reaches for mid-sentence. Same treatment as the banner one:
   a real target with negative margins so the paragraph does not grow. */
a[href="tel:988"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  margin: -13px 0;
}

/* The wordmark is a link home on every page. 35px tall is close enough that it
   only needed a little padding rather than a redesign. */
header.site .brand, .logo {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Tables scroll inside their own box rather than dragging the page sideways —
   the standard mobile treatment, and the reason no page h-scrolls. */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }


header.site {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  /* 92%, not 72%. The bar is sticky and content passes under it, so its
     legibility cannot depend on what that content happens to be. At 72% the
     operator page's table rows were readable through the wordmark: the nav was
     there, with a table on top of it. The blur is kept for the desktop glass
     look; the fill is what does the hiding. */
  background: rgba(34, 19, 25, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Without a blur there is no glass, only a 92% film — close enough that nobody
   would call it wrong, but the solid is the honest fallback and costs nothing. */
@supports not (backdrop-filter: blur(1px)) {
  header.site { background: var(--nav-solid); }
}
.brand {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
/* The same leaf the marketing site uses, so the two ends of the product are
   recognisably one thing. It is a background image rather than an inline SVG
   because this header appears on ten pages and the sprite would have to be
   copied into every one of them. */
.brand::before {
  content: "";
  width: 24px;
  height: 24px;
  margin-right: 9px;
  flex: none;
  background: url('/leaf.svg') center / contain no-repeat;
}
.brand span { color: var(--brand); }

main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 0 64px;
}

/* ── card ───────────────────────────────────────────────────────────── */
/* Glass, not paper. On a warm ground a white card is the brightest thing on
   the screen, which is fine for one card and wrong for a page of them; at 62%
   white with a real blur behind it, the ground shows through and the surface
   reads as part of the page. The fallback for engines without
   backdrop-filter is 90% white, which keeps the same contrast.
   Measured on the composite: ink 15.7:1, soft 9.2:1, muted 6.1:1. */
.card {
  background: rgba(52, 31, 39, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 70px -30px rgba(0, 0, 0, 0.75),
    0 2px 10px rgba(0, 0, 0, 0.30);
  padding: 34px 32px;
  width: 100%;
  max-width: 440px;
}
@supports not (backdrop-filter: blur(1px)) {
  .card { background: rgba(52, 31, 39, 0.9); }
}
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-text);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brand);
  display: inline-block;
}
.card h1 { font-size: 1.85rem; margin: 14px 0 6px; }
.sub { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 22px; }

/* ── forms ──────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.field .hint { font-size: 0.75rem; color: var(--ink-muted); margin-top: 4px; }

.btn-primary {
  background: var(--brand-deep);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  padding: 14px 28px;
  font-size: 0.96rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  /* No transition here on purpose: .btn-primary is in the transition set down in
     the interaction layer, and a second declaration would be a second truth. It
     read `background 0.15s` — one of the seven timings that layer replaced. */
}
.btn-primary:hover:not(:disabled) { background: var(--brand); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-block { width: 100%; text-align: center; margin-top: 6px; }
.btn-quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ── messages ───────────────────────────────────────────────────────── */
.msg {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: rgba(140, 47, 47, 0.26); border: 1px solid rgba(255, 138, 138, 0.36); color: #FFC9C9; }
.msg.ok { background: var(--brand-glow); border: 1px solid var(--brand-pale); color: var(--brand-text); }

.foot { margin-top: 20px; font-size: 0.85rem; color: var(--ink-muted); text-align: center; }
.privacy-line { margin-top: 14px; font-size: 0.78rem; color: var(--ink-muted); text-align: center; }

/* ══════════════════════════════════════════════════════════════════════════
   The auth split — sign in, create account.
   ══════════════════════════════════════════════════════════════════════════
   A centred card on an empty page is a form that has been put on a page. The
   split gives the left half one job — say what the product is, once — and
   leaves the right half to the form, which is the only thing anyone came here
   to do. Below 900px the left half is dropped rather than stacked: on a phone
   it would push the first field below the fold, and the person signing in has
   already been sold. */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  flex: 1;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 64px 56px;
  background:
    radial-gradient(120% 90% at 18% 0%, #4E1421 0%, #1D1014 70%),
    var(--night, #1D1014);
  color: #FFF7F6;
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -16%;
  bottom: -24%;
  width: 54%;
  aspect-ratio: 1;
  background: url('/leaf.svg') center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
}
.auth-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 244, 242, 0.62);
  margin: 0;
}
.auth-quote {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14ch;
}
.auth-quote em { display: block; font-style: normal; color: #FF5A66; }
.auth-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(255, 244, 242, 0.5);
  margin: 0;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 64px;
  /* The bloom the glass card needs on this side. It is the red of the panel
     opposite spilling around the corner, not a new colour. */
  background:
    radial-gradient(560px 420px at 56% 40%, rgba(200, 16, 46, 0.16) 0%, rgba(200, 16, 46, 0) 66%),
    radial-gradient(520px 380px at 96% 6%, rgba(200, 16, 46, 0.10) 0%, rgba(200, 16, 46, 0) 60%),
    radial-gradient(560px 420px at 4% 98%, rgba(194, 65, 12, 0.07) 0%, rgba(194, 65, 12, 0) 60%);
  background-repeat: no-repeat;
}
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-main { padding: 24px 16px 48px; }
}

/* ── signed-in / anonymous code ─────────────────────────────────────── */
/* A button styled as a link: same tap target, none of the visual weight.
   Sign out should not compete with starting a check-in. */
/* Caps Lock. Amber rather than red: it is a helpful nudge, not a failure,
   and it appears while somebody is mid-type. */
.caps-warn {
  margin-top: 6px; font-size: 0.82rem; color: var(--amber);
  display: flex; align-items: center; gap: 6px;
}
/* The script shows and hides this with the `hidden` attribute. A class rule
   setting `display` beats the browser's [hidden] { display: none }, so the
   warning appeared once and then never went away — it kept saying Caps Lock
   was on after it was switched off, on blur, and after signing in. */
.caps-warn[hidden] { display: none; }
.caps-warn::before { content: "\21EA"; font-size: 0.95em; }

.linklike {
  background: none; border: none; padding: 12px 4px; margin: 0;
  font: inherit; color: var(--brand-text); text-decoration: underline;
  cursor: pointer; min-height: 44px;
}
.linklike:hover { color: var(--brand-text); }

.anon-code-box {
  background: var(--brand-glow);
  border: 1px dashed var(--brand);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin: 16px 0;
}
.anon-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--brand-text);
  word-break: break-all;
  user-select: all;
}
.meta { font-size: 0.85rem; color: var(--ink-soft); }
.meta strong { color: var(--ink); font-weight: 600; }

.hidden { display: none !important; }

/* ── mobile ─────────────────────────────────────────────────────────────
   Checked against a 320px-wide screen — the narrowest phone still in use. */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }

  .crisis-bar { font-size: 0.76rem; line-height: 1.45; padding: 8px 14px; }

  /* The bar is solid on a phone. Two reasons, one of them the report that
     started this: on the operator page the rows of a table scrolled under the
     wordmark and were legible through it. The other is cost — a 12px backdrop
     blur repainting under a sticky bar is the most expensive thing on a page
     that is already scrolling, and at 92% there is almost nothing left for it
     to blur. On a phone the bar is chrome, and chrome does not need to be
     transparent. */
  header.site {
    padding: 16px 0;
    background: var(--nav-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .brand { font-size: 1.2rem; }

  main { padding: 18px 0 44px; }

  .card { padding: 22px 18px; border-radius: var(--radius-md); }
  .card h1 { font-size: 1.5rem; }
  .sub { font-size: 0.9rem; margin-bottom: 18px; }

  .btn-primary { padding: 13px 20px; }
  .btn-quiet { padding: 10px 16px; }

  /* 16px is deliberate: iOS Safari zooms the whole page when a smaller input
     receives focus, which then breaks the layout — and it does not zoom back out,
     so the page stays wrong until it is reloaded.

     This used to be `.field input, textarea`, which missed any text field not
     wrapped in a .field — the promo code box on the check-in page was exactly
     that, and so is anything added later. It is by input TYPE now, so a new field
     is covered by existing rather than by somebody remembering this comment. */
  .field input,
  textarea,
  select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  input[type="time"] { font-size: 16px; }

  .anon-code-box { padding: 14px 12px; }
  .anon-code { font-size: 0.82rem; letter-spacing: 0.03em; }

  .foot, .privacy-line { font-size: 0.8rem; }
}

@media (max-width: 380px) {
  .card { padding: 18px 14px; }
  .card h1 { font-size: 1.35rem; }
  .eyebrow { font-size: 0.68rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   The interaction layer.
   ══════════════════════════════════════════════════════════════════════════
   Everything here is one of two things: making the interface answer when it is
   touched, and making sure it can be used without a mouse.

   The focus ring is the load-bearing part. Before this there was exactly ONE
   :focus-visible rule in the whole app, on the dashboard tiles — so somebody
   navigating by keyboard could tab from the top of a page to the bottom with
   nothing on screen telling them where they were. That is not a style gap, it is
   a defect, and it is invisible to anyone using a mouse.

   The rule uses `outline`, not `box-shadow`, on purpose: outline follows
   border-radius in every current browser, it is drawn outside the box so it
   cannot be clipped by an overflow container, and it costs no layout.          */

:where(a, button, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Inputs already have a border to sit against, so the ring hugs them. */
:where(input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* On the dark buttons the tide colour would be a ring on near-black. Use the
   pale end instead, and keep the offset so it reads as a ring and not a border. */
.btn-primary:focus-visible,
.btn-danger:focus-visible,
.header-signin:focus-visible {
  outline-color: var(--brand-pale);
}

/* Nothing that moves here is load-bearing: every transition below is decoration,
   and every one of them is off for somebody who asked for that. This is not a
   courtesy — vestibular disorders are real and a page that ignores the setting is
   a page some people cannot use. */
.btn-primary,
.btn-quiet,
.btn-danger,
.header-signin,
.linklike,
.tile,
.summary,
.row-del,
.side-toggle,
.sandbox-toggle,
.tab-toggle,
.circle-link,
.hero-card,
.disclosure > summary {
  transition: background-color var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}

/* A press should be felt. One pixel and a hair of scale — enough that a thumb
   gets an answer, small enough that nothing visibly moves. */
.btn-primary:active:not(:disabled),
.btn-quiet:active:not(:disabled),
.btn-danger:active:not(:disabled),
.header-signin:active,
.row-del:active,
.linklike:active {
  transform: translateY(1px) scale(0.995);
}

button:disabled,
.btn-primary:disabled,
.btn-quiet:disabled {
  transform: none;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* The blanket rule above is deliberately blunt: it is far easier to prove that
     nothing animates than to audit every element for one that was missed. */
}

/* ── the crisis line, at phone width ───────────────────────────────────────
   On a 390px screen the full sentence wrapped to four lines and pushed the
   headline most of a screen down; the first thing a visitor met was an
   emergency notice, which is not what this site is. The number still leads —
   it is the first two words now — and the sentence is still there on any
   screen wide enough to hold it. */
.crisis-bar .crisis-short { display: none; }
@media (max-width: 640px) {
  .crisis-bar {
    font-size: 0.76rem;
    line-height: 1.4;
    padding: 7px 16px;
  }
  .crisis-bar .crisis-long { display: none; }
  .crisis-bar .crisis-short { display: block; }
  /* A real target for the number, without growing the bar around it. */
  .crisis-bar a {
    display: inline-flex;
    align-items: center;
    /* 40, not 32: this is the smallest target on the phone and the one that
       matters most. The negative margin keeps the bar the same height. */
    min-height: 40px;
    margin: -10px 0;
    padding: 0 6px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Text inside every field.
   ══════════════════════════════════════════════════════════════════════════
   Form controls do not inherit colour. The app set a colour on inputs in one
   place only — `.field input` — so every other field rendered in the browser's
   default black: the chat composer, the note box, the promo code, the admin
   key. On a dark page that is black text on a dark field, which is to say no
   text at all. It is set once, by element, so the next field is covered by the
   file rather than by somebody remembering. */
input,
textarea,
select {
  color: var(--ink);
  caret-color: var(--brand-text);
  font-family: inherit;
}
input::placeholder,
textarea::placeholder { color: rgba(255, 244, 242, 0.55); }
select option { background: #2A161E; color: var(--ink); }
