/* The base sheet: the tokens, the fonts, the reset, and the classes the
   server's own pages use (D12). The frontend's own vocabulary is in
   frontend/src/app.css, and a class one component uses is in that
   component's scoped style. Separation is by plane, never by a border: the
   only rings are focus and a danger ring on an input that can't be used.
   Colour literals live in :root and nowhere else. */

/* The design handover of 9 November 2026 sets every screen in two faces:
   TT Hoves for everything a person reads and presses, Exposure for figures
   and names, in italic for the opening's promise. Mono is the system's.
   Only the weights the roles use are here. */
@font-face {
  font-family: "TT Hoves";
  src: url("/fonts/tthoves-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves";
  src: url("/fonts/tthoves-demibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Exposure";
  src: url("/fonts/exposure-roman.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Exposure";
  src: url("/fonts/exposure-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Dark mode is a desert at night (19 Nov 2026): one warm palette from
     the ground to the glass, the sand's after dark, plain as paper is in
     light mode. Fine is blue, as in light mode; the windows keep their
     warm light. */
  /* The background (frontend/src/lib/ground.js): the ground it paints
     on, the five colour fields that lie over it on the sign-in page, and
     how strongly they paint. Contrast over the brightest field decides the
     opacity. */
  --ground: #110c09;
  --field-1: #7a5c48;
  --field-2: #debf8d;
  --field-3: #a8633f;
  --field-4: #735b6a;
  --field-5: #bf897b;
  --field-opacity: 0.6;

  /* Light glass carries the person's own things: bubbles, the composer,
     inputs. It takes a top highlight and an inner ring. */
  --glass: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.12);
  --glass-on: rgba(255, 255, 255, 0.16);
  --glass-blur: blur(24px) saturate(1.5);
  --glass-hi: rgba(255, 255, 255, 0.18);
  --glass-on-hi: rgba(255, 255, 255, 0.25);
  --glass-ring: rgba(255, 255, 255, 0.08);
  --glass-edge:
    inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-ring);
  /* Dark glass carries what Agave shows: cards, rows, tiles, menus, the
     sign-in panel and the dialog. It is matte: nearly opaque, and its blur
     drains the colour of the ground, so what stands on it holds focus. */
  --glass-dark: oklch(0.185 0.012 50 / 0.84);
  --glass-dark-blur: blur(24px) saturate(0.5);
  --glass-dark-edge: inset 0 0 0 1px oklch(1 0 0 / 0.07);
  --glass-dark-edge-hover: inset 0 0 0 1px oklch(1 0 0 / 0.16);
  /* Deeper glass, quieter edges: what a person said, and the composer they
     said it in (AG7). */
  --glass-deep: rgba(8, 5, 3, 0.55);
  --glass-deep-edge:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  /* The composer. Light mode makes it white and lifts it off the paper. */
  --composer: var(--glass-deep);
  --composer-edge: var(--glass-deep-edge);
  /* Under the glass: a code block, the slot a dragged row leaves behind. */
  --sunk: rgba(0, 0, 0, 0.28);
  /* Code on --sunk (frontend/src/lib/highlight.svelte.ts): keywords,
     strings, names and numbers. Comments take --soft. Each one passes AA
     on a code block in its mode. */
  --code-keyword: oklch(0.8 0.08 250);
  --code-string: oklch(0.86 0.07 85);
  --code-name: oklch(0.84 0.06 300);
  --code-number: oklch(0.84 0.08 55);
  /* The well a recipe's picture stands in, from its top to its foot. */
  --picture-0: rgba(0, 0, 0, 0.16);
  --picture-1: rgba(0, 0, 0, 0.3);
  /* The view, the sheet every page draws on (frontend/src/routes/Shell.svelte):
     a sweep from its top to its foot, a pool of warm light in its top left
     corner, a vignette, a rim lit from above and its shadow. Paper takes
     the design's own values. */
  --view-paper: linear-gradient(
    oklch(0.25 0.013 50) 0%,
    oklch(0.262 0.013 50) 24%,
    oklch(0.27 0.013 50) 33%,
    oklch(0.25 0.013 50) 40%,
    oklch(0.226 0.013 50) 62%,
    oklch(0.2 0.013 50) 100%
  );
  --view-light: rgba(255, 214, 160, 0.05);
  --view-vignette: rgba(8, 5, 3, 0.32);
  --view-rim: linear-gradient(
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.04)
  );
  --view-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.25),
    0 24px 30px rgba(0, 0, 0, 0.35);
  /* A faint rule, and the conversation's divider: its grip, with a ring
     that deepens under the pointer and held. Held never turns blue, since
     blue is what is selected. */
  --divider: rgba(255, 255, 255, 0.1);
  --grip: oklch(0.32 0.012 50);
  --grip-ring: rgba(255, 255, 255, 0.16);
  --grip-ring-hover: rgba(255, 255, 255, 0.32);
  --grip-ring-held: rgba(255, 255, 255, 0.44);
  --grip-shadow: rgba(0, 0, 0, 0.3);
  /* A quiet button: its fill, its ring and its ring under the pointer. */
  --btn-fill: rgba(255, 255, 255, 0.08);
  --btn-edge:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.2);
  --btn-edge-hover:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 1px 2px rgba(0, 0, 0, 0.2);
  /* What the pointer washes over a row or a button, and the inks of a
     placeholder and of an item that cannot be used. */
  --wash: rgba(255, 255, 255, 0.06);
  --placeholder: rgba(255, 255, 255, 0.5);
  --disabled: rgba(255, 255, 255, 0.38);
  /* Frosted glass, for what floats over the map and stays readable over
     it: a search panel, a context menu. */
  --frost: linear-gradient(
    oklch(0.22 0.012 50 / 0.86),
    oklch(0.2 0.012 50 / 0.94)
  );
  --frost-border: rgba(255, 255, 255, 0.12);
  --frost-blur: blur(20px) saturate(1.2);
  --frost-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2),
    0 18px 36px -14px rgba(0, 0, 0, 0.6);

  /* Four inks: titles and what a person presses, running text and the
     agent's words, descriptions, then facts, counts and placeholders. Dark
     mode needs only two of them. */
  --ink: #f5efe7;
  --body: #f5efe7;
  --soft: rgba(255, 255, 255, 0.72);
  --mu: rgba(255, 255, 255, 0.72);
  /* A link's underline, 4px under its text. */
  --link-line: rgba(255, 255, 255, 0.35);
  /* What is selected: a row's fill and its line. */
  --sel-fill: rgba(255, 255, 255, 0.12);
  --sel-line: rgba(255, 255, 255, 0.2);
  /* What a search picked: its name and its tick. */
  --pick: var(--ink);
  /* A tool that is on, in the toolbar as in the sidebar: lit, a tile
     raised off the bar. And the hairline between tools. */
  --lit: #272522;
  --lit-edge: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.4);
  --tool-rule: rgba(255, 255, 255, 0.14);
  /* A panel held off what is behind it: the summary, a tag, a state card.
     Its rim is a 1.5px border, light at the top and faint at the foot. */
  --panel: oklch(0.185 0.012 50 / 0.84);
  --panel-blur: blur(24px) saturate(0.5);
  --panel-rim: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.04)
  );
  --panel-shadow:
    0 4px 10px -4px rgba(0, 0, 0, 0.3), 0 34px 64px -22px rgba(0, 0, 0, 0.5);
  /* A menu stands over the page. */
  --menu-edge: inset 0 0 0 1px oklch(1 0 0 / 0.07);
  /* The well of a segmented control. */
  --seg-well: rgba(255, 255, 255, 0.08);
  /* Ink for the mark on an empty screen: present, and quieter than text. */
  --dim: rgba(255, 255, 255, 0.3);
  --rule: rgba(255, 255, 255, 0.18);
  /* A recipe's tile, as the handover of 11 November draws a thing's icon:
     a cream squircle lit from the top, a hairline round it and a faint
     contact shadow under it, the same in both modes. A logo keeps its own
     colours on it. The initial is ink on it. */
  --tile-top: #fdfcf9;
  --tile-foot: #ece6dc;
  --tile-line: rgba(21, 21, 21, 0.14);
  --tile-shadow: rgba(40, 34, 24, 0.12);
  --tile-ink: #151515;
  /* Agave's reply has no bubble, so its ink carries its own ground (AG7). */
  --reply-shadow: 0 1px 12px rgba(8, 5, 3, 0.6);

  /* The primary is white, and what a person said carries the same white
     held back. Focus is a white outline, never a colour. */
  --on: #ffffff;
  --on-ink: #16100c;
  --you: rgba(255, 255, 255, 0.86);
  --you-ink: #16100c;
  --focus: rgba(255, 255, 255, 0.6);
  /* A computer tile: one square per recipe and the two meters on their
     track, amber at 85%, and the outline of a square for no recipe. */
  --meter: oklch(0.8 0.08 262);
  --meter-high: oklch(0.83 0.13 78);
  --meter-track: rgba(255, 255, 255, 0.08);
  --meter-empty: oklch(0.55 0.02 50);
  /* The list: the canvas's faint ring, a row's hover wash and the level of
     a disk's use. */
  --sheet-ring: rgba(255, 255, 255, 0.06);
  --row-wash: rgba(255, 255, 255, 0.04);
  --level: rgba(255, 255, 255, 0.42);
  /* The cloud and the grain of the design handover's paper. Light mode's
     ground lies under them (frontend/src/lib/ground.css), and so does the
     onboarding. The sheet names the two files, because it is served as it
     is written and no bundler resolves a path in it. */
  --paper-cloud: url("/textures/cloud.webp") 0 0 / 512px 512px repeat;
  --paper-grain: url("/textures/grain-site.png") 0 0 / 180px 180px repeat;
  /* The onboarding (frontend/src/lib/Onboarding.svelte) is the design
     handover's paper screen, and it is paper in both modes, because it is
     one drawing. Every value below is the handover's: the photograph the
     screen stands on, the glass panel over it, the white card a question's
     answers sit in, the blue of what is picked and the red of the step at
     hand. */
  --form-paper: #efe9df;
  --form-photo: url("/textures/onboarding-form.webp");
  --form-ink: #151515;
  --form-ink-2: #5e5d57;
  --form-mu: #6f665e;
  --form-on-ink: #ffffff;
  --form-panel:
    linear-gradient(180deg, rgba(249, 247, 243, 0.8), rgba(249, 247, 243, 0.9))
      padding-box,
    linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.28) 100%) border-box;
  --form-panel-edge:
    0 0 0 1px rgba(21, 21, 21, 0.06), 0 4px 10px -4px rgba(40, 34, 24, 0.18),
    0 44px 90px -34px rgba(30, 24, 16, 0.5);
  --form-card: rgba(255, 255, 255, 0.94);
  --form-card-edge:
    0 0 0 1px rgba(21, 21, 21, 0.08), 0 1px 2px rgba(21, 21, 21, 0.05);
  --form-btn-edge:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 22px -14px rgba(21, 21, 21, 0.6);
  --form-hair: rgba(21, 21, 21, 0.08);
  --form-track: rgba(21, 21, 21, 0.14);
  --form-well-ring: rgba(21, 21, 21, 0.14);
  --form-btn-ring: rgba(21, 21, 21, 0.18);
  --form-underline: rgba(21, 21, 21, 0.35);
  --form-pick: #1e4ab8;
  --form-now: #cc3528;

  /* Corners by what a thing is, in both modes: a button, an icon button or
     a chip, a field or a tag, a panel such as the Map and List switch, a
     row, list, card or the composer, the view, a context menu and a
     search panel. */
  --radius-button: 2px;
  --radius-icon: 3px;
  --radius-field: 4px;
  --radius-panel: 5px;
  --radius: 6px;
  --radius-card: 6px;
  --radius-canvas: 8px;
  --radius-menu: 9px;
  --radius-popover: 10px;

  /* The type scale, in both modes. Each role is one size, weight and
     line; the capital labels add their own tracking. */
  --type-display: 600 21px/1.1 var(--sans);
  --type-message: 500 14px/1.6 var(--sans);
  --type-name: 600 14px/1.15 var(--sans);
  --type-label-strong: 600 13.5px/1.25 var(--sans);
  --type-menu: 500 13px/1 var(--sans);
  --type-value: 500 12.5px/1.35 var(--sans);
  --type-control: 600 12.5px/1 var(--sans);
  --type-small: 500 12px/1.2 var(--sans);
  --type-tag: 500 11.5px/1 var(--sans);
  --type-caps: 500 11px/1 var(--sans);
  --type-layer-tag: 500 10.5px/1 var(--sans);
  --caps-label: 0.1em;
  --caps-group: 0.06em;

  /* The curve a toolbar's panel rises on, fast off the mark and settling
     softly. A page and what steps back under it move on the spring of
     frontend/src/lib/motion.ts. */
  --pace: cubic-bezier(0.32, 0.72, 0, 1);

  /* Rows inside one dark-glass card are split by this, never a border. */
  --hairline: rgba(255, 255, 255, 0.06);
  --glass-well-ring: rgba(255, 255, 255, 0.14);
  /* What the dialog dims. */
  --backdrop: rgba(8, 5, 3, 0.45);
  --backdrop-blur: blur(6px);
  /* What a lifted card casts, and the only drop shadow in Agave. */
  --lift-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  /* Where a press took hold of a drag handle, until the card lifts. */
  --press: rgba(255, 255, 255, 0.28);
  /* What lies under a thing's page: the canvas and the pages under the
     top one, dimmed as they step back, and the page's own edge over
     them. */
  --page-dim: rgba(0, 0, 0, 0.32);
  --page-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);

  /* The status inks Agave writes text in. */
  --ok: #b5cbf3;
  --warn: #f0d9a6;
  --danger: #f3b195;
  /* A pill is an opaque fill and its own ink, so a pill looks the same on
     every glass. The four pairs are soft: the fill sits just above the
     glass, and the ink keeps little colour. */
  --ok-fill: oklch(0.3 0.04 262);
  --ok-fill-ink: oklch(0.9 0.05 262);
  --warn-fill: oklch(0.3 0.03 80);
  --warn-fill-ink: oklch(0.88 0.08 80);
  --danger-fill: oklch(0.29 0.05 25);
  --danger-fill-ink: oklch(0.8 0.12 25);
  --neutral-fill: oklch(0.32 0.012 50);
  --neutral-fill-ink: oklch(0.9 0.012 50);
  /* The square of a red chip. Dark mode draws it in the chip's own ink. */
  --chip-red: currentColor;
  /* The fill of a destructive button. --danger stays the text ink. */
  --danger-on: #e08a6a;
  --danger-on-ink: #1e0d07;
  --fail-ring: rgba(224, 138, 106, 0.45);

  /* A person's own tile, so a face is never read as one more surface. */
  --person: oklch(0.3 0.035 40);
  /* The tints a house picture is drawn in: body, inset, line, roof,
     foliage, glass, the light, a window, the lighthouse beam and the
     tower's cap. Dark mode draws the house at night, with its windows
     lit. */
  --pic-body: oklch(0.34 0.022 50);
  --pic-inset: oklch(0.26 0.018 50);
  --pic-line: oklch(0.52 0.03 50);
  --pic-roof: oklch(0.42 0.06 30);
  --pic-leaf: oklch(0.44 0.035 230);
  --pic-glass: oklch(0.46 0.06 230);
  --pic-led: #a2bef2;
  --pic-window: #f0d9a6;
  --pic-beam: #f0d9a6;
  --pic-cap: #a2bef2;
  --sans: "TT Hoves", "Helvetica Neue", Arial, sans-serif;
  --serif: "Exposure", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, Menlo, monospace;
  /* What a button does under the pointer. Dark mode lifts it toward the
     light it stands in; light mode pulls it toward the middle, so an ink
     button and a paper button both move. */
  --btn-hover: brightness(1.1);
  color-scheme: dark;
}

/* Light mode takes its colours from the design handover of 9 November
   2026. Lists, cards, menus and the composer are white, a panel held off
   the ground is a step under white inside its rim, and a field is between
   them. Blue marks what is selected, what has focus and what is fine. Red
   marks now and trouble. Every other status is ink, so light mode has no
   green and no amber. The attribute sits on <html> (frontend/src/app.html).
   The sign-in page takes it off again, because the door is dark. Only what
   changes is here; every other token holds in both modes. */
:root[data-light-mode] {
  --ground: #f6f4f0;
  /* Paper is opaque, so nothing shows through it and no surface blurs.
     The ladder steps toward white: a surface stands above what it rests
     on, the same separation by plane dark mode makes downward. */
  --glass: #faf9f7;
  --glass-hover: #f1eee8;
  --glass-on: #ffffff;
  --glass-blur: none;
  --glass-hi: #ffffff;
  --glass-on-hi: #ffffff;
  --glass-ring: rgba(21, 21, 21, 0.1);
  --glass-edge: inset 0 0 0 1px var(--glass-ring);
  --glass-dark: #ffffff;
  --glass-dark-blur: none;
  --glass-dark-edge:
    0 0 0 1px rgba(21, 21, 21, 0.08), 0 1px 2px rgba(21, 21, 21, 0.04);
  --glass-dark-edge-hover:
    0 0 0 1px rgba(21, 21, 21, 0.18), 0 1px 2px rgba(21, 21, 21, 0.04);
  --glass-deep: #f5f1e8;
  --glass-deep-edge: inset 0 0 0 1px rgba(21, 21, 21, 0.08);
  --composer: #ffffff;
  --composer-edge:
    0 0 0 1px rgba(21, 21, 21, 0.1), 0 1px 2px rgba(21, 21, 21, 0.07),
    0 14px 30px -12px rgba(40, 34, 24, 0.36);
  --sunk: rgba(21, 21, 21, 0.05);
  /* The handover's blue, then its roof, its teal and an ochre, each
     deepened to pass AA on paper's code block. */
  --code-keyword: #1e4ab8;
  --code-string: oklch(0.46 0.11 45);
  --code-name: oklch(0.44 0.07 185);
  --code-number: oklch(0.46 0.09 75);
  --picture-0: #f3ede0;
  --picture-1: #ece4d2;
  --panel: #f7f5f1;
  --panel-blur: none;
  --panel-rim: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.28));
  --panel-shadow:
    0 0 0 1px rgba(21, 21, 21, 0.06), 0 8px 16px -8px rgba(40, 34, 24, 0.28);
  --menu-edge:
    0 0 0 1px rgba(21, 21, 21, 0.1), 0 4px 8px -2px rgba(40, 34, 24, 0.16),
    0 24px 44px -18px rgba(40, 34, 24, 0.45);
  --seg-well: rgba(21, 21, 21, 0.06);
  --view-paper: linear-gradient(
    #eeeae3 0%,
    #f2efea 24%,
    #f7f4ef 33%,
    #ede9e2 40%,
    #e5e1d9 62%,
    #ddd9d0 100%
  );
  --view-light: rgba(255, 214, 160, 0.3);
  --view-vignette: rgba(74, 58, 30, 0.07);
  --view-rim: linear-gradient(#ffffff, rgba(255, 255, 255, 0.28));
  --view-shadow:
    0 0 0 1.5px rgba(21, 21, 21, 0.08), 0 3px 5px rgba(40, 34, 24, 0.1),
    0 24px 30px rgba(40, 34, 24, 0.16);
  --divider: rgba(21, 21, 21, 0.1);
  --grip: #ffffff;
  --grip-ring: rgba(21, 21, 21, 0.16);
  --grip-ring-hover: rgba(21, 21, 21, 0.32);
  --grip-ring-held: rgba(21, 21, 21, 0.44);
  --grip-shadow: rgba(21, 21, 21, 0.08);
  --btn-fill: #ffffff;
  --btn-edge:
    0 0 0 1px rgba(21, 21, 21, 0.14), 0 1px 2px rgba(21, 21, 21, 0.05);
  --btn-edge-hover:
    0 0 0 1px rgba(21, 21, 21, 0.32), 0 1px 2px rgba(21, 21, 21, 0.05);
  --wash: rgba(21, 21, 21, 0.05);
  --placeholder: #8b847b;
  --disabled: #a8a196;
  --frost: linear-gradient(
    rgba(252, 251, 248, 0.86),
    rgba(246, 244, 239, 0.94)
  );
  --frost-border: rgba(255, 255, 255, 0.66);
  --frost-shadow:
    0 0 0 1px rgba(21, 21, 21, 0.08), 0 1px 2px rgba(21, 21, 21, 0.06),
    0 18px 36px -14px rgba(40, 34, 24, 0.4);

  --ink: #151515;
  --body: #2e2d2a;
  --soft: #5e5d57;
  --mu: #6f665e;
  --link-line: rgba(21, 21, 21, 0.35);
  --sel-fill: rgba(30, 74, 184, 0.08);
  --sel-line: rgba(30, 74, 184, 0.2);
  --pick: #1e4ab8;
  --lit: #ffffff;
  --lit-edge: 0 0 0 1px rgb(21 21 21 / 6%), 0 1px 2px rgb(40 30 20 / 14%);
  --tool-rule: rgba(21, 21, 21, 0.12);
  --dim: rgba(21, 21, 21, 0.32);
  --rule: rgba(21, 21, 21, 0.18);
  /* Paper holds the agent's words on its own. */
  --reply-shadow: none;

  --on: #151515;
  --on-ink: #ffffff;
  --you: #f5f1e8;
  --you-ink: #151515;
  --focus: #1e4ab8;
  --btn-hover: contrast(0.86);

  --meter: #151515;
  --meter-high: #cc3528;
  --meter-track: rgba(21, 21, 21, 0.08);
  --meter-empty: rgba(21, 21, 21, 0.18);
  --sheet-ring: rgba(21, 21, 21, 0.06);
  --row-wash: rgba(21, 21, 21, 0.035);
  --level: rgba(21, 21, 21, 0.42);

  --hairline: rgba(21, 21, 21, 0.08);
  --glass-well-ring: rgba(21, 21, 21, 0.14);
  --backdrop: rgba(40, 34, 24, 0.25);
  --lift-shadow: 0 18px 40px rgba(40, 34, 24, 0.22);
  --press: rgba(21, 21, 21, 0.18);
  --page-dim: rgba(40, 34, 24, 0.12);
  --page-shadow: 0 18px 40px -18px rgba(40, 34, 24, 0.32);

  /* Blue is fine, red is now and trouble, ink is everything else. A chip's
     red text is a step deeper than its square, so it passes AA on its
     wash. */
  --ok: #1e4ab8;
  --warn: #cc3528;
  --danger: #cc3528;
  --ok-fill: rgba(30, 74, 184, 0.09);
  --ok-fill-ink: #1e4ab8;
  --warn-fill: rgba(204, 53, 40, 0.09);
  --warn-fill-ink: #b52d21;
  --danger-fill: rgba(204, 53, 40, 0.09);
  --danger-fill-ink: #b52d21;
  --neutral-fill: rgba(21, 21, 21, 0.06);
  --neutral-fill-ink: #151515;
  --chip-red: #cc3528;
  --danger-on: #cc3528;
  --danger-on-ink: #ffffff;
  --fail-ring: rgba(204, 53, 40, 0.45);

  --person: oklch(0.89 0.025 160);
  /* Light mode draws the house by day, in the handover's earth: adobe
     walls, a terracotta roof, its green and its teal. The walls are a
     colour of their own, so the house stands on paper without a panel. The
     windows are dark glass and the lighthouse's beam is faint. */
  --pic-body: oklch(0.82 0.055 65);
  --pic-inset: oklch(0.52 0.06 50);
  --pic-line: oklch(0.36 0.015 60);
  --pic-roof: #a8633f;
  --pic-leaf: #7a9a5a;
  --pic-glass: oklch(0.86 0.035 190);
  --pic-led: #5e8f7a;
  --pic-window: oklch(0.45 0.05 190);
  --pic-beam: oklch(0.85 0.09 80);
  --pic-cap: #7a9a5a;
  color-scheme: light;
}

/* --- end of the brand: fonts and tokens above, Agave's own pages below --- */

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

/* The ground is only the root's, so the background
   (frontend/src/lib/ground.js) is not painted over by the body's own. */
html {
  background: var(--ground);
}
html,
body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  font: 500 14px/1.5 var(--sans);
  font-synthesis: none;
  font-variant-ligatures: no-contextual;
  -webkit-font-smoothing: antialiased;
}

/* The window is the ground. frontend/src/routes/Shell.svelte lays the chat
   and the view on it; nothing here divides them. */
body {
  overflow: hidden;
}

/* The frontend renders into div.app (frontend/src/app.html). The shell is
   fixed to the window, so the div must not box it. */
.app {
  display: contents;
}

::selection {
  background: var(--on);
  color: var(--on-ink);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
/* A frame or a heading only a script focuses is not a control the person
   moved to, so the browser's ring on it is noise. Menu items, options and
   tabs a list moves focus through are buttons and keep theirs. */
:is(div, h1)[tabindex="-1"]:focus-visible {
  outline: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
::placeholder {
  color: var(--mu);
  opacity: 1;
}

/* The frontend's .spin (frontend/src/app.css) is the only user. */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- the classes the server's pages use, and the frontend with them ---- */

.danger-ink {
  color: var(--danger);
}

/* The two glass surfaces, and the only place the blur is spelled. Light
   glass carries the person's own things, dark glass what Agave shows. */
.glass {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}
.glass-dark {
  background: var(--glass-dark);
  backdrop-filter: var(--glass-dark-blur);
  -webkit-backdrop-filter: var(--glass-dark-blur);
  box-shadow: var(--glass-dark-edge);
}
.glass-deep {
  background: var(--glass-deep);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-deep-edge);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-button);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.005em;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  filter: var(--btn-hover);
}
.btn-primary {
  background: var(--on);
  color: var(--on-ink);
}

/* AG3, AG6: an input is a light-glass well, with a ring and no highlight. */
.field {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 1px var(--glass-well-ring);
  color: var(--ink);
}
.field:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus);
}
.field.invalid {
  box-shadow: inset 0 0 0 2px var(--danger);
}
.field-mono {
  font-family: var(--mono);
}

.fold {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  align-items: flex-start;
}
.fold-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mu);
  cursor: pointer;
}
.fold-toggle:hover {
  color: var(--ink);
}

.mono-block {
  align-self: stretch;
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: var(--radius-field);
  background: var(--sunk);
  color: var(--mu);
  font-family: var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The product name over a title, on the screen viewer. */
.brand {
  margin: 0;
  font-weight: 600;
}

/* --- the form screen ---------------------------------------------------
   The design handover's own screen: the door, the username, the
   onboarding and the server's own notices. The frontend draws it in
   Svelte (frontend/src/lib/Paper.svelte) and the server in HTML
   (internal/web/auth.go), so the vocabulary sits here, where both read
   it. Every measurement is the handover's. */

/* The photograph on paper, under the paper's cloud and grain. It lies
   behind everything, the way the ground does. */
.form-screen {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: var(--form-paper) var(--form-photo) 50% 64% / cover no-repeat;
  pointer-events: none;
}
.form-screen::before,
.form-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
}
.form-screen::before {
  background: var(--paper-cloud);
  opacity: 0.08;
}
.form-screen::after {
  background: var(--paper-grain);
  opacity: 0.12;
}
/* The wordmark stands in the screen's corner, over the photograph. */
.form-mark {
  position: fixed;
  top: 30px;
  left: 40px;
  display: block;
  width: auto;
  height: 22px;
}
/* The stage scrolls, as the body takes no overflow. The sheet's auto
   margin centres it and still lets a tall sheet scroll. */
.form-stage {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: auto;
  padding: 40px 20px;
  color: var(--form-ink);
  font-family: "TT Hoves", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  font-variant-ligatures: no-contextual;
  color-scheme: light;
}
.form-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 44px 44px 30px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: var(--form-panel);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  box-shadow: var(--form-panel-edge);
}
.form-stage :focus-visible {
  outline: 2px solid var(--form-pick);
  outline-offset: 2px;
}
.form-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.form-head h1 {
  margin: 0;
  max-width: 440px;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}
.form-line {
  margin: 0;
  max-width: 400px;
  color: var(--form-ink-2);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.55;
  text-wrap: balance;
}
/* A field under its label, and the refusal 4px under the field. */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--form-ink-2);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1;
  text-align: left;
}
.form-field {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px var(--form-well-ring),
    0 1px 2px rgb(21 21 21 / 5%);
  color: var(--form-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  outline: none;
}
.form-field::placeholder {
  color: var(--form-mu);
  opacity: 1;
}
.form-field[readonly] {
  color: var(--form-mu);
}
.form-field.invalid {
  box-shadow: inset 0 0 0 2px var(--form-now);
}
.form-danger {
  margin: 0;
  color: var(--form-now);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
}
/* The way on, and the way past under it. */
.form-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}
.form-onward {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  height: 46px;
  border: 0;
  border-radius: 3px;
  background: var(--form-ink);
  box-shadow: var(--form-btn-edge);
  color: var(--form-on-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.form-onward[disabled] {
  cursor: default;
}
.form-onward .arrow {
  display: block;
  flex: none;
  width: 15px;
  height: 15px;
}
.form-skip {
  padding: 0 0 2px;
  border: 0;
  background: none;
  box-shadow: inset 0 -1px 0 var(--form-underline);
  color: var(--form-ink);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
@media (max-width: 479.98px) {
  .form-stage {
    padding: 16px;
  }
  .form-mark {
    top: 16px;
    left: 16px;
  }
  .form-sheet {
    padding: 36px 20px 24px;
  }
}

/* --- end of the form screen: agave-brand ships it as form.css --- */
