@font-face { font-family: 'KSans'; src: url(fonts/sans.woff2) format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'KSerif'; src: url(fonts/serif.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'KBrand'; src: url(fonts/brand.woff2) format('woff2'); font-weight: 500 700; font-style: normal; font-display: swap; }
/* Kureon Health group portal concept. Tokens and glass recipe ported from the approved care home demo (Glass V7). */
:root {
  --background: 69 28% 95%; --foreground: 150 19% 13%;
  --card: 0 0% 100%; --popover: 0 0% 100%;
  --primary: 145 30% 30%; --primary-foreground: 0 0% 100%;
  --secondary: 87 30% 88%; --muted-foreground: 146 12% 23%;
  --accent: 24 69% 32%; --brand-accent: 24 69% 32%; --brand-ornament: 29 81% 73%;
  --success: 140 58% 23%; --warning: 40 100% 25%; --warning-bg: 44 75% 89%;
  --danger: 358 64% 42%; --info: 211 50% 36%;
  --border: 87 21% 79%; --ring: 145 30% 30%;
  --sidebar-bg: 87 30% 88%;
  --ink-band: 150 19% 13%; --ink-band-foreground: 69 28% 95%; --ink-band-muted: 132 10% 81%; --ink-band-accent: 29 81% 73%;
  --g-ground: hsl(var(--secondary));
  --hi: 0 0% 100%; --tint: var(--card); --edge: var(--foreground);
  --a-card: 0.3; --a-edge: 0.78; --a-hi: 0.95; --f1: 0.62; --f2: 0.1; --f3: 0.34; --lo: 0.4; --glow: 0.34;
  --a-panel: 0.5; --a-panel-edge: 0.72;
  --line: hsl(var(--foreground) / 0.11); --line-strong: hsl(var(--foreground) / 0.24);
  --control: hsl(var(--foreground) / 0.42);
  --muted: hsl(var(--foreground) / 0.84);
  --track: hsl(var(--primary) / 0.14);
  --fill: hsl(145 30% 28%); --fill-ink: hsl(var(--primary-foreground));
  --wash-a: hsl(var(--brand-ornament) / 0.34); --wash-b: hsl(var(--primary) / 0.2); --wash-c: hsl(var(--info) / 0.16);
  --dark: hsl(var(--ink-band)); --dark-ink: hsl(var(--ink-band-foreground)); --dark-muted: hsl(var(--ink-band-muted)); --dark-label: hsl(var(--ink-band-accent));
  --glow-1: hsl(var(--brand-ornament) / 0.5); --glow-2: hsl(0 0% 100% / 0.9); --glow-3: hsl(var(--info) / 0.22); --glow-4: hsl(var(--brand-ornament) / 0.26); --glow-5: hsl(var(--primary) / 0.14);
  --blur: 22px; --gut: 22px; --side-w: 264px;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --serif: KSerif, Newsreader, Georgia, "Times New Roman", serif;
  --brandserif: KBrand, Fraunces, Georgia, serif;
  --sans: KSans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
html.dark {
  --background: 150 22% 8%; --foreground: 85 22% 92%;
  --card: 150 17% 12%; --popover: 150 17% 12%;
  --primary: 145 34% 62%; --primary-foreground: 150 22% 8%;
  --secondary: 150 15% 17%; --muted-foreground: 110 10% 75%;
  --accent: 29 81% 73%; --brand-accent: 29 81% 73%; --brand-ornament: 29 56% 56%;
  --success: 143 42% 66%; --warning: 42 85% 64%; --warning-bg: 40 45% 14%;
  --danger: 5 83% 75%; --info: 211 65% 76%;
  --border: 150 12% 24%; --ring: 145 34% 62%;
  --sidebar-bg: 150 20% 10%;
  --ink-band: 150 19% 13%; --ink-band-foreground: 69 28% 95%; --ink-band-muted: 132 10% 81%; --ink-band-accent: 29 81% 73%;
  --g-ground: hsl(var(--background));
  --hi: var(--foreground); --tint: var(--foreground);
  --a-card: 0.05; --a-edge: 0.14; --a-hi: 0.16; --f1: 0.06; --f2: 0.01; --f3: 0.03; --lo: 0.04; --glow: 0.02;
  --a-panel: 0.72; --a-panel-edge: 0.14;
  --line: hsl(var(--foreground) / 0.1); --line-strong: hsl(var(--foreground) / 0.22);
  --control: hsl(var(--foreground) / 0.4);
  --muted: hsl(var(--foreground) / 0.88);
  --track: hsl(var(--primary) / 0.2);
  --fill: hsl(var(--primary));
  --wash-a: hsl(var(--brand-ornament) / 0.1); --wash-b: hsl(var(--primary) / 0.1); --wash-c: hsl(var(--info) / 0.1);
  --glow-1: hsl(var(--brand-ornament) / 0.16); --glow-2: hsl(0 0% 100% / 0.03); --glow-3: hsl(var(--info) / 0.1); --glow-4: hsl(var(--brand-ornament) / 0.08); --glow-5: hsl(var(--primary) / 0.08);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background-color: var(--g-ground); }
body {
  margin: 0; min-height: 100vh; font-family: var(--sans); font-size: 16px; line-height: 1.5;
  color: hsl(var(--foreground)); background-color: var(--g-ground);
  background-image:
    radial-gradient(55% 45% at 88% 2%, var(--glow-1), transparent 70%),
    radial-gradient(34% 40% at 24% 46%, var(--glow-4), transparent 72%),
    radial-gradient(50% 50% at 2% 100%, var(--glow-2), transparent 72%),
    radial-gradient(42% 44% at 74% 92%, var(--glow-3), transparent 70%),
    radial-gradient(30% 34% at 96% 52%, var(--glow-5), transparent 72%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: hsl(var(--primary)); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--fill); color: var(--fill-ink); }
.skip:focus { top: 12px; }

/* theme switch: the new picture fades in over the old one */
@media (prefers-reduced-motion: no-preference) {
  :root.theme-vt.theme-vt::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
  :root.theme-vt.theme-vt::view-transition-new(root) { animation: theme-in 220ms ease-out both; mix-blend-mode: normal; }
  :root.theme-vt *, :root.theme-vt *::before, :root.theme-vt *::after { transition: none !important; }
  @keyframes theme-in { from { opacity: 0; } }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) { animation: page-in 180ms ease-out both; mix-blend-mode: normal; }
  @keyframes page-in { from { opacity: 0; } }
}

/* ---- shell ---- */
.k-app { position: relative; margin: var(--gut); min-height: calc(100vh - 2 * var(--gut)); display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); border-radius: 28px; }
.k-app::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(125deg, hsl(var(--info) / 0.2) 0%, transparent 34%, transparent 60%, hsl(var(--brand-ornament) / 0.26) 100%), hsl(var(--background) / var(--a-panel));
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px hsl(var(--hi) / var(--a-panel-edge)), inset 0 1px 0 hsl(var(--hi) / var(--a-hi)), 0 1px 2px hsl(var(--edge) / 0.06), 0 40px 90px -40px hsl(var(--edge) / 0.42); }
html.dark .k-app::before { background: linear-gradient(125deg, hsl(var(--info) / 0), transparent 34%, transparent 60%, hsl(var(--brand-ornament) / 0.1) 100%), hsl(var(--sidebar-bg) / var(--a-panel)); }
.k-side { background: hsl(var(--secondary) / 0.45); border-radius: 28px 0 0 28px; position: sticky; top: var(--gut); align-self: start; height: calc(100vh - 2 * var(--gut)); z-index: 5; display: flex; flex-direction: column; border-inline-end: 1px solid hsl(var(--edge) / 0.11); }
.k-brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 0 0 24px; flex: none; color: hsl(var(--foreground)); text-decoration: none; font-family: var(--brandserif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.k-brand svg { height: 26px; width: auto; flex: none; }
.k-profile { display: flex; gap: 12px; align-items: center; margin: 0 14px 6px; padding: 10px; border-radius: 16px; flex: none; }
.k-mono { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--fill-ink); font-weight: 600; font-size: 14px; }
.k-profile b { display: block; font-size: 16px; line-height: 1.25; } .k-profile span { font-size: 14px; color: var(--muted); }
.k-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: none; }
.k-nav::-webkit-scrollbar { display: none; }
.k-nav h2 { margin: 14px 12px 4px; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: hsl(var(--brand-accent)); }
.k-nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 14px; color: hsl(var(--foreground)); text-decoration: none; font-weight: 500; font-size: 16px; transition: background-color 0.15s var(--ease); }
.k-nav a:hover { background: hsl(var(--card) / 0.6); }
.k-nav a[aria-current="page"] { background: hsl(var(--ink-band)); font-weight: 600; color: hsl(var(--ink-band-foreground)); box-shadow: 0 1px 2px rgb(20 24 30 / 0.12); }
html.dark .k-nav a[aria-current="page"] { background: hsl(var(--foreground) / 0.12); color: hsl(var(--foreground)); }
.k-nav a[aria-current="page"]::before { display: none; }
.k-nav svg, .k-dock svg, .k-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.k-nav .lbl { flex: 1; min-width: 0; line-height: 1.25; }
.k-count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 14px; font-weight: 600; background: hsl(var(--brand-ornament) / 0.3); color: hsl(var(--foreground)); }
.k-main { position: relative; z-index: 1; min-width: 0; padding: 0 28px 40px; display: flex; flex-direction: column; gap: 24px; }
.k-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding-top: 10px; flex-wrap: wrap; }
.k-top p { margin: 0; font-size: 14px; color: var(--muted); }
.k-top b { font-size: 16px; display: block; }
.k-top-r { display: flex; gap: 10px; align-items: center; }
.k-icbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: hsl(var(--foreground)); background: hsl(var(--card) / 0.6); box-shadow: inset 0 0 0 1px var(--control); }
.k-icbtn:hover { background: hsl(var(--card) / 0.9); }
html.dark .k-icbtn { background: hsl(var(--foreground) / 0.07); }
.k-theme .sun { display: none; } html.dark .k-theme .sun { display: block; } html.dark .k-theme .moon { display: none; }
.k-note { display: flex; align-items: center; gap: 12px; padding: 4px 4px 4px 16px; border-radius: 999px; font-size: 14px; background: hsl(var(--brand-ornament) / 0.16); box-shadow: inset 0 0 0 1px hsl(var(--brand-accent) / 0.3); color: hsl(var(--foreground)); }
.k-note[hidden] { display: none; }
.k-note span { flex: 1; min-width: 0; }
.k-note button { min-height: 44px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: hsl(var(--card) / 0.7); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.k-chip-sample { display: none; }
.k-note-off .k-chip-sample { display: inline-flex; }

/* ---- cards ---- */
.k-card { position: relative; isolation: isolate; border-radius: 22px; padding: 24px; min-width: 0;
  background: linear-gradient(135deg, hsl(var(--hi) / var(--f1)) 0%, hsl(var(--hi) / var(--f2)) 36%, hsl(var(--hi) / var(--f2)) 62%, hsl(var(--hi) / var(--f3)) 100%), hsl(var(--tint) / var(--a-card));
  backdrop-filter: blur(var(--blur)) saturate(170%); -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid hsl(var(--hi) / var(--a-edge));
  box-shadow: 0 0 0 1px hsl(var(--edge) / 0.06), inset 0 1px 0 hsl(var(--hi) / var(--a-hi)), inset 0 -1px 0 hsl(var(--hi) / var(--lo)), inset 0 0 26px hsl(var(--hi) / var(--glow)), 0 14px 34px -20px hsl(var(--edge) / 0.28); }
html.dark .k-card { box-shadow: 0 0 0 1px hsl(var(--edge) / 0.05), inset 0 1px 0 hsl(var(--hi) / var(--a-hi)), inset 0 -1px 0 hsl(var(--hi) / var(--lo)), 0 14px 34px -20px hsl(0 0% 0% / 0.65); }
.k-l3 { background: hsl(var(--tint) / 0.8); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 hsl(var(--hi) / 0.9); }
html.dark .k-l3 { background: hsl(var(--tint) / 0.06); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 hsl(var(--hi) / 0.1); }
.k-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.k-head > div:first-child { flex: 1 1 240px; min-width: 0; }
.k-title { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; }
.k-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; line-height: 1.4; }
.k-grid { display: grid; gap: 24px; }
.k-g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.k-g2 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.k-g2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.k-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.k-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; }
.k-eyebrow { font-size: 14px; font-weight: 600; color: hsl(var(--brand-accent)); letter-spacing: 0.02em; margin: 0; }
.k-intro h1 { font-size: 40px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; margin: 6px 0 8px; font-family: var(--serif); }
.k-meta { font-size: 16px; color: var(--muted); margin: 0; max-width: 62ch; }
.k-meta strong { color: hsl(var(--foreground)); }
.k-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.k-intro > * { min-width: 0; max-width: 100%; }
.k-intro .k-pill { white-space: normal; border-radius: 16px; }
.p-good { color: hsl(var(--success)); background: hsl(var(--success) / 0.12); }
.p-warn { color: hsl(var(--warning)); background: hsl(var(--warning) / 0.14); }
.p-bad { color: hsl(var(--danger)); background: hsl(var(--danger) / 0.12); }
.p-info { color: hsl(var(--info)); background: hsl(var(--info) / 0.12); }
.p-sample { color: hsl(var(--brand-accent)); background: hsl(var(--brand-ornament) / 0.16); box-shadow: inset 0 0 0 1px hsl(var(--brand-accent) / 0.3); }
.p-neutral { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.07); }
.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; transition: transform 0.14s var(--ease), background-color 0.14s var(--ease); }
.k-btn:active { transform: scale(0.97); }
.k-btn-primary { background: var(--fill); color: var(--fill-ink); box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3), 0 8px 18px -12px hsl(var(--foreground) / 0.55); }
.k-btn-ghost { background: transparent; color: hsl(var(--foreground)); box-shadow: inset 0 0 0 1px var(--control); }
.k-btn-ghost:hover { background: hsl(var(--card) / 0.6); }
.k-btn[disabled] { opacity: 0.55; cursor: default; }
.k-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- KPI ---- */
.k-kpi { overflow: hidden; display: flex; flex-direction: column; padding: 20px; }
.k-kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(215deg, var(--w) 0%, transparent 42%); }
.k-kpi > * { position: relative; z-index: 1; }
.w-a { --w: var(--wash-a); } .w-b { --w: var(--wash-b); } .w-c { --w: var(--wash-c); }
.k-kpi-label { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0; line-height: 1.35; }
.k-kpi-val { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 8px 0 2px; }
.k-kpi-val small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.k-kpi-note { font-size: 14px; color: var(--muted); line-height: 1.4; margin: 0; }
a.k-kpi { color: inherit; text-decoration: none; }

/* ---- dark decision card ---- */
.k-dark { background: linear-gradient(215deg, hsl(var(--ink-band-accent) / 0.12), transparent 46%), var(--dark); color: var(--dark-ink); border: 1px solid hsl(var(--ink-band-accent) / 0.22);
  box-shadow: inset 0 1px 0 hsl(var(--ink-band-foreground) / 0.1), 0 24px 50px -24px hsl(var(--ink-band) / 0.6); backdrop-filter: none; -webkit-backdrop-filter: none; }
.k-dark .k-sub { color: var(--dark-muted); } .k-dark .k-eyebrow { color: var(--dark-label); }
.k-dark :focus-visible { outline-color: var(--dark-label); }
.k-dec-count { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.k-dec-list { list-style: none; margin: 16px 0 18px; padding: 0; display: grid; gap: 10px; }
.k-dec { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: var(--dark-ink); background: hsl(var(--ink-band-foreground) / 0.07); box-shadow: inset 0 0 0 1px hsl(var(--ink-band-foreground) / 0.08), inset 0 1px 0 hsl(var(--ink-band-foreground) / 0.06); transition: background-color 0.16s var(--ease); }
.k-dec:hover { background: hsl(var(--ink-band-foreground) / 0.12); }
.k-dec-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: hsl(var(--ink-band-accent) / 0.18); color: var(--dark-label); }
.k-dec-txt { flex: 1; min-width: 0; }
.k-dec-t { display: block; font-size: 16px; font-weight: 600; line-height: 1.35; }
.k-dec-d { display: block; font-size: 14px; color: var(--dark-muted); line-height: 1.4; margin-top: 2px; }
.k-dec-go { color: var(--dark-muted); font-size: 14px; white-space: nowrap; }
.k-dark .k-btn-ghost { color: var(--dark-ink); box-shadow: inset 0 0 0 1px hsl(var(--ink-band-foreground) / 0.4); }
.k-dark .k-btn-ghost:hover { background: hsl(var(--ink-band-foreground) / 0.08); }

/* ---- table ---- */
.k-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.k-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: hsl(var(--card) / 0.62); box-shadow: 0 0 0 1px hsl(var(--edge) / 0.12), inset 0 1px 0 hsl(var(--hi) / var(--a-hi)); }
html.dark .k-seg { background: hsl(var(--hi) / 0.07); }
.k-seg button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: hsl(var(--foreground)); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color 0.2s var(--ease); }
.k-seg button:hover { background: hsl(var(--card) / 0.6); }
.k-seg button[aria-pressed="true"] { background: var(--fill); color: var(--fill-ink); box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3); }
.k-field { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; font: inherit; font-size: 16px; color: hsl(var(--foreground)); background: hsl(var(--card) / 0.7); box-shadow: inset 0 0 0 1px var(--control); min-width: 0; flex: 1 1 200px; max-width: 320px; }
html.dark .k-field { background: hsl(var(--hi) / 0.07); }
.k-field::placeholder { color: hsl(var(--foreground) / 0.7); }
.k-tscroll { overflow-x: auto; border-radius: 16px; }
table.k-t { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 16px; }
.k-t th { font-size: 14px; font-weight: 600; color: var(--muted); text-align: start; padding: 0; border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.k-t th button { all: unset; box-sizing: border-box; display: block; width: 100%; min-height: 44px; padding: 6px 10px; line-height: 1.25; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-t th button:hover { color: hsl(var(--foreground)); }
.k-t th button:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: -3px; border-radius: 8px; }
.k-t th.n button { text-align: end; }
.k-t td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.k-t .n { text-align: end; }
.k-t tbody tr:hover { background: hsl(var(--card) / 0.45); }
.k-t td a { font-weight: 600; text-decoration: none; display: inline-block; min-height: 44px; line-height: 44px; }
.k-t td a:hover { text-decoration: underline; }
.k-t td .sub { display: block; font-size: 14px; color: var(--muted); line-height: 1.2; margin-top: -10px; }
.k-t .low { color: hsl(var(--danger)); font-weight: 600; }
.k-empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---- agent pages ---- */
.k-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.c-built { color: hsl(var(--success)); background: hsl(var(--success) / 0.14); box-shadow: inset 0 0 0 1px hsl(var(--success) / 0.35); }
.c-dormant { color: hsl(var(--info)); background: hsl(var(--info) / 0.12); box-shadow: inset 0 0 0 1px hsl(var(--info) / 0.35); }
.c-sample { color: hsl(var(--success)); background: hsl(var(--success) / 0.1); box-shadow: inset 0 0 0 1px hsl(var(--success) / 0.35); }
.c-concept { color: hsl(var(--brand-accent)); background: hsl(var(--brand-ornament) / 0.16); box-shadow: inset 0 0 0 1px hsl(var(--brand-accent) / 0.4); }
.k-baa { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; background: hsl(var(--warning) / 0.12); color: hsl(var(--foreground)); box-shadow: inset 0 0 0 1px hsl(var(--warning) / 0.4); }
.k-kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.k-kv dt { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.k-kv dd { margin: 0; }
.k-kv ul { margin: 0; padding-inline-start: 18px; } .k-kv li { margin: 0 0 2px; }
.k-parts { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.k-parts li { display: block; font-size: 15px; }
.k-parts li .k-chip { margin-inline-end: 8px; }
.k-parts .k-chip { min-height: 28px; font-size: 14px; }
.k-links { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.k-links > div { flex: 1 1 260px; min-width: 0; }
.k-links h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-links .row { display: flex; gap: 8px; flex-wrap: wrap; }
.k-lk { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; color: hsl(var(--foreground)); background: hsl(var(--card) / 0.7); box-shadow: inset 0 0 0 1px var(--control); }
.k-lk:hover { background: hsl(var(--card) / 0.95); }
html.dark .k-lk { background: hsl(var(--hi) / 0.07); }
.k-q { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.k-qi { padding: 16px 18px; border-radius: 18px; display: grid; gap: 10px; transition: opacity 0.2s var(--ease); }
.k-qi[data-state="approved"], .k-qi[data-state="sent_back"] { opacity: 0.85; }
.k-qi h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.k-qi p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
.k-qi .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.k-qi .tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.k-qi details { font-size: 15px; }
.k-qi summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: hsl(var(--primary)); }
.k-qi pre { margin: 0 0 6px; padding: 12px 14px; border-radius: 14px; background: hsl(var(--foreground) / 0.05); font: inherit; font-size: 15px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.k-qi .st { font-size: 15px; font-weight: 600; }
.k-qi a.home { font-weight: 600; }
.k-sec { margin: 18px 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.k-feed li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.k-feed li:last-child { border-bottom: 0; }
.k-feed a { font-weight: 600; white-space: nowrap; }
.k-feed time { color: var(--muted); font-size: 14px; white-space: nowrap; min-width: 4.8rem; }
.k-agent-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; padding: 18px; }
.k-agent-card:hover { transform: translateY(-2px); }
.k-agent-card h3 { margin: 0; font-size: 18px; font-weight: 600; }
.k-agent-card p { margin: 0; font-size: 15px; color: var(--muted); }
.k-agent-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.k-agent-card { transition: transform 0.18s var(--ease); }
.k-table-plain { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 640px; }
.k-table-plain th { text-align: start; font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
.k-table-plain td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.k-table-plain td a { font-weight: 600; }

/* ---- diagram ---- */
.k-dia { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 28px 64px; padding: 8px 0; }
.k-node { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 14px; border-radius: 18px; text-decoration: none; color: hsl(var(--foreground)); min-width: 0;
  background: hsl(var(--card) / 0.9); box-shadow: 0 0 0 1px var(--line-strong), 0 10px 24px -16px hsl(var(--edge) / 0.4); transition: transform 0.18s var(--ease); }
html.dark .k-node { background: hsl(150 17% 14%); }
.k-node:hover { transform: translateY(-2px); }
.k-node b { font-size: 16px; line-height: 1.25; } .k-node span { font-size: 14px; color: var(--muted); line-height: 1.3; }
.k-node.group { background: hsl(var(--brand-ornament) / 0.22); }
.k-node.dec { background: var(--dark); color: var(--dark-ink); grid-column: 1 / -1; min-height: 64px; align-items: flex-start; box-shadow: none; }
.k-node.dec span { color: var(--dark-muted); }
.k-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.k-svg line { stroke: hsl(var(--primary)); stroke-width: 2.5; }
.k-svg polygon { fill: hsl(var(--primary)); }
.k-handlist.k-hand { display: none; }
.k-handlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.k-handlist li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 15px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.k-handlist li:last-child { border: 0; }
.k-handlist .arrow { color: var(--muted); font-weight: 600; }
.k-handlist .why { flex-basis: 100%; color: var(--muted); font-size: 14px; }

/* ---- footer + toast ---- */
.k-foot { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); padding-top: 8px; }
.k-foot a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.k-toast { position: fixed; z-index: 80; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 16px); transform: translate(-50%, -0.5rem); max-width: calc(100vw - 2rem); padding: 0.65rem 1rem; border-radius: 0.9rem; border: 1px solid hsl(var(--border)); background: hsl(var(--popover)); color: hsl(var(--foreground)); font-size: 1rem; line-height: 1.35; box-shadow: 0 10px 30px -12px hsl(var(--foreground) / 0.35); opacity: 0; pointer-events: none; transition: opacity 0.16s ease-out, transform 0.16s ease-out; }
.k-toast[data-on="true"] { opacity: 1; transform: translate(-50%, 0); }
.k-dock { display: none; }
.k-rise { animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .k-g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-g2 { grid-template-columns: minmax(0, 1fr); }
  .k-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023.98px) {
  :root { --gut: 0px; --blur: 12px; }
  .k-app { display: block; margin: 0; min-height: 100vh; border-radius: 0; }
  .k-app::before { border-radius: 0; box-shadow: none; }
  .k-side { display: none; }
  .k-main { padding: 0 16px calc(104px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .k-top { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .k-card { padding: 18px; border-radius: 20px; }
  .k-intro { padding: 18px; } .k-intro h1 { font-size: 32px; }
  .k-dia { display: none; }
  .k-handlist.k-hand { display: grid; }
  .k-dock { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 6px; border-radius: 26px; gap: 2px;
    background: hsl(var(--card) / 0.86); backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%); box-shadow: 0 0 0 1px var(--line-strong), 0 16px 34px -14px hsl(var(--edge) / 0.45); }
  html.dark .k-dock { background: hsl(150 17% 12% / 0.88); }
  .k-dock a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 20px; text-decoration: none; color: hsl(var(--foreground)); font-size: 14px; font-weight: 600; line-height: 1.1; padding: 4px 0; }
  .k-dock a[aria-current="page"] { background: var(--fill); color: var(--fill-ink); }
  .k-dock .k-count { position: absolute; top: 2px; right: 8px; min-width: 22px; height: 22px; font-size: 14px; }
}
@media (max-width: 600px) {
  .k-g5, .k-g3, .k-g2e { grid-template-columns: minmax(0, 1fr); }
  .k-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .k-kv dd { margin-bottom: 10px; }
  .k-kpi-val { font-size: 30px; } .k-dec-count { font-size: 44px; }
  .k-dec-go { display: none; }
  .k-field { max-width: none; }
  .k-note { border-radius: 18px; padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) { .k-rise { animation: none; } .k-toast, .k-btn, .k-node, .k-agent-card { transition: none; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .k-card, .k-dock, .k-app::before { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .k-card { background: hsl(var(--card)); }
}

/* ======== v2: sidebar sections and rail, infographics, assistant, More sheet ======== */
.k-when { font-size: 14px; color: var(--muted); }
.k-app { transition: grid-template-columns 0.28s var(--ease); }
html.rail { --side-w: 84px; }
.k-side { overflow: hidden; min-width: 0; }
.k-brandrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-inline-end: 16px; flex: none; }
.k-brandrow .k-brand { min-width: 0; overflow: hidden; }
.k-rail-btn { flex: none; width: 44px; height: 44px; }
.k-rail-btn svg { transition: transform 0.28s var(--ease); }
html.rail .k-rail-btn svg { transform: scaleX(-1); }
.k-profile { display: flex; gap: 12px; align-items: center; margin: 0 14px 6px; padding: 10px; border-radius: 16px; flex: none; overflow: hidden; background: hsl(var(--card) / 0.7); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 hsl(var(--hi) / 0.9); }
html.dark .k-profile { background: hsl(var(--hi) / 0.06); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 hsl(var(--hi) / 0.1); }
.k-profile .lbl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-profile .lbl b, .k-profile .lbl span { display: block; overflow: hidden; text-overflow: ellipsis; }
.k-nav h2 { display: none; }
.k-sec { margin-bottom: 2px; }
.k-sec-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 14px; cursor: pointer; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: hsl(var(--brand-accent)); }
.k-sec-btn:hover { background: hsl(var(--card) / 0.5); }
.k-sec-btn:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: -2px; }
.k-sec-btn .lbl { flex: 1; white-space: nowrap; font-size: 15px; }
.k-sec-btn .chev { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.k-sec-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.k-sec-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.26s var(--ease), visibility 0s linear 0.26s; }
.k-sec-panel[data-open="true"] { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.26s var(--ease), visibility 0s linear 0s; }
.k-sec-in { overflow: hidden; min-height: 0; padding-inline-start: 8px; }
.k-nav a { overflow: hidden; }
.k-nav .lbl { min-width: 0; overflow-wrap: anywhere; }
html.rail .k-brand .lbl, html.rail .k-profile .lbl, html.rail .k-nav a .lbl, html.rail .k-nav a .k-count, html.rail .k-sec-btn .lbl, html.rail .k-sec-btn .chev { display: none; }
html.rail .k-brandrow { flex-direction: column; padding: 8px 0; gap: 4px; height: auto; }
html.rail .k-brand { padding: 0; height: 40px; justify-content: center; }
html.rail .k-profile { margin: 0 14px 6px; justify-content: center; padding: 6px; background: none; box-shadow: none; }
html.rail .k-sec-panel { grid-template-rows: 1fr; visibility: visible; }
html.rail .k-sec-in { padding-inline-start: 0; }
html.rail .k-sec-btn { justify-content: center; padding: 0; min-height: 28px; pointer-events: none; }
html.rail .k-sec-btn svg:first-child { display: none; }
html.rail .k-sec-btn::after { content: ""; display: block; width: 28px; border-top: 1px solid var(--line-strong); }
html.rail .k-sec:first-child .k-sec-btn { display: none; }
html.rail .k-nav a { justify-content: center; padding: 0; }
html.rail .k-nav { padding-inline: 10px; }
@media (prefers-reduced-motion: reduce) { .k-app, .k-sec-panel, .k-sec-btn .chev, .k-rail-btn svg { transition: none; } }

/* gauge, from the care home demo */
.k-gauge-wrap { position: relative; max-width: 340px; margin: 8px auto 0; }
.k-gauge { width: 100%; min-width: 240px; height: auto; overflow: visible; display: block; }
.g-track { fill: none; stroke: var(--track); stroke-width: 18; stroke-linecap: round; }
.g-tick { stroke: var(--muted); stroke-width: 1.2; opacity: 0.55; }
.g-arc { fill: none; stroke: hsl(var(--primary)); stroke-width: 18; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(0.65, 0, 0.35, 1); }
.g-bench { stroke: hsl(var(--info)); stroke-width: 3.5; stroke-linecap: round; }
.g-bench-txt { font-size: 15px; font-weight: 600; fill: hsl(var(--foreground)); paint-order: stroke; stroke: hsl(var(--card)); stroke-width: 7px; stroke-linejoin: round; }
.g-txt { font-size: 15px; fill: var(--muted); }
.g-needle { transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1); transform-box: view-box; }
.k-g-num { margin: 4px 0 0; font-size: 48px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; text-align: center; }
.k-center { text-align: center; } .k-sub.k-center { margin-top: 4px; }
.k-seg-wide { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; margin-bottom: 4px; }
.k-seg-wide button { padding: 0 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .g-arc, .g-needle { transition: none; } }

/* bars and columns */
.k-fig { min-width: 0; }
.k-bars { display: grid; gap: 12px; }
.k-bar-row { display: grid; grid-template-columns: minmax(5.5rem, 9.5rem) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 15px; }
.k-bar-l { min-width: 0; line-height: 1.25; }
.k-bar-v { font-weight: 600; text-align: end; white-space: nowrap; }
.k-bar-track { position: relative; display: block; height: 14px; border-radius: 999px; background: var(--track); }
.k-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: hsl(var(--primary)); }
.k-bar-fill.warn { background: hsl(var(--brand-accent)); }
.k-bar-fill.good { background: hsl(var(--success)); }
.k-bar-tick { position: absolute; top: -5px; width: 3px; height: 24px; border-radius: 2px; background: hsl(var(--info)); transform: translateX(-50%); }
.k-bars + .k-sub, .k-fig + .k-sub, .k-ret + .k-sub { margin-top: 12px; }
.k-cols { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; height: 190px; align-items: end; }
.k-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.k-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 4px; justify-items: center; min-width: 0; }
.k-col-v { font-size: 14px; font-weight: 600; }
.k-col-bar { align-self: end; width: 100%; max-width: 44px; border-radius: 10px 10px 4px 4px; background: hsl(var(--primary) / 0.45); min-height: 4px; }
.k-col.now .k-col-bar { background: hsl(var(--primary)); }
.k-col-l { font-size: 14px; color: var(--muted); white-space: nowrap; }
.k-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.k-rank li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); }
.k-rank li:last-child { border: 0; }
.k-rank a { font-weight: 600; }
.k-ret { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.k-ret-n { margin: 0 0 6px; font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.k-ret .k-sub { margin-top: 6px; }

/* assistant */
.k-main { padding-bottom: 110px; }
.k-chat-fab { position: fixed; z-index: 70; right: 28px; bottom: 28px; height: 56px; min-width: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 700; font-size: 16px; background: var(--fill); color: var(--fill-ink); box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3), 0 14px 30px -12px hsl(var(--foreground) / 0.6); transition: transform 0.16s var(--ease), opacity 0.2s var(--ease); }
.k-chat-fab:active { transform: scale(0.96); }
html.chat-open .k-chat-fab { opacity: 0; pointer-events: none; transform: scale(0.8); }
.k-chat { position: fixed; z-index: 75; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); display: flex; flex-direction: column; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--hi) / 0.62), hsl(var(--hi) / 0.12) 40%, hsl(var(--hi) / 0.3)), hsl(var(--card) / 0.74);
  backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); border: 1px solid hsl(var(--hi) / var(--a-edge));
  box-shadow: 0 0 0 1px hsl(var(--edge) / 0.08), inset 0 1px 0 hsl(var(--hi) / var(--a-hi)), 0 30px 70px -26px hsl(var(--edge) / 0.5);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(0.98); transform-origin: bottom right; transition: opacity 0.2s var(--ease), transform 0.24s var(--ease), visibility 0s linear 0.24s; }
html.dark .k-chat { background: linear-gradient(135deg, hsl(var(--hi) / 0.08), hsl(var(--hi) / 0.01) 40%, hsl(var(--hi) / 0.03)), hsl(150 17% 11% / 0.8); }
.k-chat[data-open="true"] { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s var(--ease), transform 0.24s var(--ease), visibility 0s linear 0s; }
.k-chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 16px 10px 20px; border-bottom: 1px solid var(--line); flex: none; }
.k-chat-head b { font-size: 18px; } .k-chat-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.k-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.k-msg { max-width: 92%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.45; display: grid; gap: 6px; min-width: 0; }
.k-msg p { margin: 0; overflow-wrap: anywhere; }
.k-msg.bot { align-self: flex-start; background: hsl(var(--card) / 0.85); box-shadow: 0 0 0 1px var(--line); border-end-start-radius: 6px; }
html.dark .k-msg.bot { background: hsl(var(--hi) / 0.08); }
.k-msg.user { align-self: flex-end; background: var(--fill); color: var(--fill-ink); border-end-end-radius: 6px; }
.k-mt { width: 100%; border-collapse: collapse; font-size: 14px; }
.k-mt th { text-align: start; font-weight: 600; color: var(--muted); padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line-strong); }
.k-mt td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.k-mt a { font-weight: 600; }
.k-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; flex: none; }
.k-chat-chip { font: inherit; font-size: 14px; cursor: pointer; text-align: start; min-height: 44px; border: 0; }
.k-chat-form { display: flex; gap: 8px; padding: 10px 14px 14px; flex: none; border-top: 1px solid var(--line); }
.k-chat-in { flex: 1 1 auto; max-width: none; }
.k-msg .k-actions .k-btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .k-chat, .k-chat[data-open="true"], .k-chat-fab, .k-sheet, .k-backdrop { transition: none; } }

/* More sheet (phone) */
.k-sheet, .k-backdrop, .k-more-btn { display: none; }
@media (max-width: 1023.98px) {
  .k-dock { grid-template-columns: repeat(5, 1fr); }
  .k-more-btn { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 20px; font-size: 14px; font-weight: 600; line-height: 1.1; cursor: pointer; }
  .k-more-btn[aria-expanded="true"] { background: var(--fill); color: var(--fill-ink); }
  .k-more-btn:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: 2px; }
  .k-backdrop { display: block; position: fixed; inset: 0; z-index: 78; background: hsl(150 30% 5% / 0.45); opacity: 0; visibility: hidden; transition: opacity 0.2s var(--ease), visibility 0s linear 0.2s; }
  .k-backdrop[data-open="true"] { opacity: 1; visibility: visible; transition: opacity 0.2s var(--ease), visibility 0s; }
  .k-sheet { display: block; position: fixed; z-index: 79; left: 8px; right: 8px; bottom: 8px; max-height: 78vh; overflow-y: auto; border-radius: 26px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: hsl(var(--card) / 0.94); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid hsl(var(--hi) / var(--a-edge)); box-shadow: 0 30px 70px -26px hsl(var(--edge) / 0.5);
    transform: translateY(24px); opacity: 0; visibility: hidden; transition: opacity 0.2s var(--ease), transform 0.26s var(--ease), visibility 0s linear 0.26s; }
  html.dark .k-sheet { background: hsl(150 17% 11% / 0.94); }
  .k-sheet[data-open="true"] { transform: none; opacity: 1; visibility: visible; transition: opacity 0.2s var(--ease), transform 0.26s var(--ease), visibility 0s; }
  .k-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px 10px; }
  .k-sheet-head b { font-size: 18px; }
  .k-sheet-body h2 { margin: 12px 10px 2px; font-size: 14px; font-weight: 700; color: hsl(var(--brand-accent)); }
  .k-sheet-body a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 14px; text-decoration: none; color: hsl(var(--foreground)); font-size: 16px; font-weight: 500; }
  .k-sheet-body a[aria-current="page"] { background: hsl(var(--foreground) / 0.07); font-weight: 700; }
  .k-main { padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px)); }
  .k-chat-fab { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); height: 52px; min-width: 52px; padding: 0 16px; }
  .k-chat { left: 8px; right: 8px; bottom: 8px; width: auto; height: 82vh; height: 82dvh; border-radius: 26px; transform: translateY(40px); transform-origin: bottom center; }
  .k-bar-row { grid-template-columns: minmax(4.5rem, 6.5rem) minmax(0, 1fr) auto; gap: 8px; }
  .k-seg-wide button { font-size: 14px; }
  .k-cols { gap: 4px; } .k-col-l { font-size: 14px; }
}
@media (max-width: 600px) {
  .k-cols-6 .k-col-l, .k-cols .k-col-l { font-size: 14px; }
  .k-cols { overflow: hidden; }
  .k-cols .k-col:nth-child(even) .k-col-l { visibility: hidden; }
  .k-ret { grid-template-columns: minmax(0, 1fr); }
  .k-seg-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-g-num { font-size: 44px; }
}

/* demo phone line */
.k-call { display: grid; gap: 14px; }
.k-call-num { display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 28px; border-radius: 999px; font-size: 32px; font-weight: 600; letter-spacing: 0.01em; text-decoration: none; color: var(--fill-ink); background: var(--fill); box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3), 0 12px 26px -14px hsl(var(--foreground) / 0.6); width: fit-content; max-width: 100%; }
.k-call-num svg { width: 28px; height: 28px; }
.k-call ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.k-call-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 700px) { .k-call-g { grid-template-columns: minmax(0, 1fr); gap: 14px; } .k-call-num { font-size: 28px; padding: 0 22px; } }

/* ======== v3: agent colours, living avatars, agent floor ======== */
:root {
  --ag-grace: 175 62% 24%; --ag-grace-ink: 0 0% 100%;
  --ag-ada: 235 44% 42%; --ag-ada-ink: 0 0% 100%;
  --ag-sam: 140 46% 25%; --ag-sam-ink: 0 0% 100%;
  --ag-otto: 28 92% 30%; --ag-otto-ink: 0 0% 100%;
  --ag-vera: 300 34% 35%; --ag-vera-ink: 0 0% 100%;
  --ag-paige: 210 42% 35%; --ag-paige-ink: 0 0% 100%;
  --ag-faye: 345 56% 40%; --ag-faye-ink: 0 0% 100%;
  --ag-ivy: 8 62% 38%; --ag-ivy-ink: 0 0% 100%;
  --ag-hart: 74 55% 24%; --ag-hart-ink: 0 0% 100%;
  --ag-sol: 46 85% 25%; --ag-sol-ink: 0 0% 100%;
}
html.dark {
  --ag-grace: 175 45% 56%; --ag-grace-ink: 150 22% 8%;
  --ag-ada: 235 70% 78%; --ag-ada-ink: 150 22% 8%;
  --ag-sam: 140 36% 56%; --ag-sam-ink: 150 22% 8%;
  --ag-otto: 30 88% 60%; --ag-otto-ink: 150 22% 8%;
  --ag-vera: 300 42% 76%; --ag-vera-ink: 150 22% 8%;
  --ag-paige: 210 58% 70%; --ag-paige-ink: 150 22% 8%;
  --ag-faye: 345 72% 76%; --ag-faye-ink: 150 22% 8%;
  --ag-ivy: 8 72% 68%; --ag-ivy-ink: 150 22% 8%;
  --ag-hart: 74 46% 56%; --ag-hart-ink: 150 22% 8%;
  --ag-sol: 46 76% 58%; --ag-sol-ink: 150 22% 8%;
}
.k-av { position: relative; display: inline-grid; place-items: center; width: var(--av, 32px); height: var(--av, 32px); flex: none; vertical-align: middle; }
.k-av-svg { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 50%; }
.k-av-body { fill: hsl(var(--ag)); }
.k-av-sym { stroke: hsl(var(--ag-ink)); }
.k-av-sym g { transform-box: view-box; transform-origin: 32px 32px; }
.k-av-badge { position: absolute; top: -6px; right: -8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; font-weight: 700; line-height: 1; background: hsl(var(--foreground)); color: hsl(var(--background)); box-shadow: 0 0 0 2px hsl(var(--card)); }
.k-dark .k-av-body { stroke: hsl(0 0% 100% / 0.4); stroke-width: 2; }
.k-av-xs .k-av-svg, .k-av-sm .k-av-svg { }
@keyframes k-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes k-ring { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.38); opacity: 0; } }
@keyframes k-ringing { 0%, 60%, 100% { transform: rotate(0); } 12% { transform: rotate(-14deg); } 26% { transform: rotate(12deg); } 40% { transform: rotate(-9deg); } }
@keyframes k-open { from { transform: scaleX(1); } to { transform: scaleX(0.5); } }
@keyframes k-shl { from { transform: translateX(0); } to { transform: translateX(3px); } }
@keyframes k-shr { from { transform: translateX(0); } to { transform: translateX(-3px); } }
@keyframes k-sweep { to { transform: rotate(360deg); } }
@keyframes k-pop { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: 0.8; } }
@keyframes k-bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes k-wave { from { transform: skewY(-7deg); } to { transform: skewY(7deg); } }
@keyframes k-spin { 0% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
.k-av[data-state="rest"] .k-av-svg, .k-av[data-state="needs"] .k-av-svg { animation: k-breathe 4s ease-in-out infinite; }
.k-av[data-state="needs"]::after { content: ""; position: absolute; inset: 0; border-radius: 34%; border: 3px solid hsl(var(--ag)); animation: k-ring 2.2s ease-out infinite; pointer-events: none; }
.k-av[data-state="working"] .s-hand { animation: k-ringing 1.1s ease-in-out infinite; }
.k-av[data-state="working"] .s-door { transform-origin: 22px 32px; animation: k-open 1.8s ease-in-out infinite alternate; }
.k-av[data-state="working"] .s-pl { animation: k-shl 1.6s ease-in-out infinite alternate; }
.k-av[data-state="working"] .s-pr { animation: k-shr 1.6s ease-in-out infinite alternate; }
.k-av[data-state="working"] .s-sweep { animation: k-sweep 5s linear infinite; }
.k-av[data-state="working"] .s-chk, .k-av[data-state="working"] .s-cchk { animation: k-pop 1.6s ease-in-out infinite; }
.k-av[data-state="working"] .s-box { animation: k-bob 1s ease-in-out infinite alternate; }
.k-av[data-state="working"] .s-heart { transform-origin: 32px 28px; animation: k-pop 1.2s ease-in-out infinite; }
.k-av[data-state="working"] .s-flag { transform-origin: 21px 17px; animation: k-wave 1.2s ease-in-out infinite alternate; }
.k-av[data-state="working"] .s-plus { transform-origin: 46px 26px; animation: k-spin 2.4s ease-in-out infinite; }
.k-av[data-vis="0"] .k-av-svg, .k-av[data-vis="0"] .k-av-sym g, .k-av[data-vis="0"]::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .k-av .k-av-svg, .k-av .k-av-sym g, .k-av::after { animation: none !important; }
  .k-av[data-state="needs"]::after { display: none; }
}

/* the agent floor */
.k-floor { position: relative; }
.k-lane { margin-top: 24px; }
.k-lane:first-of-type { margin-top: 4px; }
.k-lane-t { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: hsl(var(--brand-accent)); }
.k-lane-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.k-ag { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-height: 44px; padding: 16px 10px 12px; border-radius: 22px; text-decoration: none; color: inherit; background: transparent; border: 0; font: inherit; cursor: pointer; transition: background-color 0.16s var(--ease); }
.k-ag:hover, .k-ag:focus-visible, .k-ag[aria-expanded="true"] { background: hsl(var(--card) / 0.55); }
html.dark .k-ag:hover, html.dark .k-ag:focus-visible, html.dark .k-ag[aria-expanded="true"] { background: hsl(var(--hi) / 0.07); }
.k-ag .k-av { margin-bottom: 4px; }
.k-ag-name { font-size: 22px; font-weight: 500; font-family: var(--serif); line-height: 1.15; }
.k-ag-role { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.k-ag-cap { font-size: 14px; line-height: 1.35; color: hsl(var(--foreground)); min-height: 2.7em; max-width: 24ch; }
.k-ag-n { font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: hsl(var(--ag) / 0.14); color: hsl(var(--foreground)); box-shadow: inset 0 0 0 1px hsl(var(--ag) / 0.5); }
.k-pop { position: absolute; z-index: 30; width: min(340px, calc(100% - 16px)); padding: 16px 18px; border-radius: 22px; display: grid; gap: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.16s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
  background: linear-gradient(135deg, hsl(var(--hi) / 0.62), hsl(var(--hi) / 0.12) 40%, hsl(var(--hi) / 0.3)), hsl(var(--card) / 0.92); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); border: 1px solid hsl(var(--hi) / var(--a-edge)); border-top: 3px solid hsl(var(--ag)); box-shadow: 0 24px 56px -22px hsl(var(--edge) / 0.5); }
html.dark .k-pop { background: linear-gradient(135deg, hsl(var(--hi) / 0.08), hsl(var(--hi) / 0.01) 40%, hsl(var(--hi) / 0.03)), hsl(150 17% 11% / 0.95); }
.k-pop[data-open="true"] { opacity: 1; visibility: visible; transform: none; transition: opacity 0.16s var(--ease), transform 0.18s var(--ease), visibility 0s; }
.k-pop h3 { margin: 0; font-size: 18px; font-weight: 600; } .k-pop p { margin: 0; font-size: 15px; line-height: 1.45; }
.k-pop dl { margin: 0; display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 4px 10px; font-size: 14px; line-height: 1.4; } .k-pop dt { color: var(--muted); font-weight: 600; } .k-pop dd { margin: 0; }
@media (prefers-reduced-motion: reduce) { .k-pop, .k-pop[data-open="true"], .k-ag { transition: none; } }
.k-ag-inline { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.k-agl { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; color: hsl(var(--foreground)); background: hsl(var(--card) / 0.7); box-shadow: inset 0 0 0 1px var(--control), inset 4px 0 0 hsl(var(--ag)); }
.k-agl:hover { background: hsl(var(--card) / 0.95); }
html.dark .k-agl { background: hsl(var(--hi) / 0.07); }
.k-agl small { font-size: 14px; font-weight: 500; color: var(--muted); }
.k-agt { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px 2px 4px; border-radius: 999px; font-size: 14px; font-weight: 700; background: hsl(var(--ag)); color: hsl(var(--ag-ink)); white-space: nowrap; }
.k-agt .k-av { margin: 0; }
.k-nav a .k-av { margin-inline-start: -2px; }
.k-feed a.feedlink { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.k-qi .k-qi-h { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1 1 260px; }
.k-qi .k-qi-h h3 { flex: 1; min-width: 0; }
.k-dec .k-av { margin-inline-end: 0; }
.k-ag-head { display: flex; gap: 20px; align-items: center; min-width: 0; flex: 1 1 320px; }
.k-ag-head > div { min-width: 0; }
.k-ag-live { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.k-accented .k-card { border-top: 3px solid hsl(var(--ag)); }
.k-accented .k-btn-primary { box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3), 0 0 0 2px hsl(var(--ag)); }
.k-accented .k-bar-fill:not(.warn):not(.good), .k-accented .k-col.now .k-col-bar { background: hsl(var(--ag)); }
.k-accented .k-col-bar { background: hsl(var(--ag) / 0.45); }
.k-accented .k-col.now .k-col-bar { background: hsl(var(--ag)); }
.k-dia-label { font-size: 14px; font-weight: 700; paint-order: stroke; stroke: hsl(var(--card)); stroke-width: 5px; stroke-linejoin: round; }
.k-node .k-av { position: absolute; top: -10px; right: -8px; }
.k-node { padding-inline-end: 34px; }
.k-node.k-n-c { box-shadow: 0 0 0 2px hsl(var(--ag)), 0 10px 24px -16px hsl(var(--edge) / 0.4); }
.k-node[data-pulse="1"] { animation: k-nodepulse 1.2s ease-out 2; }
@keyframes k-nodepulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
.k-svg line { stroke: var(--lc, hsl(var(--primary))); }
.k-svg polygon { fill: var(--lc, hsl(var(--primary))); }
.k-hand-from { display: inline-flex; align-items: center; gap: 6px; }

/* hand-off token */
.k-handoff { position: fixed; z-index: 85; left: 50%; bottom: 28px; transform: translate(-50%, 16px); width: min(460px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 22px; display: grid; gap: 10px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.24s var(--ease), visibility 0s linear 0.24s;
  background: hsl(var(--card) / 0.94); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid hsl(var(--hi) / var(--a-edge)); box-shadow: 0 24px 56px -20px hsl(var(--edge) / 0.55); }
html.dark .k-handoff { background: hsl(150 17% 11% / 0.95); }
.k-handoff[data-on="true"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.2s var(--ease), transform 0.24s var(--ease), visibility 0s; }
.k-handoff p { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-ho-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; }
.k-ho-end { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; }
.k-ho-track { position: relative; height: 4px; border-radius: 2px; background: var(--c); opacity: 0.9; }
.k-ho-mv { position: absolute; left: 0; top: 0; width: 100%; height: 4px; animation: k-homove 1.3s var(--ease) 0.2s both; }
.k-ho-mv i { position: absolute; left: 0; top: -6px; width: 16px; height: 16px; border-radius: 5px; background: var(--c); box-shadow: 0 0 0 3px hsl(var(--card)); }
@keyframes k-homove { from { transform: translateX(0); } to { transform: translateX(calc(100% - 16px)); } }
@media (prefers-reduced-motion: reduce) { .k-ho-mv { animation: none; transform: translateX(calc(100% - 16px)); } .k-handoff { transition: none; } }
@media (max-width: 1023.98px) { .k-handoff { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* chat avatars */
.k-msgrow { display: flex; gap: 8px; align-items: flex-end; max-width: 96%; align-self: flex-start; }
.k-msgrow .k-msg { max-width: none; min-width: 0; }
.k-msgrow .k-av { flex: none; margin-bottom: 2px; }
.k-chat-head .k-chat-t { display: flex; gap: 10px; align-items: center; min-width: 0; }
.k-typing p { margin: 0; color: var(--muted); font-size: 15px; }

/* ======== v3: role switcher ======== */
.k-role-side { flex: none; }
.k-role-btn { width: calc(100% - 28px); text-align: start; font: inherit; color: inherit; cursor: pointer; border: 0; min-height: 64px; }
.k-role-btn .lbl { flex: 1; }
.k-role-btn .lbl i { font-style: normal; font-size: 14px; font-weight: 600; color: hsl(var(--brand-accent)); }
.k-role-btn:hover { background: hsl(var(--card) / 0.95); }
.k-role-sw { color: var(--muted); }
.k-role-btn[aria-expanded="true"] .k-role-sw { transform: rotate(90deg); }
.k-role-drop { margin: 0 14px 8px; }
.k-role-opts { display: grid; gap: 6px; }
.k-role-opt { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 6px 10px; border-radius: 14px; border: 0; font: inherit; color: hsl(var(--foreground)); text-align: start; cursor: pointer; background: hsl(var(--card) / 0.6); box-shadow: inset 0 0 0 1px var(--line); }
html.dark .k-role-opt { background: hsl(var(--hi) / 0.06); }
.k-role-opt:hover { background: hsl(var(--card) / 0.95); }
.k-role-opt .k-mono { width: 36px; height: 36px; font-size: 14px; }
.k-role-t { min-width: 0; } .k-role-t b { display: block; font-size: 15px; line-height: 1.25; } .k-role-t span { display: block; font-size: 14px; color: var(--muted); line-height: 1.25; }
.k-role-opt[aria-pressed="true"] { background: var(--fill); color: var(--fill-ink); box-shadow: inset 0 0 0 1px hsl(var(--foreground) / 0.3); }
.k-role-opt[aria-pressed="true"] .k-role-t span { color: inherit; opacity: 0.9; }
.k-role-opt[aria-pressed="true"] .k-mono { background: var(--fill-ink); color: var(--fill); }
html.rail .k-role-btn { width: auto; min-height: 56px; justify-content: center; }
html.rail .k-role-sw, html.rail .k-role-drop { display: none; }
.k-role-topwrap { display: none; position: relative; }
.k-role-top { min-height: 44px; padding: 0 14px; font-size: 15px; }
.k-role-top svg { width: 20px; height: 20px; }
.k-role-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 90; width: min(320px, calc(100vw - 32px)); padding: 14px; }
.k-role-pop[hidden] { display: none; }
.k-role-pop .k-sub { margin: 0 0 8px; font-weight: 700; }
.k-greet { margin-top: 6px; color: hsl(var(--foreground)); font-weight: 600; }
@media (max-width: 1023.98px) { .k-role-topwrap { display: block; } .k-top-r { flex-wrap: wrap; justify-content: flex-end; } }

/* ======== v3: calls Grace took ======== */
.k-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.k-call-i { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) auto; gap: 6px 14px; align-items: start; padding: 12px 16px; border-radius: 18px; }
.k-call-i time { font-size: 14px; font-weight: 700; color: var(--muted); padding-top: 3px; }
.k-call-i .who { font-weight: 600; font-size: 16px; margin: 0; }
.k-call-i .tx { font-size: 15px; margin: 2px 0 0; color: hsl(var(--foreground)); }
.k-call-i .meta { grid-column: 2 / -1; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.k-call-i .meta a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.k-call-i .meta .k-ag-inline { gap: 6px; }
@media (max-width: 600px) { .k-call-i { grid-template-columns: minmax(0, 1fr) auto; } .k-call-i time { grid-column: 1; } .k-call-i > div { grid-column: 1 / -1; } .k-call-i .meta { grid-column: 1 / -1; } }

/* ======== v3: found so far ======== */
.k-found-g { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 24px; align-items: center; }
.k-found-n { font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; margin: 4px 0 2px; }
.k-stack { display: flex; height: 24px; border-radius: 999px; overflow: hidden; gap: 3px; background: transparent; }
.k-stack span { display: block; height: 100%; min-width: 4px; }
.k-st-a { background: hsl(var(--success)); } .k-st-d { background: hsl(var(--brand-accent)); } .k-st-w { background: hsl(var(--foreground) / 0.38); }
.k-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.k-legend li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 15px; }
.k-legend i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.k-legend b { font-weight: 700; }
.k-types { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 15px; }
.k-types li { display: flex; justify-content: space-between; gap: 10px; min-height: 36px; align-items: center; border-bottom: 1px solid var(--line); }
.k-types li:last-child { border: 0; }
.k-types a { font-weight: 600; }
@media (max-width: 800px) { .k-found-g { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* ======== v3: ratings tracker and staffing file ======== */
.k-rt-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.k-rt { padding: 16px 18px; border-radius: 18px; display: grid; gap: 10px; }
.k-rt-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.k-rt-top h3 { margin: 0; font-size: 17px; font-weight: 600; }
.k-rt-top h3 a { display: inline-flex; align-items: center; min-height: 44px; }
.k-rt-top .tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.k-bars-sm .k-bar-track { height: 10px; }
.k-bars-sm .k-bar-row { grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr) auto; }
.k-tasks { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.k-tasks li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.k-tasks b { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; background: hsl(var(--foreground) / 0.08); }
.k-tasks a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.k-cap { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.k-sf-t { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.k-sf-t th { text-align: start; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.k-sf-t td { padding: 4px 10px; border-bottom: 1px solid var(--line); }
.k-sf-t .n { text-align: end; }
.k-sf-t td a { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* ======== v3: weekly report ======== */
.k-rp-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.k-rp-num p { margin: 0; } .k-rp-num .l { font-size: 14px; font-weight: 600; color: var(--muted); } .k-rp-num .v { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; } .k-rp-num .s { font-size: 14px; color: var(--muted); }
.k-rp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.k-rp-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.k-rp-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 15px; min-height: 36px; border-bottom: 1px solid var(--line); }
.k-rp-list li:last-child { border: 0; }
.k-rp-list a { font-weight: 600; }
.k-rp-print { display: none; }
@media (max-width: 1100px) { .k-rp-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .k-rp-two { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
@media (max-width: 600px) { .k-rp-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } .k-lane-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .k-ag-name { font-size: 20px; } }

/* ======== v3: print ======== */
@page { margin: 14mm; }
@media print {
  html, body { background: #fff !important; background-image: none !important; color: #111 !important; }
  .k-side, .k-dock, .k-chat, .k-chat-fab, .k-sheet, .k-backdrop, .k-toast, .k-note, .k-top, .k-foot, .skip, .k-noprint, .k-handoff, .k-role-topwrap { display: none !important; }
  .k-app { display: block !important; margin: 0 !important; min-height: 0 !important; }
  .k-app::before { display: none !important; }
  .k-main { padding: 0 !important; gap: 10px !important; display: flex; }
  .k-card, .k-l3 { background: #fff !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; border: 1px solid #bbb !important; border-radius: 10px !important; padding: 12px 14px !important; break-inside: avoid; color: #111 !important; animation: none !important; }
  .k-rise { animation: none !important; opacity: 1 !important; transform: none !important; }
  .k-sub, .k-meta, .k-rp-num .l, .k-rp-num .s, .k-cap, .k-eyebrow { color: #333 !important; }
  .k-intro h1 { font-size: 24px !important; margin: 2px 0 4px !important; }
  .k-rp-print { display: block !important; }
  .k-bar-track, .k-stack, .k-st-a, .k-st-d, .k-st-w, .k-bar-fill, .k-legend i, .k-pill, .k-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .k-bar-track { background: #e4e8e4 !important; }
  .k-title { font-size: 16px !important; }
  .k-rp-nums { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 8px !important; }
  .k-rp-num .v { font-size: 22px !important; }
  .k-rp-two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .k-found-g { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) !important; gap: 12px !important; }
  .k-found-n { font-size: 28px !important; }
  a { color: #111 !important; text-decoration: none !important; }
  body { font-size: 14px; }
}
.k-dia { gap: 28px 96px; }
.k-svg { z-index: 3; }
@media print {
  .k-types, .k-head .k-sub, .k-note { display: none !important; }
  .k-head { margin-bottom: 8px !important; }
  .k-intro { padding: 8px 12px !important; }
  .k-intro .k-meta { font-size: 14px; }
  .k-rp { gap: 8px !important; }
  .k-bar-row { gap: 8px !important; }
  .k-bars { gap: 8px !important; }
  .k-rp-list li { min-height: 28px !important; }
}
.k-role-pop { background: hsl(var(--card) / 0.97); }
html.dark .k-role-pop { background: hsl(150 17% 12% / 0.98); }
@media (max-width: 1023.98px) { .k-role-pop { position: fixed; left: 16px; right: 16px; width: auto; top: calc(72px + env(safe-area-inset-top, 0px)); } }
.k-feed a.feedlink { display: inline; white-space: normal; }
.k-feed a.feedlink .k-av { margin-inline-end: 6px; vertical-align: -6px; }
.k-types a.feedlink .k-av { margin-inline-end: 6px; vertical-align: -6px; }
.k-ag-head { flex: 1 1 560px; }
