/* MSK Navigator studio kit (v3). The design system the wizard and the app stand on: warm paper and white, a display serif
 * for titles and big numbers, Inter for the UI, MSK Navigator teal for the one primary, muted material tints for covers and
 * medallions, objects instead of rows. Every visual value is a token on :root or lives in a .k-* part below, so a
 * screen never writes a hex, a shadow or an easing of its own. Light only. API and rules: docs/04-kit.md.
 *
 * Grounds and the serif are the landing's (landing.css: --l-ground #f7f1e8, --l-ground-2 #efe6db, Instrument Serif),
 * so the landing, the wizard and the app read as one company. Contrast notes are WCAG 2 ratios. */

@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-var.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/geist-mono-var.woff2") format("woff2"); }
@font-face { font-family: "MSK Navigator Display"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/landing-display.woff2") format("woff2"); }

:root {
  color-scheme: light;

  /* ── Colour ─────────────────────────────────────────────────────────── */
  /* Grounds: the landing's warm paper; white surfaces stand on it with soft depth. */
  --color-ground: #f7f1e8;          /* the page (landing --l-ground) */
  --color-ground-2: #efe6db;        /* sunk: tracks, desk, wells (landing --l-ground-2) */
  --color-surface: #ffffff;         /* cards, sheets, the panel, paper */
  --color-surface-2: #fbf8f3;       /* a quiet raised row, hover on white */
  /* Inks: one strong, two secondary greys, one for non-text marks only. */
  --color-ink: #22201c;             /* 14.5 on ground · 16.4 on white */
  --color-ink-2: #4a4741;           /* body; the landing's ink · 8.2 ground · 9.3 white */
  --color-ink-3: #6b665e;           /* meta, labels · 5.1 ground · 5.7 white · 4.6 ground-2 */
  --color-ink-4: #8f8a81;           /* non-text only: field edges, hollow nodes · 3.05 ground · 3.5 white */
  --color-hairline: #e6ded2;        /* rules and card edges */
  --color-hairline-strong: #d6ccbe; /* a secondary button's edge, the path's line */
  /* MSK Navigator teal: brand, selection and the one primary. Kept at v2's #2a6964 (6.4 white, 5.65 ground). */
  --color-brand: #2a6964;
  --color-brand-hover: #1f5550;     /* pressed / hover fill · 8.3 with white */
  --color-brand-mark: #4f8b85;      /* non-text teal: rings, nodes · 3.9 white · 3.5 ground */
  --color-brand-tint: #e2eeeb;      /* selection wash · teal text 5.35 on it */
  --color-brand-tint-2: #c9e0dc;    /* ring track, a selected chip's edge */
  --color-on-brand: #ffffff;
  /* Status: four, each beside a word or an icon. Informational is the teal. */
  --color-success: #376e3e;         /* 5.9 white · 5.2 own tint */
  --color-success-tint: #e6f0e3;
  --color-warning: #85580a;         /* 6.2 white · 5.3 own tint */
  --color-warning-tint: #f6ecd5;
  --color-danger: #a3392d;          /* 6.6 white · 5.4 own tint */
  --color-danger-tint: #f7e4df;
  /* Material tints: course covers, medallions, "You" chips. Muted, earthy; no purple, no neon.
   * Each has a light (hi), a body and a deep (emblem ink, rim); the deep reads ≥ 4.5 on its body. */
  --mat-sage-hi: #eef2e8;  --mat-sage: #d5e0cc;  --mat-sage-deep: #4d6847;
  --mat-clay-hi: #f7ebe2;  --mat-clay: #ebd3c2;  --mat-clay-deep: #8c4d31;
  --mat-sand-hi: #f8f0dc;  --mat-sand: #eedfbb;  --mat-sand-deep: #765a1c;
  --mat-slate-hi: #edf2f5; --mat-slate: #d3dee6; --mat-slate-deep: #3f5b72;
  --mat-teal-hi: #ebf4f2;  --mat-teal: #cde3df;  --mat-teal-deep: #24605b;
  --mat-stone-hi: #f3f0eb; --mat-stone: #e2ddd5; --mat-stone-deep: #5c574f;
  --color-medal-sheen: rgba(255, 255, 255, 0.55);
  --color-medal-rim: rgba(255, 255, 255, 0.9);
  /* Overlays: image covers only (legible text on a photo). */
  --color-cover-veil: rgba(22, 20, 17, 0.56);
  --color-cover-veil-0: rgba(22, 20, 17, 0);
  --color-cover-track: rgba(255, 255, 255, 0.35);
  --color-on-cover: #ffffff;
  --color-paper-veil: rgba(247, 241, 232, 0.72); /* a page left out of a packet */
  /* Washes and shadows (every shadow colour is warm, never grey-blue). */
  --color-wash: rgba(74, 71, 65, 0.06);
  --color-wash-strong: rgba(74, 71, 65, 0.1);
  --color-shadow-1: rgba(52, 40, 24, 0.06);
  --color-shadow-2: rgba(52, 40, 24, 0.1);
  --color-shadow-3: rgba(52, 40, 24, 0.16);
  --color-shadow-edge: rgba(52, 40, 24, 0.05);
  --color-tooltip: #22201c;
  --color-highlight: #f3e2b3;       /* a search match */
  /* Google's sign-in button (its published guidance): white fill, #747775 edge, #1f1f1f text, the four-colour G. */
  --color-google-edge: #747775;
  --color-google-text: #1f1f1f;
  --color-google-blue: #4285f4;
  --color-google-green: #34a853;
  --color-google-yellow: #fbbc05;
  --color-google-red: #ea4335;

  /* ── Type ───────────────────────────────────────────────────────────── */
  --font-display: "MSK Navigator Display", "Instrument Serif", Georgia, serif;  /* 400 only: page titles, greetings, big numbers */
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;  /* 400 and 500 */
  --font-mono: "Geist Mono Variable", ui-monospace, "SF Mono", monospace;  /* codes */
  --weight-regular: 400;
  --weight-medium: 500;
  /* UI (Inter): size / leading */
  --text-caption: 12px; --leading-caption: 16px;
  --text-meta: 13px;    --leading-meta: 20px;
  --text-body: 15px;    --leading-body: 24px;
  --text-lead: 17px;    --leading-lead: 26px;
  --text-title: 20px;   --leading-title: 28px;
  /* Display (MSK Navigator Display) */
  --display-s: 28px;  --display-s-leading: 32px;   /* sheet titles, the canvas's clinic name */
  --display-m: 34px;  --display-m-leading: 40px;   /* Navigator's turn in the wizard (≥ 28 at 390) */
  --display-l: 44px;  --display-l-leading: 48px;   /* page titles, the Home greeting */
  --display-xl: 64px; --display-xl-leading: 64px;  /* a big number */
  --tracking-display: -0.01em;
  --tracking-ui: -0.006em;
  --tracking-caps: 0.06em;

  /* ── Shape and depth ────────────────────────────────────────────────── */
  --radius-xs: 4px;      /* paper corners */
  --radius-sm: 8px;      /* tags, small wells */
  --radius-md: 12px;     /* fields, menus' rows */
  --radius-lg: 20px;     /* cards' covers, chips, tables */
  --radius-xl: 28px;     /* cards, the canvas, sheets, the panel */
  --radius-full: 9999px; /* buttons, pills, tabs: the landing's pill */
  --shadow-1: 0 0 0 1px var(--color-shadow-edge), 0 1px 2px var(--color-shadow-1), 0 4px 12px var(--color-shadow-1);
  --shadow-2: 0 0 0 1px var(--color-shadow-edge), 0 2px 6px var(--color-shadow-1), 0 16px 40px var(--color-shadow-2);
  --shadow-3: 0 0 0 1px var(--color-shadow-edge), 0 8px 24px var(--color-shadow-2), 0 32px 72px var(--color-shadow-3);
  --shadow-paper: 0 0 0 1px var(--color-shadow-edge), 0 2px 4px var(--color-shadow-1), 0 12px 32px var(--color-shadow-2);
  --shadow-inset: inset 0 1px 2px var(--color-shadow-1);
  --focus-ring: 0 0 0 2px var(--color-ground), 0 0 0 4px var(--color-brand);

  /* ── Space (4 px grid) and layout ───────────────────────────────────── */
  --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; --space-20: 80px;
  --gutter: 16px;            /* page side gutter: 16 → 24 (768) → 40 (1280) */
  --topbar: 64px;
  --tabbar: 64px;            /* the bottom tab bar below 768, plus the safe area */
  --panel: 400px;            /* Navigator's column at ≥ 1024 */
  --sheet: 480px;
  --content: 1120px;         /* the main column's measure */
  --convo: 600px;            /* the wizard's conversation column */
  --z-topbar: 20; --z-panel: 30; --z-sheet: 40; --z-dialog: 50; --z-toast: 60; --z-tooltip: 70;

  /* ── Motion ─────────────────────────────────────────────────────────── */
  --duration-fast: 120ms;     /* exits, presses */
  --duration-ui: 200ms;       /* most UI responses */
  --duration-slow: 320ms;     /* sheets, the panel, a chip's selection */
  --duration-explain: 600ms;  /* explaining moments: a finding lifts, pages fan, a medallion is earned */
  --duration-explain-max: 900ms; /* the longest explaining moment (envelope, plan → Home) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);        /* arrivals */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);     /* the landing's ease: state changes */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);             /* exits */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);     /* loops, travel */
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);  /* a medallion settling */
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1280px) { :root { --gutter: 40px; } }

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-color: var(--color-hairline); }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background-color: var(--color-ground); color: var(--color-ink);
  font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-ui); font-optical-sizing: auto;
}
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-size: inherit; font-weight: var(--weight-medium); }
b, strong { font-weight: var(--weight-medium); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
button:not(:disabled), [role="button"]:not([aria-disabled="true"]), summary { cursor: pointer; }
img, svg, video { display: block; max-width: 100%; }
img { user-select: none; -webkit-user-drag: none; }
[hidden] { display: none !important; }
code, kbd, samp, .k-mono { font-family: var(--font-mono); letter-spacing: 0; }
.k-icon, .k-ring svg, .k-check__tile svg { fill: none; }

/* Focus: a teal ring with a ground-coloured gap, keyboard focus only. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.k-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.k-tabular { font-variant-numeric: tabular-nums; }
.k-muted { color: var(--color-ink-3); }
.k-meta { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-caps { font-size: var(--text-caption); line-height: var(--leading-caption); font-weight: var(--weight-medium); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-ink-3); }
.k-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.k-stack { display: flex; flex-direction: column; gap: var(--space-6); width: 100%; min-width: 0; }
.k-stack--lg { gap: var(--space-12); }
.k-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.k-grid { display: grid; gap: var(--space-6); width: 100%; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.k-display { font-family: var(--font-display); font-weight: var(--weight-regular); letter-spacing: var(--tracking-display); }
.k-link {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; border-radius: var(--radius-xs);
  color: var(--color-brand); font-weight: var(--weight-medium);
  text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard);
}
.k-link:hover, .k-link:focus-visible { color: var(--color-brand-hover); text-decoration-color: currentColor; }
.k-link--quiet { color: var(--color-ink-2); }
.k-link--quiet:hover { color: var(--color-ink); }
.k-rule { height: 1px; width: 100%; background: var(--color-hairline); border: 0; margin: 0; }

/* ── Icons ────────────────────────────────────────────────────────────────── */
.k-icon { --icon-ink: currentColor; --icon-tint: transparent; display: block; flex-shrink: 0; overflow: visible; }
.k-icon .i-s { fill: none; stroke: var(--icon-ink); stroke-linecap: round; stroke-linejoin: round; }
.k-icon .i-t { fill: var(--icon-tint); stroke: none; transition: fill var(--duration-ui) var(--ease-standard); }
.k-icon .i-f { fill: var(--icon-ink); stroke: none; }
.k-icon .i-g-blue { fill: var(--color-google-blue); }
.k-icon .i-g-green { fill: var(--color-google-green); }
.k-icon .i-g-yellow { fill: var(--color-google-yellow); }
.k-icon .i-g-red { fill: var(--color-google-red); }
.k-icon--brand { --icon-ink: var(--color-brand); --icon-tint: var(--color-brand-tint); }
.k-icon--on { --icon-ink: var(--color-brand); --icon-tint: var(--color-brand-tint-2); }
.k-icon--muted { --icon-ink: var(--color-ink-3); }
.k-icon--subtle { --icon-ink: var(--color-ink-4); }
.k-icon--white { --icon-ink: var(--color-on-brand); }
.k-icon--success { --icon-ink: var(--color-success); --icon-tint: var(--color-success-tint); }
.k-icon--warning { --icon-ink: var(--color-warning); --icon-tint: var(--color-warning-tint); }
.k-icon--danger { --icon-ink: var(--color-danger); --icon-tint: var(--color-danger-tint); }

/* ── Buttons: pills. Secondary (white) by default; one teal primary per view; ghost; link ── */
.k-btn {
  position: relative; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: var(--space-2); white-space: nowrap;
  height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-full); border: 1px solid var(--color-hairline-strong);
  background: var(--color-surface); color: var(--color-ink); box-shadow: 0 1px 2px var(--color-shadow-1);
  font-size: var(--text-body); line-height: 1; font-weight: var(--weight-medium); user-select: none;
  transition: background-color var(--duration-ui) var(--ease-standard), border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.k-btn:hover, .k-btn[aria-expanded="true"] { background: var(--color-surface-2); border-color: var(--color-ink-4); }
.k-btn:active { transform: scale(0.97); }
.k-btn:disabled, .k-btn[aria-disabled="true"] { pointer-events: none; opacity: 0.45; }
.k-btn .k-icon { width: 20px; height: 20px; }
.k-btn--primary { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-on-brand); box-shadow: 0 1px 2px var(--color-shadow-2); }
.k-btn--primary:hover, .k-btn--primary[aria-expanded="true"] { border-color: var(--color-brand-hover); background: var(--color-brand-hover); }
.k-btn--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--color-ink-2); }
.k-btn--ghost:hover, .k-btn--ghost[aria-expanded="true"] { border-color: transparent; background: var(--color-wash); color: var(--color-ink); }
.k-btn--link { height: auto; min-height: 32px; padding: 0 var(--space-1); border-color: transparent; background: transparent; box-shadow: none; color: var(--color-brand); border-radius: var(--radius-xs); }
.k-btn--link:hover { border-color: transparent; background: transparent; color: var(--color-brand-hover); text-decoration: underline; text-underline-offset: 4px; }
.k-btn--sm { height: 36px; padding: 0 var(--space-4); font-size: var(--text-meta); }
.k-btn--sm .k-icon { width: 16px; height: 16px; }
.k-btn--lg { height: 52px; padding: 0 var(--space-8); font-size: var(--text-lead); }
.k-btn--icon { width: 44px; padding: 0; }
.k-btn--icon.k-btn--sm { width: 36px; }
.k-btn--block { width: 100%; }
.k-btn[aria-busy="true"] { pointer-events: none; }
.k-btn[aria-busy="true"] > :not(.k-spinner) { opacity: 0; }
.k-btn > .k-spinner { position: absolute; inset: 0; margin: auto; }
.k-spinner { display: block; width: 16px; height: 16px; flex-shrink: 0; border-radius: var(--radius-full); border: 2px solid var(--color-hairline-strong); border-top-color: var(--color-ink-2); animation: k-spin 600ms var(--ease-in-out) infinite; }
.k-btn--primary .k-spinner { border-color: var(--color-brand-mark); border-top-color: var(--color-on-brand); }

/* ── Small parts: pill (status word + icon), who-chip, count, kbd, avatar, Navigator's face ── */
.k-pill {
  display: inline-flex; height: 28px; flex-shrink: 0; align-items: center; gap: var(--space-1); white-space: nowrap; padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-full); background: var(--color-ground-2); color: var(--color-ink-2);
  font-size: var(--text-meta); line-height: 1; font-weight: var(--weight-medium);
}
.k-pill:not(:has(.k-icon)) { padding: 0 var(--space-3); }
.k-pill .k-icon { width: 16px; height: 16px; }
.k-pill--brand { background: var(--color-brand-tint); color: var(--color-brand); }
.k-pill--success { background: var(--color-success-tint); color: var(--color-success); }
.k-pill--warning { background: var(--color-warning-tint); color: var(--color-warning); }
.k-pill--danger { background: var(--color-danger-tint); color: var(--color-danger); }
.k-pill--you { background: var(--mat-sand-hi); color: var(--mat-sand-deep); box-shadow: inset 0 0 0 1px var(--mat-sand); }
.k-pill--quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--color-hairline-strong); }
.k-count {
  display: inline-flex; height: 20px; min-width: 20px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0 var(--space-2);
  border-radius: var(--radius-full); background: var(--color-ink); color: var(--color-surface);
  font-size: var(--text-caption); line-height: 1; font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.k-count--brand { background: var(--color-brand); color: var(--color-on-brand); }
.k-count--quiet { background: var(--color-ground-2); color: var(--color-ink-2); }
.k-kbd {
  display: inline-flex; height: 20px; min-width: 20px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0 var(--space-1);
  border-radius: var(--radius-xs); background: var(--color-ground-2); color: var(--color-ink-3);
  font-family: var(--font-sans); font-size: var(--text-caption); line-height: 1; font-weight: var(--weight-medium);
}
.k-avatar {
  position: relative; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden;
  width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--mat-stone); color: var(--color-ink-2);
  font-size: var(--text-caption); line-height: 1; font-weight: var(--weight-medium); letter-spacing: 0; white-space: nowrap;
  box-shadow: 0 0 0 2px var(--color-surface);
}
.k-avatar img { width: 100%; height: 100%; object-fit: cover; }
.k-avatar--sm { width: 28px; height: 28px; }
.k-avatar--lg { width: 48px; height: 48px; font-size: var(--text-body); }
.k-face { position: relative; display: inline-block; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--mat-stone); box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-brand-tint-2); }
.k-face img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.k-face--24 { width: 24px; height: 24px; box-shadow: 0 0 0 1px var(--color-brand-tint-2); }
.k-face--32 { width: 32px; height: 32px; }
.k-face--48 { width: 48px; height: 48px; }
.k-face--64 { width: 64px; height: 64px; }
.k-who { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }

/* ── Headings: the page title in the display serif; a section head in Inter ── */
.k-heading { display: flex; width: 100%; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.k-heading__text { display: flex; min-width: 0; flex-direction: column; gap: var(--space-2); }
.k-heading__eyebrow { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-heading__title { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-l); line-height: var(--display-l-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); text-wrap: balance; }
.k-heading__sub { max-width: 60ch; font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); }
.k-heading__end { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-3); }
.k-head { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.k-head__title { font-size: var(--text-title); line-height: var(--leading-title); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-head__sub { margin-top: var(--space-1); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
@media (max-width: 767px) { .k-heading__title { font-size: 36px; line-height: 40px; } }

/* ── Card: one idea on white, large radius, soft depth. Never a card in a card. ── */
.k-card { position: relative; display: flex; min-width: 0; flex-direction: column; gap: var(--space-5); padding: var(--space-6); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-1); }
.k-card--flush { padding: 0; overflow: hidden; }
.k-card--interactive { transition: box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-out); }
.k-card--interactive:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.k-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.k-card__title { font-size: var(--text-lead); line-height: var(--leading-lead); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-card__sub { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
@media (max-width: 767px) { .k-card { padding: var(--space-5); border-radius: var(--radius-lg); } }

/* ── Stat: a big serif number with a quiet label; a results line, never tiles ── */
.k-stat { display: inline-flex; min-width: 0; flex-direction: column; gap: var(--space-1); }
.k-stat__value { display: flex; align-items: baseline; gap: var(--space-2); font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-l); line-height: var(--display-l-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.k-stat__unit { font-family: var(--font-sans); font-size: var(--text-body); line-height: 1; letter-spacing: var(--tracking-ui); color: var(--color-ink-3); }
.k-stat__label { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-stat--xl .k-stat__value { font-size: var(--display-xl); line-height: var(--display-xl-leading); }
.k-statline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-6) var(--space-10); }
.k-statline > .k-stat + .k-stat { position: relative; }
.k-statline > .k-stat + .k-stat::before { content: ""; position: absolute; left: calc(-1 * var(--space-5)); top: var(--space-2); bottom: var(--space-2); width: 1px; background: var(--color-hairline-strong); }

/* ── Fields ───────────────────────────────────────────────────────────────── */
.k-field { display: flex; width: 100%; flex-direction: column; gap: var(--space-2); }
.k-field__label { font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-medium); color: var(--color-ink-2); }
.k-field__hint { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-field__error { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-danger); }
.k-input, .k-textarea, .k-select {
  width: 100%; border: 1px solid var(--color-ink-4); border-radius: var(--radius-md); background: var(--color-surface);
  padding: 0 var(--space-4); font-size: var(--text-body); color: var(--color-ink); outline: none;
  transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
.k-input, .k-select { height: 48px; line-height: 1; }
.k-textarea { resize: none; padding: var(--space-3) var(--space-4); line-height: var(--leading-body); }
.k-input::placeholder, .k-textarea::placeholder { color: var(--color-ink-3); opacity: 1; }
.k-input:hover, .k-textarea:hover, .k-select:hover { border-color: var(--color-ink-3); }
.k-input:focus, .k-textarea:focus, .k-select:focus { border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--color-brand-tint-2); outline: none; }
.k-input:disabled, .k-textarea:disabled, .k-select:disabled { pointer-events: none; opacity: 0.5; }
.k-input[aria-invalid="true"], .k-textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.k-select { appearance: none; padding-right: var(--space-10); cursor: pointer; background: var(--color-surface) no-repeat right 16px center / 14px 14px; background-image: var(--chevron); }
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b665e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.k-search {
  display: flex; height: 44px; cursor: text; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); overflow: clip;
  border-radius: var(--radius-full); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-ink-4);
  transition: box-shadow var(--duration-ui) var(--ease-standard); color: var(--color-ink-3);
}
.k-search:hover { box-shadow: inset 0 0 0 1px var(--color-ink-3); }
.k-search:focus-within { box-shadow: inset 0 0 0 1px var(--color-brand), 0 0 0 3px var(--color-brand-tint-2); }
.k-search input { min-width: 0; flex: 1; height: 100%; border: 0; background: transparent; padding: 0; font-size: var(--text-body); line-height: 1; color: var(--color-ink); outline: none; }
.k-search input::placeholder { color: var(--color-ink-3); opacity: 1; }
.k-search input::-webkit-search-cancel-button { display: none; }
.k-search__hint { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-1); transition: opacity var(--duration-ui) var(--ease-standard); }
.k-search:focus-within .k-search__hint { opacity: 0; }

/* Checkbox (18 drawn, 24 hit) and switch */
.k-check { position: relative; display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.k-check input { position: absolute; inset: -2px; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.k-check__tile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1.5px solid var(--color-ink-4); background: var(--color-surface); transition: background-color var(--duration-ui) var(--ease-standard), border-color var(--duration-ui) var(--ease-standard); }
.k-check__tile svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.6); transition: opacity var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-out); }
.k-check__tile svg path { fill: none; stroke: var(--color-on-brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.k-check input:checked ~ .k-check__tile, .k-check input:indeterminate ~ .k-check__tile { border-color: var(--color-brand); background: var(--color-brand); }
.k-check input:checked ~ .k-check__tile svg { opacity: 1; transform: none; }
.k-check input:indeterminate ~ .k-check__tile::after { content: ""; width: 8px; height: 2px; border-radius: var(--radius-full); background: var(--color-on-brand); }
.k-check input:focus-visible { outline: none; }
.k-check:has(input:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 6px; }
.k-check-label { display: inline-flex; min-height: 24px; align-items: center; gap: var(--space-3); color: var(--color-ink-2); cursor: pointer; }
.k-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); min-height: 32px; cursor: pointer; color: var(--color-ink-2); }
.k-switch input { position: absolute; opacity: 0; width: 44px; height: 28px; margin: 0; cursor: pointer; }
.k-switch__track { position: relative; width: 44px; height: 28px; flex-shrink: 0; border-radius: var(--radius-full); background: var(--color-hairline-strong); transition: background-color var(--duration-ui) var(--ease-standard); }
.k-switch__track::after { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--color-surface); box-shadow: 0 1px 2px var(--color-shadow-2); transition: transform var(--duration-ui) var(--ease-out); }
.k-switch input:checked + .k-switch__track { background: var(--color-brand); }
.k-switch input:checked + .k-switch__track::after { transform: translateX(16px); }
.k-switch:has(input:focus-visible) .k-switch__track { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* ── Segmented tabs: a sunk track, a white pill that slides ───────────────── */
.k-tabs { position: relative; display: inline-flex; max-width: 100%; align-items: stretch; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-full); background: var(--color-ground-2); }
.k-tabs__pill { position: absolute; top: 4px; bottom: 4px; border-radius: var(--radius-full); background: var(--color-surface); box-shadow: 0 1px 2px var(--color-shadow-2), 0 0 0 1px var(--color-shadow-edge); transition: left var(--duration-slow) var(--ease-out), width var(--duration-slow) var(--ease-out); }
.k-tabs__item {
  position: relative; z-index: 1; display: flex; min-height: 36px; min-width: max-content; flex: 1 1 0; align-items: center; justify-content: center; gap: var(--space-2);
  white-space: nowrap; padding: 0 var(--space-4); border-radius: var(--radius-full); font-size: var(--text-body); line-height: 1; font-weight: var(--weight-medium); color: var(--color-ink-3);
  transition: color var(--duration-ui) var(--ease-standard);
}
.k-tabs__item:hover { color: var(--color-ink); }
.k-tabs__item[aria-selected="true"] { color: var(--color-ink); }
.k-tabs__item .k-icon { width: 18px; height: 18px; }
.k-tabs { overflow-x: auto; scrollbar-width: none; }
.k-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 479px) { .k-tabs__item { padding: 0 var(--space-3); } }
.k-tabs--block { display: flex; width: 100%; }

/* ── App shell: a top bar with five tabs, a main column, Navigator's column; a bottom tab bar below 768 ── */
.k-shell { position: relative; display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; background: var(--color-ground); }
.k-topbar {
  position: sticky; top: 0; z-index: var(--z-topbar); grid-column: 1 / -1; display: grid; height: var(--topbar); align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-4); padding: 0 var(--gutter);
  background: var(--color-ground); box-shadow: 0 1px 0 var(--color-hairline);
}
.k-topbar__clinic { display: flex; min-width: 0; align-items: center; gap: var(--space-3); justify-self: start; border-radius: var(--radius-md); padding: var(--space-1) var(--space-2) var(--space-1) 0; }
.k-topbar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-topbar__end { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); justify-self: end; }
.k-clinicmark { display: inline-flex; width: 36px; height: 36px; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-1); font-family: var(--font-display); font-size: var(--text-title); line-height: 1; color: var(--color-ink); letter-spacing: 0; }
.k-clinicmark img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-1); }
.k-navtabs { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-full); background: var(--color-ground-2); }
.k-navtabs__item {
  display: inline-flex; height: 40px; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); border-radius: var(--radius-full);
  font-size: var(--text-body); line-height: 1; font-weight: var(--weight-medium); color: var(--color-ink-3); white-space: nowrap;
  transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
.k-navtabs__item:hover { color: var(--color-ink); }
.k-navtabs__item[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); box-shadow: 0 1px 2px var(--color-shadow-2), 0 0 0 1px var(--color-shadow-edge); }
.k-ask { gap: var(--space-2); padding: 0 var(--space-4) 0 var(--space-1); }
.k-ask .k-face { width: 32px; height: 32px; box-shadow: none; }
.k-ask[aria-expanded="true"] { border-color: var(--color-brand-mark); background: var(--color-brand-tint); }
.k-account { display: inline-flex; border-radius: var(--radius-full); }
.k-account .k-avatar { width: 40px; height: 40px; }
.k-shell__body { grid-column: 1 / -1; display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); align-items: start; }
.k-main { min-width: 0; width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: var(--space-10) var(--gutter) var(--space-20); outline: none; }
.k-tabbar { display: none; }
.k-panel { display: none; }
@media (min-width: 1024px) {
  .k-shell[data-panel-open] .k-shell__body { grid-template-columns: minmax(0, 1fr) calc(var(--panel) + var(--space-3)); }
  .k-shell[data-panel-open] .k-panel {
    position: sticky; top: calc(var(--topbar) + var(--space-3)); display: flex; height: calc(100dvh - var(--topbar) - var(--space-6)); margin-right: var(--space-3);
    animation: k-panel-in var(--duration-slow) var(--ease-out) both;
  }
}
@media (max-width: 1023px) {
  .k-shell[data-panel-open] .k-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-panel); display: flex; height: min(85dvh, 720px);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: k-rise-sheet var(--duration-slow) var(--ease-out) both;
  }
}
.k-panel[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both !important; }
@media (max-width: 767px) {
  .k-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .k-navtabs { display: none; }
  .k-ask { width: 44px; padding: 0; justify-content: center; }
  .k-ask .k-ask__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .k-main { padding: var(--space-6) var(--gutter) calc(var(--space-12) + var(--tabbar)); }
  .k-tabbar {
    position: sticky; bottom: 0; z-index: var(--z-topbar); grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--tabs, 5), minmax(0, 1fr));
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 0 var(--space-2) env(safe-area-inset-bottom);
    background: var(--color-surface); box-shadow: 0 -1px 0 var(--color-hairline);
  }
  .k-tabbar__item { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); color: var(--color-ink-3); font-size: var(--text-caption); line-height: var(--leading-caption); font-weight: var(--weight-medium); border-radius: var(--radius-md); }
  .k-tabbar__icon { display: flex; }
  .k-tabbar__item .k-icon { width: 24px; height: 24px; }
  .k-tabbar__item[aria-current="page"] { color: var(--color-brand); }
}
.k-skip { position: absolute; left: var(--space-4); top: -64px; z-index: var(--z-tooltip); padding: var(--space-3) var(--space-5); border-radius: var(--radius-full); background: var(--color-ink); color: var(--color-surface); }
.k-skip:focus { top: var(--space-3); }

/* Navigator's panel (its column at ≥ 1024, a bottom sheet below) */
.k-panel { min-width: 0; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-2); }
.k-panel__head { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); box-shadow: 0 1px 0 var(--color-hairline); }
.k-panel__who { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.k-panel__name { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-panel__role { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-panel__body { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: var(--space-5); overflow-y: auto; padding: var(--space-5); scrollbar-width: thin; }
.k-panel__foot { flex-shrink: 0; padding: var(--space-3) var(--space-4) var(--space-4); box-shadow: 0 -1px 0 var(--color-hairline); }
/* Navigator's words inside the panel and its action chips */
.k-says { display: flex; flex-direction: column; gap: var(--space-3); max-width: 44ch; font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink); }
.k-asked { align-self: flex-end; max-width: 80%; padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg); background: var(--color-ground-2); color: var(--color-ink); }
.k-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ── Navigator in the app: the greeting (Home) and an inline note (≤ 1 a screen) ── */
.k-greet { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); }
.k-greet__who { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-greet__who b { color: var(--color-ink-2); }
.k-greet__line { max-width: 26ch; font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-l); line-height: var(--display-l-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); text-wrap: balance; }
.k-greet__bridge { max-width: 60ch; margin-top: calc(-1 * var(--space-2)); font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); }
.k-greet__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
@media (max-width: 767px) { .k-greet__line { font-size: 32px; line-height: 38px; } }
.k-note { display: flex; width: 100%; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-radius: var(--radius-lg); background: var(--color-brand-tint); color: var(--color-ink); animation: k-rise var(--duration-ui) var(--ease-out) both; }
.k-note { flex-wrap: wrap; }
.k-note__text { min-width: 0; flex: 1 1 200px; padding: var(--space-1) 0; font-size: var(--text-body); line-height: var(--leading-body); }
.k-note__end { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-1); }
.k-note .k-btn--ghost:hover { background: var(--color-brand-tint-2); }
.k-note[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both; }

/* ── The conversation (the wizard): stages, Navigator's turn, past answers, big chips, the URL field ── */
.k-convo { display: flex; width: 100%; max-width: var(--convo); flex-direction: column; gap: var(--space-8); }
.k-stages { display: flex; width: 100%; align-items: center; gap: var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-stages__item { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: var(--space-2); }
.k-stages__bar { height: 4px; border-radius: var(--radius-full); background: var(--color-hairline-strong); transition: background-color var(--duration-slow) var(--ease-standard); }
.k-stages__item[data-state="done"] .k-stages__bar { background: var(--color-brand); }
.k-stages__item[data-state="current"] .k-stages__bar { background: var(--color-brand-mark); }
.k-stages__item[data-state="current"] { color: var(--color-ink); font-weight: var(--weight-medium); }
.k-stages__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) { .k-stages__item:not([data-state="current"]) .k-stages__label { visibility: hidden; } }
.k-turn { display: flex; flex-direction: column; gap: var(--space-6); animation: k-rise var(--duration-slow) var(--ease-out) both; }
.k-msg { display: flex; align-items: flex-start; gap: var(--space-4); }
.k-msg__text { display: flex; min-width: 0; flex-direction: column; gap: var(--space-3); }
.k-msg__who { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-msg__line { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-m); line-height: var(--display-m-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); text-wrap: pretty; }
.k-msg__sub { font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); }
.k-msg--small .k-msg__line { font-size: var(--text-lead); line-height: var(--leading-lead); font-family: var(--font-sans); letter-spacing: var(--tracking-ui); }
@media (max-width: 767px) { .k-msg { gap: var(--space-3); } .k-msg__line { font-size: 28px; line-height: 34px; } }
.k-answers { display: flex; flex-direction: column; }
.k-answer {
  display: flex; width: 100%; min-height: 48px; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); margin: 0 calc(-1 * var(--space-3));
  width: calc(100% + 2 * var(--space-3)); border-radius: var(--radius-md); text-align: left; color: var(--color-ink-2);
  transition: background-color var(--duration-ui) var(--ease-standard);
}
.k-answer + .k-answer { box-shadow: 0 -1px 0 var(--color-hairline); }
.k-answer:hover { background: var(--color-wash); }
.k-answer__q { flex-shrink: 0; width: 132px; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-answer__a { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-medium); color: var(--color-ink); }
.k-answer__edit { display: inline-flex; align-items: center; gap: var(--space-1); flex-shrink: 0; font-size: var(--text-meta); line-height: 1; color: var(--color-ink-3); transition: color var(--duration-ui) var(--ease-standard); }
.k-answer:hover .k-answer__edit, .k-answer:focus-visible .k-answer__edit { color: var(--color-brand); }
@media (max-width: 767px) { .k-answer__q { width: 96px; } }
.k-chips { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.k-chips--stack { flex-direction: column; align-items: stretch; }
.k-chip {
  position: relative; display: inline-flex; min-height: 56px; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); color: var(--color-ink);
  font-size: var(--text-lead); line-height: var(--leading-lead); font-weight: var(--weight-medium); text-align: left;
  transition: box-shadow var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-out);
}
.k-chip:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.k-chip:active { transform: scale(0.98); }
.k-chip .k-icon { width: 24px; height: 24px; color: var(--color-ink-3); }
.k-chip__hint { display: block; font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-regular); color: var(--color-ink-3); }
.k-chip__mark { display: none; width: 24px; height: 24px; flex-shrink: 0; align-items: center; justify-content: center; margin-left: auto; border-radius: var(--radius-full); background: var(--color-brand); color: var(--color-on-brand); }
.k-chip__mark .k-icon { width: 14px; height: 14px; color: var(--color-on-brand); }
.k-chip[aria-checked="true"], .k-chip[aria-pressed="true"] { background: var(--color-brand-tint); box-shadow: inset 0 0 0 2px var(--color-brand-mark); }
.k-chip[aria-checked="true"] .k-chip__mark, .k-chip[aria-pressed="true"] .k-chip__mark { display: inline-flex; animation: k-pop var(--duration-slow) var(--ease-spring) both; }
.k-chip[aria-checked="true"] > .k-icon, .k-chip[aria-pressed="true"] > .k-icon { color: var(--color-brand); }
.k-chip[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.k-urlfield { display: flex; width: 100%; height: 64px; align-items: center; gap: var(--space-3); padding: 0 var(--space-2) 0 var(--space-5); border-radius: var(--radius-full); background: var(--color-surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--color-ink-4); transition: box-shadow var(--duration-ui) var(--ease-standard); color: var(--color-ink-3); }
.k-urlfield:focus-within { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--color-brand), 0 0 0 4px var(--color-brand-tint-2); }
.k-urlfield input { min-width: 0; flex: 1; height: 100%; border: 0; background: transparent; padding: 0; font-size: var(--text-lead); line-height: 1; color: var(--color-ink); outline: none; }
.k-urlfield input::placeholder { color: var(--color-ink-3); opacity: 1; }
.k-urlfield .k-btn { height: 48px; }
.k-urlfield__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-3); padding-left: var(--space-5); }
@media (max-width: 479px) { .k-urlfield { height: auto; flex-wrap: wrap; padding: var(--space-2); border-radius: var(--radius-lg); } .k-urlfield > .k-icon { margin-left: var(--space-2); } .k-urlfield input { height: 48px; } .k-urlfield .k-btn { width: 100%; } .k-urlfield__links { padding-left: 0; } }
.k-say { display: flex; width: 100%; height: 48px; align-items: center; gap: var(--space-2); padding: 0 var(--space-1) 0 var(--space-4); border-radius: var(--radius-full); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-ink-4); transition: box-shadow var(--duration-ui) var(--ease-standard); }
.k-say:focus-within { box-shadow: inset 0 0 0 1px var(--color-brand), 0 0 0 3px var(--color-brand-tint-2); }
.k-say input { min-width: 0; flex: 1; height: 100%; border: 0; background: transparent; padding: 0; font-size: var(--text-body); color: var(--color-ink); outline: none; }
.k-say input::placeholder { color: var(--color-ink-3); opacity: 1; }
.k-say .k-btn { height: 40px; width: 40px; }
.k-typing { display: inline-flex; height: 40px; align-items: center; gap: var(--space-1); padding: 0 var(--space-4); border-radius: var(--radius-full); background: var(--color-surface); box-shadow: var(--shadow-1); }
.k-typing i { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-ink-4); animation: k-dot 600ms var(--ease-in-out) infinite alternate; }
.k-typing i:nth-child(2) { animation-delay: 200ms; }
.k-typing i:nth-child(3) { animation-delay: 400ms; }

/* ── The canvas: "Your plan, taking shape" ────────────────────────────────── */
.k-canvas { display: flex; width: 100%; flex-direction: column; border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-2); overflow: hidden; }
.k-canvas__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-6); box-shadow: 0 1px 0 var(--color-hairline); }
.k-canvas__title { display: flex; min-width: 0; align-items: center; gap: var(--space-3); font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-canvas__count { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); font-variant-numeric: tabular-nums; }
.k-canvas__toggle { display: none; }
.k-canvas__body { display: flex; flex-direction: column; }
.k-canvas__sec { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.k-canvas__sec + .k-canvas__sec { box-shadow: 0 -1px 0 var(--color-hairline); }
.k-canvas__label { display: flex; align-items: center; gap: var(--space-2); }
.k-canvas__label .k-icon { width: 16px; height: 16px; color: var(--color-ink-3); }
.k-canvas__sec[data-state="filled"] .k-canvas__label .k-icon { color: var(--color-brand); }
.k-canvas__sec[data-state="empty"] .k-canvas__fill { display: flex; flex-direction: column; gap: var(--space-3); }
.k-canvas__sec[data-state="filling"] .k-canvas__fill, .k-canvas__sec[data-state="filled"] .k-canvas__fill { animation: k-lift var(--duration-explain) var(--ease-out) both; }
.k-canvas__sec[data-highlight] { background: var(--color-brand-tint); }
@media (max-width: 767px) {
  .k-canvas { border-radius: var(--radius-lg); }
  .k-canvas__toggle { display: inline-flex; }
  .k-canvas__head { padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); box-shadow: none; }
  .k-canvas[data-collapsed] .k-canvas__body { display: none; }
  .k-canvas:not([data-collapsed]) .k-canvas__head { box-shadow: 0 1px 0 var(--color-hairline); }
  .k-canvas__sec { padding: var(--space-5) var(--space-4); }
}
/* The brand card: what was read from the clinic's website */
.k-brandcard { display: flex; flex-direction: column; gap: var(--space-4); }
.k-brandcard__top { display: flex; align-items: center; gap: var(--space-4); }
.k-brandcard__logo { display: inline-flex; width: 56px; height: 56px; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-1); font-family: var(--font-display); font-size: var(--display-s); line-height: 1; color: var(--color-ink); letter-spacing: 0; }
.k-brandcard__logo img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-2); }
.k-brandcard__name { font-family: var(--font-display); font-size: var(--display-s); line-height: var(--display-s-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.k-brandcard__url { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-brandcard__rows { display: grid; gap: var(--space-3); }
.k-brandcard__row { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--text-body); line-height: var(--leading-body); color: var(--color-ink-2); }
.k-brandcard__row > .k-icon { width: 20px; height: 20px; margin-top: 2px; color: var(--color-ink-3); }
.k-brandcard__row[data-lift] { animation: k-lift var(--duration-explain) var(--ease-out) both; }
.k-brandcard__row[data-missing] { color: var(--color-ink-3); }
.k-swatches { display: flex; align-items: center; gap: var(--space-2); }
.k-swatch { width: 24px; height: 24px; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1px var(--color-wash-strong); }
.k-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.k-faces { display: flex; align-items: center; }
.k-faces > * + * { margin-left: calc(-1 * var(--space-2)); }

/* ── Media card: image-led course card ───────────────────────────────────── */
.k-media { position: relative; display: flex; min-width: 0; flex-direction: column; gap: var(--space-3); border-radius: var(--radius-lg); text-align: left; color: var(--color-ink); }
.k-media__cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); background: var(--m-cover, var(--mat-stone)); box-shadow: var(--shadow-1); transition: box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-out); }
.k-media--poster .k-media__cover { aspect-ratio: 4 / 5; }
.k-media--wide .k-media__cover { aspect-ratio: 21 / 9; }
.k-media__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--duration-slow) var(--ease-standard), transform var(--duration-slow) var(--ease-out); }
.k-media__cover img[data-loaded] { opacity: 1; }
.k-media__cover[data-loading]::before { content: ""; position: absolute; inset: 0; background: var(--m-cover-hi, var(--mat-stone-hi)); animation: k-shimmer 600ms var(--ease-in-out) infinite alternate; }
.k-media__veil { position: absolute; left: 0; right: 0; bottom: 0; height: 56%; background: linear-gradient(to top, var(--color-cover-veil), var(--color-cover-veil-0)); pointer-events: none; }
.k-media__over { position: absolute; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); color: var(--color-on-cover); }
.k-media__left { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-medium); }
.k-media__track { height: 4px; border-radius: var(--radius-full); background: var(--color-cover-track); overflow: hidden; }
.k-media__fill { height: 100%; border-radius: inherit; background: var(--color-on-cover); transition: width var(--duration-slow) var(--ease-out); }
.k-media__play { position: absolute; left: 50%; top: 50%; display: flex; width: 56px; height: 56px; align-items: center; justify-content: center; margin: -28px 0 0 -28px; border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-2); opacity: 0; transform: scale(0.9); transition: opacity var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-out); }
.k-media__play .k-icon { width: 20px; height: 20px; margin-left: 2px; }
.k-media__corner { position: absolute; left: var(--space-3); top: var(--space-3); }
.k-media__text { display: flex; min-width: 0; flex-direction: column; gap: var(--space-1); padding: 0 var(--space-1); }
.k-media__kicker { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-media__title { font-size: var(--text-lead); line-height: var(--leading-lead); font-weight: var(--weight-medium); color: var(--color-ink); text-wrap: balance; }
.k-media__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
a.k-media:hover .k-media__cover, button.k-media:hover .k-media__cover { box-shadow: var(--shadow-2); }
a.k-media:hover .k-media__cover img, button.k-media:hover .k-media__cover img { transform: scale(1.03); }
a.k-media:hover .k-media__play, button.k-media:hover .k-media__play, .k-media:focus-visible .k-media__play { opacity: 1; transform: none; }
.k-media:focus-visible { outline-offset: 4px; }
.k-media--sage { --m-cover: var(--mat-sage); --m-cover-hi: var(--mat-sage-hi); }
.k-media--clay { --m-cover: var(--mat-clay); --m-cover-hi: var(--mat-clay-hi); }
.k-media--sand { --m-cover: var(--mat-sand); --m-cover-hi: var(--mat-sand-hi); }
.k-media--slate { --m-cover: var(--mat-slate); --m-cover-hi: var(--mat-slate-hi); }
.k-media--teal { --m-cover: var(--mat-teal); --m-cover-hi: var(--mat-teal-hi); }

/* ── Ring and bar progress ────────────────────────────────────────────────── */
.k-ring { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; gap: var(--space-3); }
.k-ring svg { flex-shrink: 0; transform: rotate(-90deg); }
.k-ring__track { fill: none; stroke: var(--color-brand-tint); }
.k-ring__fill { fill: none; stroke: var(--color-brand); stroke-linecap: round; transition: stroke-dashoffset var(--duration-slow) var(--ease-out); }
.k-ring__center { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; font-size: var(--text-meta); line-height: 1; font-weight: var(--weight-medium); color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.k-ring__label { display: flex; flex-direction: column; font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-ring__label small { font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-regular); color: var(--color-ink-3); }
.k-progress { display: flex; width: 100%; align-items: center; gap: var(--space-3); }
.k-progress__track { position: relative; height: 6px; min-width: 0; flex: 1; overflow: hidden; border-radius: var(--radius-full); background: var(--color-brand-tint); }
.k-progress__fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-full); background: var(--color-brand); transition: width var(--duration-slow) var(--ease-out); }
.k-progress__label { flex-shrink: 0; font-size: var(--text-meta); line-height: 1; color: var(--color-ink-3); font-variant-numeric: tabular-nums; }

/* ── Medallion: a badge with depth (the only gradient in the kit, besides image veils) ── */
.k-medal { display: inline-flex; width: calc(var(--medal, 112px) + var(--space-8)); flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; border-radius: var(--radius-lg); color: var(--color-ink); }
.k-medal__art { position: relative; width: var(--medal, 112px); height: var(--medal, 112px); transition: transform var(--duration-ui) var(--ease-out); }
.k-medal__art svg { width: 100%; height: 100%; overflow: visible; }
button.k-medal:hover .k-medal__art, a.k-medal:hover .k-medal__art { transform: translateY(-2px) scale(1.02); }
.k-medal__emblem { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.k-medal__emblem .k-icon { width: 34% !important; height: 34% !important; --icon-ink: var(--m-deep); --icon-tint: var(--m-mid); }
.k-medal[data-state="locked"] .k-medal__emblem .k-icon { --icon-ink: var(--color-ink-4); --icon-tint: transparent; }
.k-medal__tag { position: absolute; right: 2%; bottom: 2%; display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-ink-3); box-shadow: var(--shadow-1); }
.k-medal__name { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); text-wrap: balance; }
.k-medal__state { margin-top: calc(-1 * var(--space-3)); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-medal--sm { --medal: 64px; gap: var(--space-2); }
.k-medal--sm .k-medal__name { font-size: var(--text-meta); line-height: var(--leading-meta); }
.k-medal--sm .k-medal__state { margin-top: calc(-1 * var(--space-2)); font-size: var(--text-caption); line-height: var(--leading-caption); }
.k-medal--lg { --medal: 160px; }
.k-medal .m-hi { stop-color: var(--m-hi); }
.k-medal .m-mid { stop-color: var(--m-mid); }
.k-medal .m-deep { stop-color: var(--m-deep); }
.k-medal .m-disc { fill: var(--m-mid); }
.k-medal .m-rim { fill: none; stroke: var(--color-medal-rim); }
.k-medal .m-edge { fill: none; stroke: var(--m-deep); opacity: 0.35; }
.k-medal .m-face { fill: var(--m-hi); }
.k-medal .m-sheen { fill: var(--color-medal-sheen); }
.k-medal .m-emblem { color: var(--m-deep); }
.k-medal .m-track { fill: none; stroke: var(--color-hairline); }
.k-medal .m-arc { fill: none; stroke: var(--color-brand); stroke-linecap: round; transition: stroke-dashoffset var(--duration-slow) var(--ease-out); }
.k-medal .m-tag { fill: var(--color-surface); }
.k-medal--sage { --m-hi: var(--mat-sage-hi); --m-mid: var(--mat-sage); --m-deep: var(--mat-sage-deep); }
.k-medal--clay { --m-hi: var(--mat-clay-hi); --m-mid: var(--mat-clay); --m-deep: var(--mat-clay-deep); }
.k-medal--sand { --m-hi: var(--mat-sand-hi); --m-mid: var(--mat-sand); --m-deep: var(--mat-sand-deep); }
.k-medal--slate { --m-hi: var(--mat-slate-hi); --m-mid: var(--mat-slate); --m-deep: var(--mat-slate-deep); }
.k-medal--teal { --m-hi: var(--mat-teal-hi); --m-mid: var(--mat-teal); --m-deep: var(--mat-teal-deep); }
.k-medal[data-state="progress"], .k-medal[data-state="locked"] { --m-hi: var(--mat-stone-hi); --m-mid: var(--mat-stone-hi); --m-deep: var(--mat-stone-deep); }
.k-medal[data-state="locked"] .m-emblem { color: var(--color-ink-4); }
.k-medal[data-state="earned"][data-lift] .k-medal__art { animation: k-earn var(--duration-slow) var(--ease-spring) both; }
.k-medals { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-6); }

/* ── Path: the plan as a path. Compact (Home) and full (Plan) ─────────────── */
.k-path { width: 100%; }
/* compact: four phase segments, the you-are-here pin, and the next step */
.k-path--compact { display: flex; flex-direction: column; gap: var(--space-5); }
.k-path__phases { display: grid; grid-template-columns: repeat(var(--phases, 4), minmax(0, 1fr)); gap: var(--space-2); }
.k-path__phase { position: relative; display: flex; min-width: 0; flex-direction: column; gap: var(--space-3); }
.k-path__pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-path__phase[data-state="current"] .k-path__pname { color: var(--color-ink); font-weight: var(--weight-medium); }
.k-path__seg { position: relative; display: flex; height: 24px; align-items: center; justify-content: space-between; padding: 0 var(--space-1); }
.k-path__seg::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: var(--radius-full); background: var(--color-ground-2); }
.k-path__seg::after { content: ""; position: absolute; left: 0; top: 10px; height: 4px; width: var(--done, 0%); border-radius: var(--radius-full); background: var(--color-brand); transition: width var(--duration-slow) var(--ease-out); }
.k-path__dot { position: relative; z-index: 1; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-surface); box-shadow: inset 0 0 0 2px var(--color-hairline-strong); }
.k-path__dot[data-state="done"] { background: var(--color-brand); box-shadow: none; }
.k-path__dot[data-state="current"] { width: 24px; height: 24px; background: var(--color-surface); box-shadow: inset 0 0 0 4px var(--color-brand), 0 0 0 4px var(--color-brand-tint); }
.k-path__here { position: absolute; top: 100%; margin-top: var(--space-2); white-space: nowrap; }
.k-path__next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.k-path__nexttitle { font-size: var(--text-lead); line-height: var(--leading-lead); font-weight: var(--weight-medium); color: var(--color-ink); }
@media (max-width: 767px) { .k-path__phase:not([data-state="current"]) .k-path__pname { visibility: hidden; } .k-path__phase[data-state="current"] .k-path__pname { overflow: visible; } }
/* full: phases stacked, each step a node on one line */
.k-path--full { display: flex; flex-direction: column; gap: var(--space-10); }
.k-path__block { display: flex; flex-direction: column; gap: var(--space-4); }
.k-path__phead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.k-path__ptitle { display: flex; align-items: baseline; gap: var(--space-3); font-size: var(--text-title); line-height: var(--leading-title); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-path__pnum { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-s); line-height: 1; color: var(--color-ink-3); letter-spacing: 0; }
.k-path__pmeta { flex-shrink: 0; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); font-variant-numeric: tabular-nums; }
.k-path__steps { position: relative; display: flex; flex-direction: column; }
.k-path__step {
  position: relative; display: flex; width: 100%; min-height: 72px; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border-radius: var(--radius-lg); text-align: left; transition: background-color var(--duration-ui) var(--ease-standard);
}
.k-path__step:hover { background: var(--color-surface); box-shadow: var(--shadow-1); }
.k-path__step::before { content: ""; position: absolute; left: 31px; top: 0; bottom: 0; width: 2px; background: var(--color-hairline-strong); }
.k-path__steps > li:first-child .k-path__step::before { top: 50%; }
.k-path__steps > li:last-child .k-path__step::before { bottom: 50%; }
.k-path__steps > li:only-child .k-path__step::before { display: none; }
.k-path__step[data-state="done"]::before { background: var(--color-brand-mark); }
.k-path__node { position: relative; z-index: 1; display: flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--color-ground-2); color: var(--color-ink-3); box-shadow: 0 0 0 4px var(--color-ground); }
.k-path__node .k-icon { width: 20px; height: 20px; }
.k-path__step[data-state="done"] .k-path__node { background: var(--color-brand); color: var(--color-on-brand); }
.k-path__step[data-state="current"] .k-path__node { background: var(--color-surface); color: var(--color-brand); box-shadow: 0 0 0 4px var(--color-ground), inset 0 0 0 2px var(--color-brand); }
.k-path__step[data-type="badge"] .k-path__node { border-radius: var(--radius-full); }
.k-path__body { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: var(--space-1); }
.k-path__title { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-path__step[data-state="done"] .k-path__title { color: var(--color-ink-2); }
.k-path__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-path__end { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-2); }
.k-path__step[data-highlight] { background: var(--color-brand-tint); }
.k-path__whosm { display: none; }
@media (max-width: 767px) { .k-path__end .k-pill { display: none; } .k-path__step { padding-right: var(--space-2); } .k-path__whosm { display: inline-flex; } }   /* on a phone who does what moves under the title */

/* ── Paper: a page frame at US Letter, a fanned stack, a desk ─────────────── */
.k-paper { position: relative; flex-shrink: 0; width: var(--paper-w, 100%); aspect-ratio: 8.5 / 11; overflow: hidden; border-radius: var(--radius-xs); background: var(--color-surface); box-shadow: var(--shadow-paper); container-type: inline-size; }
.k-paper__sheet { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; transform: scale(var(--paper-scale, 1)); }
.k-paper[data-included="false"] { box-shadow: inset 0 0 0 1px var(--color-hairline-strong); }
.k-paper[data-included="false"]::after { content: ""; position: absolute; inset: 0; background: var(--color-paper-veil); }
.k-paper[data-current] { box-shadow: var(--shadow-paper), 0 0 0 2px var(--color-ground), 0 0 0 4px var(--color-brand); }
.k-paper--thumb { --paper-w: 96px; border-radius: 2px; }
.k-pstack { position: relative; width: var(--stack-w, 200px); aspect-ratio: 8.5 / 11; flex-shrink: 0; }
.k-pstack > .k-paper { position: absolute; inset: 0; width: 100%; transition: transform var(--duration-slow) var(--ease-out); }
.k-pstack > .k-paper:nth-last-child(1) { transform: none; z-index: 5; }
.k-pstack > .k-paper:nth-last-child(2) { transform: translate(6%, 2%) rotate(4deg); z-index: 4; }
.k-pstack > .k-paper:nth-last-child(3) { transform: translate(-6%, 3%) rotate(-5deg); z-index: 3; }
.k-pstack > .k-paper:nth-last-child(4) { transform: translate(10%, 5%) rotate(8deg); z-index: 2; }
.k-pstack > .k-paper:nth-last-child(n+5) { transform: translate(-9%, 5%) rotate(-9deg); z-index: 1; }
.k-pstack[data-fan] > .k-paper:nth-last-child(2), :is(a, button):hover > .k-pstack > .k-paper:nth-last-child(2) { transform: translate(18%, 1%) rotate(7deg); }
.k-pstack[data-fan] > .k-paper:nth-last-child(3), :is(a, button):hover > .k-pstack > .k-paper:nth-last-child(3) { transform: translate(-18%, 2%) rotate(-8deg); }
.k-pstack[data-fan] > .k-paper:nth-last-child(4), :is(a, button):hover > .k-pstack > .k-paper:nth-last-child(4) { transform: translate(30%, 4%) rotate(13deg); }
.k-pstack[data-fan] > .k-paper:nth-last-child(n+5), :is(a, button):hover > .k-pstack > .k-paper:nth-last-child(n+5) { transform: translate(-28%, 5%) rotate(-14deg); }
.k-pstack[data-assembling] > .k-paper { animation: k-assemble var(--duration-explain) var(--ease-out) both; }
.k-pstack__count { position: absolute; right: -8px; bottom: -8px; z-index: 6; }
.k-desk { position: relative; display: flex; align-items: center; justify-content: center; padding: var(--space-10) var(--space-8); border-radius: var(--radius-xl); background: var(--color-ground-2); box-shadow: var(--shadow-inset); overflow: hidden; }

/* ── Channel: mail · fax · email as a segmented choice; a status pill for tracking ── */
.k-channel { display: inline-flex; max-width: 100%; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-full); background: var(--color-ground-2); }
.k-channel__opt {
  display: inline-flex; height: 36px; min-width: 0; flex: 1 1 0; align-items: center; justify-content: center; gap: var(--space-2); padding: 0 var(--space-4);
  border-radius: var(--radius-full); color: var(--color-ink-3); font-size: var(--text-meta); line-height: 1; font-weight: var(--weight-medium); white-space: nowrap;
  transition: background-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
.k-channel__opt .k-icon { width: 18px; height: 18px; }
.k-channel__opt:hover { color: var(--color-ink); }
.k-channel__opt[aria-checked="true"] { background: var(--color-surface); color: var(--color-ink); box-shadow: 0 1px 2px var(--color-shadow-2), 0 0 0 1px var(--color-shadow-edge); }
.k-channel__opt[aria-checked="true"] .k-icon { color: var(--color-brand); }
.k-channel--sm .k-channel__opt { height: 28px; padding: 0 var(--space-3); }
.k-channel--sm .k-channel__opt .k-icon { width: 16px; height: 16px; }
.k-channel--icons .k-channel__opt { padding: 0 var(--space-3); }

/* ── Timeline: a plain tracking timeline (vertical), or steps in a row ───── */
.k-tl { display: flex; flex-direction: column; }
.k-tl__ev { position: relative; display: flex; gap: var(--space-4); padding-bottom: var(--space-5); }
.k-tl__ev:last-child { padding-bottom: 0; }
.k-tl__ev::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--color-hairline-strong); }
.k-tl__ev:last-child::before { display: none; }
.k-tl__ev[data-state="done"]::before { background: var(--color-brand-mark); }
.k-tl__dot { position: relative; z-index: 1; display: flex; width: 24px; height: 24px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--color-surface); box-shadow: inset 0 0 0 2px var(--color-hairline-strong); color: var(--color-ink-3); }
.k-tl__dot .k-icon { width: 14px; height: 14px; }
.k-tl__ev[data-state="done"] .k-tl__dot { background: var(--color-brand); box-shadow: none; color: var(--color-on-brand); }
.k-tl__ev[data-state="current"] .k-tl__dot { box-shadow: inset 0 0 0 2px var(--color-brand), 0 0 0 4px var(--color-brand-tint); color: var(--color-brand); }
.k-tl__body { display: flex; min-width: 0; flex: 1; flex-direction: column; padding-top: 0; }
.k-tl__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.k-tl__title { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-tl__ev[data-state="next"] .k-tl__title { font-weight: var(--weight-regular); color: var(--color-ink-3); }
.k-tl__time { flex-shrink: 0; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); font-variant-numeric: tabular-nums; }
.k-tl__text { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-tl--row { flex-direction: row; align-items: flex-start; }
.k-tl--row .k-tl__ev { flex: 1; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding-bottom: 0; padding-right: var(--space-3); }
.k-tl--row .k-tl__ev::before { left: 24px; right: 0; top: 11px; bottom: auto; width: auto; height: 2px; }
.k-tl--row .k-tl__top { flex-direction: column; gap: 0; }

/* ── Provider buttons: "Continue with Google" / "Continue with email" ────── */
.k-provider {
  display: inline-flex; width: 100%; height: 52px; align-items: center; justify-content: center; gap: var(--space-3); padding: 0 var(--space-6);
  border-radius: var(--radius-full); border: 1px solid var(--color-google-edge); background: var(--color-surface); color: var(--color-google-text);
  font-size: var(--text-body); line-height: 1; font-weight: var(--weight-medium); letter-spacing: 0;
  transition: background-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.k-provider:hover { background: var(--color-surface-2); box-shadow: 0 1px 3px var(--color-shadow-2); }
.k-provider:active { transform: scale(0.98); }
.k-provider .k-icon { width: 20px; height: 20px; }
.k-provider--email { border-color: var(--color-hairline-strong); color: var(--color-ink); }
.k-providers { display: flex; width: 100%; flex-direction: column; gap: var(--space-3); }

/* ── Choice cards (settings: approval mode) ──────────────────────────────── */
.k-choice { position: relative; display: flex; width: 100%; min-height: 72px; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); cursor: pointer; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); text-align: left; transition: box-shadow var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard); }
.k-choice:hover { box-shadow: var(--shadow-2); }
.k-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.k-choice:has(input:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.k-choice:has(input:checked) { background: var(--color-brand-tint); box-shadow: inset 0 0 0 2px var(--color-brand-mark); }
.k-choice > .k-icon { width: 24px; height: 24px; color: var(--color-ink-3); }
.k-choice:has(input:checked) > .k-icon { color: var(--color-brand); }
.k-choice__text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: var(--space-1); }
.k-choice__title { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-choice__line { font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-choice__mark { display: flex; width: 22px; height: 22px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1.5px var(--color-ink-4); background: var(--color-surface); color: var(--color-on-brand); }
.k-choice__mark .k-icon { width: 14px; height: 14px; opacity: 0; }
.k-choice:has(input:checked) .k-choice__mark { background: var(--color-brand); box-shadow: none; }
.k-choice:has(input:checked) .k-choice__mark .k-icon { opacity: 1; }
.k-choices { display: grid; gap: var(--space-3); width: 100%; }
@media (min-width: 640px) { .k-choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Table (Packets › Doctors only) ───────────────────────────────────────── */
.k-table-wrap { width: 100%; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); }
.k-table { width: 100%; min-width: var(--table-min, 0); }
.k-table__head { display: grid; grid-template-columns: var(--cols); height: 44px; box-shadow: 0 1px 0 var(--color-hairline); }
.k-table__th { display: flex; min-width: 0; height: 100%; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); }
.k-table__sort, .k-table__label { display: flex; min-height: 24px; align-items: center; gap: var(--space-2); white-space: nowrap; font-size: var(--text-meta); line-height: 1; font-weight: var(--weight-medium); color: var(--color-ink-3); border-radius: var(--radius-xs); }
.k-table__sort:hover, .k-table__sort[data-sorted] { color: var(--color-ink); }
.k-table__sort .k-icon { width: 14px; height: 14px; }
.k-table__row { display: grid; grid-template-columns: var(--cols); min-height: 56px; box-shadow: 0 1px 0 var(--color-hairline); transition: background-color var(--duration-ui) var(--ease-standard); }
.k-table__row:last-child { box-shadow: none; }
.k-table__row:hover { background: var(--color-surface-2); }
.k-table[data-opens] .k-table__row { cursor: pointer; }
.k-table__row[aria-current="true"] { background: var(--color-brand-tint); }
.k-table__cell { display: flex; min-width: 0; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); color: var(--color-ink-2); }
.k-table__cell--lead { font-weight: var(--weight-medium); color: var(--color-ink); }
.k-table__cell--end { justify-content: flex-end; }
.k-table__lead-link { min-width: 0; min-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: var(--radius-xs); }
.k-table__lead-link:hover { color: var(--color-brand); }
.k-table__group { display: flex; min-height: 48px; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--color-surface-2); box-shadow: 0 1px 0 var(--color-hairline); }
.k-table__empty { padding: var(--space-8) var(--space-4); }
.k-table__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: var(--text-meta); color: var(--color-ink-3); box-shadow: 0 -1px 0 var(--color-hairline); }
@media (max-width: 639px) {
  .k-table--stack .k-table__head { display: none; }
  .k-table--stack .k-table__row { grid-template-columns: minmax(0, 1fr); padding: var(--space-2) 0; }
  .k-table--stack .k-table__cell { padding: var(--space-1) var(--space-4); }
  .k-table--stack .k-table__cell--end { justify-content: flex-start; }
}

/* ── Empty state and skeleton ─────────────────────────────────────────────── */
.k-empty { display: flex; min-height: 160px; width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; color: var(--color-ink-3); }
.k-empty > .k-icon { width: 24px; height: 24px; margin-bottom: var(--space-1); }
.k-empty__title { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-medium); color: var(--color-ink); }
.k-empty__hint { font-size: var(--text-meta); line-height: var(--leading-meta); }
.k-empty__action { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.k-skeleton { display: block; border-radius: var(--radius-sm); background: var(--color-ground-2); animation: k-shimmer 600ms var(--ease-in-out) infinite alternate; }

/* ── Sheet: a right slide-out at ≥ 768, a bottom sheet below; non-modal ──── */
.k-sheet {
  position: fixed; right: var(--space-3); top: var(--space-3); bottom: var(--space-3); z-index: var(--z-sheet); display: flex; flex-direction: column;
  width: min(var(--sheet-width, var(--sheet)), calc(100vw - 24px)); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-3);
  outline: none; overflow: hidden; animation: k-sheet-in var(--duration-slow) var(--ease-out) both; contain: layout paint;
}
.k-sheet[data-closing] { animation: k-sheet-out var(--duration-fast) var(--ease-in) both; }
@media (max-width: 767px) {
  .k-sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation-name: k-rise-sheet; }
  .k-sheet[data-closing] { animation-name: k-sink-sheet; }
}
.k-sheet__header { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-4) var(--space-4) var(--space-6); }
.k-sheet__heading { display: flex; min-width: 0; flex-direction: column; gap: var(--space-2); padding-top: var(--space-1); }
.k-sheet__title { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-s); line-height: var(--display-s-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.k-sheet__desc { font-size: var(--text-body); line-height: var(--leading-body); color: var(--color-ink-3); }
.k-sheet__actions { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-2); }
.k-sheet__body { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow-y: auto; scrollbar-width: thin; padding: var(--space-2) var(--space-6) var(--space-6); }
.k-sheet__foot { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-5); box-shadow: 0 -1px 0 var(--color-hairline); }
.k-sheet__foot--between { justify-content: space-between; }
.k-section { display: flex; width: 100%; flex-direction: column; gap: var(--space-3); padding: var(--space-5) 0; box-shadow: 0 1px 0 var(--color-hairline); }
.k-section:first-child { padding-top: 0; }
.k-section:last-child { padding-bottom: 0; box-shadow: none; }
.k-section__title { font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-medium); color: var(--color-ink-3); }
.k-prose { max-width: 64ch; font-size: var(--text-body); line-height: var(--leading-body); color: var(--color-ink-2); }
.k-prose p + p { margin-top: var(--space-3); }
.k-rows { display: flex; width: 100%; flex-direction: column; gap: var(--space-3); }
.k-rows__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.k-rows__row dt { flex-shrink: 0; color: var(--color-ink-3); }
.k-rows__row dd { min-width: 0; text-align: right; font-weight: var(--weight-medium); overflow-wrap: anywhere; color: var(--color-ink); font-variant-numeric: tabular-nums; }

/* Dialog: one short question that must be answered */
.k-dialog { position: fixed; inset: 0; z-index: var(--z-dialog); margin: auto; display: flex; height: fit-content; max-height: calc(100dvh - 32px); width: calc(100% - 32px); max-width: 420px; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-3); outline: none; animation: k-pop-in var(--duration-ui) var(--ease-out) both; }
.k-dialog--md { max-width: 520px; }
.k-dialog[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both; }
.k-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-4) var(--space-2) var(--space-6); }
.k-dialog__heading { display: flex; min-width: 0; flex-direction: column; gap: var(--space-2); padding-top: var(--space-1); }
.k-dialog__title { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-s); line-height: var(--display-s-leading); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.k-dialog__desc { color: var(--color-ink-3); }
.k-dialog__body { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; padding: var(--space-4) var(--space-6); }
.k-dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-6); }

/* ── Command palette (⌘K) ─────────────────────────────────────────────────── */
.k-palette { position: fixed; left: 0; right: 0; top: 14vh; z-index: var(--z-dialog); margin: 0 auto; display: flex; width: calc(100% - 32px); max-width: 600px; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-3); outline: none; animation: k-pop-in var(--duration-ui) var(--ease-out) both; }
.k-palette[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both; }
.k-palette__bar { display: flex; height: 64px; flex-shrink: 0; align-items: center; gap: var(--space-3); padding: 0 var(--space-5); color: var(--color-ink-3); box-shadow: 0 1px 0 var(--color-hairline); }
.k-palette__input { height: 40px; min-width: 0; flex: 1; border: 0; background: transparent; padding: 0; font-size: var(--text-lead); line-height: 1; color: var(--color-ink); outline: none; }
.k-palette__input::placeholder { color: var(--color-ink-3); opacity: 1; }
.k-palette__input:focus-visible { outline: none; }
.k-palette__list { display: flex; max-height: min(420px, 60vh); flex-direction: column; gap: var(--space-2); overflow-y: auto; scrollbar-width: thin; padding: var(--space-2); }
.k-palette__group { display: flex; flex-direction: column; }
.k-palette__label { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--text-caption); line-height: var(--leading-caption); font-weight: var(--weight-medium); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-ink-3); }
.k-palette__option { display: flex; height: 44px; cursor: default; user-select: none; align-items: center; gap: var(--space-3); padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--color-ink-2); }
.k-palette__option .k-icon { width: 20px; height: 20px; color: var(--color-ink-3); }
.k-palette__option[aria-selected="true"] { background: var(--color-brand-tint); color: var(--color-ink); }
.k-palette__option[aria-selected="true"] .k-icon { color: var(--color-brand); }
.k-palette__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-palette__hint { margin-left: auto; flex-shrink: 0; padding-left: var(--space-3); font-size: var(--text-meta); color: var(--color-ink-3); }
.k-palette__empty { padding: var(--space-6) var(--space-2); text-align: center; color: var(--color-ink-3); }
mark { border-radius: 2px; background: var(--color-highlight); color: inherit; }

/* ── Menu and tooltip ─────────────────────────────────────────────────────── */
.k-menu { position: fixed; z-index: var(--z-dialog); min-width: 200px; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-2); box-shadow: var(--shadow-3); animation: k-pop-in var(--duration-ui) var(--ease-out) both; }
.k-menu[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both; }
.k-menu__item { display: flex; width: 100%; min-height: 40px; cursor: default; user-select: none; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--color-ink-2); outline: none; text-align: left; transition: background-color var(--duration-ui) var(--ease-standard); }
.k-menu__item .k-icon { width: 20px; height: 20px; color: var(--color-ink-3); }
.k-menu__item:focus, .k-menu__item:hover { background: var(--color-wash); color: var(--color-ink); outline: none; }
.k-menu__item[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.k-menu__item--danger { color: var(--color-danger); }
.k-menu__item--danger .k-icon { color: var(--color-danger); }
.k-menu__tick { margin-left: auto; color: var(--color-brand) !important; }
.k-menu__label { padding: var(--space-2) var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink-3); }
.k-menu__sep { height: 1px; margin: var(--space-2) calc(-1 * var(--space-2)); background: var(--color-hairline); }
/* Tour (Kit.tour): a spotlight with a teal ring over a veiled screen, and a bubble. The only overlay while it runs. */
.k-tour { position: fixed; inset: 0; z-index: var(--z-tooltip); pointer-events: none; }
.k-tour__veil { position: fixed; inset: 0; pointer-events: auto; }
.k-tour__spot { position: fixed; border-radius: var(--radius-lg); outline: 9999px solid var(--color-cover-veil); box-shadow: var(--focus-ring); pointer-events: none;
  left: 0; top: 0; transition: translate var(--duration-slow) var(--ease-out), width var(--duration-slow) var(--ease-out), height var(--duration-slow) var(--ease-out); }
.k-tour__bubble { position: fixed; left: 0; top: 0; translate: 12px 12px; display: flex; width: min(360px, calc(100vw - 24px)); flex-direction: column; gap: var(--space-2); padding: var(--space-5); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-3); pointer-events: auto; outline: none;
  animation: k-rise var(--duration-ui) var(--ease-out) both; transition: translate var(--duration-slow) var(--ease-out); }
.k-tour__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0 0; }
.k-tour__count { color: var(--color-brand); }
.k-tour__title { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--display-s); line-height: var(--display-s-leading); letter-spacing: -0.01em; color: var(--color-ink); }
.k-tour__text { font-size: var(--text-body); line-height: var(--leading-body); color: var(--color-ink-2); }
.k-tour__foot { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
[data-tour-target] { position: relative; }
.k-pill--handed { color: var(--color-ink-2); }
.k-tooltip { position: fixed; z-index: var(--z-tooltip); max-width: 320px; pointer-events: none; border-radius: var(--radius-sm); background: var(--color-tooltip); padding: var(--space-2) var(--space-3); font-size: var(--text-meta); line-height: var(--leading-meta); font-weight: var(--weight-medium); color: var(--color-surface); animation: k-pop-in var(--duration-fast) var(--ease-out) both; }

/* ── Toast (Undo) ─────────────────────────────────────────────────────────── */
.k-toasts { position: fixed; left: 0; right: 0; bottom: var(--space-6); z-index: var(--z-toast); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-2); width: min(440px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 1024px) { html[data-panel-open] .k-toasts { right: calc(var(--panel) + var(--space-3)); } html[data-sheet-open] .k-toasts { right: calc(var(--sheet) + var(--space-3)); } }
@media (max-width: 767px) { .k-toasts { bottom: calc(var(--tabbar) + var(--space-4) + env(safe-area-inset-bottom)); } }
@media (hover: none), (pointer: coarse) { .k-toast .k-kbd { display: none; } }
.k-toast { pointer-events: auto; display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); border-radius: var(--radius-full); background: var(--color-ink); color: var(--color-surface); box-shadow: var(--shadow-3); animation: k-rise var(--duration-ui) var(--ease-out) both; }
.k-toast[data-closing] { animation: k-fade-out var(--duration-fast) var(--ease-in) both; }
.k-toast__msg { min-width: 0; font-size: var(--text-body); line-height: var(--leading-body); }
.k-toast__end { display: flex; flex-shrink: 0; align-items: center; gap: var(--space-2); }
.k-toast .k-kbd { background: transparent; color: var(--color-hairline-strong); }
.k-toast .k-btn { height: 40px; border-color: transparent; background: var(--color-surface); color: var(--color-ink); }

/* ── Motion ───────────────────────────────────────────────────────────────── */
@keyframes k-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes k-lift { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes k-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes k-fade-out { to { opacity: 0; } }
@keyframes k-pop { 0% { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
@keyframes k-pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes k-sheet-in { from { transform: translateX(calc(100% + 24px)); } to { transform: none; } }
@keyframes k-sheet-out { to { transform: translateX(calc(100% + 24px)); } }
@keyframes k-rise-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes k-sink-sheet { to { transform: translateY(100%); } }
@keyframes k-panel-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes k-shimmer { from { opacity: 1; } to { opacity: 0.55; } }
@keyframes k-spin { to { transform: rotate(360deg); } }
@keyframes k-dot { from { opacity: 0.35; transform: translateY(0); } to { opacity: 1; transform: translateY(-3px); } }
@keyframes k-earn { 0% { opacity: 0; transform: scale(0.6) rotate(-12deg); } 70% { opacity: 1; } to { transform: none; } }
@keyframes k-assemble { from { opacity: 0; transform: translate(var(--from-x, 0), var(--from-y, 40%)) rotate(var(--from-r, 0deg)); } }
.k-anim-rise { animation: k-rise var(--duration-ui) var(--ease-out) both; }
.k-anim-lift { animation: k-lift var(--duration-explain) var(--ease-out) both; }
.k-anim-fade { animation: k-fade var(--duration-ui) var(--ease-standard) both; }

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

/* ── Print: Kit.print(node) prints only that node ─────────────────────────── */
.k-print-root { display: none; }
@media print { body.k-printing .k-print-root { display: block; } body.k-printing > *:not(.k-print-root) { display: none !important; } body.k-printing { background: var(--color-surface); } }

/* ── Gallery states (kit.html only): hover / focus / press pinned for a still picture ── */
.is-focus { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.k-btn.is-hover { background: var(--color-surface-2); border-color: var(--color-ink-4); }
.k-btn--primary.is-hover { border-color: var(--color-brand-hover); background: var(--color-brand-hover); }
.k-btn--ghost.is-hover { background: var(--color-wash); border-color: transparent; }
.k-btn.is-active { transform: scale(0.97); }
.k-chip.is-hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.k-input.is-focus { border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--color-brand-tint-2); outline: none; }
.k-media.is-hover .k-media__play { opacity: 1; transform: none; }
.k-media.is-hover .k-media__cover { box-shadow: var(--shadow-2); }

/* ── Late fixes kept together: alignment of inline groups inside flex columns ── */
.k-channel, .k-tabs { align-self: flex-start; }
.k-tabs--block { align-self: stretch; }
.k-brandcard__val { display: flex; min-width: 0; min-height: 24px; flex: 1; align-items: center; }
.k-canvas__count { white-space: nowrap; }
@media (max-width: 767px) {
  .k-canvas__title { font-size: var(--text-meta); }
  .k-stages__item[data-state="current"] .k-stages__label { overflow: visible; }
}
