/* Cork shared look — Round 2 visual convergence (Notion: Cork Visual Language & Characters, section 6).
 *
 * One stylesheet for every screen: design tokens + shared controls (button, chip) + the
 * canonical bottom nav (rendered by /static/cork-nav.js).
 *
 * Load it BEFORE a page's own <style> so page-local rules still win while screens converge:
 *   <link rel="stylesheet" href="/static/cork.css?v=vis3">
 * Bump the ?v= on every change: sw.js serves .css/.js cache-first, so an unversioned URL
 * would stay stale on installed PWAs.
 *
 * The token block mirrors static/tokens/*.css (the Claude Design System cut 2 drop-in).
 * It is inlined here so pages make one request instead of an @import chain; a test
 * (tests/test_vis_shared_shell.py) keeps the two in sync. Fonts are NOT imported here:
 * each page keeps its own non-blocking font load (display=swap), so this file never waits
 * on the network.
 *
 * Class names are prefixed .ck- so nothing here restyles existing page markup by accident.
 */

/* ── Tokens: colour ─────────────────────────────────────────────────────── */
:root{
--navy-900:#12192c;--navy-800:#1a2744;--navy-700:#2d3f6e;
--cream-050:#faf7f2;--cream-100:#f3ecdf;
--ink-900:#1a1a1a;--ink-700:#4a453e;--muted-500:#746a5a;
--gold-800:#7a5f22;--gold-700:#a8843a;--gold-500:#c9a84c;--gold-300:#eddfa0;--gold-100:#f5ecd3;
--dusty-pink-400:#d9a6a0;--burgundy-700:#722f37;--grey-400:#beb8ac;
--white:#ffffff;
--color-bg:var(--cream-050);
--color-surface:var(--white);
--color-surface-sunken:var(--cream-100);
--color-text-primary:var(--ink-900);
--color-text-secondary:var(--muted-500);
--color-text-inverse:var(--cream-050);
--color-brand-primary:var(--navy-800);
--color-brand-primary-hover:var(--navy-700);
--color-brand-accent:var(--gold-500);
--color-brand-accent-soft:rgba(201,168,76,.12);
--color-accent-pink:var(--dusty-pink-400);
--color-accent-burgundy:var(--burgundy-700);
--color-accent-grey:var(--grey-400);
--color-border:rgba(26,26,26,.09);
--color-border-strong:rgba(26,39,68,.18);
--color-focus:var(--navy-800);
--color-error:#b23b2e;
}
/* Journal semantic (journal.html only): moment backgrounds and verdict/rating
   tints, moved here unchanged from the page's local palette (Bundle 3). */
:root{
--journal-moment-dinner:#f0e8ef;--journal-moment-drinks:#e8f0f5;--journal-moment-celebration:#f5f0e0;
--journal-moment-casual:#e8f5ee;--journal-moment-solo:#f5f5f5;
--journal-loved:var(--burgundy-700);--journal-loved-bg:#f5e2e0;
--journal-again:var(--gold-700);--journal-again-bg:#f0e6c9;
--journal-maybe:var(--muted-500);--journal-maybe-bg:#f2efe8;
--journal-pass:#6b6357;--journal-pass-bg:#e8e4dc;
--journal-rec:var(--navy-800);--journal-rec-bg:#e4e8f0;
}

/* ── Tokens: typography ─────────────────────────────────────────────────── */
:root{
--font-serif:'Playfair Display',Georgia,'Times New Roman',serif;
/* Display headings share the Corksomm wordmark's Jost (Maz, 27 Oct); serif stays for editorial italic prose. */
--font-display:'Jost','Futura','Century Gothic',sans-serif;
--weight-display:500;--weight-display-strong:600;--tracking-display:-.01em;
--font-sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
--font-hand:'Caveat',cursive;
--text-xs:.75rem;--text-sm:.8125rem;--text-body:.9375rem;--text-md:1.0625rem;
--text-lg:1.25rem;--text-xl:1.625rem;--text-2xl:2rem;--text-display:2.5rem;
--leading-tight:1.2;--leading-snug:1.35;--leading-normal:1.5;
--tracking-wide:.08em;--tracking-wider:.1em;
--weight-regular:400;--weight-medium:500;--weight-semibold:600;--weight-bold:700;
}

/* ── Tokens: spacing ────────────────────────────────────────────────────── */
:root{
--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;
--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;
--ck-gutter:20px;
}

/* ── Tokens: radius / shadow / motion ───────────────────────────────────── */
:root{
--radius-sm:8px;--radius-md:12px;--radius-lg:16px;--radius-xl:20px;--radius-pill:999px;
--shadow-sm:0 2px 8px rgba(26,26,26,.06);
--shadow-md:0 6px 24px rgba(26,26,26,.10);
--ease-standard:cubic-bezier(.32,.72,0,1);
--duration-fast:150ms;
--duration-base:250ms;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */
:root{
--ck-shell-max:480px;
/* Height of the bottom nav, plus its bottom padding over the iPhone home bar.
   Pages clear it with padding-bottom: calc(var(--ck-nav-h) + var(--ck-nav-pb)).
   (Maz 1 Oct 16:14: adding the full safe-area inset on top of a 64px nav left a
   tall blank strip under the icons on iPhone; the old nav used ~20px.) */
--ck-nav-h:64px;
--ck-nav-pb:max(8px, calc(env(safe-area-inset-bottom, 0px) - 14px));
}

/* ── Button ─────────────────────────────────────────────────────────────── */
/* Variants: primary (navy) · secondary (white, outline) · accent (gold, one hero CTA
   at most) · ghost (text only). One primary per state. Size: default md, .ck-btn--sm. */
.ck-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:14px 26px;
  font-family:var(--font-sans);font-size:var(--text-body);font-weight:var(--weight-semibold);line-height:1.2;
  border:none;border-radius:var(--radius-pill);cursor:pointer;text-decoration:none;
  background:var(--color-brand-primary);color:var(--color-text-inverse);
  transition:transform .1s,opacity .15s,background-color var(--duration-fast);
  -webkit-tap-highlight-color:transparent;
}
.ck-btn:active{transform:scale(.98)}
.ck-btn:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
.ck-btn:disabled,.ck-btn[aria-disabled="true"]{opacity:.5;cursor:default;transform:none}
.ck-btn--sm{padding:10px 18px;font-size:var(--text-sm)}
.ck-btn--block{display:flex;width:100%}
.ck-btn--primary{background:var(--color-brand-primary);color:var(--color-text-inverse)}
.ck-btn--secondary{background:var(--color-surface);color:var(--color-brand-primary);box-shadow:inset 0 0 0 1.5px var(--color-border-strong)}
.ck-btn--accent{background:var(--color-brand-accent);color:var(--navy-900)}
.ck-btn--ghost{background:transparent;color:var(--color-brand-primary)}

/* ── Chip (read-only status badge) ──────────────────────────────────────── */
/* Tones: neutral (default) · gold · navy · pink. Text on gold tints uses --gold-800 (AA). */
.ck-chip{
  display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border-radius:var(--radius-pill);
  font-family:var(--font-sans);font-size:var(--text-xs);font-weight:var(--weight-semibold);
  letter-spacing:.04em;text-transform:uppercase;line-height:1.3;
  background:var(--color-surface-sunken);color:var(--color-text-secondary);
}
.ck-chip--gold{background:var(--color-brand-accent-soft);color:var(--gold-800);box-shadow:inset 0 0 0 1px rgba(201,168,76,.4)}
.ck-chip--navy{background:rgba(26,39,68,.08);color:var(--color-brand-primary)}
.ck-chip--pink{background:rgba(217,166,160,.18);color:var(--burgundy-700)}

/* ── Choice (selectable answer) ───────────────────────────────────────── */
/* The one V1 answer control (Round 2 HMC, 7 Oct): compact white pill, navy text,
   restrained border; selected = gold accent (soft gold fill, gold edge, check).
   Single-select advances on one tap; multi-select shows the check and a quiet
   Continue (.ck-btn--sm). Text-only; no emoji. .ck-choice__sub is an optional
   second line; .ck-choice--getout is the dashed "skip / none" answer. */
.ck-choices{display:flex;flex-wrap:wrap;gap:8px}
.ck-choice{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:9px 16px;
  font-family:var(--font-sans);font-size:.875rem;font-weight:var(--weight-medium);line-height:1.25;text-align:left;
  background:var(--color-surface);color:var(--color-brand-primary);
  border:1.5px solid var(--color-border-strong);border-radius:var(--radius-pill);cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background-color var(--duration-fast),border-color var(--duration-fast),opacity var(--duration-fast),transform .1s;
}
.ck-choice:active{transform:scale(.97)}
.ck-choice:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
.ck-choice[aria-pressed="true"],.ck-choice.is-selected{
  background:var(--color-brand-accent-soft);border-color:var(--color-brand-accent);color:var(--navy-900);
  box-shadow:inset 0 0 0 .5px var(--color-brand-accent)}
.ck-choice[aria-disabled="true"]{opacity:.45;cursor:default}
.ck-choice__check{display:none;width:14px;height:14px;fill:none;stroke:var(--gold-800);stroke-width:2.4;
  stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.ck-choice[aria-pressed="true"] .ck-choice__check{display:block}
.ck-choice--stack{flex-direction:column;align-items:flex-start;gap:1px;border-radius:var(--radius-lg);padding:10px 16px}
.ck-choice__sub{font-size:var(--text-xs);font-weight:var(--weight-regular);color:var(--color-text-secondary)}
.ck-choice--getout{border-style:dashed;color:var(--color-text-secondary);background:transparent}
/* Layouts with a line icon (HMC mockup, 7 Oct): .ck-choices--list = full-width rows,
   icon left; .ck-choices--grid = two-column tiles, icon above a centred label
   (.ck-choice--wide spans both columns as a row). Selected = the gold state above;
   the icon picks up the gold edge. */
.ck-choice__icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;
  stroke-linejoin:round;flex-shrink:0;color:var(--color-brand-primary)}
.ck-choice[aria-pressed="true"] .ck-choice__icon{color:var(--gold-800)}
.ck-choices--list,.ck-choices--grid{width:100%}
.ck-choices--list{flex-direction:column;flex-wrap:nowrap}
.ck-choices--list .ck-choice,.ck-choices--grid .ck-choice--wide{
  width:100%;justify-content:flex-start;gap:14px;min-height:50px;padding:11px 16px;
  border-radius:var(--radius-md);border-width:1px;border-color:var(--color-border-strong)}
.ck-choices--grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ck-choices--grid .ck-choice{
  flex-direction:column;justify-content:center;gap:6px;min-height:74px;padding:12px 8px;
  text-align:center;border-radius:var(--radius-md);border-width:1px;border-color:var(--color-border-strong)}
.ck-choices--grid .ck-choice--wide{grid-column:1 / -1;flex-direction:row;justify-content:flex-start;
  gap:14px;min-height:50px;padding:11px 16px;text-align:left}
.ck-choices--list .ck-choice[aria-disabled="true"],.ck-choices--grid .ck-choice[aria-disabled="true"]{opacity:.6}
.ck-choices--list .ck-choice[aria-pressed="true"],.ck-choices--grid .ck-choice[aria-pressed="true"]{
  border-color:var(--color-brand-accent);background:rgba(201,168,76,.18);box-shadow:inset 0 0 0 1px var(--color-brand-accent)}
.ck-choices--list .ck-choice__label,.ck-choices--grid .ck-choice__label{font-size:.875rem;line-height:1.25}

/* ── Tap acknowledgement (Maz 21 Oct) ───────────────────────────────────── */
/* Any chip/button that submits something adds .ck-tap; /static/cork-tap.js sets the
   states. Pressed (:active) = soft gold, as .ck-choice. Picked = filled with the brand
   accent (gold) so the tap reads as registered at once; the other buttons fade and
   are disabled while it saves. .ck-tap-note is the one short line under the buttons
   (Saving… / Saved / error). .ck-leaving fades and collapses a card before removal.
   :root raises specificity so page-local chip rules (.chip.used, .x.skip) can't hide it. */
.ck-tap{-webkit-tap-highlight-color:transparent;
  transition:background-color var(--duration-fast),border-color var(--duration-fast),color var(--duration-fast),opacity .2s,transform .1s}
.ck-tap:active:not(:disabled){transform:scale(.96);background-color:var(--color-brand-accent-soft);border-color:var(--color-brand-accent)}
:root .ck-tap.is-picked{background:var(--color-brand-accent);border-color:var(--color-brand-accent);border-style:solid;
  color:var(--navy-900);opacity:1;font-weight:var(--weight-semibold);cursor:default;transform:none}
:root .ck-tap.is-muted{opacity:.35;pointer-events:none}
.ck-tap:disabled{cursor:default}
.ck-tap-note{width:100%;margin-top:6px;font-family:var(--font-sans);font-size:var(--text-xs);font-weight:var(--weight-medium);
  line-height:1.35;color:var(--color-text-secondary)}
.ck-tap-note--ok{color:var(--gold-800)}
.ck-tap-note--ok::before{content:"\2713\00a0"}
.ck-tap-note--error{color:var(--burgundy-700)}
.ck-leaving{overflow:hidden;opacity:0;max-height:0 !important;margin-top:0 !important;margin-bottom:0 !important;
  padding-top:0 !important;padding-bottom:0 !important;
  transition:opacity .2s ease,max-height .3s ease .1s,margin .3s ease .1s,padding .3s ease .1s}
@media (prefers-reduced-motion: reduce){.ck-tap,.ck-leaving{transition:none}.ck-tap:active:not(:disabled){transform:none}}

/* ── Icon (one stroke family, 1.8px, currentColor) ──────────────────────── */
.ck-icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}

/* ── Bottom nav: Home · Journal · Taste · Me ────────────────────────────── */
/* Markup comes from /static/cork-nav.js. Fixed to the bottom of the 480px shell by
   default; .ck-nav--inline keeps it in flow for flex-column chat shells (session). */
.ck-nav{
  /* --vp-gap: iPhone home-screen app quirk (measured 1 Oct 17:03): on pages that
     don't scroll, iOS gives the page 654 of 693pt, so a bottom:0 nav floated
     39pt up. cork-nav.js measures the gap and the nav drops by it. */
  position:fixed;bottom:calc(-1 * var(--vp-gap, 0px));left:50%;transform:translateX(-50%);z-index:50;
  width:100%;max-width:var(--ck-shell-max);
  display:flex;justify-content:space-around;align-items:stretch;
  box-sizing:border-box;
  min-height:calc(var(--ck-nav-h) + var(--ck-nav-pb) - 6px);
  padding:6px 8px var(--ck-nav-pb);
  background:var(--color-bg);border-top:1px solid var(--color-border);
  font-family:var(--font-sans);
}
.ck-nav--inline{position:relative;left:auto;transform:none;max-width:none;flex-shrink:0;
  min-height:calc(var(--ck-nav-h) + var(--ck-nav-pb) - 6px);padding-bottom:var(--ck-nav-pb)}
.ck-nav__item{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:44px;padding:2px 0;
  color:var(--color-text-secondary);text-decoration:none;
  font-size:11px;font-weight:var(--weight-medium);letter-spacing:.01em;
  background:none;border:none;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:color var(--duration-fast);
}
.ck-nav__item .ck-icon{width:22px;height:22px}
.ck-nav__item[aria-current="page"]{color:var(--color-brand-primary);font-weight:var(--weight-semibold)}
.ck-nav__dot{width:4px;height:4px;border-radius:2px;background:transparent}
.ck-nav__item[aria-current="page"] .ck-nav__dot{background:var(--color-brand-accent)}
.ck-nav__item:focus-visible{outline:2px solid var(--color-focus);outline-offset:-4px;border-radius:var(--radius-sm)}

/* ── Coming soon (calm placeholder for a destination that isn't ready) ──── */
/* Cream canvas, one existing illustration, serif title, one quiet action. Never shows
   sample data as if it were the user's own. Used by constellation.html (Taste). */
.ck-soon{
  max-width:var(--ck-shell-max);margin:0 auto;
  padding:calc(var(--space-12) + env(safe-area-inset-top, 0px)) var(--space-6) var(--space-8);
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:var(--space-4);
  font-family:var(--font-sans);color:var(--color-text-primary);
}
.ck-soon__art{width:168px;height:auto;aspect-ratio:468/488;margin-bottom:var(--space-2)}
.ck-soon__title{font-family:var(--font-display);font-weight:var(--weight-display-strong);font-size:var(--text-2xl);letter-spacing:var(--tracking-display);
  line-height:var(--leading-tight);color:var(--color-brand-primary);margin:0}
.ck-soon__body{font-size:var(--text-body);line-height:var(--leading-normal);color:var(--color-text-secondary);
  max-width:34ch;margin:0;text-wrap:pretty}
.ck-soon .ck-btn{margin-top:var(--space-2)}

/* ── Chat identity: small Cork mark once per run of Cork messages ───────── */
/* Replaces the "C" circle on every message (Joe, 1 Oct 11:38). The 64px mark is a
   6.5 KB derivative of static/assets/logo/cork-mark.png (same artwork). */
.ck-cork-id{width:28px;height:28px;flex-shrink:0;margin-top:2px}
.ck-cork-id img{display:block;width:28px;height:28px;border-radius:8px}

/* ── Cork's Pick (Recommendation) ───────────────────────────────────────── */
/* A message inside the conversation, under Cork's lead-in, aligned with Cork's
   bubbles. Same white surface as a Cork bubble, only richer. No CTA. */
.ck-pick{
  flex:1;min-width:0;background:var(--color-surface);border-radius:var(--radius-lg);
  border:1px solid var(--color-border);box-shadow:0 1px 3px rgba(0,0,0,.06);
  padding:16px 16px 18px;font-family:var(--font-sans);color:var(--color-text-primary);
}
.ck-pick__eyebrow{display:flex;align-items:center;gap:10px;font-size:var(--text-xs);font-weight:var(--weight-semibold);
  letter-spacing:.08em;text-transform:uppercase}
.ck-pick__label{color:var(--gold-800)}
.ck-pick__type{display:inline-flex;align-items:center;gap:6px;color:var(--color-text-secondary);letter-spacing:.04em}
.ck-pick__dot{width:8px;height:8px;border-radius:50%;border:1px solid var(--color-border-strong);background:var(--grey-400)}
.ck-pick__name{font-family:var(--font-display);font-size:var(--text-xl);font-weight:var(--weight-display-strong);letter-spacing:var(--tracking-display);
  color:var(--navy-800);line-height:1.15;margin-top:10px;text-wrap:balance;overflow-wrap:anywhere}
.ck-pick__meta{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-top:6px;font-size:var(--text-sm)}
.ck-pick__facts{color:var(--ink-900)}
.ck-pick__why{font-size:14px;line-height:1.5;color:var(--ink-900);margin:12px 0 0;text-wrap:pretty}
.ck-pick__why strong{color:var(--navy-800)}
.ck-pick__cue{font-size:var(--text-sm);color:var(--gold-800);font-weight:var(--weight-medium);margin-top:8px}
.ck-pick__alts{margin-top:14px;padding-top:10px;border-top:1px dashed var(--color-border-strong)}
.ck-pick__alts-label{font-size:var(--text-xs);font-weight:var(--weight-semibold);letter-spacing:.08em;text-transform:uppercase;
  color:var(--color-text-secondary);margin-bottom:2px}
.ck-pick__alt{display:flex;align-items:baseline;gap:10px;padding:7px 0}
.ck-pick__alt-name{font-family:var(--font-display);font-size:15px;font-weight:var(--weight-display-strong);color:var(--navy-800)}
.ck-pick__alt-meta{font-size:12px;color:var(--color-text-secondary);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Round 2 (2.1): on phones the pick is the focal point, not the whole screen —
   ~15–20% less height via type, padding and spacing; same hierarchy. */
@media (max-width:480px){
  .ck-pick{padding:12px 14px 13px}
  .ck-pick__name{font-size:1.3125rem;margin-top:6px}
  .ck-pick__meta{margin-top:4px}
  .ck-pick__why{font-size:13.5px;line-height:1.42;margin-top:8px}
  .ck-pick__cue{margin-top:5px}
  .ck-pick__alts{margin-top:10px;padding-top:6px}
  .ck-pick__alt{padding:4px 0}
  .ck-pick__alt-name{font-size:14px}
}

/* ── Wine list summary (collapsed list once Cork has read it) ───────────── */
/* Notion 6 (frozen): the list photo never competes with the conversation. While the
   list is being read the session shows the full preview; once read it collapses to
   one quiet hairline line, "N wines · View list". No container. "View list" opens the
   existing lightbox and is omitted when the original image can't be restored.
   Link text uses --gold-800 (AA on cream) rather than the pack's --gold-700. */
.ck-list-summary{
  display:flex;align-items:center;gap:6px;flex-shrink:0;min-height:40px;padding:4px 16px;
  background:var(--color-bg);border-bottom:1px solid var(--color-border);
  font-family:var(--font-sans);font-size:var(--text-sm);color:var(--color-text-secondary);
}
.ck-list-summary[hidden]{display:none}
.ck-list-summary__count{color:var(--navy-800);font-weight:var(--weight-semibold);white-space:nowrap}
.ck-list-summary__view{
  background:none;border:none;padding:6px 0;min-height:32px;cursor:pointer;
  font-family:var(--font-sans);font-size:var(--text-sm);font-weight:var(--weight-semibold);
  color:var(--gold-800);text-decoration:underline;text-underline-offset:3px;
}
.ck-list-summary__view:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px;border-radius:4px}

/* ── Wordmark: CORKSOMM (Maz's approved brand pack, 27 Oct) ─────────────── */
/* Jost 500, uppercase, 0.05em tracking; the approved glass-O SVG replaces the FIRST O
   (never a text O). Rules below follow the pack's wordmark.css exactly. Markup:
     <span class="corksomm-wordmark" role="img" aria-label="Corksomm">C<img src="/static/assets/logo/corksomm-glass-o.svg" alt="">RKSOMM</span>
   Size comes from the page (font-size on the element). On dark headers add
   .corksomm-wordmark--reversed and use corksomm-glass-o-reversed.svg (#FBF7EF). */
.corksomm-wordmark{font-family:'Jost','Futura','Century Gothic',sans-serif;font-weight:500;letter-spacing:.05em;
  line-height:1;color:#5A1E2B;white-space:nowrap;display:inline-block}
.corksomm-wordmark img{height:.74em;width:.74em;vertical-align:-.015em;margin:0 .05em 0 0}
.corksomm-wordmark--reversed{color:#FBF7EF}

/* ── Skeleton (Bundle 3 slice 11): loading placeholder ─────────────────────── */
/* One palette and one shimmer for every loading state (Home boot card, Journal list and
   insights). Add .ck-skeleton to a placeholder block; the page keeps its size and radius.
   Sunken cream with a faint darker sweep, so it reads on white cards and the cream page. */
.ck-skeleton{
  background:linear-gradient(90deg,transparent 25%,rgba(26,26,26,.045) 50%,transparent 75%) var(--color-surface-sunken);
  background-size:200% 100%;
  animation:ck-shimmer 1.4s ease-in-out infinite;
}
@keyframes ck-shimmer{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}
@media (prefers-reduced-motion: reduce){.ck-skeleton{animation:none}}

/* ── Keyboard focus ring (Bundle 2, G8) ─────────────────────────────────── */
/* The one deliberate exception to the .ck- prefix rule: every tappable control on every
   screen gets the DESIGN.md ring (2px, 2px offset) for keyboard / switch users.
   :focus-visible only, so a finger or mouse tap never shows it. :where() keeps specificity
   at zero, so any page rule that styles its own ring still wins. Text fields are left out:
   they already show focus with a border change, and they match :focus-visible on every tap.
   Colour (Maz, 27 Oct): --color-focus is navy-800 on light surfaces (13.86:1 on cream; gold-500
   was 2.14:1); a dark container opts in with data-surface="dark" (or .ck-on-dark) and the
   controls inside it get gold-500 (6.48:1 on navy-800). Descendants only: the ring sits on the
   container's own background, so a focusable dark card on cream keeps the navy ring.
   Every page ring reads var(--color-focus). */
:where([data-surface="dark"], .ck-on-dark) *{--color-focus:var(--gold-500)}
:where(a[href], button, summary, select, [role="button"], [tabindex]:not([tabindex="-1"]),
  input[type="checkbox"], input[type="radio"], input[type="button"], input[type="submit"]):focus-visible{
  outline:2px solid var(--color-focus);outline-offset:2px}

/* ── Toast (Bundle 2, G9): the in-app message that replaces browser alert() ─ */
/* Markup comes from /static/cork-toast.js (CorkToast.show / CorkToast.error). White
   surface, ink text, burgundy-700 for errors; one polite live region per page. Sits under
   the status bar / notch, inside the 480px shell. */
.ck-toast-region{
  position:fixed;z-index:400;left:50%;transform:translateX(-50%);
  top:max(var(--space-4), calc(env(safe-area-inset-top, 0px) + var(--space-3)));
  width:calc(100% - 2 * var(--space-5));max-width:calc(var(--ck-shell-max) - 2 * var(--space-5));
  display:flex;flex-direction:column;gap:var(--space-2);pointer-events:none;
}
.ck-toast{
  pointer-events:auto;display:flex;align-items:flex-start;gap:var(--space-2);
  background:var(--color-surface);color:var(--color-text-primary);
  border:1px solid var(--color-border-strong);border-radius:var(--radius-md);box-shadow:var(--shadow-md);
  padding:var(--space-3) var(--space-2) var(--space-3) var(--space-4);
  font-family:var(--font-sans);font-size:var(--text-body);font-weight:var(--weight-medium);line-height:var(--leading-snug);
  opacity:0;transform:translateY(-8px);
  transition:opacity var(--duration-base) var(--ease-standard),transform var(--duration-base) var(--ease-standard);
}
.ck-toast.is-in{opacity:1;transform:none}
.ck-toast--error{color:var(--burgundy-700);border-left:4px solid var(--burgundy-700)}
.ck-toast__msg{flex:1;min-width:0;padding-top:2px}
.ck-toast__close{
  flex-shrink:0;width:44px;height:44px;margin:-10px -4px -10px 0;border:none;border-radius:var(--radius-pill);
  background:none;color:var(--color-text-secondary);cursor:pointer;
  display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;
}
.ck-toast__close .ck-icon{width:18px;height:18px}
@media (prefers-reduced-motion: reduce){.ck-toast{transition:none;transform:none}}

/* ── Typing indicator (Bundle 3 slice 10): "Cork is thinking" ──────────────── */
/* One indicator on Home, session and Help me choose (session's look): a Cork bubble with
   three gold dots, fixed 30px tall so a progress line never changes its height (ADR-1b).
   .ck-typing__label is the optional one-line progress text (role="status"); empty = hidden.
   Markup: <div class="ck-typing"><span class="ck-typing__dot"></span>×3
           <span class="ck-typing__label" role="status" aria-live="polite"></span></div> */
.ck-typing{
  display:flex;gap:4px;align-items:center;flex:0 0 auto;
  background:var(--color-surface);border-radius:4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding:0 14px;height:30px;box-sizing:border-box;box-shadow:var(--shadow-sm);
}
.ck-typing__dot{
  width:6px;height:6px;border-radius:50%;background:var(--color-brand-accent);
  animation:ck-typing-bounce 1.4s ease-in-out infinite;
}
.ck-typing__dot:nth-child(2){animation-delay:.2s}
.ck-typing__dot:nth-child(3){animation-delay:.4s}
.ck-typing__label{
  margin-left:6px;font-family:var(--font-sans);font-size:var(--text-sm);line-height:1;white-space:nowrap;
  color:var(--color-text-secondary);   /* muted-500 on white: 5.31:1 */
}
.ck-typing__label:empty{display:none}
@keyframes ck-typing-bounce{
  0%,60%,100%{opacity:.3;transform:translateY(0)}
  30%{opacity:1;transform:translateY(-4px)}
}
@media (prefers-reduced-motion: reduce){.ck-typing__dot{animation:none}}
