/* Kova: AI in the app, a proof of concept by Osimah Digital. A phone running
 * an outdoor-gear shop sits between the demo controls (left) and the AI
 * decision log (right).
 *
 * Two layers, two design languages:
 * - The frame (the Osimah bar, the title, the demo controls, the decision log
 *   and the footer) is Osimah's: paper and near-black grounds, the teal and
 *   cyan of the logo ring, DM Serif Display and Inter, and Osimah's spacing,
 *   radius and duration ladders. Its source of truth is DESIGN.md in the
 *   DrKamsheh/Osimah-website repo.
 * - The app on the phone is the client's shop, Kova: moss and lichen greens
 *   with one amber accent, Bricolage Grotesque for display, IBM Plex Sans to
 *   read and IBM Plex Mono for data. Its tokens are set on .screen, so
 *   everything inside the phone reads them and nothing outside does.
 * One thing crosses over: what the AI does inside the app (the AI marks,
 * "Why this?", the assistant's steps) wears Osimah's teal and its ring, the
 * same hue as the log that explains it.
 *
 * Every colour is a token below; dark mode redefines the tokens and nothing
 * else. docs/HANDOFF.md § 4a lists the rules and where each one came from. */

/* ---------- Tokens: Osimah, the frame ---------- */
:root {
  color-scheme: light;

  /* Grounds: Osimah's paper. */
  --bg: #f6f6f6;
  --surface: #fff;
  --wash: rgb(7 26 28 / .04);        /* under a row being pointed at */

  /* Ink. Every text colour here clears 4.5:1 on --bg. */
  --ink: #071a1c;
  --ink-2: #616a6b;                  /* the one body grey: ledes, labels, meta (5.1:1) */
  --line: rgb(7 26 28 / .12);        /* every hairline */
  --field-line: #7c8790;             /* the edge of a switch, which owes 3:1 */

  /* One accent ink, and the call-to-action ink. */
  --accent-text: #0e7a90;            /* eyebrows, the accent phrase, links (4.6:1) */
  --accent-wash: #e5f3f6;
  --action: #073b45;                 /* the chosen customer, the skip link, "Talk to our team" */
  --action-ink: #fff;
  --action-hover: #0a5260;
  --action-edge: #16b8c8;            /* the 1px edge round a filled button */
  --live: #0e7a90;                   /* a fraud signal switched on */
  --live-ink: #fff;

  /* Focus owes 3:1 to its ground: Osimah's dark teal on paper, the cyan on
     anything dark (the bar, the log, dark mode). */
  --focus: #0d4452;

  /* Osimah's dark frames, the same in both themes: the bar on its near-black
     with a hairline, and the decision log on its contact-band navy. */
  --frame: #05070a;
  --frame-line: #1b232b;
  --console: #01032b;
  --console-edge: transparent;
  --console-ink: #eef1ee;
  --console-ink-2: #b7c0c6;          /* 10.8:1 on the navy */
  --console-muted: #7c8790;          /* 5.4:1 on the navy */
  --console-line: rgb(255 255 255 / .14);
  --console-control: rgb(255 255 255 / .32);
  --on-dark-accent: #7be4f0;         /* accent ink on dark */
  --on-dark-focus: #29c6e8;          /* focus ring and a highlighted edge on dark */
  --on-dark-hover: #16b8c8;
  --on-dark-tint: rgb(41 198 232 / .1);

  /* The phone is Osimah's flat frame: a near-black rim, no notch, no shadow. */
  --bezel: #05070a;
  --bezel-edge: transparent;

  --osimah-logo: url("../img/osimah-on-light.webp");

  /* Osimah's Latin pair: DM Serif Display for the one display head, Inter for
     everything else. There is no mono face in the frame. */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Osimah's ladders: 4px spacing, six radii, three durations, two curves. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --r-xs: 2px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --dur-1: 120ms;
  --dur-2: 170ms;
  --dur-3: 240ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);

  /* The phone fits the window once it sticks, from 640px up to its full 840. */
  --phone-h: clamp(640px, calc(100vh - 40px), 840px);
}

/* Dark: Osimah's own canvas. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #05070a;
    --surface: #0b0f14;
    --wash: rgb(255 255 255 / .05);
    --ink: #eef1ee;
    --ink-2: #b7c0c6;
    --line: #1b232b;
    --field-line: #5f6c78;
    --accent-text: #7be4f0;
    --accent-wash: rgb(41 198 232 / .14);
    --action: #eef1ee;
    --action-ink: #05070a;
    --action-hover: #16b8c8;
    --live: #29c6e8;
    --live-ink: #05070a;
    --focus: #29c6e8;
    --console-edge: rgb(255 255 255 / .14);
    --bezel-edge: #2a3540;
    --osimah-logo: url("../img/osimah-on-dark.webp");
}

/* ---------- Tokens: Kova, the app on the phone ---------- */
.screen {
  color-scheme: light;

  --panel: #f6f7f1;            /* paper: the screen */
  --surface: #fff;             /* cards and fields */
  --wash: #dde6d3;             /* lichen: icon buttons, gauges, the assistant's steps */

  --ink: #0f1a14;
  --ink-2: #333d37;
  --muted: #5a655d;            /* stone, a step darker so it clears 4.5:1 on lichen (4.7:1) */
  --line: #d3dbcb;
  --field-line: #768178;       /* edges of things you type into (3:1 on paper and lichen) */

  /* Focus owes 3:1 to its ground: moss on the light grounds, amber on dark ones
     (the voice overlay, the moss card), ink on the amber card. */
  --focus: #1f3d2b;

  --brand: #1f3d2b;            /* moss: headings, the current tab */
  --brand-2: #2e5a41;          /* links */
  --brand-fill: #1f3d2b;       /* filled moss surfaces */
  --brand-fill-ink: #f6f7f1;
  --brand-fill-muted: #dde6d3;

  --amber: #e8a33d;
  --amber-ink: #0f1a14;
  --amber-wash: #fbefd9;
  --amber-edge: #f0d3a0;

  /* The AI at work, in Osimah's hue: the deep teal clears 4.5:1 on every Kova
     ground it sits on (6.8:1 on lichen), the ring is the logo's cyan end. */
  --ai-ink: #0a5260;
  --ai-wash: #eaf9fd;
  --ai-ring: #16a3ca;
  /* The ring round what a use case picked from the list is about (spotlight() in app.js). */
  --spot: #16a3ca;

  /* "Why this?" is the way to the log, so it wears the log: Osimah's navy and
     cyan (13.9:1), the same in both themes, with a cyan edge on dark grounds. */
  --why-bg: #01032b;
  --why-hover: #0c1356;
  --why-ink: #7be4f0;
  --why-edge: transparent;

  --danger: #b63e27;
  --ok: #2e7d4f;
  --risk-low: #e3f1e7;
  --risk-mid: #fbefd9;
  --risk-high: #f7ded8;

  --action: #0f1a14;           /* the black pill */
  --action-ink: #f6f7f1;

  --overlay: rgb(15 26 20 / .45);
  --voice-bg: rgb(15 26 20 / .92);
  --push-bg: rgb(255 255 255 / .96);
  --push-ink: #333d37;
  --match-bg: rgb(255 255 255 / .88);

  /* Product tiles. */
  --tint-0: #e7dcc8;
  --tint-1: #d7e3d0;
  --tint-2: #d9e2e6;
  --tint-3: #e9d9cf;
  --tint-4: #e1e4cf;
  --tint-5: #dcd6e4;
  --tint-ink: #1f3d2b;

  --shadow-float: 0 12px 30px -10px rgb(15 26 20 / .4);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

:root[data-theme="dark"] .screen {
    color-scheme: dark;

    --panel: #121a15;
    --surface: #18231c;
    --wash: #22302a;

    --ink: #e6ede3;
    --ink-2: #c5cfc6;
    --muted: #9aa89e;
    --line: #2a3a30;
    --field-line: #6b7a70;
    --focus: #e8a33d;

    --brand: #b5d6be;
    --brand-2: #a3cdb0;
    --brand-fill: #2a5139;
    --brand-fill-ink: #f6f7f1;
    --brand-fill-muted: #cddcc6;

    --amber-wash: rgb(232 163 61 / .16);
    --amber-edge: rgb(232 163 61 / .45);

    --ai-ink: #7be4f0;
    --ai-wash: rgb(41 198 232 / .14);
    --ai-ring: #29c6e8;
    --spot: #29c6e8;

    --why-edge: rgb(123 228 240 / .45);

    --danger: #f08a73;
    --ok: #6cc592;
    --risk-low: #183324;
    --risk-mid: #3a2e16;
    --risk-high: #42201a;

    --action: #e6ede3;
    --action-ink: #0f1a14;

    --overlay: rgb(0 0 0 / .6);
    --voice-bg: rgb(5 8 6 / .94);
    --push-bg: rgb(30 42 34 / .97);
    --push-ink: #c5cfc6;
    --match-bg: rgb(11 17 13 / .8);

    --tint-0: #3a3326;
    --tint-1: #273527;
    --tint-2: #233038;
    --tint-3: #3b2d27;
    --tint-4: #33362a;
    --tint-5: #2f2b3a;
    --tint-ink: #d7e6da;

    --shadow-float: 0 12px 30px -10px rgb(0 0 0 / .7);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
/* The frame's sizes are in rem so it follows the reader's text size; the app
   on the phone is drawn in px, because the phone is a fixed size. */
body { font: .875rem/1.5 var(--font-text); color: var(--ink); background: var(--bg); min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
input { font: inherit; color: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.screen :focus-visible { outline-offset: 2px; }
.card--nba :focus-visible, .voice-ov :focus-visible { outline-color: var(--amber); }
.card--winback :focus-visible { outline-color: #0f1a14; }
.wide-only { display: inline; }
.lede-short, .persona-note, .log-peek { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--action); color: var(--action-ink); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

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

/* ---------- Osimah: the bar, the lockup and the footer ---------- */
.osimah-logo { display: block; width: 120px; aspect-ratio: 320 / 86; background: var(--osimah-logo) no-repeat center / contain; }

.osimah-bar { color-scheme: dark; background: var(--frame); border-bottom: 1px solid var(--frame-line); color: var(--console-ink-2); }
.osimah-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); max-width: 1360px; min-height: 64px; margin: 0 auto; padding: var(--space-3) 28px; }
.osimah-bar :focus-visible { outline-color: var(--on-dark-focus); }
.osimah-bar__home { display: block; border-radius: var(--r-xs); }
.osimah-bar .osimah-logo { width: 132px; background-image: url("../img/osimah-on-dark.webp"); }
.osimah-bar p { font-size: .8125rem; font-weight: 500; text-align: end; }
.osimah-bar__end { display: flex; align-items: center; gap: var(--space-4); }
/* Osimah's language switch: a link to the same page in the other language, a
   transparent 32px pill with a globe and the language's own name. */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid #2a3540; border-radius: var(--r-pill); color: var(--console-ink-2); font-size: .75rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: border-color var(--dur-1) var(--ease-soft), color var(--dur-1) var(--ease-soft); }
.lang-switch svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lang-switch:is(:hover, :focus-visible) { border-color: var(--on-dark-hover); color: var(--console-ink); }
/* Osimah's header ask: the off-white pill of the dark bar, with the arrow that
   says it opens elsewhere. Phones get it in the footer and the tour instead. */
.osimah-bar__cta { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: var(--console-ink); color: var(--frame); font-size: .8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color var(--dur-1) var(--ease-soft); }
.osimah-bar__cta:is(:hover, :focus-visible) { background: var(--on-dark-hover); }

/* Osimah's .btn--ink: the call-to-action ink, a cyan edge, at least 48px. */
.btn-ink { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--action-edge); border-radius: var(--r-pill); background: var(--action); color: var(--action-ink); font-size: .9375rem; font-weight: 600; text-decoration: none; transition: background-color var(--dur-1) var(--ease-soft); }
.btn-ink:is(:hover, :focus-visible) { background: var(--action-hover); }
/* The arrow of a link that opens elsewhere nudges along itself; in Arabic it points the other way. */
:is(.osimah-bar__cta, .btn-ink, .tour__contact) svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease-out); }
:is(.osimah-bar__cta, .btn-ink, .tour__contact):is(:hover, :focus-visible) svg { transform: translate(3px, -3px); }
[dir="rtl"] :is(.osimah-bar__cta, .btn-ink, .tour__contact) svg { scale: -1 1; }

/* The footer: the ask (a next step for whoever wants this in their own app),
   then who made it, then what the demo does with data. */
.made-by { width: min(1304px, 100% - 56px); margin: var(--space-2) auto 0; padding-bottom: var(--space-7); border-top: 1px solid var(--line); }
.made-by__ask { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); flex-wrap: wrap; padding: var(--space-6) 0; border-bottom: 1px solid var(--line); }
.made-by__question { font: 400 1.75rem/1.2 var(--font-display); color: var(--ink); text-wrap: balance; }
.made-by__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); flex-wrap: wrap; padding-top: var(--space-5); }
.made-by__lockup { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-2); font-size: .8125rem; font-weight: 500; text-decoration: none; border-radius: var(--r-xs); }
.made-by__lockup:hover { color: var(--ink); }
.made-by__row p { color: var(--ink-2); font-size: .8125rem; max-width: 34rem; text-wrap: pretty; }
.privacy { margin-top: var(--space-4); }
.privacy summary { display: inline-flex; align-items: center; gap: var(--space-2); list-style: none; cursor: pointer; color: var(--ink-2); font-size: .8125rem; font-weight: 600; border-radius: var(--r-xs); }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-3) var(--ease-out); }
.privacy[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.privacy p { max-width: 46rem; margin-top: var(--space-2); color: var(--ink-2); font-size: .8125rem; line-height: 1.6; text-wrap: pretty; }

/* ---------- Stage ---------- */
.stage { display: grid; grid-template-columns: 300px 410px minmax(320px, 1fr); gap: var(--space-6); max-width: 1360px; margin: 0 auto; padding: var(--space-6) 28px; align-items: start; }
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); max-width: 1360px; margin: 0 auto; padding: var(--space-6) 28px 0; }
.eyebrow { font: 600 .75rem/1rem var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.brand .eyebrow { margin-bottom: var(--space-3); }
.brand h1 { font: 400 clamp(2.25rem, 3.9vw, 3.5rem)/1.1 var(--font-display); letter-spacing: -.0125em; color: var(--ink); text-wrap: balance; overflow-wrap: break-word; }
.brand h1 em { color: var(--accent-text); }
.brand__aside { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); max-width: 34rem; }
.brand__aside p { color: var(--ink-2); font-size: 1rem; line-height: 1.65; text-wrap: pretty; }
/* Osimah's outline button: the call-to-action ink's edge and label, filled under the pointer. */
.tour-start { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding-inline: var(--space-4) var(--space-5); border: 1px solid var(--action); border-radius: var(--r-pill); color: var(--action); font-size: .9375rem; font-weight: 600; transition: background-color var(--dur-1) var(--ease-soft), color var(--dur-1) var(--ease-soft); }
.tour-start svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.tour-start:is(:hover, :focus-visible) { background: var(--action); color: var(--action-ink); }
.tour-start:active { scale: .98; }

/* The demo controls are ruled sections, not boxes: a hairline over each. */
.side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: var(--space-5); }
.panel { border-top: 1px solid var(--line); padding-top: var(--space-4); }
.panel h2 { font: 600 1rem/1.35 var(--font-text); color: var(--ink); margin-bottom: var(--space-3); }
.panel summary { list-style: none; cursor: default; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary:focus-visible { border-radius: var(--r-xs); }
.panel-note { color: var(--ink-2); font-size: .8125rem; margin-bottom: var(--space-2); }

.persona { display: flex; gap: var(--space-3); align-items: center; width: 100%; padding: 10px var(--space-3); border-radius: var(--r-md); margin-bottom: var(--space-1); transition: background-color var(--dur-1) var(--ease-soft); }
.persona b { display: block; font-size: .9375rem; font-weight: 600; }
.persona small { color: var(--ink-2); font-size: .8125rem; }
.persona[aria-pressed="true"] { background: var(--action); color: var(--action-ink); }
.persona[aria-pressed="true"] small { color: inherit; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--accent-wash); color: var(--ink); flex: none; }
.persona[aria-pressed="true"] .avatar { background: var(--action-ink); color: var(--action); }

.uc { list-style: none; }
.uc button { display: flex; gap: var(--space-3); width: 100%; padding: 7px var(--space-2); border-radius: var(--r-sm); align-items: flex-start; text-align: start; transition: background-color var(--dur-1) var(--ease-soft); }
/* Under each title, a line in plain words on what the use case does. */
.uc__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uc__text small { font-size: .8125rem; line-height: 1.45; color: var(--ink-2); }
/* A use case not yet tried is an empty ring; a tried one is filled, so the
   state reads by shape as well as colour. */
.uc .dot { width: 10px; height: 10px; margin-top: .42em; border-radius: 50%; border: 1.5px solid var(--field-line); flex: none; transition: background-color var(--dur-1) var(--ease-soft); }
.uc .done .dot { background: var(--accent-text); border-color: var(--accent-text); }
.uc .where { margin-inline-start: auto; padding-top: .15em; font-size: .75rem; color: var(--ink-2); white-space: nowrap; }

/* Each fraud signal is one switch: the whole row, words and all, toggles it. */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; padding: 6px 0; border-radius: var(--r-sm); }
.switch { width: 38px; height: 22px; border-radius: var(--r-pill); border: 1px solid var(--field-line); position: relative; flex: none; transition: background-color var(--dur-2) var(--ease-soft), border-color var(--dur-2) var(--ease-soft); }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--field-line); transition: transform var(--dur-2) var(--ease-out); }
.toggle[aria-checked="true"] .switch { background: var(--live); border-color: var(--live); }
.toggle[aria-checked="true"] .switch::after { transform: translateX(16px); background: var(--live-ink); }
[dir="rtl"] .toggle[aria-checked="true"] .switch::after { transform: translateX(-16px); }
/* A switch the tour turned on lights up for a moment. */
.toggle { transition: background-color var(--dur-3) var(--ease-soft), box-shadow var(--dur-3) var(--ease-soft); }
.toggle.flash { background: var(--accent-wash); box-shadow: 0 0 0 6px var(--accent-wash); }
/* Osimah's outline button, small: a control at its natural size. */
.reset { display: inline-flex; align-items: center; min-height: 36px; margin-top: var(--space-3); padding: 0 var(--space-4); border: 1px solid var(--action); border-radius: var(--r-pill); color: var(--action); font-size: .8125rem; font-weight: 600; transition: background-color var(--dur-1) var(--ease-soft), color var(--dur-1) var(--ease-soft); }
.reset:is(:hover, :focus-visible) { background: var(--action); color: var(--action-ink); }

@media (hover: hover) {
  .persona:hover, .uc button:hover { background: var(--wash); }
  .persona[aria-pressed="true"]:hover { background: var(--action-hover); }
  .privacy summary:hover { color: var(--ink); }
}

/* ---------- Phone ---------- */
.phone-wrap { position: sticky; top: 20px; }
/* Osimah's phone frame: a 6px rim on --r-xl, the screen's corner the frame's
   radius minus its rim (--r-lg). */
.phone { width: 410px; height: var(--phone-h); background: var(--bezel); border-radius: var(--r-xl); padding: 6px; box-shadow: 0 0 0 1px var(--bezel-edge); }
.screen { position: relative; width: 100%; height: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; outline-offset: -4px; }
.statusbar { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; font-weight: 600; font-size: 14px; flex: none; }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 10px; flex: none; }
.appbar-actions { display: flex; gap: 8px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--brand); letter-spacing: -.03em; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); position: relative; }
.iconbtn svg, .mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--amber); color: var(--amber-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.view { flex: 1; overflow-y: auto; padding: 0 20px 20px; scrollbar-width: none; overscroll-behavior: contain; }
.view::-webkit-scrollbar { display: none; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding: 8px 8px 14px; background: var(--panel); flex: none; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); padding: 4px; border-radius: 10px; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--brand); font-weight: 600; box-shadow: inset 0 2px 0 var(--brand); border-radius: 0 0 10px 10px; }

/* ---------- App content ---------- */
/* The app's type steps: 12 (labels, the smallest), 13, 14 (body), 16 (fields),
   18, 22 and 26 for heads. */
.screen .eyebrow { font: 400 12px/1.45 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hello { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; margin: 6px 0 4px; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
/* What the AI decided carries Osimah's ring and teal; the log explains it. */
.ai-mark { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px; color: var(--ai-ink); background: var(--ai-wash); padding: 3px 9px; border-radius: 20px; letter-spacing: .02em; }
.ai-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ai-ring); }
/* "Why this?" is the bridge to the log: a chip in the log's navy and cyan with
   an info ring, 13px, and 44px tall to a finger (see Touch). */
.why { display: inline-flex; align-items: center; gap: 5px; flex: none; position: relative; min-height: 28px; padding: 0 11px 0 8px; border-radius: 999px; background: var(--why-bg); color: var(--why-ink); box-shadow: inset 0 0 0 1px var(--why-edge); font: 600 13px/1 var(--body); white-space: nowrap; vertical-align: middle; transition: background-color .12s; }
.why svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.why:hover { background: var(--why-hover); color: #eef1ee; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-family: var(--display); font-size: 18px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.01em; }
.card p { font-size: 13px; }
.card--nba { background: var(--brand-fill); color: var(--brand-fill-ink); border: 0; }
.card--nba { --ai-ring: #7be4f0; }
.card--nba .ai-mark { background: rgb(0 0 0 / .25); color: #7be4f0; }
.card--hero { background: var(--tint-2); border: 0; }
.card--winback { background: var(--amber); color: var(--amber-ink); border: 0; }
.card--winback { --ai-ring: #073b45; }
.card--winback .ai-mark { background: rgb(255 255 255 / .6); color: #073b45; }
.card--winback .cta { background: #0f1a14; color: #f6f7f1; }
.card h3.title-row { font-family: var(--body); font-size: 14px; font-weight: 600; line-height: 1.45; letter-spacing: 0; margin: 0; }
.card h3.flush { margin-top: 0; }
.card .staff { margin-top: 6px; }
.card .best-time { margin-top: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* A card's AI mark and "Why this?" share a line where they fit; on a very narrow phone the chip goes under the mark. */
.card > .row:first-child { flex-wrap: wrap; row-gap: 6px; }
.ai-mark { white-space: nowrap; }

.cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--action); color: var(--action-ink); padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; margin-top: 10px; min-height: 36px; }
.cta--block { width: 100%; padding: 13px; margin-top: 14px; }
.cta:disabled, .cta[aria-disabled="true"] { opacity: .7; cursor: default; }
.card--nba .cta { background: var(--amber); color: var(--amber-ink); }
.cta--ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.link { font-family: var(--mono); font-size: 12px; color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }
/* The walkthrough presses Pay where it can be seen. */
.cta.pressed { scale: .97; opacity: .85; }

.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 10px; }
.sec-h h3 { font-family: var(--display); font-size: 18px; font-weight: 700; }
.rail { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; scroll-padding-inline: 20px; }
.rail::-webkit-scrollbar { display: none; }
/* A use case picked from the list rings its part of the screen for a moment. */
.reco-block { border-radius: 14px; }
.spot { outline: 3px solid var(--spot); outline-offset: 3px; transition: outline-color .6s; }
.no-offer { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--wash); font-size: 13px; }
.no-offer .cta { margin-top: 8px; }
.prod { flex: none; width: 148px; display: block; border-radius: 16px; }
.prod b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.prod small { color: var(--muted); font-size: 12px; }
.prod s { color: var(--muted); font-size: 12px; margin-inline-start: 4px; }
.thumb { height: 130px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 8px; position: relative; color: var(--tint-ink); }
.thumb svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.thumb--big { height: 200px; border-radius: 20px; margin-bottom: 12px; }
.thumb--big svg { width: 96px; height: 96px; stroke-width: 2.2; }
.tint-0 { background: var(--tint-0); }
.tint-1 { background: var(--tint-1); }
.tint-2 { background: var(--tint-2); }
.tint-3 { background: var(--tint-3); }
.tint-4 { background: var(--tint-4); }
.tint-5 { background: var(--tint-5); }
.match, .flag { position: absolute; inset-inline-start: 8px; bottom: 8px; font-family: var(--mono); font-size: 12px; background: var(--match-bg); color: var(--ink); padding: 2px 7px; border-radius: 10px; }
.flag { top: 8px; bottom: auto; background: var(--amber); color: var(--amber-ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .prod { width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--feed { margin: 4px 0 10px; }
.chip { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
button.chip:hover { border-color: var(--field-line); }
.chip.on { background: var(--brand-fill); color: var(--brand-fill-ink); border-color: var(--brand-fill); }
.chip--parsed { background: var(--amber-wash); border-color: var(--amber-edge); font-family: var(--mono); font-size: 12px; }

.searchbox { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--field-line); border-radius: 14px; padding: 4px 6px 4px 12px; margin: 6px 0 10px; }
.searchbox input { flex: 1; border: 0; outline: 0; padding: 9px 0; background: transparent; min-width: 0; font-size: 16px; }
.searchbox input::placeholder, .composer input::placeholder { color: var(--muted); opacity: 1; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox:focus-within, .searchbox.is-typing { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.mic { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-fill); color: var(--brand-fill-ink); display: grid; place-items: center; flex: none; }
.mic svg { width: 18px; height: 18px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; }
.results-head { margin: 14px 0 8px; align-items: flex-start; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.pay-with { margin-top: 6px; }
/* The fraud signals switched on beside the phone, in the AI's teal: a staff view. */
.signals-on { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--ai-wash); color: var(--ai-ink); font-size: 13px; }
.signals-on p:first-child { display: flex; gap: 7px; font-weight: 600; }
.signals-on p:first-child::before { content: ""; width: 7px; height: 7px; margin-top: .5em; border-radius: 50%; border: 1.5px solid var(--ai-ring); flex: none; }
.signals-on .eyebrow { margin: 2px 0 0; margin-inline-start: 14px; color: var(--ai-ink); }
.note { color: var(--muted); font-size: 12px; margin: -2px 0 10px; }

/* ---------- Assistant ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.msg { max-width: 84%; padding: 10px 13px; border-radius: 18px; font-size: 14px; }
.msg--me { align-self: flex-end; background: var(--brand-fill); color: var(--brand-fill-ink); border-end-end-radius: 6px; }
.msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 6px; }
.steps { align-self: flex-start; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--wash); border-radius: 12px; padding: 8px 10px; max-width: 90%; }
.steps ol { list-style: none; }
.steps li { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; word-break: break-word; }
.steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ai-ring); flex: none; transform: translateY(-1px); }
.steps .why { display: flex; width: max-content; margin-top: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.chat .grid2 { align-self: stretch; }
.handoff { border: 1px solid var(--brand); border-radius: 14px; padding: 10px; background: var(--surface); font-size: 12px; align-self: stretch; }
.handoff dt { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; margin-top: 6px; }
.handoff dt:first-child { margin-top: 0; }
.composer-chips { padding: 6px 20px 0; }
.composer { display: flex; gap: 8px; padding: 8px 20px 10px; border-top: 1px solid var(--line); margin-top: 6px; background: var(--panel); }
.composer input { flex: 1; border: 1px solid var(--field-line); border-radius: 999px; padding: 8px 14px; background: var(--surface); outline: 0; min-width: 0; font-size: 16px; }
.composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.send { background: var(--action); color: var(--action-ink); border-radius: 999px; padding: 0 14px; font-weight: 600; font-size: 13px; }

/* ---------- Profile ---------- */
.gauge { height: 10px; border-radius: 10px; background: var(--wash); overflow: hidden; margin: 8px 0; }
.gauge b { display: block; height: 100%; border-radius: 10px; transition: width .6s; }
.factor { display: grid; grid-template-columns: 1fr 90px 44px; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; }
.factor .bar { height: 6px; border-radius: 6px; background: var(--wash); overflow: hidden; }
.factor .bar b { display: block; height: 100%; background: var(--amber); }
.factor .bar b.good { background: var(--ok); }
.factor .v { text-align: end; font-family: var(--mono); font-size: 12px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 70px; margin: 10px 0 4px; }
.hours i { display: block; background: var(--line); border-radius: 2px 2px 0 0; }
.hours i.best { background: var(--amber); }
.hours-x { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.line-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.line-item--total { font-weight: 600; border: 0; }
.line-item .end { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }

/* ---------- Overlays inside the phone ---------- */
.sheet-bg { position: absolute; inset: 0; background: var(--overlay); z-index: 20; display: none; }
.sheet-bg.open { display: block; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 28px 28px 0 0; padding: 10px 20px 28px; z-index: 21; transform: translateY(105%); transition: transform .3s var(--ease); max-height: 88%; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow-float); }
.sheet.open { transform: none; }
.sheet:focus { outline: none; }
.sheet-top { display: flex; align-items: center; justify-content: center; position: relative; min-height: 24px; margin-bottom: 8px; }
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); }
.sheet-close { position: absolute; inset-inline-end: -6px; top: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); }
.sheet-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet h2 { font-family: var(--display); font-size: 22px; line-height: 1.15; margin: 4px 0; }
.price { font-family: var(--display); font-size: 22px; font-weight: 700; white-space: nowrap; flex: none; }
.sheet .row .chips { justify-content: flex-end; }
.price s { font-family: var(--body); font-size: 13px; font-weight: 400; color: var(--muted); margin-inline-start: 6px; }
.risk { border-radius: 14px; padding: 12px; margin: 12px 0; font-size: 13px; }
.risk--low { background: var(--risk-low); }
.risk--mid { background: var(--risk-mid); }
.risk--high { background: var(--risk-high); }
.faceid { display: grid; place-items: center; padding: 16px 0; color: var(--brand); }
.faceid svg { width: 90px; height: 90px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.scan { animation: scan 1.4s ease-in-out; }
@keyframes scan { 0% { opacity: .3; transform: scale(.92); } 50% { opacity: 1; } 100% { transform: scale(1); } }

.push { position: absolute; top: 50px; left: 10px; right: 10px; z-index: 40; transform: translateY(-160%); transition: transform .45s cubic-bezier(.2, .9, .2, 1), visibility 0s linear .45s; visibility: hidden; }
.push.show { transform: none; visibility: visible; transition-delay: 0s; }
.push button { display: flex; gap: 10px; width: 100%; background: var(--push-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-float); }
.push .appi { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-fill); color: var(--amber); font-family: var(--display); font-weight: 800; display: grid; place-items: center; flex: none; }
.push .body { flex: 1; min-width: 0; }
.push b { font-size: 13px; }
.push .text { display: block; font-size: 13px; color: var(--push-ink); }
.push small { font-size: 12px; color: var(--muted); }

.toast { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--action); color: var(--action-ink); padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .3s, transform .3s; z-index: 45; width: max-content; max-width: calc(100% - 40px); text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.sheet.open ~ .toast, .voice-ov:not([hidden]) ~ .toast { bottom: auto; top: 56px; } /* clear of the checkout total and Cancel */

.voice-ov { position: absolute; inset: 0; background: var(--voice-bg); z-index: 35; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f6f7f1; padding: 30px; text-align: center; gap: 16px; }
.voice-ov:focus { outline: none; }
.voice-ov .eyebrow { color: var(--amber); }
.voice-ov h2 { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.voice-ov .hint { font-size: 13px; color: #c5cfc6; }
.voice-ov .chips { justify-content: center; }
.voice-ov .chip { background: transparent; color: #f6f7f1; border-color: rgb(255 255 255 / .35); }
.voice-ov .chip:hover { border-color: rgb(255 255 255 / .7); }
.voice-ov form { width: 100%; display: flex; gap: 8px; }
.voice-ov input { flex: 1; min-width: 0; border-radius: 999px; border: 1px solid rgb(255 255 255 / .4); padding: 10px 14px; background: rgb(255 255 255 / .12); outline: 0; color: #f6f7f1; font-size: 16px; }
.voice-ov input::placeholder { color: #b9c4bb; }
.voice-ov input:focus { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.voice-ov .send { background: var(--amber); color: #0f1a14; }
.voice-ov .cta--ghost { color: #f6f7f1; margin-top: 0; }
.voice-ov .actions { display: flex; gap: 10px; justify-content: center; }
.wave { display: flex; gap: 5px; height: 40px; align-items: center; }
.wave i { width: 5px; height: 8px; background: var(--amber); border-radius: 4px; }
.wave.live i { animation: wave 1s infinite ease-in-out; }
.wave i:nth-child(2) { animation-delay: .1s; }
.wave i:nth-child(3) { animation-delay: .2s; }
.wave i:nth-child(4) { animation-delay: .3s; }
.wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 0%, 100% { height: 8px; } 50% { height: 38px; } }

/* ---------- Decision log: Osimah's navy band ---------- */
.console { color-scheme: dark; background: var(--console); color: var(--console-ink); border: 1px solid var(--console-edge); border-radius: var(--r-lg); padding: var(--space-5); position: sticky; top: 20px; height: var(--phone-h); display: flex; flex-direction: column; }
.console :focus-visible { outline-color: var(--on-dark-focus); }
.console header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.console h2 { font: 400 1.75rem/1.15 var(--font-display); color: var(--console-ink); }
.console-count { font-size: .8125rem; font-weight: 500; color: var(--console-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.console .lede { font-size: .8125rem; line-height: 1.6; color: var(--console-ink-2); margin-bottom: var(--space-4); text-wrap: pretty; }
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.filters button { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 500; line-height: 1; padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--console-control); color: var(--console-ink-2); transition: border-color var(--dur-1) var(--ease-soft), color var(--dur-1) var(--ease-soft); }
.filters button[aria-pressed="true"] { background: var(--console-ink); color: var(--frame); border-color: var(--console-ink); }
/* The log scrolls inside its panel: a thin scrollbar, and a fade at an edge
   with more beyond it (app.js sets more-above and more-below). */
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-inline-end: var(--space-1); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .3) transparent; --fade-top: 0px; --fade-bottom: 0px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent); mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent); }
.log.more-above { --fade-top: 24px; }
.log.more-below { --fade-bottom: 56px; }
.entry { border: 1px solid var(--console-line); border-radius: var(--r-md); padding: var(--space-3); font-size: .8125rem; line-height: 1.5; font-variant-numeric: tabular-nums; animation: in var(--dur-3) var(--ease-out); scroll-margin: var(--space-3); transition: border-color var(--dur-1) var(--ease-soft), background-color var(--dur-1) var(--ease-soft); }
.entry:focus { outline: none; }
.entry:focus-visible { outline: 2px solid var(--on-dark-focus); outline-offset: 2px; }
.entry.flash { border-color: var(--on-dark-focus); background: var(--on-dark-tint); }
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }
.entry .top { display: flex; justify-content: space-between; gap: var(--space-2); color: var(--console-muted); font-size: .75rem; }
.entry .top > :last-child { white-space: nowrap; }
.entry .tag { color: var(--on-dark-accent); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.entry h3 { font-size: .9375rem; font-weight: 600; line-height: 1.35; color: var(--console-ink); margin: 6px 0; }
.entry dl { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); }
.entry dt { color: var(--console-muted); }
.entry dd { color: var(--console-ink); word-break: break-word; }
.entry dd .line { display: block; }
/* A model's own label (reco, track_order) beside the words for it: smaller and quieter. */
.entry .id { display: inline-block; padding: 0 5px; border: 1px solid var(--console-line); border-radius: var(--r-xs); color: var(--console-ink-2); font-size: .75rem; line-height: 1.4; }
.entry .plain { margin: 0 0 var(--space-2); color: var(--console-ink); font-size: .875rem; line-height: 1.5; }
.entry .plain__label { display: block; color: var(--on-dark-accent); font-size: .75rem; font-weight: 600; }
.entry .decision { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--console-line); color: var(--on-dark-accent); font-weight: 600; }
.console-empty { color: var(--console-ink-2); font-size: .8125rem; padding: 20px 0; }
.back-to-cases { display: none; justify-self: center; margin-top: calc(var(--space-2) - var(--space-5)); padding: var(--space-2); font-size: .8125rem; font-weight: 600; color: var(--accent-text); text-underline-offset: 4px; border-radius: var(--r-xs); }
.back-to-app { display: none; align-self: center; margin-top: var(--space-3); font-size: .8125rem; font-weight: 600; color: var(--on-dark-accent); text-underline-offset: 4px; border-radius: var(--r-xs); }

/* Narrow screens: under the app, the newest decision in the log's navy, one
   tap from its entry (shown from 900px down). */
.log-peek { color-scheme: dark; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-3); padding: 9px 14px; border: 1px solid var(--console-edge); border-radius: var(--r-md); background: var(--console); color: var(--console-ink); text-decoration: none; transition: border-color var(--dur-2) var(--ease-soft); }
.log-peek:focus-visible { outline-color: var(--focus); }
.log-peek.flash { border-color: var(--on-dark-focus); }
.log-peek__top { grid-column: 1; grid-row: 1; display: flex; gap: var(--space-2); min-width: 0; overflow: hidden; white-space: nowrap; color: var(--on-dark-accent); font-size: .75rem; font-weight: 600; }
.log-peek__count { color: var(--console-ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.log-peek__count::before { content: "·"; margin-inline-end: var(--space-2); }
.log-peek__text { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.log-peek__go { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 6px; color: var(--on-dark-accent); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.log-peek__go svg, .tour__latest-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] :is(.log-peek__go, .tour__latest-go) svg { scale: -1 1; }
@media (max-width: 400px) { .log-peek__count { display: none; } }

@media (hover: hover) {
  .filters button:hover { border-color: var(--on-dark-hover); color: var(--console-ink); }
  .filters button[aria-pressed="true"]:hover { color: var(--frame); }
}

/* On dark grounds a moss fill alone is too close to the screen: a chosen chip gets the light moss edge. */
:root[data-theme="dark"] .chip.on { border-color: var(--brand); }

/* ---------- Touch ---------- */
/* To a finger every control is at least 44px tall: drawn that size where there
   is room, or grown by an empty pseudo-element where it sits in a line of text
   (Osimah's rule). Neighbours keep 8px apart. */
@media (pointer: coarse) {
  .uc button, .persona, .toggle, .reset, button.chip, .filters button, .cta, .send, .tour__back, .tour__next, .privacy summary { min-height: 44px; }
  button.chip { display: inline-flex; align-items: center; padding-inline: 13px; }
  .filters button { padding-inline: 13px; }
  .chips, .filters { gap: 8px; }
  .iconbtn { width: 44px; height: 44px; }
  .link, .back-to-app, .made-by__lockup, .mic, .tour__close, .lang-switch, .osimah-bar__cta { position: relative; }
  :is(.link, .back-to-app, .made-by__lockup, .mic, .sheet-close, .tour__close, .lang-switch, .osimah-bar__cta, .why)::after { content: ""; position: absolute; }
  .link::after, .back-to-app::after, .made-by__lockup::after { inset: -14px -8px; }
  .why::after { inset: -8px -4px; }
  .mic::after { inset: -4px; }
  .sheet-close::after, .tour__close::after { inset: -6px; }
  .lang-switch::after, .osimah-bar__cta::after { inset: -6px 0; }
}

/* ---------- Forced colours ---------- */
@media (forced-colors: active) {
  .toggle[aria-checked="true"] .switch { background: Highlight; border-color: Highlight; }
  .switch::after { forced-color-adjust: none; background: CanvasText; }
  .cta, .send, .iconbtn, .mic, .sheet-close { border: 1px solid ButtonText; }
  .sheet { border-top: 1px solid CanvasText; }
  .gauge, .factor .bar { border: 1px solid CanvasText; }
  .gauge b, .factor .bar b, .hours i { forced-color-adjust: none; background: CanvasText !important; }
  .hours i.best, .uc .done .dot { forced-color-adjust: none; background: Highlight !important; border-color: Highlight; }
  .persona[aria-pressed="true"], .filters button[aria-pressed="true"], .chip.on { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .persona[aria-pressed="true"] small { color: HighlightText; }
  .tabs button[aria-current="page"] { text-decoration: underline; }
  .why, .osimah-bar__cta, .tour__latest { border: 1px solid ButtonText; }
  .signals-on { border: 1px solid CanvasText; }
  /* A logo keeps the ground it was drawn for. */
  .osimah-logo { forced-color-adjust: none; background-color: #f6f6f6; background-image: url("../img/osimah-on-light.webp"); border-radius: var(--r-sm); }
  .osimah-bar .osimah-logo { background-color: #05070a; background-image: url("../img/osimah-on-dark.webp"); }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1180px) {
  .stage { grid-template-columns: 410px 1fr; }
  .side { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); align-items: start; }
  .phone-wrap, .console { position: static; }
}

/* One column: the customers, then the phone, then the rest, so the app is near the top. */
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding: var(--space-5) 14px; gap: var(--space-5); }
  .osimah-bar__inner, .brand { padding-inline: 14px; }
  .made-by { width: calc(100% - 28px); }
  .brand { flex-direction: column; align-items: flex-start; }
  .wide-only { display: none; }
  .side { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .phone-wrap { display: flex; justify-content: center; }
  .console { height: 560px; }
  .back-to-app { display: block; }
  /* One column: a swipe on the app or the log that reaches its end moves the
     page on, so the phone never holds the page in place. */
  .view, .log { overscroll-behavior-y: auto; }
  .back-to-cases { display: block; }
  /* The app comes into view sooner: the short lede, and the customers as a
     switch of first names with a line on the one chosen. */
  .brand { padding-top: var(--space-5); }
  .brand .eyebrow { margin-bottom: var(--space-2); }
  .lede-long { display: none; }
  .lede-short { display: inline; }
  .panel--personas h2 { margin-bottom: var(--space-2); }
  #personas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; }
  .persona { justify-content: center; gap: var(--space-2); min-height: 44px; margin: 0; padding: 4px 6px; border-radius: 11px; }
  .persona .avatar { width: 26px; height: 26px; font-size: .75rem; }
  .persona__rest, .persona small { display: none; }
  .persona-note { display: block; margin-top: var(--space-2); color: var(--ink-2); font-size: .8125rem; }
  .log-peek { display: grid; width: min(410px, 100%); justify-self: center; margin-top: calc(var(--space-2) - var(--space-5)); }
  /* The use cases and fraud switches fold here, so the phone follows the customers. */
  .panel { padding-block: var(--space-3); }
  .panel summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 32px; }
  .panel summary h2 { margin-bottom: 0; }
  .panel summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); margin-block: -4px 0; margin-inline-end: 4px; transition: transform var(--dur-3) var(--ease-out); }
  .panel[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .panel[open] summary { margin-bottom: 10px; }
  .made-by__ask, .made-by__row { flex-direction: column; align-items: flex-start; }
  .made-by__question { font-size: 1.5rem; }
}

/* Osimah's header ask stands down on a phone; the footer and the tour carry it. */
@media (max-width: 600px) {
  .osimah-bar__cta { display: none; }
}

/* Short screens: the assistant's suggestions scroll sideways so the chat keeps room. */
@media (max-height: 700px) {
  .composer-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .composer-chips::-webkit-scrollbar { display: none; }
  .composer-chips .chip { flex: none; }
}

/* A phone shows the app full width, like the real thing. */
@media (max-width: 460px) {
  .stage { padding: var(--space-4) 0; }
  .osimah-bar__inner { min-height: 56px; }
  .osimah-bar .osimah-logo { width: 112px; }
  .osimah-bar p { max-width: 11rem; }
  .panel, .console { margin-inline: 14px; }
  .console h2 { font-size: 1.5rem; }
  /* Shorter by the strip under it, so the app and its newest decision fill the screen together. */
  .phone { width: 100%; height: calc(100vh - 82px); height: calc(100svh - 82px); min-height: 520px; max-height: 800px; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
  .log-peek { width: auto; justify-self: stretch; margin-inline: 14px; }
  .screen { border-radius: 0; border-block: 1px solid var(--line); }
  .statusbar { height: 28px; }
  .tabs { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* ---------- The walkthrough ---------- */
/* A ring round what the step is about, and a card beside it. The card floats
   over paper and the dark frames alike, so it takes Osimah's one floating
   shadow (the floating ask's). */
.tour-ring { position: fixed; z-index: 90; border: 2px solid var(--accent-text); border-radius: var(--r-lg); pointer-events: none; transition: top var(--dur-3) var(--ease-out), left var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out), height var(--dur-3) var(--ease-out); }
.tour { position: fixed; z-index: 91; width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-4) var(--space-5) var(--space-5); box-shadow: 0 8px 20px -10px rgb(7 59 69 / .5); }
.tour__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.tour__count { font: 600 .75rem/1rem var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.tour__close { width: 32px; height: 32px; margin-inline-end: -8px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background-color var(--dur-1) var(--ease-soft); }
.tour__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.tour__title { font: 400 1.5rem/1.2 var(--font-display); color: var(--ink); margin-bottom: var(--space-2); }
/* Each step moves focus to its title so a screen reader reads it, but a title
   is not a control, so it draws no ring (a ring made it look like a field). */
.tour__title:focus, .tour__title:focus-visible { outline: none; }
.tour__body { color: var(--ink-2); font-size: .9375rem; line-height: 1.6; text-wrap: pretty; }
.tour__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }
.tour__back, .tour__next { min-height: 40px; padding: 0 var(--space-5); border-radius: var(--r-pill); font-weight: 600; font-size: .875rem; transition: background-color var(--dur-1) var(--ease-soft), color var(--dur-1) var(--ease-soft); }
.tour__back { border: 1px solid var(--action); color: var(--action); }
.tour__next { background: var(--action); color: var(--action-ink); border: 1px solid var(--action-edge); }
.tour__back:active, .tour__next:active { scale: .98; }
/* The last step's ask: a next step for whoever wants this in their own app. */
.tour__ask { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--r-md); background: var(--accent-wash); }
.tour__ask p { color: var(--ink); font-size: .875rem; font-weight: 600; }
.tour__contact { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-4); border: 1px solid var(--action-edge); border-radius: var(--r-pill); background: var(--action); color: var(--action-ink); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color var(--dur-1) var(--ease-soft); }
.tour__contact:is(:hover, :focus-visible) { background: var(--action-hover); }
/* There the ask is the one filled button; Finish steps back to an outline. */
.tour--last .tour__next { background: transparent; color: var(--action); border-color: var(--action); }
/* On a narrow screen: the step's newest decision, in the log's navy. */
.tour__latest { display: grid; gap: 2px; width: 100%; margin-top: var(--space-3); padding: 8px 12px; border-radius: var(--r-md); background: var(--console); color: var(--console-ink); color-scheme: dark; text-align: start; }
.tour__latest:focus-visible { outline-color: var(--focus); }
.tour__latest-top { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--on-dark-accent); font-size: .75rem; font-weight: 600; }
.tour__latest-go { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tour__latest-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; }
@media (hover: hover) {
  .tour__close:hover { background: var(--wash); }
  .tour__back:hover, .tour--last .tour__next:hover { background: var(--action); color: var(--action-ink); }
  .tour__next:hover { background: var(--action-hover); }
}
/* Narrow screens: the card is a sheet at the foot of the window, tighter so
   the app keeps more of the screen, and the page leaves room under the demo so
   the last part can scroll clear of it. */
.tour--docked { inset: auto 0 0 0; width: auto; max-height: 46vh; overflow-y: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; border-inline: 0; border-bottom: 0; padding: var(--space-3) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom)); }
.tour--docked .tour__top { margin-bottom: 0; }
.tour--docked .tour__title { font-size: 1.25rem; margin-bottom: var(--space-1); }
.tour--docked .tour__body { font-size: .875rem; line-height: 1.55; }
.tour--docked .tour__actions { margin-top: var(--space-3); }
.touring body { padding-bottom: 46vh; }
@media (min-width: 901px) { .touring body { padding-bottom: 0; } }
/* The --action and --focus tokens already turn light in dark mode. */
:root[data-theme="dark"] .tour-ring { border-color: var(--on-dark-focus); }
@media (forced-colors: active) {
  .tour-ring { border-color: Highlight; }
  .tour { border: 1px solid CanvasText; }
  .tour__back, .tour__next { border: 1px solid ButtonText; }
}

/* ---------- Kova's landscape and responsive motion layer ---------- */
.theme-toggle { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--console-control); border-radius: 50%; color: var(--console-ink); transition: background var(--dur-2); }
.theme-toggle:hover { background: var(--on-dark-tint); }
.theme-toggle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.theme-toggle:focus-visible { outline-color: var(--on-dark-focus); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-sun, :root[data-theme="dark"] .theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
.brand { position: relative; isolation: isolate; padding-top: 40px; }
.brand > div { position: relative; }
.brand-paths { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; fill: none; stroke: var(--accent-text); stroke-width: .65; pointer-events: none; mask-image: linear-gradient(90deg, transparent 15%, #000 52%, transparent 84%); }
.brand h1 { font-size: clamp(2.8rem, 4.6vw, 4.1rem); line-height: 1.04; }
.brand h1 > span { display: block; }
.brand__aside { max-width: 32rem; }
.brand__aside p { font-size: .9375rem; }
.tour-start { min-height: 40px; padding-inline: 15px; border-radius: var(--r-pill); background: var(--accent-wash); }
.panel--personas { border-top: 2px solid var(--accent-text); }
.persona { border: 1px solid transparent; transition: background var(--dur-2), border-color var(--dur-2); }
.persona[aria-pressed="true"] { border-color: var(--action-edge); }
.avatar { border-radius: 50%; }
.uc .dot { border-radius: 50%; }
.appbar { padding-bottom: 16px; }
.logo { font-size: 29px; }
.hello { font-size: 29px; letter-spacing: -.035em; }
.sub { margin-bottom: 18px; }
.card { padding: 16px; border-radius: 18px; }
.card h3 { font-size: 21px; letter-spacing: -.02em; line-height: 1.18; }
.card--nba { position: relative; overflow: hidden; background-image: radial-gradient(ellipse at 100% 100%, rgb(181 214 190 / .14), transparent 70%); }
.card--nba > :not(.nba-product) { position: relative; z-index: 1; }
.card--nba h3 { max-width: 90%; }
.card--nba p { max-width: 94%; }
.nba-product { position: absolute; inset-inline-end: -17px; bottom: -22px; opacity: .12; pointer-events: none; transform: rotate(-15deg); }
.nba-product svg { width: 142px; height: 142px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.cta { min-height: 38px; font-weight: 600; transition: background var(--dur-2), transform var(--dur-2); }
.cta:active { transform: scale(.97); }
.card--hero { overflow: hidden; background: var(--wash); }
.card--hero h3 { font-size: 25px; max-width: 17ch; }
.landscape { height: 100px; margin: -16px -16px 14px; overflow: hidden; background: #dce6d5; }
.landscape svg { display: block; width: 100%; height: 100%; }
.landscape__sun { fill: #e8a33d; }
.landscape__far { fill: #93ad98; }
.landscape__ridge { fill: #f0f3e7; }
.landscape__near { fill: #41684f; }
.landscape__trees { fill: #234531; }
.landscape__trail { fill: none; stroke: #e8c987; stroke-width: 3; stroke-linecap: round; }
.landscape__tent { fill: #e8a33d; }
.landscape__detail { fill: #6f4e27; }
.landscape--camping { background: #243e3c; }
.landscape--camping .landscape__far { fill: #54756a; }
.landscape--camping .landscape__ridge { fill: #91b0a0; }
.landscape--hiking { background: #e6dfca; }
.landscape--hiking .landscape__far { fill: #9ca58a; }
.landscape--hiking .landscape__near { fill: #596e4e; }
.thumb { isolation: isolate; overflow: hidden; border: 1px solid color-mix(in srgb, var(--tint-ink) 10%, transparent); }
.thumb::before { content: ""; position: absolute; z-index: -1; width: 104px; height: 104px; border: 1px solid color-mix(in srgb, var(--tint-ink) 15%, transparent); border-radius: 50%; }
.thumb::after { content: ""; position: absolute; z-index: -1; inset: 64% -20px -30px; background: color-mix(in srgb, var(--tint-ink) 6%, transparent); transform: rotate(-12deg); }
.thumb svg { width: 80px; height: 80px; stroke-width: 1.7; fill: color-mix(in srgb, var(--tint-ink) 9%, transparent); transition: transform var(--dur-3) var(--ease-out); }
.thumb--big svg { width: 124px; height: 124px; }
.thumb--big::before { width: 164px; height: 164px; }
.prod b { line-height: 1.35; }
.prod small { font-weight: 600; color: var(--brand); }
.tabs { position: relative; }
.tabs button { position: relative; z-index: 1; min-height: 46px; transition: color var(--dur-2); }
.tabs--animated button[aria-current="page"] { box-shadow: none; border-radius: 10px; }
.tab-indicator { position: absolute; top: 0; left: 0; pointer-events: none; border-radius: 12px; background: var(--wash); border: 1px solid var(--line); }
.console { background-image: radial-gradient(ellipse at 100% 0%, rgb(41 198 232 / .09), transparent 55%); }
.console header h2::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--on-dark-accent); margin-inline-end: 9px; vertical-align: middle; }
.entry { border-radius: 12px; border-color: transparent; border-bottom-color: var(--console-line); background: rgb(255 255 255 / .025); }
.entry .decision { border-inline-start: 2px solid var(--on-dark-accent); padding-inline-start: 10px; border-top: 0; padding-top: 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .prod:hover .thumb svg { transform: translateY(-4px) rotate(-5deg); }
  .cta:hover { transform: translateY(-1px); }
}
@media (max-width: 900px) {
  .brand { padding-top: 24px; gap: 16px; }
  .brand h1 { font-size: clamp(2.6rem, 6.5vw, 3.5rem); }
  .brand h1 > span { display: inline; }
  .brand-paths { mask-image: linear-gradient(90deg, transparent 10%, #000 65%, transparent); opacity: .5; }
  .brand__aside { gap: 12px; max-width: 40rem; }
  .persona .avatar { flex-shrink: 0; }
}
@media (max-width: 460px) {
  .osimah-bar__end { gap: 10px; }
  .theme-toggle { width: 36px; height: 36px; }
  .osimah-bar__end > p { display: none; }
  .brand h1 { font-size: 2.5rem; }
  .brand__aside p { font-size: .875rem; }
  .landscape { height: 88px; }
  .card--hero h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .cta:active, .cta:hover, .prod:hover .thumb svg { transform: none; }
}
@media (forced-colors: active) {
  .brand-paths, .landscape, .nba-product { display: none; }
  .tab-indicator { background: Canvas; border-color: Highlight; }
  .theme-toggle { border-color: ButtonText; }
}

/* ---------- Arabic, right to left ---------- */
/* Hidden until app.js has put the Arabic words in (set in index.html). */
html[data-pending] body { visibility: hidden; }

/* Osimah's Arabic faces: Noto Kufi Arabic for display (500 in the frame),
   IBM Plex Sans Arabic for text. In the app, Kufi takes Bricolage's place and
   Plex Sans Arabic Plex Sans's; Latin words keep their own faces. */
:root:lang(ar) {
  --font-display: 'Noto Kufi Arabic', 'DM Serif Display', Georgia, serif;
  --font-text: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}
:lang(ar) .screen {
  --display: 'Noto Kufi Arabic', 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  /* Plex Mono's wide spaces split Arabic words apart, so its labels take Plex
     Sans Arabic; the assistant's tool calls, which are code, keep the mono. */
  --mono: 'IBM Plex Sans Arabic', 'IBM Plex Mono', ui-monospace, monospace;
}
:lang(ar) .steps { font-family: 'IBM Plex Mono', 'IBM Plex Sans Arabic', ui-monospace, monospace; }
/* Arabic has no capitals, no italic and no tracking, and wants looser leading. */
:lang(ar) * { letter-spacing: normal !important; text-transform: none !important; }
:lang(ar) em { font-style: normal; }
:lang(ar) body { line-height: 1.7; }
:lang(ar) .brand h1, :lang(ar) .console h2, :lang(ar) .tour__title { font-weight: 500; line-height: 1.4; }
:lang(ar) .console h2 { font-size: 1.5rem; }
:lang(ar) .brand h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
:lang(ar) .tour__title { font-size: 1.25rem; }
:lang(ar) .brand__aside p, :lang(ar) .tour__body { line-height: 1.85; }
:lang(ar) .tour--docked .tour__body { line-height: 1.7; }
:lang(ar) .made-by__question { font-weight: 500; line-height: 1.5; }
:lang(ar) .eyebrow, :lang(ar) .tour__count { font-size: .8125rem; }
:lang(ar) .screen { line-height: 1.7; }
:lang(ar) .hello { line-height: 1.4; font-size: 24px; }
:lang(ar) .card h3, :lang(ar) .sheet h2, :lang(ar) .voice-ov h2, :lang(ar) .sec-h h3 { line-height: 1.5; }
:lang(ar) .logo { letter-spacing: -.03em !important; }
