/* Conversations with Professor George. Plain CSS, no external resources.

   Colours, type and the brand icon follow the KLI style guide of 21 November 2025:
   - Deep Blue #293069 and Teal #0ACBAD are the primary colours; Blue #174DCB and Light Blue #0AD7E3 the secondary
     ones; White is #FAFAFA and Black #0D1024. Text and marks use these and the guide's tints. A few surfaces are
     in-between shades the guide does not list (a pale Deep Blue panel, pure white fields, and in the dark scheme
     three steps between Black and Deep Blue); each is marked below.
   - Text pairings are the ones the guide allows: Deep Blue, Blue or Black on White; White or Teal 80 on Deep Blue;
     White on Blue; Deep Blue or Black on Teal; White, Teal 80 or Light Blue on Black. Never Light Blue on White,
     Blue on Deep Blue or Black on Deep Blue. Teal on White is kept for shapes and marks, not for small text, which
     it cannot carry; where a mark has to be seen against White it is Deep Blue.
   - Headlines: Cormorant Infant Bold. Buttons and labels: Roboto Condensed Medium; the small capital labels are
     Bold, as in the guide's own page labels. Body copy: Roboto Condensed Light. Page headlines are 36 px and body
     copy 16 px and up; headings inside panels are smaller.
   - The red of error messages is not a brand colour; the guide has none for errors. */

@font-face {
  font-family: "Cormorant Infant"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/cormorant-infant-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Infant"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/cormorant-infant-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto Condensed"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/roboto-condensed-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto Condensed"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/roboto-condensed-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --deep-blue: #293069;
  --teal: #0ACBAD;
  --teal-80: #3BD6BD;
  --blue: #174DCB;
  --white: #FAFAFA;
  --black: #0D1024;

  --paper: #FAFAFA;
  --surface: #F3F4F9;             /* not in the guide: Deep Blue at a low tint on White */
  --raised: #FFFFFF;              /* not in the guide: pure white, for fields */
  --ink: #0D1024;                 /* Black on White */
  --ink-soft: #293069;            /* Deep Blue on White */
  --heading: #293069;
  --muted: #545987;               /* Deep Blue 80 % */
  --rule: #D4D6E1;                /* Deep Blue 20 % */
  --rule-strong: #7F83A5;         /* Deep Blue 60 % */
  --button: #293069;              /* White on Deep Blue */
  --button-ink: #FAFAFA;
  --button-hover: #174DCB;        /* White on Blue */
  --accent-text: #174DCB;         /* Blue on White, for small coloured text */
  --highlight: #0ACBAD;           /* Teal: marks, selected answers */
  --highlight-ink: #293069;       /* Deep Blue on Teal */
  --highlight-soft: #CEF5EF;      /* Teal 20 % */
  --mark: #293069;
  --focus: #174DCB;
  --danger: #A3271B;
  --danger-soft: #FBEAE7;
  --torch: url("/static/torch.svg");
  --wash: linear-gradient(100deg, #CEF5EF 0%, #FAFAFA 33%, #D1DBF5 66%, #CEF7F9 100%);   /* the guide's light gradient */
  --shadow: 0 1px 2px rgba(41, 48, 105, 0.06), 0 10px 28px rgba(41, 48, 105, 0.10);
  --serif: "Cormorant Infant", "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Roboto Condensed", Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --top: 3.75rem;
  --side: 20rem;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1024;             /* Black */
    --surface: #161A3D;           /* these two and --rule: not in the guide, steps between Black and Deep Blue */
    --raised: #1F2552;
    --ink: #FAFAFA;               /* White on Black */
    --ink-soft: #D4D6E1;
    --heading: #FAFAFA;
    --muted: #A9ACC3;             /* Deep Blue 40 % */
    --rule: #2F3672;
    --rule-strong: #7F83A5;
    --button: #0ACBAD;            /* Black on Teal */
    --button-ink: #0D1024;
    --button-hover: #3BD6BD;
    --accent-text: #3BD6BD;       /* Teal 80 on Black */
    --highlight: #0ACBAD;
    --highlight-ink: #0D1024;
    --highlight-soft: rgba(10, 203, 173, 0.16);
    --mark: #3BD6BD;
    --focus: #3BD6BD;
    --danger: #F2A99F;
    --danger-soft: #3A1D22;
    --torch: url("/static/torch-white.svg");
    --wash: linear-gradient(165deg, #293069 0%, #293069 30%, #174DCB 78%, #0ACBAD 135%);   /* after the guide's dark backgrounds: Deep Blue into Blue, a little Teal */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 1rem); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;               /* body copy: Roboto Condensed Light */
  line-height: 1.5;
}
strong, b { font-weight: 600; }

h1, h2, h3, p, ul, ol, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.noscript { max-width: 32rem; margin: 4rem auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 50; padding: 0.5rem 0.875rem;
  background: var(--white); color: var(--deep-blue); border-radius: var(--radius); text-decoration: none; font-weight: 500;
  --focus: #3BD6BD;               /* it appears on the Deep Blue bar: White box, Teal 80 ring */
}
.skip:focus { top: 0.5rem; }

/* ---- Buttons and fields ---- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.5rem 1.125rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 500; font-size: 1rem; line-height: 1.2; letter-spacing: 0.02em; text-align: center;
  cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button.primary { background: var(--button); color: var(--button-ink); }
.button.primary:hover { background: var(--button-hover); }
.button.quiet { background: transparent; color: var(--ink-soft); border-color: var(--rule-strong); font-weight: 500; }
.button.quiet:hover { background: var(--surface); border-color: var(--ink-soft); }
.button.small { min-height: 2.25rem; padding: 0.375rem 0.75rem; font-size: 0.9375rem; }
.button.wide { width: 100%; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button.primary:disabled { opacity: 1; background: var(--muted); color: var(--paper); }

input[type="text"], input[type="email"], textarea {
  width: 100%; padding: 0.625rem 0.75rem;
  background: var(--raised); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-size: 1rem; line-height: 1.5;
}
textarea { resize: vertical; min-height: 2.875rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }

label, legend { font-weight: 500; font-size: 1rem; color: var(--heading); }
.optional { font-weight: 400; color: var(--muted); font-size: 0.9375rem; margin-left: 0.25rem; }
.error { color: var(--danger); font-size: 1rem; font-weight: 400; }

/* ---- Sign-in ---- */

.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--wash); }
.signin-card {
  width: 100%; max-width: 30rem; padding: 2.5rem 2.25rem;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 12px; box-shadow: var(--shadow);
}
.signin-card::before {
  content: ""; display: block; width: 1.75rem; height: 3.5rem; margin-bottom: 1.5rem;
  background: var(--torch) left center / contain no-repeat;
}
.eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.signin h1 { font-family: var(--serif); font-weight: 700; font-size: 2.25rem; line-height: 1.12; margin-top: 0.5rem; color: var(--heading); }
.lead { margin-top: 1rem; color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.55; }
.signin form { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: grid; gap: 0.5rem; }
.signin input { font-weight: 500; font-size: 1.125rem; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; text-transform: uppercase; min-height: 3rem; }
.signin input::placeholder { letter-spacing: 0.1em; font-weight: 400; }
.field-help { color: var(--muted); font-size: 0.9375rem; font-weight: 400; }
.signin .button { margin-top: 0.75rem; min-height: 3rem; }

/* ---- App frame ---- */

.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: var(--top) auto; min-height: 100vh; min-height: 100dvh; }

.top {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem; height: var(--top); padding: 0 1.25rem;
  background: var(--deep-blue); color: var(--white);
  /* inside the bar: White and Teal 80 on Deep Blue, in both colour schemes */
  --ink: #FAFAFA; --ink-soft: #FAFAFA; --muted: #D4D6E1; --rule-strong: rgba(250, 250, 250, 0.55); --surface: rgba(250, 250, 250, 0.12);
  --focus: #3BD6BD;
}
.brand {
  flex: 1; min-width: 0; padding-left: 1.375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--serif); font-weight: 700; font-size: 1.375rem; line-height: 2rem;
  background: url("/static/torch-white.svg") left center / auto 1.75rem no-repeat;
}
.tag {
  display: inline-block; margin-left: 0.5rem; padding: 0.125rem 0.5rem; vertical-align: 0.1em;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.4;
  color: var(--teal-80); border: 1px solid var(--teal-80); border-radius: 999px;
}
/* The users' page: the name, a thin rule, and the line that says what this is. One line in the bar, whatever the
   width: the line is set smaller than the name, and on the narrowest screens only the name is left. */
.brand-sep { display: inline-block; width: 1px; height: 1.05em; margin: 0 0.625rem 0 0.375rem; vertical-align: -0.14em; background: currentColor; opacity: 0.45; }
.brand-line { font-family: var(--sans); font-weight: 400; font-size: 0.9375rem; letter-spacing: 0.01em; color: var(--muted); }
.signin h1 .brand-sep { display: none; }
.signin h1 .brand-line { display: block; margin-top: 0.375rem; font-size: 1.0625rem; font-weight: 500; line-height: 1.35; color: var(--ink-soft); }
.top .button { min-height: 2.25rem; padding: 0.375rem 0.75rem; font-size: 0.9375rem; white-space: nowrap; }
.top .button.quiet:hover { border-color: var(--white); }
.menu-button { display: none; }
.help-short { display: none; }

.side {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top));
  overflow-y: auto; overflow-x: hidden; background: var(--surface); border-right: 1px solid var(--rule);
}
.side-inner { display: flex; flex-direction: column; gap: 1.75rem; min-height: 100%; padding: 1.25rem 1rem 1rem; }
.side-heading { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--heading); margin-bottom: 0.5rem; padding: 0 0.5rem; }
.side-note { font-size: 0.9375rem; font-weight: 400; color: var(--muted); padding: 0 0.5rem; }

.conversation-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.conversation-list button {
  display: block; width: 100%; padding: 0.5rem; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
}
.conversation-list button:hover { background: var(--paper); }
.conversation-list button[aria-current="true"] { background: var(--paper); border-left-color: var(--mark); }
.conversation-list button[aria-current="true"] .conversation-title { font-weight: 500; color: var(--heading); }
.conversation-title { display: block; font-size: 1rem; font-weight: 400; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: block; font-size: 0.875rem; font-weight: 400; color: var(--muted); margin-top: 0.125rem; }

.areas { display: grid; gap: 2px; margin-top: 0.5rem; }
.area summary {
  display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.375rem 0.5rem;
  cursor: pointer; border-radius: var(--radius); font-size: 1rem; font-weight: 400; color: var(--ink-soft); list-style: none;
}
.area summary::-webkit-details-marker { display: none; }
.area summary:hover { background: var(--paper); }
.area summary::after {
  content: ""; width: 0.4375rem; height: 0.4375rem; margin-left: auto; margin-right: 0.25rem; flex: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg);
}
.area[open] summary::after { transform: rotate(45deg); }
.area-mark {
  flex: none; display: grid; place-items: center; width: 1.125rem; height: 1.125rem;
  border: 1.5px solid var(--rule-strong); border-radius: 50%; color: var(--highlight-ink);
}
.area-mark svg { width: 0.6875rem; height: 0.6875rem; display: none; }
.area.tried .area-mark { background: var(--highlight); border-color: var(--highlight); }
.area.tried .area-mark svg { display: block; }
.area-body { padding: 0.125rem 0.5rem 0.75rem 2.125rem; display: grid; gap: 0.375rem; }
.area-hint { font-size: 0.875rem; font-weight: 400; color: var(--muted); margin-bottom: 0.125rem; }
.opener {
  display: block; width: 100%; padding: 0.5rem 0.625rem; text-align: left; cursor: pointer;
  background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: 1rem; line-height: 1.4; color: var(--ink-soft);
}
.opener:hover { border-color: var(--button); color: var(--ink); }

.account { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.account .side-note { min-width: 0; overflow-wrap: anywhere; }
.account .button { flex: none; white-space: nowrap; }
.account strong { color: var(--heading); font-weight: 500; }

.backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(13, 16, 36, 0.5); }

/* ---- Conversation ---- */

.main { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - var(--top)); min-height: calc(100dvh - var(--top)); }
.thread { flex: 1; width: 100%; max-width: 45rem; margin: 0 auto; padding: 2.5rem 1.5rem 2rem; }

.welcome { padding: 3rem 0 1rem; max-width: 34rem; }
.welcome h1 { font-family: var(--serif); font-weight: 700; font-size: 2.25rem; line-height: 1.15; color: var(--heading); }
.welcome p { margin-top: 1rem; color: var(--ink-soft); font-size: 1.25rem; line-height: 1.5; }
.welcome .welcome-note { color: var(--muted); font-size: 1rem; font-weight: 400; }
.narrow-only { display: none; }

.thread-status { color: var(--muted); padding: 2rem 0; }

.turns { display: grid; gap: 2.25rem; }
.turn { min-width: 0; scroll-margin-top: calc(var(--top) + 1rem); }
.who { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.375rem; }
.turn-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.turn.user { padding-left: 1rem; border-left: 2px solid var(--highlight); }
.turn.user .turn-text { color: var(--ink-soft); font-size: 1.0625rem; font-weight: 400; line-height: 1.55; }
.turn.user.pending .turn-text { color: var(--muted); }

.turn.george .who { color: var(--accent-text); display: flex; align-items: center; gap: 0.625rem; }
/* His portrait: round, with a thin ring so that its dark background reads on both the light and the dark page. */
.avatar { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 1px var(--rule-strong); }
.avatar.large { display: block; width: 6rem; height: 6rem; margin-bottom: 1.5rem; box-shadow: 0 0 0 1px var(--rule-strong), var(--shadow); }
.thinking-face { position: relative; display: block; width: 2.5rem; height: 2.5rem; }
.thinking-face .pulse { position: absolute; right: -0.125rem; bottom: -0.125rem; box-shadow: 0 0 0 2px var(--paper); }
.turn.george .turn-text { font-size: 1.1875rem; line-height: 1.6; color: var(--ink); max-width: 40rem; }

.turn.safety .safety-box { padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.turn.safety .who { color: var(--ink-soft); }
.turn.safety .turn-text { font-size: 1.0625rem; font-weight: 400; line-height: 1.6; }
.safety-note { margin-top: 0.75rem; padding-top: 0.625rem; border-top: 1px solid var(--rule); font-size: 0.875rem; font-weight: 400; color: var(--muted); }

/* ---- Feedback under a reply ---- */

.feedback { margin-top: 1.125rem; padding: 0.875rem 1rem 0.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.feedback legend { float: left; width: 100%; margin-bottom: 0.5rem; font-size: 1rem; }
.feedback legend + * { clear: both; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice, .chip { position: relative; display: inline-flex; cursor: pointer; font-weight: 400; }
.choice input, .chip input, .rating-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; inset: 0; }
.choice span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 5rem; min-height: 2.75rem; padding: 0.375rem 1rem;
  background: var(--raised); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-size: 1rem; font-weight: 500; color: var(--ink-soft); transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.choice:hover span { border-color: var(--button); }
.choice input:checked + span { background: var(--highlight); border-color: var(--highlight-ink); box-shadow: inset 0 0 0 1px var(--highlight-ink); color: var(--highlight-ink); font-weight: 700; }
.choice input:focus-visible + span, .chip input:focus-visible + span, .rating-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.more { margin-top: 1rem; padding-top: 0.875rem; border-top: 1px solid var(--rule); display: grid; gap: 0.875rem; }
.more label { display: block; margin-bottom: 0.25rem; }
.more .chip { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip span {
  display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0.25rem 0.75rem;
  background: var(--raised); border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 0.9375rem; font-weight: 400; color: var(--ink-soft);
  transition: background-color 120ms ease, border-color 120ms ease;
}
.chip:hover span { border-color: var(--button); }
.chip input:checked + span { background: var(--highlight-soft); border-color: var(--mark); font-weight: 500; }
.chip input:checked + span::before {
  content: ""; width: 0.3125rem; height: 0.5625rem; margin: -0.125rem 0.125rem 0 0.125rem;
  border-right: 2px solid var(--mark); border-bottom: 2px solid var(--mark); transform: rotate(45deg);
}
.feedback textarea { font-size: 1rem; font-weight: 400; }
.feedback textarea.suggested { font-size: 1.0625rem; }
.save-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.625rem; }
.save-status { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.save-status.saved { color: var(--accent-text); font-weight: 600; }
.save-status.failed { color: var(--danger); font-weight: 600; }
.save-retry { background: none; border: 0; padding: 0.25rem; font-size: 0.875rem; font-weight: 600; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* ---- Waiting, errors, finished ---- */

.thinking { margin-top: 2.25rem; display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; align-items: center; color: var(--ink-soft); font-size: 1.125rem; }
.thinking .seconds { font-size: 0.875rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 0.375rem; }
.thinking-slow { grid-column: 2; margin-top: 0.25rem; font-size: 0.9375rem; font-weight: 400; color: var(--muted); }
.pulse { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--highlight); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

.notice { margin-top: 1.5rem; padding: 0.875rem 1rem; background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius); color: var(--ink); font-weight: 400; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* What the person takes away from the conversation (users' page): one quiet line and small choices at the end of
   the conversation, from the third reply. No box: it must not compete with the conversation. */
.takeaway { margin-top: 1.75rem; color: var(--muted); font-size: 0.875rem; }
.takeaway[hidden] { display: none; }
.takeaway-toggle { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; margin: -0.5rem 0; padding: 0; background: none; border: 0; font: inherit; font-size: 0.875rem; color: var(--muted); text-align: left; cursor: pointer; }
.takeaway-toggle::after { content: ""; flex: none; width: 0.375rem; height: 0.375rem; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-0.125rem) rotate(45deg); }
.takeaway-toggle[aria-expanded="true"]::after { transform: translateY(0.0625rem) rotate(-135deg); }
.takeaway-toggle:hover { color: var(--ink-soft); }
.takeaway-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.takeaway-panel { margin-top: 0.5rem; }
.takeaway-panel[hidden] { display: none; }
.takeaway-choices { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.takeaway-choice { min-height: 2.25rem; padding: 0.25rem 0.75rem; background: transparent; border: 1px solid var(--rule-strong); border-radius: var(--radius); font: inherit; font-size: 0.875rem; color: var(--muted); cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.takeaway-choice:hover { border-color: var(--ink-soft); color: var(--ink-soft); }
.takeaway-choice[aria-pressed="true"] { background: var(--surface); border-color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--ink-soft); color: var(--ink); font-weight: 500; }
.takeaway-choice:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* What was chosen, shown when folded (not announced), and the line that says what became of a tap (announced: it
   stays in the page when empty, or a screen reader would not hear it fill). */
.takeaway-said, .takeaway-status { margin-top: 0.25rem; font-size: 0.8125rem; }
.takeaway-said:empty { display: none; }

.finished { margin-top: 2.5rem; padding: 1.25rem 1.25rem 1.375rem; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--highlight); border-radius: var(--radius); }
.finished h2 { font-family: var(--serif); font-weight: 700; font-size: 1.625rem; line-height: 1.2; color: var(--heading); }
.finished p { margin-top: 0.5rem; color: var(--ink-soft); }
.finished .notice-actions { margin-top: 1rem; }

/* ---- Composer ---- */

.composer { position: sticky; bottom: 0; z-index: 10; background: var(--paper); border-top: 1px solid var(--rule); }
.composer-inner { max-width: 45rem; margin: 0 auto; padding: 0.875rem 1.5rem 0.75rem; }
.composer-row { display: flex; gap: 0.625rem; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; resize: none; min-height: 2.875rem; max-height: 12rem; font-size: 1.0625rem; }
.composer .button.primary { min-width: 5rem; min-height: 2.875rem; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.25rem; margin-top: 0.375rem; }
.hint { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.build-note { margin-top: 0.25rem; font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.composer.closed .composer-row, .composer.closed .composer-foot { display: none; }
.composer.closed .build-note { margin-top: 0; }

/* ---- Dialogs ---- */

.dialog {
  width: min(34rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto;
  padding: 1.75rem 1.75rem 1.5rem; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 12px; box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(13, 16, 36, 0.55); }
.dialog h2 { font-family: var(--serif); font-weight: 700; font-size: 1.75rem; line-height: 1.2; color: var(--heading); }
.tips { margin-top: 1.125rem; display: grid; gap: 0.875rem; counter-reset: tip; }
.tips li { position: relative; padding-left: 2.25rem; color: var(--ink-soft); line-height: 1.55; counter-increment: tip; }
.tips li::before {
  content: counter(tip); position: absolute; left: 0; top: 0.0625rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--highlight); font-size: 0.875rem; font-weight: 700; color: var(--highlight-ink);
}
.tips strong { color: var(--heading); font-weight: 500; }
.dialog-note { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.9375rem; font-weight: 400; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

.rating { margin-top: 1.125rem; }
.rating legend { margin-bottom: 0.625rem; line-height: 1.4; }
.rating-options { display: grid; gap: 0.375rem; }
.rating-option { position: relative; display: block; cursor: pointer; font-weight: 400; }
.rating-option span {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.375rem 0.875rem;
  background: var(--raised); border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: 1rem; font-weight: 400; color: var(--ink-soft);
}
.rating-option b { flex: none; display: grid; place-items: center; width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 1px solid var(--rule-strong); font-size: 0.875rem; font-weight: 500; }
.rating-option:hover span { border-color: var(--button); }
.rating-option input:checked + span { background: var(--highlight-soft); border-color: var(--mark); font-weight: 500; }
.rating-option input:checked + span b { background: var(--highlight); border-color: var(--highlight); color: var(--highlight-ink); font-weight: 700; }
#finish-form > label { display: block; margin: 1.25rem 0 0.375rem; }
#finish-form .error { margin-top: 0.75rem; }

/* ---- Narrow screens ---- */

@media (max-width: 60rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: inline-flex; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(21rem, 88vw); height: auto;
    border-right: 1px solid var(--rule); box-shadow: var(--shadow);
    transform: translateX(-102%); visibility: hidden; transition: transform 180ms ease, visibility 0s linear 180ms;
  }
  .side.open { transform: none; visibility: visible; transition: transform 180ms ease; }
  .thread { padding: 1.75rem 1.25rem 1.5rem; }
  .composer-inner { padding: 0.75rem 1.25rem 0.625rem; }
  .composer-foot { min-height: 0; }
  .composer-foot .button { margin-left: auto; }
  .welcome { padding-top: 1.5rem; }
}

@media (max-width: 40rem) {
  .top { padding: 0 0.75rem; gap: 0.5rem; }
  .brand { font-size: 1.125rem; padding-left: 1.125rem; background-size: auto 1.375rem; }
  .brand .tag { display: none; }
  .brand-sep { margin: 0 0.5rem 0 0.25rem; }
  .brand-line { font-size: 0.8125rem; }
  .signin h1 .brand-line { font-size: 1rem; }
  .help-long { display: none; }
  .help-short { display: inline; }
  .thread { padding: 1.5rem 1rem 1.25rem; }
  .composer-inner { padding: 0.625rem 1rem 0.5rem; }
  .turn.george .turn-text { font-size: 1.125rem; line-height: 1.6; }
  .welcome h1, .signin h1 { font-size: 1.75rem; }
  .welcome p { font-size: 1.125rem; }
  .signin-card { padding: 1.75rem 1.25rem; }
  .feedback { padding: 0.75rem 0.75rem 0.625rem; }
  .choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice span { width: 100%; min-width: 0; padding: 0.375rem 0.25rem; }
  .dialog { padding: 1.25rem 1.125rem 1.125rem; }
  .build-note { font-size: 0.8125rem; }
}

@media (max-width: 25rem) {
  .brand .brand-line { font-size: 0.75rem; }      /* "Geo AI" and the line side by side on a 375 px phone */
}

@media (max-width: 23.1875rem) {      /* under 372 px the line no longer fits beside the menu button */
  .brand .brand-sep, .brand .brand-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .pulse { opacity: 0.8; }
}

/* the beginning of a reply, shown while the rest is written (beta edition) */
.early-note { margin-top: 0.5rem; font-size: 0.9375rem; font-weight: 400; color: var(--muted); }

/* sign-in by e-mail (beta edition): the address, then the eight-digit code */
.signin input[type="email"], .signin #door-name, .signin #door-word { text-transform: none; letter-spacing: 0; font-variant-numeric: normal; }
#door-word-box, #door-email-box { display: grid; gap: 0.5rem; }
#door-word-box[hidden], #door-email-box[hidden] { display: none; }
/* new here / here before: two choices side by side, the chosen one filled */
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1.75rem; }
.mode[hidden] { display: none; }
.mode-choice { min-height: 2.75rem; padding: 0.5rem 0.5rem; font: inherit; font-weight: 500; font-size: 1rem; line-height: 1.2; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer; }
.mode-choice:hover { background: var(--surface); }
.mode-choice[aria-pressed="true"] { background: var(--surface); border-color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--ink-soft); color: var(--ink); }
.mode + form, .mode ~ form { margin-top: 1.25rem; }
/* inside: the e-mail address that opens these conversations again */
.keep { margin: 0 0 1.5rem; padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); display: grid; gap: 0.625rem; }
.keep[hidden] { display: none; }
.keep-heading { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--heading); margin: 0; }
.keep-text { font-size: 1rem; color: var(--ink-soft); margin: 0; overflow-wrap: anywhere; }
.keep-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.keep-form[hidden], .keep-links[hidden] { display: none; }
.keep-form input { flex: 1 1 12rem; min-width: 0; min-height: 2.75rem; }
.keep #keep-code { font-size: 1.25rem; font-weight: 500; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.keep-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.signin input[type="email"]::placeholder { letter-spacing: 0; }
.signin #otp { text-align: center; font-size: 1.625rem; letter-spacing: 0.25em; padding-left: 0.25em; min-height: 3.5rem; }
.signin #otp::placeholder { letter-spacing: 0.25em; opacity: 0.35; }
.otp-lead { font-weight: 400; overflow-wrap: anywhere; }
.class-box { margin-top: 0.5rem; }
.class-box summary { cursor: pointer; color: var(--accent-text); font-weight: 500; padding: 0.375rem 0; }
.class-box[open] summary { margin-bottom: 0.5rem; }
.class-box label { display: block; margin-bottom: 0.5rem; }
.invited { margin-top: 0.75rem; }
.text-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); text-decoration: underline; cursor: pointer; }
.signin-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; justify-content: space-between; }
.signin .link-button { min-height: 2.75rem; margin-top: 0.25rem; justify-self: start; }
.account .button + .button { margin-top: 0.5rem; }
/* Two buttons (the users' page): the line "Signed in as" gets a row of its own, the buttons sit under it. Beside
   two buttons it was left 16 px and stood one letter to a line. */
.account:has(.button + .button) { flex-wrap: wrap; justify-content: flex-start; }
.account:has(.button + .button) .side-note, .account:has(.button + .button) .error { flex: 1 1 100%; }
.account:has(.button + .button) .button + .button { margin-top: 0; }

/* ---- The privacy policy ---- */
/* KLI's text is a part of the page (beta.html, #privacy). The page script shows it alone when the address ends in
   #privacy: the rest of the page keeps its place and its fields, but is neither seen, read out nor reached by Tab. */

.policy-link { text-align: center; font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.policy-link a { display: inline-block; padding: 0.375rem 0.5rem; color: inherit; text-decoration: underline; text-underline-offset: 0.15em; border-radius: 4px; }
.policy-link a:hover { color: var(--ink-soft); }
.signin .policy-link { margin-top: 1.25rem; }
.side .policy-link { margin-top: -1.25rem; text-align: left; }
.side .policy-link a { padding-left: 0.5rem; }

html.policy-open body > :not(.policy) { visibility: hidden; }
html.policy-open .side.open { visibility: hidden; }       /* the open menu on a phone says "visible" for itself */
html.policy-open { overflow: hidden; }            /* one scroll bar: the policy's; the page behind keeps its place */
.policy {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink);
}
.policy-bar { max-width: 44rem; margin: 0 auto; padding: 0.5rem 1.25rem; }
.policy > .policy-bar:first-child {
  position: sticky; top: 0; z-index: 1; max-width: none; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.policy > .policy-bar:last-child { padding-bottom: 3rem; }
.policy-back {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.5rem; margin-left: -0.5rem;
  color: var(--ink-soft); font-size: 1rem; font-weight: 500; text-decoration: none; border-radius: var(--radius);
}
.policy-back::before {
  content: ""; width: 0.5rem; height: 0.5rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.policy-back:hover { background: var(--surface); }
.policy-inner { max-width: 44rem; margin: 0 auto; padding: 2rem 1.25rem 1.5rem; overflow-wrap: break-word; }
.policy h1 { font-family: var(--serif); font-weight: 700; font-size: 2.25rem; line-height: 1.15; color: var(--heading); }
.policy h1:focus, .policy h2:focus { outline: none; }
.policy-sub { margin-top: 0.375rem; font-size: 1.0625rem; font-weight: 500; color: var(--ink-soft); }
.policy-date { margin-top: 0.75rem; font-size: 0.9375rem; font-weight: 400; color: var(--muted); }
.policy h2 {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); scroll-margin-top: 4rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.625rem; line-height: 1.2; color: var(--heading);
}
.policy h3 { margin-top: 1.75rem; font-size: 1.125rem; font-weight: 600; line-height: 1.35; color: var(--heading); }
.policy-inner > p, .policy-inner > ul > li { font-size: 1.0625rem; font-weight: 400; line-height: 1.6; }
.policy-inner > p { margin-top: 0.875rem; }
.policy-inner > ul { margin-top: 0.875rem; padding-left: 1.25rem; list-style: disc; }
.policy-inner > ul > li { margin-top: 0.375rem; padding-left: 0.25rem; }
.policy-inner > ul > li::marker { color: var(--rule-strong); }
.policy-inner > .policy-sub { margin-top: 0.375rem; }
.policy-inner > .policy-date { margin-top: 0.75rem; font-size: 0.9375rem; }
.policy-address { padding: 0.875rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.policy-inner a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 0.15em; }
.policy-contents { margin-top: 1.75rem; padding: 1rem 1.25rem 1.125rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.policy .policy-contents h2 {
  margin: 0; padding: 0; border: 0; font-family: var(--sans); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--heading);
}
.policy-contents ol { margin-top: 0.5rem; columns: 2; column-gap: 2rem; }
.policy-contents li { break-inside: avoid; }
.policy-contents a { display: block; padding: 0.3125rem 0; font-size: 1rem; font-weight: 400; line-height: 1.35; text-decoration: none; }
.policy-contents a:hover { text-decoration: underline; }

@media (max-width: 40rem) {
  .policy-inner { padding-top: 1.5rem; }
  .policy h1 { font-size: 1.875rem; }
  .policy h2 { font-size: 1.4375rem; }
  .policy-contents ol { columns: 1; }
  .policy-contents a { padding: 0.5rem 0; }
}

@media print {
  html.policy-open body > :not(.policy) { display: none; }
  html.policy-open .policy { position: static; overflow: visible; }
  html.policy-open .policy-bar, html.policy-open .policy-contents { display: none; }
  html.policy-open .policy h2 { break-after: avoid; }
}
