/* css/tokens.css */
/* ==========================================================================
   Weesify "Aurora" design tokens v2 — docs/design/DESIGN_LANGUAGE.md
   Emerald identity, lime energy, violet intelligence (Assist), tangerine heat.
   Single source of truth for colour, type, space, radius, elevation, motion.
   ========================================================================== */
@layer reset, tokens, base, components, utilities;

@font-face { font-family: "Manrope"; font-weight: 200 800; font-style: normal; font-display: swap; src: url("/fonts/Manrope-Variable.woff") format("woff"); }
@font-face { font-family: "Urbanist"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/Urbanist-Variable.woff") format("woff"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/InstrumentSerif-Italic.woff") format("woff"); }

@layer tokens {
  :root {
    color-scheme: light;

    /* ---- Brand palette ---- */
    --emerald-50: #E9FDF4;
    --emerald-100: #CFFAE6;
    --emerald-200: #9EF2CD;
    --emerald-300: #5FE6AE;
    --emerald-400: #25D695;
    --emerald-500: #0BC284;
    --emerald-600: #07A06C;
    --emerald-700: #067C55;
    --emerald-800: #065E41;
    --forest-900: #062A1E;
    --forest-950: #03170F;
    --ink-raw: #0B0F0D;

    --lime-300: #D9FB8F;
    --lime-400: #C2F45B;
    --lime-500: #A6E635;

    --violet-300: #C4B5FF;
    --violet-400: #A08BFF;
    --violet-500: #7C5CFF;
    --violet-600: #6441F2;
    --violet-700: #4B2BC9;

    --tangerine-400: #FF9A5C;
    --tangerine-500: #FF7A3D;
    --tangerine-600: #E85D1E;

    --sky-500: #3B8BFF;
    --rose-500: #FF4D8D;

    /* Stone neutrals (warm-green tint) */
    --moss-0: #FFFFFF;
    --moss-25: #FBFBF9;
    --moss-50: #F5F6F3;
    --moss-100: #EEF0EC;
    --moss-200: #E4E7E2;
    --moss-300: #CDD2CB;
    --moss-400: #9BA39B;
    --moss-500: #6B736C;
    --moss-600: #4A524C;
    --moss-700: #333A35;
    --moss-800: #1E2420;
    --moss-900: #111512;

    /* ---- Semantic surfaces ---- */
    --canvas: #F1F2EE;
    --surface: #FFFFFF;
    --surface-2: #FAFAF8;
    --surface-sunken: #F4F5F2;
    --surface-hover: #F4F5F1;
    --surface-active: #ECEEE9;
    --overlay: rgb(8 12 10 / 0.42);
    --glass: rgb(255 255 255 / 0.72);
    --glass-strong: rgb(255 255 255 / 0.86);
    --glass-line: rgb(255 255 255 / 0.7);

    --ink: var(--ink-raw);
    --text: #262C28;
    --text-muted: #6B736C;
    --text-subtle: #9BA39B;
    --text-on-ink: #F6FAF7;
    --line: #E6E9E4;
    --line-strong: #D5DAD3;

    --accent: var(--emerald-500);
    --accent-hover: var(--emerald-600);
    --accent-text: var(--emerald-700);
    --accent-soft: var(--emerald-50);
    --accent-soft-2: var(--emerald-100);
    --assist: var(--violet-500);
    --assist-soft: #F1EDFF;
    --assist-text: var(--violet-600);
    --heat: var(--tangerine-500);
    --heat-soft: #FFF1E9;

    --success: var(--emerald-600);
    --success-soft: var(--emerald-50);
    --warning: #B86F00;
    --warning-soft: #FFF5E0;
    --danger: #D93A3A;
    --danger-soft: #FDECEC;
    --info: #2563EB;
    --info-soft: #EAF1FE;

    /* Data viz: validated categorical order (see dataviz notes in DESIGN_LANGUAGE.md) */
    --chart-1: #0BC284;
    --chart-2: #7C5CFF;
    --chart-3: #FF7A3D;
    --chart-4: #3B8BFF;
    --chart-5: #E4A11B;
    --chart-6: #FF4D8D;

    /* ---- Signature gradients ---- */
    --grad-aurora: linear-gradient(120deg, #0BC284 0%, #25D695 22%, #7C5CFF 62%, #FF7A3D 100%);
    --grad-brand: linear-gradient(135deg, #C2F45B 0%, #25D695 55%, #0BC284 100%);
    --grad-forest: radial-gradient(120% 120% at 100% 0%, rgb(37 214 149 / .55) 0%, transparent 52%), linear-gradient(155deg, #0B3B2A 0%, #062A1E 48%, #03170F 100%);
    --grad-violet: radial-gradient(120% 120% at 100% 0%, rgb(196 181 255 / .5) 0%, transparent 55%), linear-gradient(155deg, #7C5CFF 0%, #5B3BE8 55%, #3A1FB0 100%);
    --grad-sunset: radial-gradient(120% 120% at 0% 0%, rgb(255 214 170 / .6) 0%, transparent 50%), linear-gradient(150deg, #FF9A5C 0%, #FF7A3D 45%, #E8531E 100%);
    --grad-ink: radial-gradient(120% 140% at 100% 0%, rgb(124 92 255 / .35) 0%, transparent 45%), radial-gradient(90% 120% at 0% 100%, rgb(11 194 132 / .28) 0%, transparent 50%), linear-gradient(160deg, #15191A 0%, #0B0D0C 100%);
    --grad-mesh: radial-gradient(60% 60% at 12% 8%, rgb(194 244 91 / .28), transparent 60%), radial-gradient(50% 55% at 88% 12%, rgb(124 92 255 / .20), transparent 60%), radial-gradient(60% 60% at 70% 100%, rgb(11 194 132 / .18), transparent 60%);
    --hatch: repeating-linear-gradient(135deg, rgb(255 255 255 / .38) 0 2px, transparent 2px 7px);

    --focus-ring: 0 0 0 3px rgb(11 194 132 / 0.32);

    /* ---- Typography ---- */
    --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Urbanist", "Manrope", ui-sans-serif, system-ui, sans-serif;
    --font-accent: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    --fs-micro: 0.75rem;    /* 12 */
    --fs-small: 0.8125rem;  /* 13 */
    --fs-body: 0.875rem;    /* 14 */
    --fs-h3: 1.0625rem;     /* 17 */
    --fs-h2: 1.375rem;      /* 22 */
    --fs-h1: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);
    --fs-display: clamp(2.5rem, 1.4rem + 4.6vw, 4.75rem);

    /* ---- Space (4px base) ---- */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-14: 56px;

    /* ---- Radius ---- */
    --r-xs: 7px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-2xl: 36px; --r-pill: 999px;

    /* ---- Elevation ---- */
    --e1: 0 1px 2px rgb(20 28 22 / 0.04), 0 0 0 1px rgb(20 28 22 / 0.02);
    --e2: 0 10px 30px -10px rgb(20 28 22 / 0.16), 0 2px 6px rgb(20 28 22 / 0.05);
    --e3: 0 30px 80px -20px rgb(20 28 22 / 0.32), 0 6px 16px rgb(20 28 22 / 0.08);
    --e-glow: 0 18px 50px -12px rgb(11 194 132 / 0.45);
    --e-glow-violet: 0 18px 50px -12px rgb(124 92 255 / 0.5);
    --e-inset: inset 0 1px 0 rgb(255 255 255 / 0.7);

    /* ---- Motion ---- */
    --t-instant: 80ms; --t-fast: 150ms; --t-base: 240ms; --t-slow: 380ms; --t-lazy: 700ms;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-in: cubic-bezier(.4, 0, 1, 1);
    --ease-spring: cubic-bezier(.34, 1.45, .64, 1);

    /* ---- Layout ---- */
    --sidebar-w: 260px;
    --sidebar-rail: 72px;
    --shell-gap: 10px;
    --topbar-h: 64px;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #08090A;
    --surface: #111315;
    --surface-2: #14171A;
    --surface-sunken: #0C0E10;
    --surface-hover: #1A1D20;
    --surface-active: #202428;
    --overlay: rgb(0 0 0 / 0.62);
    --glass: rgb(22 25 28 / 0.66);
    --glass-strong: rgb(22 25 28 / 0.86);
    --glass-line: rgb(255 255 255 / 0.08);

    --ink: #F4F6F5;
    --text: #D9DEDB;
    --text-muted: #8E9692;
    --text-subtle: #626A66;
    --text-on-ink: #0B0F0D;
    --line: rgb(255 255 255 / 0.07);
    --line-strong: rgb(255 255 255 / 0.12);

    --accent: #2BE3A2;
    --accent-hover: #5CEFBC;
    --accent-text: #6FF2C6;
    --accent-soft: rgb(43 227 162 / 0.10);
    --accent-soft-2: rgb(43 227 162 / 0.18);
    --assist: #9A83FF;
    --assist-soft: rgb(124 92 255 / 0.14);
    --assist-text: #B9A9FF;
    --heat: #FF9A5C;
    --heat-soft: rgb(255 122 61 / 0.14);

    --success: #3DDC9A;
    --success-soft: rgb(61 220 154 / 0.12);
    --warning: #F0B44C;
    --warning-soft: rgb(240 180 76 / 0.12);
    --danger: #F17171;
    --danger-soft: rgb(241 113 113 / 0.12);
    --info: #7BA5FF;
    --info-soft: rgb(123 165 255 / 0.12);

    --chart-1: #0FA873; /* validated: scripts/validate_palette.js --mode dark */
    --chart-2: #8468FF;
    --chart-3: #E0692F;
    --chart-4: #4388F0;
    --chart-5: #BC8C14;
    --chart-6: #EC4C87;

    --grad-mesh: radial-gradient(55% 55% at 10% 0%, rgb(43 227 162 / .16), transparent 60%), radial-gradient(45% 50% at 90% 5%, rgb(124 92 255 / .20), transparent 60%), radial-gradient(60% 60% at 60% 100%, rgb(255 122 61 / .08), transparent 60%);
    --hatch: repeating-linear-gradient(135deg, rgb(0 0 0 / .28) 0 2px, transparent 2px 7px);

    --focus-ring: 0 0 0 3px rgb(43 227 162 / 0.32);
    --e1: 0 1px 2px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.02);
    --e2: 0 14px 34px -10px rgb(0 0 0 / 0.7), 0 2px 6px rgb(0 0 0 / 0.35);
    --e3: 0 34px 90px -16px rgb(0 0 0 / 0.85);
    --e-inset: inset 0 1px 0 rgb(255 255 255 / 0.05);
  }

  @media (prefers-reduced-motion: reduce) {
    :root { --t-instant: 1ms; --t-fast: 1ms; --t-base: 1ms; --t-slow: 1ms; --t-lazy: 1ms; }
  }
}

/* css/base.css */
/* Reset + base typography ------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100dvh; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
  [x-cloak] { display: none !important; }
}

@layer base {
  html { background: var(--canvas); }
  body {
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.57;
    color: var(--text);
    background: var(--canvas);
    font-feature-settings: "kern", "calt";
    font-weight: 450;
  }
  h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
  h1 { font-size: var(--fs-h1); letter-spacing: -0.035em; }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: var(--fs-h3); }
  strong, b { font-weight: 650; color: var(--ink); }
  small { font-size: var(--fs-small); }
  code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
  ::selection { background: var(--accent-soft-2); color: var(--ink); }

  :focus { outline: none; }
  :focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

  /* Scrollbars: quiet, thin */
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--r-sm); background: var(--ink); color: var(--text-on-ink); transition: top var(--t-fast) var(--ease-out); }
  .skip-link:focus { top: 12px; }

  .serif-accent, em.accent { font-family: var(--font-accent); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
  .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.04em; line-height: 1.02; color: var(--ink); }
  .tabular { font-variant-numeric: tabular-nums; }
}

/* css/components/controls.css */
/* Buttons, inputs, choice controls ---------------------------------------- */
@layer components {
  /* ---- Button ---- */
  .btn {
    --btn-h: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--btn-h); padding: 0 14px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    font-size: var(--fs-body); font-weight: 500; line-height: 1; white-space: nowrap;
    user-select: none; position: relative;
    transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out),
                color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out),
                transform var(--t-instant) var(--ease-out);
  }
  .btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
  .btn svg { width: 16px; height: 16px; flex: none; }
  .btn .kbd { margin-left: 2px; }

  .btn-primary { background: var(--ink); color: var(--text-on-ink); box-shadow: var(--e1), inset 0 1px 0 rgb(255 255 255 / .08); }
  .btn-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 88%, var(--accent)); }
  .btn-primary .kbd { background: rgb(255 255 255 / .12); color: inherit; border-color: rgb(255 255 255 / .16); }
  :root[data-theme="dark"] .btn-primary .kbd { background: rgb(0 0 0 / .08); border-color: rgb(0 0 0 / .12); }

  .btn-brand { background: linear-gradient(180deg, var(--emerald-500), var(--emerald-600)); color: #fff; box-shadow: var(--e1), inset 0 1px 0 rgb(255 255 255 / .2); }
  .btn-brand:hover:not(:disabled) { background: linear-gradient(180deg, var(--emerald-600), var(--emerald-700)); }

  .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--e1); }
  .btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--moss-400); }

  .btn-ghost { background: transparent; color: var(--text); }
  .btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }

  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover:not(:disabled) { background: color-mix(in oklab, var(--danger) 88%, black); }
  .btn-danger-ghost { color: var(--danger); }
  .btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }

  .btn-sm { --btn-h: 30px; padding: 0 10px; font-size: var(--fs-small); gap: 6px; }
  .btn-lg { --btn-h: 44px; padding: 0 20px; font-size: 0.9375rem; border-radius: 10px; }
  .btn-block { width: 100%; }
  .btn-icon { width: var(--btn-h); padding: 0; }

  .btn .btn-spinner { display: none; }
  .btn[data-loading] .btn-label, .btn.is-loading .btn-label { opacity: 0; }
  .btn[data-loading] .btn-spinner, .btn.is-loading .btn-spinner { display: block; position: absolute; animation: spin .7s linear infinite; }

  /* ---- Keyboard hint ---- */
  .kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
    font-family: var(--font-sans); font-size: 11px; font-weight: 500; line-height: 1;
    color: var(--text-muted); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--r-xs);
  }

  /* ---- Field ---- */
  .field { display: grid; gap: 6px; }
  .field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-small); font-weight: 500; color: var(--ink); }
  .field-label .optional { font-weight: 400; color: var(--text-subtle); }
  .field-hint { font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.45; }
  .field-error { font-size: var(--fs-micro); color: var(--danger); display: flex; gap: 6px; align-items: center; }
  .field-error svg { width: 14px; height: 14px; }

  .input, .select, .textarea {
    width: 100%; min-height: 38px; padding: 8px 12px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    box-shadow: var(--e1);
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast);
  }
  .input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
  .input:hover, .select:hover, .textarea:hover { border-color: var(--moss-400); }
  .input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); outline: none; }
  .input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
  .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent); }
  .input:disabled { background: var(--surface-sunken); color: var(--text-muted); }
  .textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
  .select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A7872' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
  .input-lg { min-height: 46px; font-size: 0.9375rem; padding: 10px 14px; border-radius: 10px; }

  /* Input group: [prefix][input][suffix] */
  .input-group { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--e1); transition: border-color var(--t-fast), box-shadow var(--t-fast); overflow: hidden; }
  .input-group:hover { border-color: var(--moss-400); }
  .input-group:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
  .input-group .input, .input-group .select { border: 0; box-shadow: none; border-radius: 0; min-width: 0; }
  .input-group .input:focus, .input-group .select:focus { box-shadow: none; }
  .input-addon { display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--surface-sunken); color: var(--text-muted); font-size: var(--fs-small); white-space: nowrap; border-right: 1px solid var(--line); }
  .input-addon:last-child { border-right: 0; border-left: 1px solid var(--line); }
  .input-addon svg { width: 16px; height: 16px; }
  .input-icon { position: relative; }
  .input-icon > svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--text-subtle); pointer-events: none; }
  .input-icon > .input { padding-left: 36px; }

  /* ---- Toggle (switch) ---- */
  .switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; }
  .switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
  .switch-track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--moss-300); transition: background var(--t-fast) var(--ease-out); }
  .switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform var(--t-base) var(--ease-spring); }
  .switch input:checked + .switch-track { background: var(--accent); }
  .switch input:checked + .switch-track::after { transform: translateX(16px); }
  .switch input:focus-visible + .switch-track { box-shadow: var(--focus-ring); }
  :root[data-theme="dark"] .switch-track { background: var(--line-strong); }

  .toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; }
  .toggle-row + .toggle-row { border-top: 1px solid var(--line); }
  .toggle-row-title { font-weight: 500; color: var(--ink); }
  .toggle-row-desc { font-size: var(--fs-small); color: var(--text-muted); }

  /* ---- Checkbox / radio ---- */
  .check { appearance: none; width: 16px; height: 16px; flex: none; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); display: inline-grid; place-content: center; transition: background var(--t-fast), border-color var(--t-fast); cursor: pointer; }
  .check::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform var(--t-fast) var(--ease-spring); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #fff; }
  .check:checked { background: var(--ink); border-color: var(--ink); }
  .check:checked::before { transform: scale(1); }
  .check[type="radio"] { border-radius: 50%; }
  .check[type="radio"]::before { clip-path: circle(50%); width: 6px; height: 6px; }

  /* ---- Segmented control ---- */
  .segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: 10px; }
  .segmented > * { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px; font-size: var(--fs-small); font-weight: 500; color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
  .segmented > *:hover { color: var(--ink); }
  .segmented > [aria-pressed="true"], .segmented > [aria-selected="true"], .segmented > .is-active { background: var(--surface); color: var(--ink); box-shadow: var(--e1), 0 0 0 1px var(--line); }
  .segmented svg { width: 15px; height: 15px; }

  /* ---- Choice cards (large selectable tiles, onboarding & pickers) ---- */
  .choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .choice {
    position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out), background var(--t-fast);
    cursor: pointer;
  }
  .choice:hover { border-color: var(--moss-400); transform: translateY(-1px); box-shadow: var(--e2); }
  .choice:has(input:checked), .choice.is-selected { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); box-shadow: 0 0 0 1px var(--accent), var(--e1); }
  .choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
  .choice input { position: absolute; opacity: 0; pointer-events: none; }
  .choice-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--line); }
  .choice:has(input:checked) .choice-icon, .choice.is-selected .choice-icon { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .choice-icon svg { width: 18px; height: 18px; }
  .choice-title { font-weight: 500; color: var(--ink); }
  .choice-desc { font-size: var(--fs-small); color: var(--text-muted); line-height: 1.4; }
  .choice-check { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; transition: all var(--t-fast); }
  .choice:has(input:checked) .choice-check, .choice.is-selected .choice-check { background: var(--accent); border-color: var(--accent); color: #fff; }
  .choice-check svg { width: 12px; height: 12px; opacity: 0; }
  .choice:has(input:checked) .choice-check svg, .choice.is-selected .choice-check svg { opacity: 1; }

  /* Option tiles (visual pickers in builder) */
  .tile-grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { display: grid; gap: 6px; text-align: center; font-size: var(--fs-micro); color: var(--text-muted); cursor: pointer; }
  .tile-preview { aspect-ratio: 1 / 0.8; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-sunken); display: grid; place-items: center; overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
  .tile:hover .tile-preview { border-color: var(--moss-400); transform: translateY(-1px); }
  .tile.is-selected .tile-preview, .tile:has(input:checked) .tile-preview { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  .tile.is-selected, .tile:has(input:checked) { color: var(--ink); font-weight: 500; }
  .tile input { position: absolute; opacity: 0; pointer-events: none; }

  /* Colour swatch input */
  .color-field { display: flex; align-items: center; gap: 8px; }
  .color-field input[type="color"] { appearance: none; width: 38px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
  .color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
  .color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
  .color-field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }

  input[type="range"].range { width: 100%; accent-color: var(--accent); }

  @keyframes spin { to { rotate: 360deg; } }
}

/* css/components/surfaces.css */
/* Cards, badges, menus, dialogs, drawers, toasts, empty states, skeletons */
@layer components {
  /* ---- Card ---- */
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--e1); }
  .card-pad { padding: var(--s-5); }
  .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .card-title { font-size: var(--fs-h3); font-weight: 500; color: var(--ink); }
  .card-subtitle { font-size: var(--fs-small); color: var(--text-muted); }
  .card-body { padding: 20px; }
  .card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .card-interactive { transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .card-interactive:hover { border-color: var(--line-strong); box-shadow: var(--e2); transform: translateY(-1px); }

  /* ---- Badge / pill ---- */
  .badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 500; line-height: 1; white-space: nowrap; background: var(--surface-sunken); color: var(--text); border: 1px solid var(--line); }
  .badge svg { width: 12px; height: 12px; }
  .badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in oklab, var(--accent) 25%, transparent); }
  .badge-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in oklab, var(--warning) 25%, transparent); }
  .badge-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 25%, transparent); }
  .badge-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in oklab, var(--info) 25%, transparent); }
  .badge-ink { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
  .dot-live { color: var(--accent); box-shadow: 0 0 0 0 currentColor; animation: pulse 2s var(--ease-out) infinite; }

  .delta { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 500; }
  .delta svg { width: 12px; height: 12px; }
  .delta-up { color: var(--accent-text); background: var(--accent-soft); }
  .delta-down { color: var(--danger); background: var(--danger-soft); }
  .delta-flat { color: var(--text-muted); background: var(--surface-sunken); }

  /* ---- Avatar ---- */
  .avatar { --size: 32px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--size) * .38); font-weight: 500; color: var(--ink); background: linear-gradient(135deg, var(--emerald-100), var(--moss-100)); border: 1px solid var(--line); overflow: hidden; }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-square { border-radius: 9px; }
  .avatar-ws { background: linear-gradient(135deg, var(--emerald-500), var(--forest-900)); color: #fff; border: 0; }

  /* ---- Menu / popover ---- */
  .menu {
    min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e2);
    transform-origin: var(--origin, top right);
  }
  .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 7px; font-size: var(--fs-body); color: var(--text); text-align: left; transition: background var(--t-instant), color var(--t-instant); }
  .menu-item:hover, .menu-item:focus-visible { background: var(--surface-hover); color: var(--ink); box-shadow: none; }
  .menu-item svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
  .menu-item .kbd { margin-left: auto; }
  .menu-item-danger, .menu-item-danger svg { color: var(--danger); }
  .menu-item-danger:hover { background: var(--danger-soft); color: var(--danger); }
  .menu-sep { height: 1px; margin: 6px -6px; background: var(--line); }
  .menu-label { padding: 6px 10px 4px; font-size: var(--fs-micro); color: var(--text-subtle); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

  /* Transition classes for Alpine x-transition (entrance/exit) */
  .pop-enter { transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
  .pop-enter-start { opacity: 0; transform: scale(.97) translateY(-4px); }
  .pop-enter-end { opacity: 1; transform: none; }
  .pop-leave { transition: opacity var(--t-instant) var(--ease-in), transform var(--t-instant) var(--ease-in); }
  .pop-leave-start { opacity: 1; }
  .pop-leave-end { opacity: 0; transform: scale(.98); }

  /* ---- Dialog / sheet ---- */
  .overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .dialog-wrap { position: fixed; inset: 0; z-index: 61; display: grid; place-items: start center; padding: 10vh 16px 16px; overflow-y: auto; }
  .dialog { width: 100%; max-width: var(--dialog-w, 520px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--e3); overflow: hidden; }
  .dialog-lg { --dialog-w: 860px; }
  .dialog-md { --dialog-w: 640px; }
  .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; }
  .dialog-title { font-size: var(--fs-h3); font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; }
  .dialog-body { padding: 4px 22px 22px; }
  .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
  .dialog-enter { transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); }
  .dialog-enter-start { opacity: 0; transform: translateY(10px) scale(.98); }
  .dialog-enter-end { opacity: 1; transform: none; }
  .fade-enter { transition: opacity var(--t-base) var(--ease-out); }
  .fade-leave { transition: opacity var(--t-fast) var(--ease-in); }
  .fade-start { opacity: 0; }
  .fade-end { opacity: 1; }

  .drawer { position: fixed; z-index: 61; top: 8px; right: 8px; bottom: 8px; width: min(520px, calc(100vw - 16px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--e3); overflow: hidden; }
  .drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
  .drawer-body { flex: 1; overflow-y: auto; padding: 20px; align-content: start; }
  .drawer-enter { transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); }
  .drawer-enter-start { opacity: 0; transform: translateX(24px); }
  .drawer-enter-end { opacity: 1; transform: none; }
  .drawer-leave { transition: opacity var(--t-fast) var(--ease-in), transform var(--t-fast) var(--ease-in); }
  .drawer-leave-end { opacity: 0; transform: translateX(16px); }

  @media (max-width: 640px) {
    .dialog-wrap { place-items: end stretch; padding: 0; }
    .dialog { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; overflow-y: auto; }
    .dialog-enter-start { transform: translateY(32px); }
    .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .drawer-enter-start { transform: translateY(32px); }
  }

  /* ---- Toasts ---- */
  .toasts { position: fixed; z-index: 80; bottom: 16px; right: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
  .toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--ink); color: var(--text-on-ink); border-radius: var(--r-md); box-shadow: var(--e3); font-size: var(--fs-body); }
  .toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
  .toast-success svg { color: var(--emerald-400); }
  .toast-error svg { color: #FF9C9C; }
  .toast-enter { transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-spring); }
  .toast-enter-start { opacity: 0; transform: translateY(12px) scale(.96); }
  .toast-enter-end { opacity: 1; transform: none; }

  /* ---- Alert / callout ---- */
  .callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-small); color: var(--text); }
  .callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
  .callout-accent { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 22%, transparent); }
  .callout-accent svg { color: var(--accent-text); }
  .callout-warning { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 25%, transparent); }
  .callout-warning svg { color: var(--warning); }
  .callout-danger { background: var(--danger-soft); border-color: color-mix(in oklab, var(--danger) 25%, transparent); }
  .callout-danger svg { color: var(--danger); }

  /* ---- Empty state ---- */
  .empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 56px 24px; }
  .empty-art { position: relative; width: 240px; height: 120px; margin-bottom: 12px; }
  .empty-art .ghost { position: absolute; left: 50%; width: 220px; height: 44px; translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--e1); }
  .empty-art .ghost:nth-child(1) { top: 0; scale: .9; opacity: .55; }
  .empty-art .ghost:nth-child(2) { top: 30px; scale: .95; opacity: .8; }
  .empty-art .ghost:nth-child(3) { top: 62px; box-shadow: var(--e2); }
  .empty-art .ghost svg { width: 16px; height: 16px; color: var(--accent-text); }
  .empty-art .ghost .bar { height: 8px; border-radius: 4px; background: var(--moss-100); flex: 1; }
  .empty-art .ghost .bar.short { flex: .45; background: var(--accent-soft-2); }
  .empty-title { font-size: var(--fs-h3); font-weight: 500; color: var(--ink); }
  .empty-text { max-width: 380px; color: var(--text-muted); }
  .empty-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

  /* ---- Skeleton ---- */
  .skeleton { position: relative; overflow: hidden; background: var(--surface-sunken); border-radius: 6px; }
  .skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); animation: shimmer 1.4s infinite; }
  :root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / .05), transparent); }

  /* ---- Tabs (underline) ---- */
  .tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: color var(--t-fast); }
  .tab:hover { color: var(--ink); }
  .tab[aria-selected="true"], .tab.is-active { color: var(--ink); }
  .tab[aria-selected="true"]::after, .tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
  .tab .count { font-size: var(--fs-micro); color: var(--text-subtle); font-weight: 400; }

  /* ---- Progress ---- */
  .progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-sunken); overflow: hidden; }
  .progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400)); transition: width var(--t-slow) var(--ease-out); }
  .progress-ring { --p: 0; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-active) 0); display: grid; place-items: center; }
  .progress-ring::before { content: ""; grid-area: 1/1; width: calc(var(--size) - 8px); height: calc(var(--size) - 8px); border-radius: 50%; background: var(--surface); }
  .progress-ring > span { grid-area: 1/1; font-size: var(--fs-micro); font-weight: 500; color: var(--ink); z-index: 1; }

  @keyframes shimmer { to { transform: translateX(100%); } }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
}

@layer components {
  :root[data-theme="dark"] .avatar:not(.avatar-ws) { background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 28%, var(--surface)), var(--surface-2)); color: var(--ink); }
}

/* css/components/aurora.css */
/* ==========================================================================
   Aurora brand layer: gradients, glass, glow, motion and signature components.
   Used by the app, the marketing site and the auth/onboarding flows.
   ========================================================================== */
@layer components {
  /* ---- Titles use the display face everywhere ---- */
  .card-title, .page-title, .dialog-title, .section-title, .kpi-value, .drawer-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

  /* ---- Ambient aurora backdrop (fixed, behind content) ---- */
  .aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .aurora::before, .aurora::after, .aurora > i {
    content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform;
    animation: aurora-drift 26s var(--ease-out) infinite alternate;
  }
  .aurora::before { width: 46vmax; height: 46vmax; left: -12vmax; top: -18vmax; background: radial-gradient(circle, rgb(194 244 91 / .55), transparent 65%); }
  .aurora::after { width: 42vmax; height: 42vmax; right: -14vmax; top: -10vmax; background: radial-gradient(circle, rgb(124 92 255 / .38), transparent 65%); animation-duration: 32s; animation-direction: alternate-reverse; }
  .aurora > i { width: 38vmax; height: 38vmax; left: 30%; bottom: -26vmax; background: radial-gradient(circle, rgb(11 194 132 / .35), transparent 65%); animation-duration: 38s; }
  :root[data-theme="dark"] .aurora::before { background: radial-gradient(circle, rgb(43 227 162 / .30), transparent 65%); opacity: .7; }
  :root[data-theme="dark"] .aurora::after { background: radial-gradient(circle, rgb(124 92 255 / .38), transparent 65%); opacity: .8; }
  :root[data-theme="dark"] .aurora > i { background: radial-gradient(circle, rgb(255 122 61 / .16), transparent 65%); }
  @keyframes aurora-drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } 100% { transform: translate3d(-3vmax, 5vmax, 0) scale(.96); } }

  /* Film grain (subtle, premium) */
  .grain { position: relative; isolation: isolate; }
  .grain::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; opacity: .18; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  }

  /* ---- Glass ---- */
  .glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: var(--e2); }

  /* ---- Gradient cards ---- */
  .g-card { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-lg); color: #fff; border: 0; }
  .g-card > * { position: relative; z-index: 1; }
  .g-forest { background: var(--grad-forest); box-shadow: 0 24px 50px -24px rgb(6 42 30 / .8); }
  .g-violet { background: var(--grad-violet); box-shadow: var(--e-glow-violet); }
  .g-sunset { background: var(--grad-sunset); box-shadow: 0 24px 50px -22px rgb(232 83 30 / .6); }
  .g-ink { background: var(--grad-ink); box-shadow: var(--e3); }
  .g-brand { background: var(--grad-brand); color: var(--forest-950); box-shadow: var(--e-glow); }
  .g-card::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
    background: radial-gradient(80% 60% at 110% -10%, rgb(255 255 255 / .35), transparent 60%);
  }
  .g-card .muted, .g-card .subtle { color: rgb(255 255 255 / .72); }
  .g-brand .muted { color: rgb(3 23 15 / .66); }

  .text-gradient { background: var(--grad-aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .text-brand { background: linear-gradient(90deg, var(--emerald-500), var(--violet-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* Gradient border (1px) */
  .g-border { position: relative; border: 0 !important; }
  .g-border::before {
    content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgb(11 194 132 / .7), rgb(124 92 255 / .55), rgb(255 122 61 / .45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  }

  /* Hover sheen */
  .sheen { position: relative; overflow: hidden; }
  .sheen::after { content: ""; position: absolute; inset: -50% auto -50% -60%; width: 40%; transform: rotate(18deg) translateX(-120%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent); transition: transform 900ms var(--ease-out); pointer-events: none; }
  .sheen:hover::after { transform: rotate(18deg) translateX(520%); }

  /* ---- Buttons v2 ---- */
  .btn { --btn-h: 40px; border-radius: 12px; padding: 0 16px; font-weight: 600; letter-spacing: -0.005em; }
  .btn-sm { --btn-h: 32px; border-radius: 10px; padding: 0 12px; }
  .btn-icon { padding: 0; width: var(--btn-h); }
  .btn-lg { --btn-h: 50px; border-radius: 14px; padding: 0 22px; font-size: 0.9375rem; }
  .btn-xl { --btn-h: 58px; border-radius: 16px; padding: 0 28px; font-size: 1rem; }
  .btn-pill { border-radius: var(--r-pill); }
  .btn-primary { background: var(--ink); color: var(--text-on-ink); box-shadow: 0 8px 20px -10px rgb(11 15 13 / .6), inset 0 1px 0 rgb(255 255 255 / .12); }
  .btn-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 86%, var(--accent)); box-shadow: 0 14px 26px -12px rgb(11 15 13 / .6), inset 0 1px 0 rgb(255 255 255 / .14); }
  .btn-brand { background: var(--grad-brand); color: var(--forest-950); box-shadow: 0 12px 28px -12px rgb(11 194 132 / .7), inset 0 1px 0 rgb(255 255 255 / .45); }
  .btn-brand:hover:not(:disabled) { filter: saturate(1.1) brightness(1.03); background: var(--grad-brand); box-shadow: 0 18px 34px -12px rgb(11 194 132 / .8), inset 0 1px 0 rgb(255 255 255 / .5); }
  .btn-assist { background: linear-gradient(135deg, #9A83FF, #7C5CFF 50%, #5B3BE8); color: #fff; box-shadow: 0 12px 28px -12px rgb(124 92 255 / .8), inset 0 1px 0 rgb(255 255 255 / .3); }
  .btn-assist:hover:not(:disabled) { filter: brightness(1.06); }
  .btn-glass { background: rgb(255 255 255 / .1); color: #fff; border: 1px solid rgb(255 255 255 / .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .btn-glass:hover:not(:disabled) { background: rgb(255 255 255 / .18); }
  .btn-secondary { border-color: var(--line-strong); box-shadow: var(--e1); }

  .input, .select, .textarea { min-height: 42px; border-radius: 12px; padding: 9px 14px; box-shadow: none; background: var(--surface); }
  .input-lg { min-height: 52px; border-radius: 14px; padding: 12px 16px; font-size: 0.9375rem; }
  .input-group { border-radius: 12px; box-shadow: none; }
  .input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 4px var(--accent-soft-2); }
  .input-group:focus-within { box-shadow: 0 0 0 4px var(--accent-soft-2); }

  .card { border-radius: var(--r-lg); box-shadow: var(--e1); }
  .dialog { border-radius: var(--r-xl); }

  /* ---- Chips ---- */
  .chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-small); font-weight: 600; color: var(--text); white-space: nowrap; transition: all var(--t-fast) var(--ease-out); }
  .chip svg { width: 14px; height: 14px; }
  .chip:hover { border-color: var(--line-strong); color: var(--ink); }
  .chip[aria-pressed="true"], .chip.is-active { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .chip-glass { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .18); color: #fff; backdrop-filter: blur(8px); }
  .eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; color: var(--ink); background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--e1); }
  .eyebrow .eyebrow-tag { height: 20px; padding: 0 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font-size: 11px; color: #fff; background: var(--grad-aurora); }

  /* ---- Stepper (segmented progress) ---- */
  .stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
  .stepper > span { height: 4px; border-radius: var(--r-pill); background: var(--line-strong); overflow: hidden; position: relative; }
  .stepper > span::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--grad-brand); transition: transform var(--t-lazy) var(--ease-out); }
  .stepper > span.is-done::after, .stepper > span.is-current::after { transform: scaleX(1); }
  .stepper > span.is-current::after { background: linear-gradient(90deg, var(--emerald-500), var(--violet-500)); }

  /* ---- Select cards (onboarding pickers) ---- */
  .pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
  .pick {
    position: relative; display: grid; align-content: space-between; gap: 18px; min-height: 124px; padding: 16px; text-align: left; cursor: pointer;
    border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-fast), background var(--t-base);
  }
  .pick:hover { transform: translateY(-3px); box-shadow: var(--e2); border-color: var(--line-strong); }
  .pick input { position: absolute; opacity: 0; pointer-events: none; }
  .pick-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--line); transition: all var(--t-base) var(--ease-out); }
  .pick-icon svg { width: 20px; height: 20px; }
  .pick-title { font-family: var(--font-display); font-weight: 650; font-size: 1rem; color: var(--ink); letter-spacing: -0.01em; }
  .pick-desc { font-size: var(--fs-small); color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
  .pick-radio { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: all var(--t-fast); }
  .pick-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--t-base) var(--ease-spring); }
  .pick:has(input:checked), .pick.is-selected { border-color: transparent; color: #fff; background: var(--grad-violet); box-shadow: var(--e-glow-violet); transform: translateY(-3px); }
  .pick.pick-green:has(input:checked), .pick.pick-green.is-selected { background: var(--grad-forest); box-shadow: 0 20px 44px -20px rgb(6 42 30 / .9); }
  .pick:has(input:checked) .pick-title, .pick.is-selected .pick-title { color: #fff; }
  .pick:has(input:checked) .pick-desc, .pick.is-selected .pick-desc { color: rgb(255 255 255 / .75); }
  .pick:has(input:checked) .pick-icon, .pick.is-selected .pick-icon { background: rgb(255 255 255 / .16); border-color: rgb(255 255 255 / .22); color: #fff; }
  .pick:has(input:checked) .pick-radio, .pick.is-selected .pick-radio { border-color: #fff; background: rgb(255 255 255 / .2); }
  .pick:has(input:checked) .pick-radio::after, .pick.is-selected .pick-radio::after { transform: scale(1); }
  .pick:has(input:focus-visible) { box-shadow: var(--focus-ring); }
  .pick-wide { grid-template-columns: 1fr auto; align-items: center; min-height: 96px; }

  /* ---- Floating / motion helpers ---- */
  .float { animation: float 7s ease-in-out infinite; }
  .float-slow { animation: float 10s ease-in-out infinite; }
  .float-delay { animation-delay: -3s; }
  @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
  .reveal { animation: reveal var(--t-lazy) var(--ease-out) both; }
  .reveal-2 { animation-delay: 80ms; } .reveal-3 { animation-delay: 160ms; } .reveal-4 { animation-delay: 240ms; } .reveal-5 { animation-delay: 320ms; }
  @keyframes reveal { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  .glow-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 18px 4px currentColor; background: currentColor; animation: twinkle 4s ease-in-out infinite; }
  @keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }

  /* ---- Charts: hatched stacked bars ---- */
  .vbars { --h: 200px; display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
  .vbars-axis { display: flex; flex-direction: column-reverse; justify-content: space-between; height: var(--h); font-size: 11px; color: var(--text-subtle); text-align: right; font-variant-numeric: tabular-nums; }
  .vbars-plot { position: relative; height: var(--h); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: clamp(4px, 1.4vw, 14px);
    background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px calc(var(--h) / 4)); }
  .vbar { position: relative; display: flex; flex-direction: column-reverse; gap: 3px; height: 100%; justify-content: flex-start; cursor: default; }
  .vbar > span { display: block; border-radius: 8px; min-height: 2px; transition: height var(--t-lazy) var(--ease-out), filter var(--t-fast); }
  .vbar .seg-a { background: var(--ink); }
  .vbar .seg-b { background: var(--lime-400); background-image: var(--hatch); }
  :root[data-theme="dark"] .vbar .seg-a { background: #EDEFEE; }
  .vbar:hover > span { filter: brightness(1.08); }
  .vbar .bar-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; padding: 4px 8px; border-radius: 8px; background: var(--ink); color: var(--text-on-ink); font-size: 11px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t-fast); }
  .vbar:hover .bar-tip { opacity: 1; }
  .vbars-labels { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: clamp(4px, 1.4vw, 14px); font-size: 11px; color: var(--text-subtle); text-align: center; }
  .legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-micro); color: var(--text-muted); }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

  /* ---- Donut ---- */
  .donut { --size: 168px; --thick: 22px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
    background: conic-gradient(var(--donut)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thick)), #000 calc(100% - var(--thick) + 1px)); mask: radial-gradient(farthest-side, transparent calc(100% - var(--thick)), #000 calc(100% - var(--thick) + 1px)); }
  .donut-wrap { position: relative; width: var(--size, 168px); height: var(--size, 168px); flex: none; }
  .donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
  .donut-center b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 650; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
  .donut-center span { font-size: var(--fs-micro); color: var(--text-muted); }

  /* ---- Progress ring (setup) ---- */
  .ring { --p: 50; --size: 56px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none;
    background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
  .ring b { font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: var(--ink); }

  /* ---- Phone mockup (showcase) ---- */
  .phone { position: relative; width: 280px; aspect-ratio: 9 / 19; border-radius: 44px; padding: 10px; background: linear-gradient(160deg, #2A2F2C, #0B0D0C); box-shadow: 0 0 0 1px rgb(255 255 255 / .08) inset, 0 50px 100px -30px rgb(0 0 0 / .6), 0 30px 60px -30px rgb(11 194 132 / .35); }
  .phone-screen { position: relative; width: 100%; height: 100%; border-radius: 35px; overflow: hidden; background: var(--surface); }
  .phone-screen::before { content: ""; position: absolute; top: 9px; left: 50%; translate: -50% 0; width: 86px; height: 24px; border-radius: 20px; background: #000; z-index: 5; }

  /* ---- Section heading pattern ---- */
  .kicker { font-size: var(--fs-micro); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
}

@layer components {
  .donut-block { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
  .donut-legend { flex: 1; min-width: 150px; display: grid; gap: 10px; margin: 0; padding: 0; }
  .donut-legend li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-small); color: var(--text); }
  .donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
  .donut-legend b { font-variant-numeric: tabular-nums; color: var(--ink); }
  .vbar > span { border-radius: 6px; }
}

@layer components {
  .vbar .bar-tip { display: none; z-index: 5; }
  .vbar:hover .bar-tip { display: block; }
  .vbar:nth-last-child(-n+3) .bar-tip { left: auto; right: 0; translate: none; }
  .vbar:nth-child(-n+3) .bar-tip { left: 0; translate: none; }
  .vbars-plot { overflow: visible; }
}
@layer components {
  .vbars-plot, .vbars-labels { grid-auto-columns: minmax(0, 1fr); }
  .vbars-labels span { white-space: nowrap; overflow: visible; font-size: 10.5px; }
  @media (max-width: 640px) { .vbars-plot, .vbars-labels { gap: 3px; } .vbars { grid-template-columns: 26px 1fr; gap: 6px; } }
}

/* css/components/shell.css */
/* App shell: framed layout, sidebar, top bar, page header, palette -------- */
@layer components {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; padding: var(--shell-gap); gap: var(--shell-gap); background: var(--canvas); background-image: var(--grad-mesh); background-attachment: fixed; }
  .shell[data-collapsed="true"] { grid-template-columns: var(--sidebar-rail) minmax(0, 1fr); }

  /* ---- Sidebar ---- */
  .sidebar { position: sticky; top: var(--shell-gap); height: calc(100dvh - 2 * var(--shell-gap)); display: flex; flex-direction: column; gap: 6px; padding: 10px 8px; min-width: 0; overflow-y: auto; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; }
  .sidebar-brand .brand-mark { font-size: 1.25rem; }
  .sidebar-brand .brand-mark svg { width: 30px; height: 30px; }
  .ws-switcher { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 16px; text-align: left; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--e1); transition: background var(--t-fast), box-shadow var(--t-fast); }
  .ws-switcher:hover { box-shadow: var(--e2); }
  .ws-switcher .avatar { --size: 34px; border-radius: 11px; }
  .switcher-name { font-family: var(--font-display); font-weight: 700; color: var(--ink); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
  .switcher-meta { font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.2; }
  .ws-switcher > svg { width: 16px; height: 16px; color: var(--text-subtle); margin-left: auto; flex: none; }

  .sidebar-create { margin: 8px 0 6px; }
  .sidebar-create-btn { height: 44px; border-radius: 14px; justify-content: flex-start; padding: 0 14px; }
  .sidebar-create-btn .kbd { margin-left: auto; }
  .nav { display: grid; gap: 2px; }
  .nav-section { margin-top: 14px; padding: 0 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-subtle); }
  .nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 13px; color: var(--text-muted); font-weight: 600; transition: background var(--t-fast), color var(--t-fast); }
  .nav-item svg { width: 19px; height: 19px; flex: none; stroke-width: 1.8; }
  .nav-item:hover { background: var(--glass-strong); color: var(--ink); }
  .nav-item[aria-current="page"] { background: var(--ink); color: var(--text-on-ink); box-shadow: 0 10px 22px -12px rgb(11 15 13 / .7); }
  .nav-item[aria-current="page"] svg { color: var(--lime-400); }
  :root[data-theme="dark"] .nav-item[aria-current="page"] svg { color: var(--emerald-600); }
  .nav-item.is-soon { opacity: .55; cursor: default; }
  .nav-item.is-soon:hover { background: none; color: var(--text-muted); }
  .nav-item .soon { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); background: var(--assist-soft); color: var(--assist-text); }

  .sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; }
  .usage-card { padding: 16px; border-radius: 20px; display: grid; gap: 12px; }
  .usage-title { color: #fff; font-family: var(--font-display); font-size: .98rem; }
  .usage-row { display: grid; gap: 6px; font-size: var(--fs-micro); color: rgb(255 255 255 / .7); }
  .usage-row .usage-line { display: flex; justify-content: space-between; }
  .usage-row .usage-line b { color: #fff; font-weight: 700; }
  .usage-card .progress { background: rgb(255 255 255 / .12); height: 6px; }
  .usage-card .progress > span { background: linear-gradient(90deg, #C2F45B, #25D695); }
  .usage-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 36px; border-radius: 12px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16); color: #fff; font-weight: 700; font-size: var(--fs-small); transition: background var(--t-fast); }
  .usage-cta:hover { background: rgb(255 255 255 / .2); }
  .usage-cta svg { width: 15px; height: 15px; }
  .user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 14px; text-align: left; transition: background var(--t-fast); }
  .user-chip:hover { background: var(--glass-strong); }

  .shell[data-collapsed="true"] .hide-collapsed { display: none !important; }
  .shell[data-collapsed="true"] .nav-item { justify-content: center; padding: 0; }
  .shell[data-collapsed="true"] .nav-section { visibility: hidden; height: 6px; padding: 0; margin-top: 6px; }
  .shell[data-collapsed="true"] .sidebar-create-btn { justify-content: center; padding: 0; }
  .shell[data-collapsed="true"] .ws-switcher { justify-content: center; padding: 8px 0; }
  .shell[data-collapsed="true"] .sidebar-brand { justify-content: center; }

  /* ---- Main panel ---- */
  .main { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--e2); min-height: calc(100dvh - 2 * var(--shell-gap)); position: relative; }
  :root[data-theme="dark"] .main { background: var(--surface); }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--surface) 84%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-radius: 28px 28px 0 0; }
  .crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-body); color: var(--text-muted); font-weight: 600; }
  .crumbs a:hover { color: var(--ink); }
  .crumbs .current { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumbs svg { width: 14px; height: 14px; color: var(--text-subtle); flex: none; }
  .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .topbar-icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
  .topbar-icon svg { width: 17px; height: 17px; }
  .search-trigger { display: flex; align-items: center; gap: 8px; height: 40px; width: 280px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-subtle); background: var(--surface-sunken); transition: border-color var(--t-fast), background var(--t-fast); font-weight: 500; }
  .search-trigger:hover { border-color: var(--line-strong); background: var(--surface); }
  .search-trigger svg { width: 16px; height: 16px; }
  .search-trigger .kbd { margin-left: auto; }
  .assist-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #9A83FF, #7C5CFF 50%, #5B3BE8); box-shadow: 0 10px 22px -12px rgb(124 92 255 / .9), inset 0 1px 0 rgb(255 255 255 / .3); transition: filter var(--t-fast), transform var(--t-fast); }
  .assist-pill:hover { filter: brightness(1.07); transform: translateY(-1px); }
  .assist-pill svg { width: 16px; height: 16px; }
  .topbar .mobile-nav-btn, .topbar .mobile-brand { display: none; }
  .icon-btn { width: 32px; height: 32px; border-radius: 10px; }

  .page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 32px 64px; }
  .page-narrow { max-width: 900px; }
  .page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
  .page-title { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.4rem); font-weight: 700; letter-spacing: -0.045em; color: var(--ink); line-height: 1.05; }
  .page-desc { margin-top: 6px; color: var(--text-muted); max-width: 640px; font-size: .95rem; }
  .page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .section-title { font-size: var(--fs-h3); font-weight: 700; color: var(--ink); }

  /* ---- Mobile tab bar ---- */
  .tabbar { display: none; }

  /* ---- Command palette / launcher ---- */
  .palette { --dialog-w: 620px; }
  .palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .palette-input svg { width: 18px; height: 18px; color: var(--text-subtle); flex: none; }
  .palette-input input { flex: 1; border: 0; background: transparent; font-size: 1rem; color: var(--ink); outline: none; }
  .palette-input input:focus-visible { box-shadow: none; }
  .palette-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 8px; }
  .palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; color: var(--text); }
  .palette-item .pi-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-muted); flex: none; }
  .palette-item .pi-icon svg { width: 16px; height: 16px; }
  .palette-item .pi-sub { font-size: var(--fs-micro); color: var(--text-muted); }
  .palette-item .kbd { margin-left: auto; }
  .palette-item.is-active, .palette-item:hover { background: var(--surface-hover); color: var(--ink); }
  .palette-item.is-active .pi-icon { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: var(--fs-micro); color: var(--text-muted); background: var(--surface-2); }
  .palette-foot span { display: inline-flex; gap: 6px; align-items: center; }

  .launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .launcher-tile { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out), background var(--t-fast); }
  .launcher-tile:hover, .launcher-tile:focus-visible { border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); box-shadow: var(--e2); transform: translateY(-1px); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
  .launcher-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), var(--e1); }
  .launcher-icon svg { width: 20px; height: 20px; }
  .launcher-title { font-weight: 500; color: var(--ink); }
  .launcher-desc { font-size: var(--fs-small); color: var(--text-muted); }
  .launcher-tile .kbd { position: absolute; top: 10px; right: 10px; }
  .launcher-tile[aria-disabled="true"] { opacity: .55; pointer-events: none; }

  /* ---- Responsive shell ---- */
  @media (max-width: 1023px) {
    .search-trigger { width: 40px; padding: 0; justify-content: center; }
    .search-trigger span, .search-trigger .kbd { display: none; }
  }
  @media (max-width: 767px) {
    .shell, .shell[data-collapsed="true"] { grid-template-columns: minmax(0, 1fr); padding: 0; }
    .sidebar { position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: 290px; height: 100dvh; background: var(--canvas); padding: 14px 12px; transform: translateX(-104%); transition: transform var(--t-base) var(--ease-out); box-shadow: var(--e3); border-radius: 0 28px 28px 0; }
    .shell[data-mobile-open="true"] .sidebar { transform: none; }
    .topbar .mobile-nav-btn { display: inline-grid; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); }
    .topbar .mobile-brand { display: inline-flex; }
    .mobile-brand svg { width: 28px; height: 28px; }
    .main { border-radius: 0; border: 0; min-height: 100dvh; box-shadow: none; }
    .topbar { border-radius: 0; padding: 0 14px; height: 60px; }
    .crumbs { display: none; }
    .page { padding: 22px 16px 120px; }
    .launcher-grid { grid-template-columns: minmax(0, 1fr); }
    .tabbar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; height: 68px; padding: 0 8px; border-radius: 24px; background: color-mix(in oklab, var(--ink) 94%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); box-shadow: 0 20px 40px -14px rgb(0 0 0 / .55); }
    .tabbar-item { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: rgb(255 255 255 / .55); }
    :root[data-theme="dark"] .tabbar-item { color: rgb(11 15 13 / .55); }
    .tabbar-item svg { width: 21px; height: 21px; }
    .tabbar-item[aria-current="page"] { color: var(--lime-400); }
    :root[data-theme="dark"] .tabbar-item[aria-current="page"] { color: var(--emerald-700); }
    .tabbar-create { justify-self: center; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-brand); color: var(--forest-950); box-shadow: 0 10px 24px -8px rgb(11 194 132 / .8), inset 0 1px 0 rgb(255 255 255 / .5); transform: translateY(-14px); border: 4px solid var(--canvas); }
    .tabbar-create svg { width: 24px; height: 24px; stroke-width: 2.4; }
  }
  @media (min-width: 768px) { .mobile-scrim { display: none !important; } }
}

@layer components {
  .ws-switcher { font-size: var(--fs-body); }
  .ws-switcher .switcher-name { font-size: var(--fs-body); font-weight: 700; }
  .user-chip { font-size: var(--fs-body); }
}

@layer components { .brand-logo { height: 28px; width: auto; max-width: 170px; object-fit: contain; } 
  /* Starred and recent (ADR-0042) */
  .title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .title-row > h1 { min-width: 0; }
  .star-btn { flex: none; color: var(--text-subtle); }
  .star-btn:hover { color: var(--amber-500, #F59E0B); }
  .star-btn.is-on { color: var(--amber-500, #F59E0B); }
  .star-btn.is-on svg { fill: currentColor; }
  .cp-hero .star-btn, .g-card .star-btn { color: rgb(255 255 255 / .75); } .cp-hero .star-btn.is-on, .g-card .star-btn.is-on { color: #FCD34D; }
  .jb-list { display: grid; gap: 2px; padding: 6px; }
  .jb-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; min-width: 0; }
  .jb-item:hover { background: var(--surface-2); }
  .jb-icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); }
  .jb-icon svg { width: 16px; height: 16px; }
  .jb-item b { display: block; font-size: 14px; font-weight: 600; }
  .jb-item small { display: block; font-size: 12px; color: var(--text-muted); }
  .jb-star { flex: none; color: var(--amber-500, #F59E0B); } .jb-star svg { width: 14px; height: 14px; fill: currentColor; }

  /* Bulk selection (ADR-0042) */
  .row:has(> .row-check) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  @media (max-width: 640px) { .row:has(> .row-check) { grid-template-columns: auto auto minmax(0, 1fr); } }
  .row .row-check { align-self: center; }
  .bulk-bar b { color: var(--text-on-ink); }
  .row.is-selected { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
  .select-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin: 0 0 8px 4px; cursor: pointer; }
  .qr-card, .product-card-wrap { position: relative; }
  .product-card-wrap { display: grid; }
  .product-card-wrap > .product-card { height: 100%; }
  .card-check { position: absolute; top: 12px; left: 12px; z-index: 3; width: 22px; height: 22px; box-shadow: 0 2px 8px rgb(0 0 0 / .18); opacity: 0; transition: opacity var(--t-fast); }
  .qr-card:hover .card-check, .product-card-wrap:hover .card-check, .card-check:checked, .card-check:focus-visible { opacity: 1; }
  @media (hover: none) { .card-check { opacity: 1; } }
  .qr-card.is-selected, .product-card-wrap.is-selected > .product-card { outline: 2px solid var(--accent); outline-offset: 2px; }
  .product-card-wrap .card-check { left: auto; right: 12px; }

  /* Settings → Import & export (ADR-0042) */
  .dh-heading { margin: 28px 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .dh-heading:first-of-type { margin-top: 8px; }
  .dh-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
  .dh-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
  .dh-tile > div { flex: 1; min-width: 0; }
  .dh-tile b { color: var(--ink); display: block; }
  .dh-tile p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
  .dh-tile .btn { flex: none; }
  .dh-wide { grid-column: 1 / -1; }
  .dh-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
  .dh-icon svg { width: 18px; height: 18px; position: relative; z-index: 1; }
  .dh-forms { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); column-gap: 20px; }
  .dh-forms li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; }
  .dh-forms li .truncate { flex: 1; min-width: 0; }
  .dh-sample { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-sunken); font-size: 12.5px; overflow-x: auto; }
  .dh-result { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-sunken); }
  .dh-result.is-ok { background: color-mix(in oklab, var(--emerald-500, #10B981) 12%, var(--surface)); }
  .dh-errors { margin: 0; padding: 0 0 0 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-muted); max-height: 240px; overflow: auto; }
  @media (max-width: 520px) { .dh-tile { flex-wrap: wrap; } .dh-tile .btn { margin-left: 54px; } }
}

/* css/components/data.css */
/* Data display: resource rows, tables, KPI tiles, charts, toolbars -------- */
@layer components {
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
  .toolbar .grow { flex: 1; }
  .toolbar .input-icon { width: min(320px, 100%); }

  /* ---- Resource list (row cards) ---- */
  .rows { display: grid; gap: 8px; }
  .row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  }
  .row:hover { border-color: var(--line-strong); box-shadow: var(--e1); }
  .row.is-archived { background: var(--surface-2); }
  .row-lead { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
  .row-lead img { width: 20px; height: 20px; }
  .row-lead svg { width: 18px; height: 18px; color: var(--text-muted); }
  .row-lead.square { border-radius: 10px; }
  .row-main { min-width: 0; display: grid; gap: 2px; }
  .row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; color: var(--ink); }
  .row-title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
  .row-title .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-small); color: var(--text-muted); }
  .row-sub svg { width: 13px; height: 13px; flex: none; color: var(--text-subtle); }
  .row-sub .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-meta { display: flex; align-items: center; gap: 8px; }
  .icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--text-muted); transition: background var(--t-instant), color var(--t-instant); }
  .icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
  .icon-btn svg { width: 15px; height: 15px; }
  .icon-btn.is-done { color: var(--accent-text); }
  .stat-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-small); color: var(--text); font-variant-numeric: tabular-nums; transition: border-color var(--t-fast), background var(--t-fast); }
  .stat-pill:hover { border-color: var(--line-strong); background: var(--surface); }
  .stat-pill svg { width: 14px; height: 14px; color: var(--text-muted); }

  .pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-small); color: var(--text-muted); }

  /* ---- Table ---- */
  .table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: auto; background: var(--surface); }
  .table { width: 100%; font-size: var(--fs-body); }
  .table th { text-align: left; font-weight: 500; font-size: var(--fs-micro); color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
  .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .table tr:last-child td { border-bottom: 0; }
  .table tbody tr { transition: background var(--t-instant); }
  .table tbody tr:hover { background: var(--surface-2); }
  .table .num { text-align: right; font-variant-numeric: tabular-nums; }

  /* ---- KPI tiles ---- */
  .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .kpi { position: relative; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e1); overflow: hidden; }
  .kpi-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--text-muted); }
  .kpi-label svg { width: 15px; height: 15px; }
  .kpi-value { margin-top: 8px; font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
  .kpi-foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: var(--fs-micro); color: var(--text-muted); }
  .kpi-spark { position: absolute; right: 14px; top: 18px; width: 88px; height: 30px; color: var(--accent); }
  .kpi.is-feature { background: radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--accent) 26%, transparent), transparent 55%), linear-gradient(160deg, var(--forest-900), #0B241B); color: #E9FFF5; border-color: transparent; }
  .kpi.is-feature .kpi-label, .kpi.is-feature .kpi-foot { color: rgb(233 255 245 / .7); }
  .kpi.is-feature .kpi-value { color: #fff; }
  .kpi.is-feature .kpi-spark { color: var(--emerald-400); }
  @media (max-width: 1023px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  /* ---- Charts (server-rendered SVG) ---- */
  .chart { width: 100%; height: 220px; color: var(--accent); }
  .chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
  .chart .axis { fill: var(--text-subtle); font-size: 11px; font-family: var(--font-sans); }
  .chart .area { fill: url(#chartFill); }
  .chart .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .chart .bar { fill: currentColor; opacity: .85; }
  .chart-empty { display: grid; place-items: center; height: 220px; color: var(--text-muted); font-size: var(--fs-small); border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--surface-2) 10px 20px); }

  .bars { display: grid; gap: 6px; align-content: start; }
  .bar-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: var(--fs-small); color: var(--text); overflow: hidden; }
  .bar-row::before { content: ""; position: absolute; inset: 0; width: var(--w, 0%); background: var(--accent-soft); border-radius: inherit; transition: width var(--t-slow) var(--ease-out); }
  .bar-row > * { position: relative; }
  .bar-row .label { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-row .value { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }

  /* ---- Description list ---- */
  .dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: var(--fs-body); }
  .dl dt { color: var(--text-muted); }
  .dl dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

  /* ---- Grid layout helpers ---- */
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
  @media (max-width: 1023px) { .grid-3, .grid-main-side { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } .row { grid-template-columns: auto minmax(0, 1fr); } .row-meta { grid-column: 1 / -1; justify-content: flex-end; } .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .dl dd { margin-bottom: 8px; } }
}

@layer components {
  .btn-secondary[aria-pressed="true"] { background: var(--ink); color: var(--text-on-ink); border-color: var(--ink); }
  @media (max-width: 767px) { .link-editor-grid { grid-template-columns: minmax(0, 1fr) !important; } .link-editor-side { border-left: 0 !important; border-top: 1px solid var(--line); } }
}

@layer components {
  @media (max-width: 767px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; }
    .kpi-value { font-size: 1.5rem; }
    .kpi-foot { white-space: nowrap; }
  }
  @media (max-width: 520px) { .kpi-spark { display: none; } }
}

/* css/components/dashboard.css */
/* Dashboard surfaces: home hero, setup banner, KPI cards, rankings, featured page ---------- */
@layer components {
  .home-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
  .home-date { font-size: var(--fs-small); color: var(--text-muted); font-weight: 600; }
  .home-greeting { font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.1rem); letter-spacing: -0.05em; line-height: 1.02; margin: 4px 0 6px; }
  .home-greeting em.accent, .page-title em.accent { background: linear-gradient(95deg, var(--emerald-600), var(--violet-500)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
  :root[data-theme="dark"] .home-greeting em.accent { background: linear-gradient(95deg, #5FE6AE, #B9A9FF); -webkit-background-clip: text; background-clip: text; }

  /* Setup banner */
  .setup { padding: 22px; border-radius: 28px; margin-bottom: 18px; }
  .setup-head { display: flex; align-items: center; gap: 16px; }
  .setup-title { color: #fff; font-size: 1.35rem; letter-spacing: -0.03em; }
  .setup-title em.accent { color: #C2F45B; }
  .setup-steps { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 10px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .setup-steps::-webkit-scrollbar { display: none; }
  .setup-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 18px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); transition: background var(--t-fast), transform var(--t-base) var(--ease-out); }
  .setup-step:hover { background: rgb(255 255 255 / .12); transform: translateY(-2px); }
  .setup-step b { display: block; color: #fff; font-size: 13.5px; }
  .setup-step small { display: block; color: rgb(255 255 255 / .6); font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
  .setup-step-icon { width: 32px; height: 32px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgb(255 255 255 / .1); color: #fff; }
  .setup-step-icon svg { width: 16px; height: 16px; }
  .setup-step.is-done { opacity: .6; }
  .setup-step.is-done .setup-step-icon { background: #C2F45B; color: var(--forest-950); }
  .setup-step.is-done b { text-decoration: line-through; text-decoration-color: rgb(255 255 255 / .4); }

  /* KPI cards v2 */
  .kpis { gap: 14px; }
  .kpi { padding: 18px 18px 16px; border-radius: 22px; min-height: 148px; display: flex; flex-direction: column; }
  .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .kpi-label { font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }
  .kpi-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); border: 1px solid var(--line); color: var(--ink); }
  .kpi-icon svg { width: 17px; height: 17px; }
  .kpi-value { margin-top: auto; padding-top: 14px; font-size: clamp(1.8rem, 1.3rem + 1vw, 2.3rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
  .kpi-foot { margin-top: 10px; }
  .kpi.is-feature { border: 0; }
  .kpi.is-feature .kpi-label, .kpi.is-feature .kpi-foot { color: rgb(255 255 255 / .7); }
  .kpi.is-feature .kpi-value { color: #fff; }
  .kpi.is-feature .kpi-icon { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .16); color: #fff; }
  .kpi.is-feature .delta-up { background: rgb(194 244 91 / .18); color: #C2F45B; }
  .kpi.is-feature .kpi-spark { position: absolute; right: 16px; bottom: 16px; top: auto; width: 110px; height: 40px; color: #C2F45B; opacity: .9; }

  /* Rankings */
  .top-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
  .top-row + .top-row { border-top: 1px solid var(--line); }
  .top-rank { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--ink); background: var(--surface-sunken); border: 1px solid var(--line); }
  .top-row:first-child .top-rank { background: var(--grad-brand); border: 0; color: var(--forest-950); }
  .top-meter { height: 6px; border-radius: 6px; background: var(--surface-sunken); margin-top: 8px; overflow: hidden; }
  .top-meter span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--emerald-500), var(--violet-500)); }
  .fw-600 { font-weight: 650; }

  /* Featured page */
  .feature-page { padding: 20px; border-radius: 26px; display: grid; gap: 14px; min-height: 360px; overflow: hidden; }
  .feature-page-top { display: flex; justify-content: space-between; gap: 12px; }
  .feature-page-title { color: #fff; font-size: 1.4rem; letter-spacing: -0.03em; margin-top: 10px; }
  .feature-page-stat { text-align: right; }
  .feature-page-stat b { display: block; font-family: var(--font-display); font-size: 1.8rem; color: #fff; letter-spacing: -0.04em; line-height: 1; }
  .feature-page-stat small { color: rgb(255 255 255 / .6); }
  .feature-page-phone { height: 200px; position: relative; margin: 4px -20px -20px; }
  .feature-page-phone .phone { position: absolute; left: 50%; top: 0; translate: -50% 0; width: 210px; transform: rotate(-6deg); transform-origin: top center; }
  .feature-page-phone .phone-screen { height: 420px; }

  .next-action { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); transition: all var(--t-fast); }
  .next-action:hover { border-color: var(--line-strong); background: var(--surface); transform: translateY(-1px); box-shadow: var(--e1); }
  .next-action-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--assist-soft); color: var(--assist-text); flex: none; }
  .next-action-icon svg { width: 17px; height: 17px; }
  .activity-row { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }

  @media (min-width: 1024px) { .grid-main-side { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; } }
  .card-header { padding: 18px 22px; }
  .card-body { padding: 20px 22px; }

  @media (max-width: 767px) {
    .setup { border-radius: 22px; padding: 18px; }
    .setup-steps { grid-template-columns: repeat(6, 78%); margin-right: -18px; padding-right: 18px; scroll-snap-type: x mandatory; }
    .setup-step { scroll-snap-align: start; }
    .kpi { min-height: 132px; }
    .home-hero .page-actions { width: 100%; }
    .home-hero .page-actions > * { flex: 1; }
  }
}

@layer components {
  .insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; align-items: start; }
  .insight-grid .card:first-child { grid-row: span 2; }
  .kpis.is-loading { opacity: .6; transition: opacity var(--t-base); }
  .bar-row { padding: 9px 12px; border-radius: 10px; }
  .bar-row::before { background: linear-gradient(90deg, var(--accent-soft-2), var(--assist-soft)); }
  .bar-row .value { font-weight: 700; }
  section > h3.text-sm { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
}

@layer components {
  .stat-strip { display: grid; grid-template-columns: 1.1fr .8fr 1.4fr; gap: 14px; margin-bottom: 22px; }
  .stat-strip > div { border-radius: 22px; padding: 18px 20px; display: grid; gap: 4px; align-content: center; min-width: 0; }
  .stat-strip b { font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 700; letter-spacing: -0.04em; color: var(--ink); line-height: 1.1; }
  .stat-strip-main b { color: #fff; }
  .stat-strip-item { background: var(--surface-2); border: 1px solid var(--line); }
  .stat-strip-item.is-wide b { font-size: 1.25rem; letter-spacing: -0.02em; }
  @media (max-width: 767px) { .stat-strip { grid-template-columns: 1fr 1fr; } .stat-strip-main { grid-column: 1 / -1; } .stat-strip-item.is-wide b { font-size: 1rem; } }

  /* Resource rows, premium */
  .row { border-radius: 18px; padding: 14px 16px; gap: 16px; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-fast); }
  .row:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: var(--line); }
  .row-lead { width: 44px; height: 44px; border-radius: 14px !important; font-family: var(--font-display); font-size: 16px !important; font-weight: 700 !important; }
  .row-title { font-weight: 700; font-size: .95rem; letter-spacing: -0.01em; }
  .stat-pill { height: 32px; padding: 0 12px; font-weight: 700; }
  .table-wrap { border-radius: 20px; }
  .table th { font-weight: 700; letter-spacing: .08em; font-size: 11px; }
  .toolbar { gap: 10px; margin-bottom: 16px; }
  .toolbar .input { height: 42px; }
}

@layer components {
  .invite-row { display: flex; gap: 10px; align-items: flex-start; }
  @media (max-width: 640px) { .invite-row { flex-wrap: wrap; } .invite-row > .field { flex: 1 1 100%; } .invite-row > .select { flex: 1; width: auto !important; } }
}

/* Reports (ADR-0040) */
@layer components {
  .rp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .rp-start { display: grid; gap: 4px; justify-items: start; padding: 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); transition: border-color var(--t-fast, .15s), transform var(--t-fast, .15s); }
  .rp-start:hover { border-color: var(--accent); transform: translateY(-1px); }
  .rp-start b { color: var(--ink); }
  .rp-start small { font-size: 12.5px; line-height: 1.4; }
  .rp-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
  .rp-icon svg { width: 17px; height: 17px; }
}

/* css/components/os.css */
/* Weesify OS: pillar navigation, the OS map and module pages ------------------------------ */
@layer components {
  /* Sidebar: pillar sections, compact items, roadmap badges */
  .nav-item.is-planned { color: var(--text-subtle); }
  .nav-item.is-planned svg { opacity: .8; }
  .nav-badge { margin-left: auto; min-width: 26px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-pill); font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--text-subtle); border: 1px dashed var(--line-strong); }
  .nav-badge.is-now { border: 0; color: #fff; background: var(--grad-violet); }
  .nav-item[aria-current="page"] .nav-badge { color: var(--text-on-ink); border-color: rgb(255 255 255 / .3); }

  /* Status language, shared everywhere */
  .os-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
  .os-dot.is-live { background: var(--emerald-500); box-shadow: 0 0 0 3px color-mix(in oklab, var(--emerald-500) 22%, transparent); }
  .os-dot.is-building { background: var(--violet-500); box-shadow: 0 0 0 3px color-mix(in oklab, var(--violet-500) 22%, transparent); animation: os-pulse 2.2s var(--ease-out) infinite; }
  .os-dot.is-planned { background: transparent; border: 2px solid var(--text-subtle); }
  .g-card .os-dot.is-planned { border-color: rgb(255 255 255 / .7); }
  @keyframes os-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--violet-500) 6%, transparent); } }
  @media (prefers-reduced-motion: reduce) { .os-dot.is-building { animation: none; } }

  .os-counts { display: flex; flex-wrap: wrap; gap: 8px; }
  .os-count { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--glass-strong); border: 1px solid var(--line); font-size: var(--fs-small); color: var(--text-muted); box-shadow: var(--e1); }
  .os-count b { color: var(--ink); font-size: 15px; }

  /* Roadmap strip */
  .os-road { padding: 20px 22px; }
  .os-stages { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
  .os-stage { display: grid; gap: 6px; min-width: 0; }
  .os-stage-bar { height: 6px; border-radius: var(--r-pill); background: var(--line-strong); }
  .os-stage.is-done .os-stage-bar { background: var(--grad-forest); }
  .os-stage.is-now .os-stage-bar { background: repeating-linear-gradient(-45deg, var(--violet-500) 0 6px, var(--violet-400) 6px 12px); }
  .os-stage-n { font-size: 11px; font-weight: 700; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
  .os-stage-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .os-stage.is-done .os-stage-label { color: var(--ink); }
  .os-stage.is-now .os-stage-label { color: var(--assist-text); }
  @media (max-width: 720px) {
    .os-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  }

  /* Pillars and module cards */
  .os-pillar { margin-top: 34px; }
  .os-pillar-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
  .os-pillar-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
  .os-pillar-icon svg { width: 20px; height: 20px; }
  .os-pillar-title { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.03em; }
  .os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
  .os-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 196px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); color: var(--text); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast), border-color var(--t-fast); }
  .os-card:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: var(--line-strong); }
  .os-card.is-planned { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--hatch); border-style: dashed; box-shadow: none; }
  .os-card.is-building { border-color: color-mix(in oklab, var(--violet-500) 40%, var(--line)); background: linear-gradient(160deg, var(--assist-soft), var(--surface) 55%); }
  .os-card-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); }
  .os-card-icon:not(.g-card) { background: var(--surface-sunken); }
  .os-card-icon.g-card { border: 0; color: #fff; }
  .os-card-icon svg { width: 20px; height: 20px; }
  .os-card.is-building .os-card-icon { background: var(--grad-violet); color: #fff; border: 0; }
  .os-card-title { margin-top: 10px; font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
  .os-card-tag { font-size: var(--fs-small); color: var(--text-muted); }
  .os-card-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 8px; }
  .os-card-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
  .os-card-cta svg { width: 14px; height: 14px; transition: transform var(--t-fast) var(--ease-out); }
  .os-card:hover .os-card-cta svg { transform: translateX(3px); }
  .os-status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; white-space: nowrap; }
  .os-status.is-live { background: var(--accent-soft); color: var(--accent-text); }
  .os-status.is-building { background: var(--assist-soft); color: var(--assist-text); }
  .os-status.is-planned { color: var(--text-muted); border: 1px dashed var(--line-strong); }
  .os-goal { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--heat); }
  .os-goal svg { width: 13px; height: 13px; }

  /* The connected-graph band */
  .os-flow { margin-top: 38px; padding: clamp(22px, 3vw, 36px); display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 1000px) { .os-flow { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; } }
  .os-flow-title { color: #fff; font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); letter-spacing: -0.04em; margin: 14px 0 8px; }
  .os-flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; counter-reset: flow; }
  @media (min-width: 560px) { .os-flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .os-flow-steps li { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); color: rgb(255 255 255 / .9); font-size: var(--fs-small); font-weight: 600; }
  .os-flow-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgb(194 244 91 / .14); color: var(--lime-400); }
  .os-flow-icon svg { width: 17px; height: 17px; }

  /* Module page */
  .os-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }
  .os-back:hover { color: var(--ink); }
  .os-back svg { width: 15px; height: 15px; }
  .os-hero { padding: clamp(22px, 4vw, 44px); display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 900px) { .os-hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); align-items: center; } }
  .os-hero-title { color: #fff; font-family: var(--font-display); font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.4rem); letter-spacing: -0.05em; line-height: 1; margin-top: 16px; }
  .os-hero-tag { font-family: var(--font-accent); font-style: italic; font-size: 1.35rem; color: rgb(255 255 255 / .86); margin-top: 6px; }
  .os-hero-pitch { max-width: 58ch; margin-top: 12px; color: rgb(255 255 255 / .78); }
  .os-hero-art { display: grid; justify-items: center; gap: 16px; }
  .os-hero-glyph { width: 116px; height: 116px; border-radius: 34px; display: grid; place-items: center; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .22); backdrop-filter: blur(10px); box-shadow: 0 24px 60px -24px rgb(0 0 0 / .5); }
  .os-hero-glyph svg { width: 52px; height: 52px; color: #fff; stroke-width: 1.5; }
  .os-hero-stage { width: min(240px, 100%); padding: 12px 14px; border-radius: 16px; background: rgb(0 0 0 / .18); display: grid; gap: 6px; color: #fff; }
  .os-hero-stage small { color: rgb(255 255 255 / .7); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .os-hero-stage b { font-family: var(--font-display); font-size: 1.3rem; }
  .os-hero-stage .stepper > span { background: rgb(255 255 255 / .2); }
  @media (max-width: 899px) { .os-hero-art { justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; } .os-hero-glyph { width: 72px; height: 72px; border-radius: 22px; } .os-hero-glyph svg { width: 32px; height: 32px; } }
  .os-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .os-features li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text); }
  .os-feature-tick { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
  .os-feature-tick svg { width: 14px; height: 14px; }

  /* Create launcher: modules that are coming */
  .launcher-soon-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); }
  .launcher-soon-head a { display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0; text-transform: none; font-size: var(--fs-small); color: var(--assist-text); }
  .launcher-soon-head svg { width: 13px; height: 13px; }
  .launcher-soon { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
  .launcher-soon-tile { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: var(--r-md); border: 1px dashed var(--line-strong); color: var(--text-muted); font-size: var(--fs-small); font-weight: 600; transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast); }
  .launcher-soon-tile svg { width: 17px; height: 17px; flex: none; }
  .launcher-soon-tile small { font-size: 10.5px; font-weight: 700; color: var(--text-subtle); }
  .launcher-soon-tile:hover { border-style: solid; border-color: color-mix(in oklab, var(--violet-500) 45%, var(--line)); color: var(--ink); background: var(--assist-soft); }

  /* Home: compact OS overview */
  .os-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 6px 18px; padding: 4px 20px 20px; }
  .os-home-col { display: grid; align-content: start; gap: 2px; min-width: 0; }
  .os-home-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 8px; font-size: var(--fs-small); color: var(--ink); }
  .os-home-icon.g-card { border-radius: 9px; }
  .os-home-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
  .os-home-icon svg { width: 14px; height: 14px; }
  .os-home-row { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; margin: 0 -10px; border-radius: 10px; font-size: var(--fs-small); font-weight: 600; color: var(--text); min-width: 0; }
  .os-home-row:hover { background: var(--surface-hover); }
  .os-home-row.is-planned { color: var(--text-muted); font-weight: 500; }
  .os-home-row small { font-size: 10.5px; font-weight: 700; color: var(--text-subtle); }
  .os-home-goal { width: 14px; height: 14px; color: var(--heat); flex: none; }

  /* Tall navigation: keep the pillars visible on shorter screens */
  @media (min-width: 1024px) and (max-height: 1040px) { .sidebar-foot .usage-card { display: none; } }
}

/* css/components/audience.css */
/* Audience OS: contacts, stages, tags, segments, import, contact profile ---------------------- */
@layer components {
  /* Tone palette shared by stages and tags (names only — never user colours) */
  .tone-emerald { --tone: var(--emerald-500); --tone-soft: color-mix(in oklab, var(--emerald-500) 14%, var(--surface)); --tone-text: var(--accent-text); }
  .tone-violet { --tone: var(--violet-500); --tone-soft: color-mix(in oklab, var(--violet-500) 14%, var(--surface)); --tone-text: var(--assist-text); }
  .tone-tangerine { --tone: var(--tangerine-500); --tone-soft: color-mix(in oklab, var(--tangerine-500) 14%, var(--surface)); --tone-text: color-mix(in oklab, var(--tangerine-600) 85%, var(--ink)); }
  .tone-sky { --tone: var(--sky-500); --tone-soft: color-mix(in oklab, var(--sky-500) 14%, var(--surface)); --tone-text: color-mix(in oklab, var(--sky-500) 70%, var(--ink)); }
  .tone-amber { --tone: #E4A11B; --tone-soft: color-mix(in oklab, #E4A11B 16%, var(--surface)); --tone-text: color-mix(in oklab, #B8790A 85%, var(--ink)); }
  .tone-rose { --tone: var(--rose-500); --tone-soft: color-mix(in oklab, var(--rose-500) 14%, var(--surface)); --tone-text: color-mix(in oklab, var(--rose-500) 75%, var(--ink)); }
  .tone-ink { --tone: var(--ink); --tone-soft: var(--surface-sunken); --tone-text: var(--ink); }

  .hide-sm { }
  @media (max-width: 720px) { .hide-sm { display: none; } }
  .input-sm, .select-sm { height: 34px; font-size: var(--fs-small); padding-inline: 10px; }
  .icon-btn-sm { width: 28px; height: 28px; }
  .icon-btn-sm svg { width: 15px; height: 15px; }
  .modal-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--grad-violet); color: #fff; }
  .modal-icon svg { width: 18px; height: 18px; }

  /* Stage distribution */
  .aud-stages { margin-top: 16px; padding: 16px 18px; display: grid; gap: 12px; }
  .aud-stage-bar { display: flex; gap: 3px; height: 12px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-sunken); }
  .aud-stage-bar span { background: var(--tone); min-width: 6px; }
  .aud-stage-bar span:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
  .aud-stage-legend { display: flex; flex-wrap: wrap; gap: 6px; }
  .aud-stage-key { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid transparent; font-size: var(--fs-small); color: var(--text-muted); font-weight: 600; }
  .aud-stage-key i { width: 9px; height: 9px; border-radius: 3px; background: var(--tone); }
  .aud-stage-key b { color: var(--ink); }
  .aud-stage-key small { color: var(--text-subtle); font-weight: 600; }
  .aud-stage-key:hover { background: var(--surface-hover); }
  .aud-stage-key.is-active { background: var(--tone-soft); border-color: color-mix(in oklab, var(--tone) 35%, transparent); color: var(--tone-text); }

  /* Layout: views rail + list */
  .aud-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 1100px) { .aud-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } .aud-rail { position: sticky; top: 88px; } }
  .aud-rail { display: grid; gap: 14px; }
  .aud-rail-group { display: grid; gap: 2px; }
  .aud-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-subtle); }
  .aud-rail-empty { padding: 8px 12px; font-size: var(--fs-small); color: var(--text-subtle); line-height: 1.45; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
  .aud-view { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; border-radius: 12px; color: var(--text-muted); font-weight: 600; font-size: var(--fs-small); text-align: left; min-width: 0; }
  .aud-view svg { width: 16px; height: 16px; flex: none; }
  .aud-view small { color: var(--text-subtle); font-weight: 600; }
  .aud-view:hover { background: var(--surface-hover); color: var(--ink); }
  .aud-view.is-active { background: var(--ink); color: var(--text-on-ink); }
  .aud-view.is-active svg { color: var(--lime-400); }
  .aud-view.is-active small { color: rgb(255 255 255 / .6); }
  .aud-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; }
  @media (max-width: 1099px) {
    .aud-rail { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; gap: 8px; padding-bottom: 2px; }
    .aud-rail-group { display: flex; gap: 6px; align-items: center; }
    .aud-rail-head, .aud-rail-empty { display: none; }
    .aud-view { width: auto; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
    .aud-tags { flex-wrap: nowrap; }
  }

  .tag-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--tone-soft); color: var(--tone-text); font-size: 12.5px; font-weight: 600; border: 1px solid color-mix(in oklab, var(--tone) 22%, transparent); white-space: nowrap; max-width: 100%; }
  .tag-chip small { opacity: .7; font-weight: 600; }
  .tag-chip.is-active { background: var(--tone); color: #fff; }
  .tag-chip.is-sm { height: 22px; padding: 0 8px; font-size: 11.5px; }
  .tag-chip button { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; margin-right: -4px; color: inherit; opacity: .7; }
  .tag-chip button:hover { opacity: 1; background: rgb(0 0 0 / .08); }
  .tag-chip button svg { width: 11px; height: 11px; }
  .tag-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tone); display: inline-block; }

  .aud-seg-banner { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px 18px; margin-bottom: 14px; }

  .bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--ink); color: var(--text-on-ink); box-shadow: var(--e2); position: sticky; top: 76px; z-index: 5; }
  .bulk-bar .btn-secondary { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: var(--text-on-ink); }
  .bulk-bar .btn-ghost { color: rgb(255 255 255 / .7); }
  .bulk-tag { display: flex; gap: 6px; }
  .bulk-tag .input { width: 150px; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: var(--text-on-ink); }

  .aud-table tr.is-selected td { background: var(--accent-soft); }
  .aud-person { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 340px; }
  @media (max-width: 720px) { .aud-person { max-width: 190px; gap: 10px; } }
  .aud-person:hover .ink { text-decoration: underline; text-underline-offset: 3px; }
  .aud-avatar { background: var(--tone); color: #fff; border: 0; font-weight: 700; }
  .stage-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--tone-soft); color: var(--tone-text); font-size: 12px; font-weight: 700; }
  .stage-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
  .aud-row-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: 260px; }

  /* Segment builder */
  .seg-match { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--text-muted); font-weight: 600; }
  .seg-match .select { width: auto; }
  .seg-rows { display: grid; gap: 8px; }
  .seg-row { display: grid; grid-template-columns: 150px 180px minmax(0, 1fr) 36px; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .seg-row:has(> select:nth-child(2)[aria-label='Custom field']) { grid-template-columns: 140px 150px 150px minmax(0, 1fr) 36px; }
  @media (max-width: 720px) { .seg-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; } .seg-row > :nth-child(3) { grid-column: 1 / 3; } }
  .seg-preview { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--assist-soft), var(--accent-soft)); }
  .seg-preview-n { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
  .seg-preview b { display: block; color: var(--ink); }
  .seg-preview small { color: var(--text-muted); font-size: var(--fs-small); }

  .consent-box { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
  .consent-box b { display: block; color: var(--ink); font-size: var(--fs-small); }
  .consent-box small { color: var(--text-muted); font-size: 12.5px; }
  .consent-box:has(input:checked) { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); background: var(--accent-soft); }

  .dropzone { display: grid; justify-items: center; gap: 6px; padding: 28px 18px; text-align: center; border-radius: var(--r-lg); border: 1.5px dashed var(--line-strong); background: var(--surface-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
  .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
  .dropzone svg { width: 26px; height: 26px; color: var(--accent-text); }
  .dropzone b { color: var(--ink); }
  .dropzone small { color: var(--text-muted); font-size: 12.5px; max-width: 42ch; }
  .import-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0; }
  .import-done-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; }
  .import-done-icon svg { width: 26px; height: 26px; }
  .import-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .import-stats div { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .import-stats b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
  .import-stats small { color: var(--text-muted); }

  /* Contact profile */
  .cp-hero { padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 900px) { .cp-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
  .cp-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
  .cp-avatar { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; flex: none; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .28); box-shadow: 0 20px 40px -20px rgb(0 0 0 / .5); }
  .cp-name { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); letter-spacing: -0.04em; line-height: 1.05; }
  .cp-sub { color: rgb(255 255 255 / .78); margin-top: 4px; }
  .cp-stats { display: flex; gap: 10px; flex-wrap: wrap; }
  .cp-stat { padding: 10px 14px; border-radius: 16px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); color: #fff; min-width: 110px; }
  .cp-stat small { display: block; color: rgb(255 255 255 / .7); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .cp-stat b { font-family: var(--font-display); font-size: 1.15rem; }
  .cp-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  @media (min-width: 1100px) { .cp-grid { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }
  .cp-fields { display: grid; gap: 2px; }
  .cp-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
  .cp-field:last-child { border-bottom: 0; }
  .cp-field dt { color: var(--text-muted); font-weight: 600; }
  .cp-field dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
  .cp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .cp-tag-add { display: flex; gap: 6px; margin-top: 10px; }

  .timeline { list-style: none; margin: 0; padding: 0; display: grid; }
  .tl-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
  .tl-item::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line); }
  .tl-item:last-child::before { display: none; }
  .tl-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--line); }
  .tl-icon svg { width: 16px; height: 16px; }
  .tl-item.is-good .tl-icon { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
  .tl-item.is-note .tl-icon { background: var(--assist-soft); color: var(--assist-text); border-color: transparent; }
  .tl-item.is-visit .tl-icon { background: transparent; border-style: dashed; color: var(--text-muted); }
  .tl-item.is-visit .tl-title { font-weight: 500; }
  .tl-item.is-warn .tl-icon { background: var(--heat-soft); color: var(--heat); border-color: transparent; }
  .tl-title { font-weight: 600; color: var(--ink); font-size: var(--fs-small); }
  .tl-meta { font-size: 12px; color: var(--text-subtle); }
  .tl-body { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-small); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
  .note-composer { display: grid; gap: 8px; margin-bottom: 20px; }
  .note-composer .textarea { min-height: 84px; }
  .stage-picker { display: flex; flex-wrap: wrap; gap: 6px; }
  .stage-picker .stage-pill { height: 32px; padding: 0 14px; background: transparent; border: 1px solid var(--line); color: var(--text-muted); cursor: pointer; }
  .stage-picker .stage-pill:hover:not(:disabled) { border-color: var(--tone); color: var(--tone-text); }
  .stage-picker .stage-pill.is-current { background: var(--tone); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px var(--tone); }
  .stage-picker .stage-pill.is-current::before { background: #fff; }
  /* Custom fields manager */
  .cf-list { display: grid; gap: 8px; }
  .cf-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto auto 36px; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
  .cf-row .cf-opts { grid-column: 2 / 3; grid-row: 2; }
  .cf-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--assist-text); }
  .cf-key { font-size: 11px; color: var(--text-subtle); }
  @media (max-width: 640px) { .cf-row { grid-template-columns: minmax(0, 1fr) auto 36px; } .cf-type, .cf-key { display: none; } .cf-row .cf-opts { grid-column: 1 / -1; } }
  .cf-add { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  .cf-add > .btn { justify-self: start; }
  .cf-add-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) 160px; }
}

/* css/components/forms.css */
/* Forms: list, create studio, builder, responses inbox ----------------------------------- */
@layer components {
  .inspector-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

  /* Empty state + templates */
  .forms-empty { padding: clamp(24px, 4vw, 44px); display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 980px) { .forms-empty { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; } }
  .forms-empty h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .forms-empty p { color: rgb(255 255 255 / .72); max-width: 56ch; }
  .forms-empty-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .forms-empty-points li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); color: #fff; font-weight: 600; font-size: var(--fs-small); }
  .forms-empty-points svg { width: 18px; height: 18px; color: var(--lime-400); }
  .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
  .tpl-card { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast), border-color var(--t-fast); }
  .tpl-card:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: var(--line-strong); }
  .tpl-card b { margin-top: 8px; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
  .tpl-card small { color: var(--text-muted); font-size: 12.5px; }
  .tpl-card-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
  .tpl-card-icon svg { width: 19px; height: 19px; }
  .tpl-card-icon.is-plain { border: 1.5px dashed var(--line-strong); color: var(--text-muted); }

  /* Form cards */
  .forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
  .form-card { display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); overflow: hidden; transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .form-card:hover { box-shadow: var(--e2); transform: translateY(-2px); }
  .form-card-art { position: relative; display: block; height: 168px; padding: 16px; border-radius: 0; color: #fff; }
  .form-card-art.is-plain { background: var(--hatch), var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
  .form-card-status { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .22); backdrop-filter: blur(8px); font-size: 11.5px; font-weight: 700; }
  .form-card-art.is-plain .form-card-status { background: var(--surface); border-color: var(--line); }
  .form-card-mock { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%) rotate(-2deg); width: 72%; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 24px 50px -20px rgb(0 0 0 / .45); display: grid; gap: 7px; transition: transform var(--t-slow) var(--ease-out); }
  .form-card:hover .form-card-mock { transform: translateX(-50%) rotate(0deg) translateY(-6px); }
  .form-card-mock i { display: grid; gap: 3px; font-style: normal; }
  .form-card-mock i b { font-size: 9.5px; font-weight: 700; color: #33413B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .form-card-mock i::after { content: ""; height: 14px; border-radius: 5px; border: 1px solid #DCE3DF; background: #F7F9F8; }
  .form-card-mock i.is-tall::after { height: 24px; }
  .form-card-mock i.is-choice::after { height: 10px; width: 60%; border-radius: 999px; }
  .form-card-mock em { justify-self: end; font-style: normal; font-size: 9px; font-weight: 800; color: #fff; background: #0B0F0D; padding: 4px 10px; border-radius: 6px; }
  .form-card-body { padding: 36px 18px 16px; display: grid; gap: 14px; }
  .form-card-title { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
  .form-card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
  .form-card-stats div { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
  .form-card-stats dt { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
  .form-card-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
  .form-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  /* Create studio */
  .form-create { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 860px) { .form-create { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
  .tpl-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
  .tpl-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
  .tpl-pick b { display: block; font-size: var(--fs-small); color: var(--ink); }
  .tpl-pick small { display: block; font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
  .tpl-pick .tpl-card-icon { width: 34px; height: 34px; border-radius: 11px; }
  .tpl-pick .tpl-card-icon svg { width: 16px; height: 16px; }
  .tpl-pick:hover { border-color: var(--line-strong); }
  .tpl-pick.is-active { border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent); }
  .form-create-preview { display: none; }
  @media (min-width: 860px) { .form-create-preview { display: block; position: sticky; top: 0; } .form-create-preview .phone { width: 100%; } }
  .form-preview-site { min-height: 100%; background: var(--site-bg); font-family: var(--site-font); color: var(--site-text); }
  .form-preview-card { margin: -34px 10px 14px; padding: 14px; border-radius: 18px; background: var(--site-surface); box-shadow: 0 16px 40px -24px rgb(0 0 0 / .4); zoom: .74; }

  /* Builder */
  .fb-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
  .fb-mark svg { width: 16px; height: 16px; }
  .form-builder .builder-bar > * { min-width: 0; }
  .form-builder .builder-bar > .cluster:first-child { overflow: hidden; }
  .form-builder .builder-bar > .cluster:first-child > div { flex: 1 1 auto; }
  .fb-name { display: block; width: 100%; max-width: 280px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink); padding: 2px 6px; margin-left: -6px; border-radius: 8px; }
  .fb-name:hover { background: var(--surface-hover); }
  .fb-name:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent); }
  .fb-settings-link { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 12px; border-radius: var(--r-md); border: 1px dashed var(--line-strong); color: var(--text-muted); font-size: var(--fs-small); font-weight: 600; }
  .fb-settings-link:hover { color: var(--ink); border-style: solid; }
  .fb-settings-link svg { width: 16px; height: 16px; }
  .form-builder .outline-main { min-width: 0; flex: 1 1 auto; }
  .form-builder .outline-item { min-width: 0; }
  .outline-item.is-break { background: var(--surface-2); border-style: dashed; }
  .fb-canvas { min-height: 100%; background: var(--site-bg); font-family: var(--site-font); color: var(--site-text); }
  .fb-canvas-card { margin: -64px auto 24px; width: calc(100% - 24px); max-width: 620px; padding: 22px 18px; border-radius: calc(var(--site-radius) + 8px); background: var(--site-surface); box-shadow: 0 24px 60px -34px rgb(0 0 0 / .45); }
  .device.is-desktop .fb-canvas-card { padding: 34px; }
  .fb-canvas .wf-field[data-field] { cursor: pointer; border-radius: 12px; outline: 2px solid transparent; outline-offset: 6px; transition: outline-color var(--t-fast); }
  .fb-canvas .wf-field[data-field]:hover { outline-color: color-mix(in oklab, #0BC284 45%, transparent); }
  .fb-canvas .wf-field.is-selected { outline-color: #0BC284; }
  .fb-canvas .wf-field * { pointer-events: none; }
  .fb-logic { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--assist-soft); }
  .fb-logic .inspector-row svg { color: var(--assist-text); vertical-align: -2px; }
  .fb-logic-rule { display: grid; gap: 6px; }
  .fb-share { padding: 18px; }
  .fb-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fb-theme { display: grid; gap: 6px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
  .fb-theme span { height: 44px; border-radius: 10px; }
  .fb-theme small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
  .fb-theme.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .fb-theme.is-active small { color: var(--ink); }

  /* Responses */
  .insights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
  .ins-row { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: var(--fs-small); }
  .ins-label { color: var(--ink); font-weight: 600; }
  .ins-bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-sunken); overflow: hidden; }
  .ins-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); min-width: 3px; }
  .ins-n { text-align: right; font-weight: 700; color: var(--ink); }
  .ins-n small { margin-left: 6px; font-weight: 600; color: var(--text-subtle); }
  .inbox { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1000px) { .inbox { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } .inbox-detail { position: sticky; top: 88px; } .inbox-back { display: none; } }
  @media (max-width: 999px) { .inbox.has-open .inbox-list { display: none; } .inbox:not(.has-open) .inbox-detail { display: none; } }
  .inbox-list { display: grid; gap: 6px; align-content: start; }
  .inbox-tools { display: grid; gap: 8px; margin-bottom: 6px; }
  .inbox-tools small { margin-left: 4px; opacity: .7; }
  .inbox-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
  .inbox-item:hover { border-color: var(--line-strong); }
  .inbox-item.is-open { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .inbox-item.is-new b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }
  .inbox-item b { color: var(--ink); font-size: var(--fs-small); }
  .inbox-excerpt { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .inbox-detail { padding: 20px; min-height: 320px; }
  .inbox-detail-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .inbox-contact { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
  .inbox-contact:hover { border-color: var(--line-strong); }
  .inbox-contact b { color: var(--ink); font-size: var(--fs-small); }
  .qa { display: grid; gap: 2px; margin: 0; }
  .qa-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .qa-row:last-child { border-bottom: 0; }
  .qa-row dt { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
  .qa-row dd { margin: 4px 0 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
  .qa-row.is-old dt::after { content: " · removed from form"; color: var(--text-subtle); font-weight: 500; }
  .inbox-placeholder { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 60px 16px; }
  .inbox-placeholder span { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 6px; }
  .inbox-placeholder svg { width: 24px; height: 24px; }

  /* Settings: email sending */
  .mail-picks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .mail-pick { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: var(--e1); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .mail-pick b { color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
  .mail-pick small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
  .mail-pick.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--e2); }
  .mail-pick.is-active .pick-radio { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 45%, transparent 50%); }
  .mail-pick-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
  .mail-pick-icon svg { width: 20px; height: 20px; }
  .mail-pick .pick-radio { position: static; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
  .mail-server-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 120px 170px; }
  @media (max-width: 640px) { .mail-server-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mail-server-grid > :first-child { grid-column: 1 / -1; } }
  .mail-providers { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
  .mail-provider { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); border: 1px dashed var(--line-strong); font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
  .mail-provider svg { width: 16px; height: 16px; color: var(--text-muted); }
}

/* css/components/store.css */
/* Store: products, editor, orders, payments ---------------------------------------------- */
@layer components {
  .store-connect { padding: clamp(20px, 3vw, 32px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
  .store-connect h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); letter-spacing: -0.03em; margin: 12px 0 6px; }
  .store-connect p { color: rgb(255 255 255 / .8); max-width: 60ch; }

  .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
  .product-card { display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast); color: var(--text); }
  .product-card:hover { transform: translateY(-3px); box-shadow: var(--e2); }
  .product-card-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background-size: cover; background-position: center; border-radius: 0; color: #fff; }
  .product-card-img > svg { width: 38px; height: 38px; opacity: .9; }
  .product-card-status { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: rgb(11 15 13 / .55); color: #fff; font-size: 11.5px; font-weight: 700; backdrop-filter: blur(8px); }
  .product-card-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
  .product-card-body > b { font-family: var(--font-display); font-size: 1.08rem; color: var(--ink); }
  .product-card-price { font-weight: 800; color: var(--ink); }
  .product-card-stats { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
  .product-card-stats b { color: var(--ink); }

  .pe-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .pe-layout { grid-template-columns: minmax(0, 1fr) 320px; } .pe-preview { position: sticky; top: 88px; } }
  .pe-preview { display: grid; gap: 14px; justify-items: center; }
  .pe-preview .phone { width: 300px; }
  @media (max-width: 1099px) { .pe-preview { display: none; } }
  .pe-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 0; }
  .pe-stats div { padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
  .pe-stats dt { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
  .pe-stats dd { margin: 2px 0 0; font-weight: 800; color: var(--ink); font-size: 13.5px; }
  .pe-image { display: flex; gap: 16px; align-items: center; }
  .pe-image img, .pe-image-ph { width: 160px; aspect-ratio: 16 / 10; border-radius: var(--r-md); object-fit: cover; flex: none; }
  .pe-image-ph { display: grid; place-items: center; }
  .pe-image-ph svg { width: 26px; height: 26px; }
  .pe-price-grid { display: grid; gap: 12px; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); }
  @media (max-width: 560px) { .pe-price-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pe-price-grid > :first-child { grid-column: 1 / -1; } }
  .pe-files { display: grid; gap: 8px; }
  .pe-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
  .pe-file svg { width: 16px; height: 16px; flex: none; }

  .order-status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--surface-sunken); color: var(--text-muted); }
  .order-status.is-paid { background: var(--accent-soft); color: var(--accent-text); }
  .order-status.is-pending { background: var(--warning-soft); color: var(--warning); }
  .order-status.is-failed { background: var(--danger-soft); color: var(--danger); }
  .order-hero { padding: 20px; display: grid; gap: 2px; }
  .order-hero small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
  .order-hero b { font-family: var(--font-display); font-size: 2rem; letter-spacing: -0.04em; }

  .pay-grid { display: grid; gap: 14px; }
  .pay-card { display: grid; gap: 14px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
  .pay-card.is-connected { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
  .pay-card-head { display: flex; gap: 14px; align-items: flex-start; }
  .pay-card-head b { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin-right: 6px; }
  .pay-logo { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
  .pay-webhook { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
}

.orders-tools { min-width: 0; }
.orders-tools > * { min-width: 0; }
@media (max-width: 640px) {
  .orders-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .orders-tools .segmented { display: flex; overflow-x: auto; scrollbar-width: none; }
  .orders-tools .segmented button { flex: 1 0 auto; }
}

/* Weesify Wallet ------------------------------------------------------------------------ */
@layer components {
  .wl-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 900px) { .wl-grid { grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(0, 1fr)); } }
  .wl-hero { padding: 24px; border-radius: 26px; display: grid; gap: 6px; align-content: end; min-height: 170px; color: #fff; }
  .wl-label { font-size: 13px; font-weight: 600; opacity: .8; }
  .wl-amount { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -0.04em; line-height: 1.02; }
  .wl-note { font-size: 13px; opacity: .78; }
  .wl-tile { padding: 20px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; align-content: end; min-width: 0; }
  .wl-tile span { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .wl-tile b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); letter-spacing: -0.02em; }
  .wl-tile small { font-size: 12px; color: var(--text-subtle); display: flex; gap: 4px; align-items: center; }
  .wl-account b { font-size: 1.1rem; }
  .wl-account .link-btn { justify-self: start; margin-top: 4px; font-size: 13px; }
  .wl-setup { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1000px) { .wl-setup { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
  .wl-setup-intro { padding: 28px; border-radius: 28px; color: #fff; display: grid; gap: 12px; }
  .wl-setup-intro h2 { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); letter-spacing: -0.03em; line-height: 1.05; }
  .wl-setup-intro p { margin: 0; opacity: .85; }
  .wl-setup-intro ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
  .wl-setup-intro li { display: flex; gap: 10px; align-items: flex-start; }
  .wl-setup-intro li svg { width: 18px; height: 18px; flex: none; color: var(--lime-400); }
  .wl-resolved { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
  .wl-resolved svg { width: 22px; height: 22px; flex: none; }
  .wl-resolved small { display: block; font-size: 11.5px; font-weight: 600; opacity: .8; }
  .wl-resolved b { color: var(--ink); }
  .wl-pending { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
  .wl-pending-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
  .wl-list { display: grid; }
  .wl-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); min-width: 0; }
  .wl-row b { color: var(--ink); font-size: var(--fs-small); display: block; }
  .wl-row small { display: block; font-size: 12px; }
  .wl-row-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); flex: none; }
  .wl-row-icon svg { width: 16px; height: 16px; }
  .wl-row-icon.is-in { background: var(--accent-soft); color: var(--accent-text); }
  .wl-amt { white-space: nowrap; }
  .wl-amt.is-in { color: var(--accent-text); }
  .wl-currencies { display: grid; gap: 8px; }
  .wl-cur-row { display: flex; align-items: baseline; gap: 12px; }
  .wl-cur-row b { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
  @media (max-width: 560px) { .wl-row { padding: 12px 16px; } }
}
@layer components { .wl-hero .wl-amount, .wl-hero b { color: #fff; } }

/* Plan & billing ---------------------------------------------------------------------- */
@layer components {
  .bl-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 1000px) { .bl-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
  .bl-current { padding: 26px; border-radius: 28px; color: #fff; display: grid; gap: 10px; align-content: start; }
  .bl-current h2 { margin: 8px 0 0; font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); letter-spacing: -0.04em; line-height: 1; color: #fff; }
  .bl-current p { margin: 0; opacity: .82; }
  .bl-current .badge { background: rgb(255 255 255 / .16); color: #fff; border-color: rgb(255 255 255 / .25); }
  .bl-current-foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .16); font-size: 14px; }
  .bl-current-foot b { color: #fff; }
  .bl-meter { display: grid; gap: 6px; font-size: 13px; color: var(--text-muted); }
  .bl-meter b { color: var(--ink); }
  .bl-meter.is-near .progress span { background: var(--warning); }
  .bl-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .bl-save { margin-left: 4px; color: var(--accent-text); font-weight: 700; }
  .bl-plans { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 900px) { .bl-plans { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
  .bl-plan { position: relative; display: grid; gap: 12px; align-content: start; padding: 22px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); }
  .bl-plan.is-featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--e2); }
  .bl-plan.is-current { background: var(--surface-2); }
  .bl-plan h3 { margin: 0; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
  .bl-plan-tag { margin: 0; color: var(--text-muted); font-size: 13.5px; min-height: 2.8em; }
  .bl-price { margin: 0; display: flex; align-items: baseline; gap: 6px; }
  .bl-price b { font-family: var(--font-display); font-size: 2rem; letter-spacing: -0.03em; color: var(--ink); }
  .bl-price small { color: var(--text-muted); }
  .bl-plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--text); }
  .bl-plan li { display: flex; gap: 8px; align-items: flex-start; }
  .bl-plan li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-text); }
  .bl-plan .btn { margin-top: auto; }
}

/* Storefront settings (ADR-0033) ------------------------------------------------------------ */
@layer components {
  .sfa-start { display: grid; gap: 24px; padding: clamp(22px, 4vw, 40px); align-items: center; overflow: hidden; }
  .sfa-start-copy { display: grid; gap: 12px; justify-items: start; max-width: 520px; }
  .sfa-start h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); letter-spacing: -0.03em; }
  .sfa-start p { margin: 0; opacity: .88; line-height: 1.55; }
  .sfa-start-art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 360px; width: 100%; justify-self: center; }
  .sfa-tile { display: grid; gap: 8px; padding: 10px; border-radius: 18px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .24); backdrop-filter: blur(10px);
    animation: sfa-float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.4s); }
  .sfa-tile i { display: block; aspect-ratio: 4 / 3; border-radius: 12px; background: linear-gradient(135deg, rgb(255 255 255 / .55), rgb(255 255 255 / .12)); }
  .sfa-tile b { display: block; height: 9px; width: 70%; border-radius: 9px; background: rgb(255 255 255 / .6); }
  .sfa-tile em { display: block; height: 22px; width: 48%; border-radius: 8px; background: #fff; justify-self: end; }
  @keyframes sfa-float { 50% { transform: translateY(-6px); } }
  @media (prefers-reduced-motion: reduce) { .sfa-tile { animation: none; } }

  .sfa-layout { display: grid; gap: 20px; align-items: start; }
  .sfa-status { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
  .sfa-entry { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); transition: transform var(--t-fast), box-shadow var(--t-fast); }
  .sfa-entry:hover { transform: translateY(-1px); box-shadow: var(--e2); }
  .sfa-entry.is-live .sfa-status-icon { background: var(--accent); color: var(--text-on-accent, #fff); }
  .sfa-entry-go { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); flex: none; transition: transform var(--t-fast); }
  .sfa-entry:hover .sfa-entry-go { transform: translateX(3px); }
  .sfa-status-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-muted); }
  .sfa-status.is-live .sfa-status-icon { background: var(--accent); color: var(--text-on-accent, #fff); box-shadow: 0 12px 26px -14px var(--accent); }
  .sfa-status-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .sfa-url { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-muted); }
  .sfa-looks { border: 0; margin: 0; padding: 0; min-width: 0; }
  .sfa-look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 6px; }
  .sfa-look { display: grid; gap: 6px; padding: 6px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast); }
  .sfa-look:hover { transform: translateY(-1px); }
  .sfa-look.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .sfa-look:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sfa-look-sw { position: relative; display: block; height: 38px; border-radius: 9px; background: var(--lk-bg); border: 1px solid rgb(0 0 0 / .06); overflow: hidden; }
  .sfa-look-sw i:first-child { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 7px; background: var(--lk-accent); }
  .sfa-look-sw i:last-child { position: absolute; left: 36px; right: 10px; top: 15px; height: 7px; border-radius: 7px; background: var(--lk-text); opacity: .6; }
  .sfa-look-name { font-size: 12.5px; font-weight: 600; text-align: center; }

  .sfa-list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; }
  .sfa-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; transition: background var(--t-fast); }
  .sfa-item:hover { background: var(--surface-2); }
  .sfa-item + .sfa-item { border-top: 1px solid var(--line); border-radius: 0; }
  .sfa-item.is-dim .sfa-thumb, .sfa-item.is-dim .sfa-item-main { opacity: .5; }
  .sfa-status-icon svg { width: 22px; height: 22px; }
  .sfa-entry-go svg { width: 16px; height: 16px; }
  .sfa-thumb svg { width: 20px; height: 20px; }
  .sfa-thumb { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--accent-soft) center / cover no-repeat; display: grid; place-items: center; color: var(--accent-text); }
  .sfa-item-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
  .sfa-item-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
  .sfa-item-meta .badge { font-size: 11px; }
  .sfa-item-ctl { display: flex; align-items: center; gap: 2px; flex: none; }
  .sfa-item-ctl .switch { margin-left: 6px; }

  .sfa-preview { display: none; }
  .sfa-phone { margin-top: 8px; border-radius: 34px; padding: 10px; background: var(--ink, #0B0F0D); box-shadow: 0 40px 80px -40px rgb(0 0 0 / .6); }

  .order-lines { list-style: none; margin: 0; padding: 4px 14px; border-radius: var(--r-md); border: 1px solid var(--line); display: grid; }
  .order-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.5px; min-width: 0; }
  .order-lines li + li { border-top: 1px solid var(--line); }

  @media (min-width: 900px) {
    .sfa-start { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  }
  @media (min-width: 1100px) {
    .sfa-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .sfa-preview { display: block; position: sticky; top: 88px; }
  }
}

/* Options and inventory (ADR-0037) */
@layer components {
  .pe-opt { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; gap: 10px; align-items: start; }
  .pe-opt-x { margin-top: 28px; }
  @media (max-width: 560px) { .pe-opt { grid-template-columns: minmax(0, 1fr) auto; } .pe-opt > :nth-child(2) { grid-column: 1 / 2; } .pe-opt-x { grid-row: 1; grid-column: 2; } }
  .pe-variants .table td { vertical-align: top; }
  .pe-variants .input-sm { width: 100%; min-width: 72px; }
  .pe-variants .field-error { margin-top: 4px; }
  .pe-stock-grid { align-items: start; }

  .iv-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1150px) { .iv-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
  .iv-stock { display: inline-flex; align-items: center; gap: 4px; }
  .iv-count { width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
  .iv-move { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line); font-size: var(--fs-small); min-width: 0; }
  .iv-move small { display: block; }
  .iv-change { flex: none; min-width: 44px; padding: 3px 8px; border-radius: 999px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-sunken); color: var(--ink); }
  .iv-change.is-down { background: var(--danger-soft); color: var(--danger); }
  .iv-change.is-up { background: var(--success-soft); color: var(--success); }
  .iv-sheet { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
  .iv-sheet-backdrop { position: absolute; inset: 0; background: rgb(10 12 14 / .38); backdrop-filter: blur(3px); }
  .iv-sheet-panel { position: relative; width: min(440px, 100%); height: 100%; overflow-y: auto; border-radius: 0; animation: iv-in .22s var(--ease-out, ease-out); }
  @keyframes iv-in { from { transform: translateX(24px); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .iv-sheet-panel { animation: none; } }
}

/* Discounts (ADR-0038) */
@layer components {
  .dc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .dc-row:first-child { border-top: 0; }
  .dc-row.is-dim .dc-main, .dc-row.is-dim .dc-tag { opacity: .6; }
  .dc-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; font-weight: 700; letter-spacing: .03em; background: var(--accent-soft); color: var(--accent-text); border: 1px dashed color-mix(in oklab, var(--accent) 45%, transparent); white-space: nowrap; }
  .dc-tag.is-sale { font-family: inherit; letter-spacing: 0; background: var(--violet-soft, var(--assist-soft)); color: var(--violet-700); border-style: solid; border-color: transparent; }
  .dc-tag svg { width: 14px; height: 14px; }
  .dc-main { min-width: 0; display: grid; gap: 2px; }
  .dc-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dc-uses { display: grid; justify-items: end; line-height: 1.2; }
  .dc-actions { flex-wrap: nowrap; }
  @media (max-width: 760px) {
    .dc-row { grid-template-columns: minmax(0, 1fr) auto; }
    .dc-tag { grid-column: 1; justify-self: start; }
    .dc-row .tk-state { grid-column: 2; grid-row: 1; justify-self: end; }
    .dc-main { grid-column: 1 / -1; }
    .dc-uses { justify-items: start; grid-column: 1; }
    .dc-actions { grid-column: 2; justify-self: end; }
  }
  .dc-type { margin-bottom: 4px; }
  .dc-type svg { width: 15px; height: 15px; }
  .dc-amount { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px; align-items: start; }
  @media (max-width: 560px) { .dc-amount { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
  .dc-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 220px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
  .dc-code-input { text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono, ui-monospace, monospace); }
}

/* Licence keys (ADR-0039) */
@layer components {
  .lic-grid { align-items: start; }
  .lic-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-small); color: var(--text-muted); }
  .lic-stats b { color: var(--ink); }
  .lic-pool { font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; }
  .lk-key { font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; letter-spacing: .03em; }
}
@layer components {
  .lk-reveal { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
  .lk-reveal code { font-size: 14.5px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
  .lk-reveal .muted { flex: 1; }
  .lk-device { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-small); min-width: 0; }
  .lk-device svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
  .lk-device.is-dim { opacity: .55; }
}
@layer components { .table tr.is-clickable { cursor: pointer; } .table tr.is-clickable:hover td { background: var(--surface-hover); } }

/* css/components/email.css */
/* Email & broadcasts (ADR-0019): inbox-style list, composer with a live phone preview, results ---------------- */
@layer components {
  /* Empty state */
  .em-empty { padding: clamp(24px, 4vw, 44px); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  @media (min-width: 980px) { .em-empty { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
  .em-empty h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .em-empty h2 em.accent { color: #C2F45B; font-style: italic; }
  .em-empty p { color: rgb(255 255 255 / .72); max-width: 54ch; }
  .em-empty-art { position: relative; min-height: 230px; display: grid; place-items: center; }
  .em-env { position: relative; width: min(280px, 80%); aspect-ratio: 1.45; border-radius: 18px; background: linear-gradient(160deg, #1D2A24, #111815); border: 1px solid rgb(255 255 255 / .12); box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7); }
  .em-env-flap { position: absolute; inset: 0 0 38% 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(180deg, rgb(255 255 255 / .1), rgb(255 255 255 / .02)); border-radius: 18px 18px 0 0; z-index: 2; }
  .em-env-letter { position: absolute; left: 9%; right: 9%; bottom: 22%; padding: 14px; border-radius: 12px; background: #fff; display: grid; gap: 7px; transform: translateY(-38%) rotate(-3deg); box-shadow: 0 20px 40px -18px rgb(0 0 0 / .5); animation: em-rise 3.2s var(--ease-out) infinite alternate; }
  .em-env-letter i { height: 7px; border-radius: 99px; background: #E3E8E5; }
  .em-env-letter i.is-h { height: 11px; width: 70%; background: #101512; }
  .em-env-letter i.is-short { width: 55%; }
  .em-env-letter b { width: 42%; height: 18px; border-radius: 6px; background: var(--emerald-500); margin-top: 4px; }
  @keyframes em-rise { to { transform: translateY(-52%) rotate(0deg); } }
  @media (prefers-reduced-motion: reduce) { .em-env-letter { animation: none; } }
  .em-float { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); backdrop-filter: blur(10px); color: #fff; font-size: 12px; font-weight: 700; }
  .em-float svg { width: 14px; height: 14px; color: var(--lime-400); }
  .em-float-1 { top: 8%; right: 4%; } .em-float-2 { bottom: 6%; left: 2%; }

  .em-meter { height: 8px; border-radius: 99px; background: rgb(255 255 255 / .18); overflow: hidden; margin-top: 12px; }
  .em-meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime-400), #fff); transition: width .6s var(--ease-out); }
  .em-meter.is-light { background: var(--surface-sunken); margin-top: 4px; }
  .em-meter.is-light > span { background: linear-gradient(90deg, var(--emerald-500), var(--violet-500)); }
  .tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--surface-sunken); font-size: 11px; font-weight: 700; color: var(--text-muted); }

  /* Inbox-style list */
  .em-list { display: grid; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); overflow: hidden; }
  .em-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); transition: background var(--t-fast); }
  .em-row:last-child { border-bottom: 0; }
  .em-row:hover { background: var(--surface-hover); }
  .em-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding-left: 16px; color: inherit; text-decoration: none; }
  .em-avatar { width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); border: 1px dashed var(--line-strong); }
  .em-avatar svg { width: 18px; height: 18px; }
  .em-avatar.is-sent { background: var(--grad-forest); color: #fff; border: 0; }
  .em-avatar.is-sending { background: var(--grad-brand); color: #fff; border: 0; }
  .em-avatar.is-scheduled { background: var(--grad-violet); color: #fff; border: 0; }
  .em-avatar.is-failed { background: var(--danger-soft); color: var(--danger); border: 0; }
  .em-row-text { min-width: 0; display: grid; gap: 1px; }
  .em-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .em-row-top b { color: var(--ink); font-size: 15px; }
  .em-row-text small { color: var(--text-muted); font-size: 13px; }
  .em-row-text small.em-row-when { color: var(--text-subtle); font-size: 12px; }
  .em-status { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .01em; background: var(--surface-sunken); color: var(--text-muted); flex: none; }
  .em-status.is-sent { background: var(--success-soft); color: var(--success); }
  .em-status.is-sending, .em-status.is-scheduled { background: var(--assist-soft); color: var(--assist-text); }
  .em-status.is-failed { background: var(--danger-soft); color: var(--danger); }
  .em-row-stats { display: flex; gap: 18px; margin: 0; flex: none; }
  .em-row-stats dt { font-size: 11px; color: var(--text-subtle); }
  .em-row-stats dd { margin: 0; font-weight: 700; color: var(--ink); font-size: 15px; }
  @media (max-width: 640px) { .em-row { flex-wrap: wrap; padding: 12px 12px 12px 0; } .em-row-stats { order: 3; width: 100%; padding-left: 70px; } }

  /* Composer */
  .em-hero { align-items: flex-end; flex-wrap: wrap; }
  @media (max-width: 760px) { .em-hero { display: flex; flex-direction: column; align-items: stretch; } .em-hero > div { width: 100%; } .em-hero .page-actions { flex-wrap: wrap; } .em-hero .page-actions > * { flex: 1 1 auto; } }
  .em-name { width: 100%; border: 0; background: transparent; padding: 2px 0; font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; letter-spacing: -0.03em; color: var(--ink); border-bottom: 1.5px dashed transparent; border-radius: 0; }
  .em-name:hover { border-bottom-color: var(--line-strong); }
  .em-name:focus { outline: none; border-bottom-color: var(--accent); }
  .em-steps { display: flex; gap: 6px; margin: 4px 0 20px; overflow-x: auto; scrollbar-width: none; }
  .em-step { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font-weight: 600; font-size: var(--fs-small); white-space: nowrap; }
  .em-step i { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; background: var(--surface-sunken); color: var(--text-muted); }
  .em-step.is-active { background: var(--ink); color: var(--text-on-ink); border-color: var(--ink); }
  .em-step.is-active i { background: var(--emerald-500); color: #04140D; }
  .em-compose { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .em-compose { grid-template-columns: minmax(0, 1fr) 420px; } }
  .em-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  .em-mobile-switch { display: none; margin-bottom: 14px; }
  @media (max-width: 1099px) {
    .em-mobile-switch { display: inline-flex; }
    .em-compose[data-show="edit"] .em-preview { display: none; }
    .em-compose[data-show="preview"] .em-panel { display: none; }
  }
  .em-from { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .em-from > div { display: grid; }
  .em-from-avatar { width: 36px; height: 36px; flex: none; border-radius: 99px; display: grid; place-items: center; background: var(--grad-brand); color: #fff; font-weight: 800; font-family: var(--font-display); }

  .em-blocks { display: grid; }
  .em-block { border-top: 1px solid var(--line); }
  .em-block.is-open { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
  .em-block-head { display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 0; }
  .em-block-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 16px; background: none; border: 0; text-align: left; color: inherit; }
  .em-block-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
  .em-block.is-open .em-block-icon { background: var(--ink); color: var(--text-on-ink); }
  .em-block-icon svg { width: 16px; height: 16px; }
  .em-block-sum { display: grid; min-width: 0; }
  .em-block-sum b { font-size: 13px; color: var(--ink); }
  .em-block-sum small { color: var(--text-muted); font-size: 12.5px; }
  .em-block-tools { display: flex; align-items: center; gap: 2px; flex: none; }
  .em-block-body { padding: 4px 16px 18px; }
  .em-tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .em-tag { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; }
  .em-tag:hover { border-style: solid; color: var(--ink); }
  .em-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--hatch), var(--surface-2); }
  .em-add-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); box-shadow: var(--e1); transition: transform var(--t-fast) var(--ease-out); }
  .em-add-btn:hover { transform: translateY(-1px); border-color: var(--line-strong); }
  .em-add-btn svg { width: 15px; height: 15px; color: var(--accent-text); }
  .em-color { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
  .em-color input { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
  .em-swatches { display: flex; gap: 8px; }
  .em-swatch { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); background: linear-gradient(135deg, var(--bg) 50%, var(--card) 50%); }
  .em-swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
  .em-logo-thumb { height: 32px; width: auto; max-width: 90px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

  .em-aud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  @media (max-width: 560px) { .em-aud { grid-template-columns: minmax(0, 1fr); } }
  .em-aud-card { display: grid; gap: 2px; padding: 14px; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .em-aud-card:hover { border-color: var(--line-strong); }
  .em-aud-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  .em-aud-card:focus-within { box-shadow: var(--focus-ring); }
  .em-aud-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-sunken); margin-bottom: 8px; }
  .em-aud-card.is-active .em-aud-icon { background: var(--accent); color: #fff; }
  .em-aud-icon svg { width: 17px; height: 17px; }
  .em-aud-card b { color: var(--ink); } .em-aud-card small { color: var(--text-muted); font-size: 12.5px; }

  .em-check { list-style: none; margin: 0; padding: 0; display: grid; }
  .em-check li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .em-check li:last-child { border-bottom: 0; }
  .em-check li > svg { width: 26px; height: 26px; padding: 5px; border-radius: 99px; flex: none; }
  .em-check li.is-ok > svg { background: var(--success-soft); color: var(--success); }
  .em-check li.is-bad > svg { background: var(--danger-soft); color: var(--danger); }
  .em-check li > span { flex: 1; min-width: 0; display: grid; }
  .em-check li small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .em-problems { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
  .em-when { display: grid; gap: 12px; justify-items: start; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
  .em-sched { color: #fff; }
  .em-sched h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -0.03em; margin: 14px 0 6px; }
  .em-sched p { color: rgb(255 255 255 / .75); }
  .em-kpis { margin-top: 0; }
  @media (min-width: 1100px) { .em-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .em-panel > .callout { margin-bottom: 16px; }

  /* Preview: an inbox row on top, the email below, inside a device frame */
  .em-preview { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
  .em-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .em-device { justify-self: center; width: 390px; max-width: 100%; border-radius: 34px; padding: 10px; background: linear-gradient(160deg, #1B211E, #0A0D0C); box-shadow: var(--e3), inset 0 0 0 1px rgb(255 255 255 / .08); display: grid; gap: 0; overflow: hidden; transition: width var(--t-slow, .3s) var(--ease-out), border-radius .3s; }
  .em-device.is-desktop { width: 100%; border-radius: 16px; padding: 6px; }
  @media (min-width: 1100px) { .em-device.is-desktop { width: min(680px, calc(100vw - 420px)); justify-self: end; } }
  .em-inbox { display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px 12px; border-radius: 26px 26px 0 0; background: #fff; border-bottom: 1px solid #E8ECE9; color: #101512; }
  .em-device.is-desktop .em-inbox { border-radius: 11px 11px 0 0; }
  .em-inbox > div { flex: 1; font-size: 13px; }
  .em-inbox b { font-size: 14px; }
  .em-inbox-subj { font-weight: 600; }
  .em-inbox-pre { font-size: 12.5px; color: #6B746E !important; }
  .em-inbox small { color: #8A938D; }
  .em-frame { display: block; width: 100%; height: min(640px, 70vh); border: 0; background: #F1F2EE; border-radius: 0 0 26px 26px; }
  .em-device.is-desktop .em-frame { border-radius: 0 0 11px 11px; height: min(720px, 75vh); }
}

/* css/components/automations.css */
/* Automations (ADR-0020): recipe list, a vertical flow canvas with "+" between steps, an inspector, run history ---- */
@layer components {
  .au-empty { padding: clamp(24px, 4vw, 44px); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); overflow: hidden; margin-bottom: 24px; }
  @media (min-width: 980px) { .au-empty { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
  .au-empty h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .au-empty h2 em.accent { color: #C2F45B; font-style: italic; }
  .au-empty p { color: rgb(255 255 255 / .72); max-width: 54ch; }
  .au-empty-art { display: grid; justify-items: center; gap: 0; }
  .au-empty-art i { width: 2px; height: 18px; background: linear-gradient(rgb(255 255 255 / .1), rgb(255 255 255 / .35)); }
  .au-node { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); color: #fff; font-weight: 700; font-size: 13px; backdrop-filter: blur(8px); animation: au-pop .6s var(--ease-out) both; }
  .au-node svg { width: 16px; height: 16px; color: var(--lime-400); }
  .au-node.is-trigger { background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); border-color: transparent; }
  .au-node.is-trigger svg { color: #fff; }
  .au-node.is-wait { background: transparent; border-style: dashed; color: rgb(255 255 255 / .75); }
  .au-empty-art > :nth-child(3) { animation-delay: .12s; } .au-empty-art > :nth-child(5) { animation-delay: .24s; } .au-empty-art > :nth-child(7) { animation-delay: .36s; }
  @keyframes au-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
  @media (prefers-reduced-motion: reduce) { .au-node { animation: none; } }

  /* List */
  .au-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
  .au-card { position: relative; display: grid; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .au-card:hover { box-shadow: var(--e2); transform: translateY(-2px); }
  .au-card-main { display: grid; gap: 10px; padding: 18px 18px 16px; color: inherit; text-decoration: none; min-width: 0; }
  .au-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 72px; }
  .au-card-title { font-family: var(--font-display); font-size: 1.14rem; letter-spacing: -0.02em; color: var(--ink); }
  .au-card-actions { position: absolute; top: 14px; right: 12px; display: flex; align-items: center; gap: 6px; }
  .au-state { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-sunken); color: var(--text-muted); }
  .au-state.is-active { background: var(--success-soft); color: var(--success); }
  .au-strip { display: flex; align-items: center; gap: 0; padding: 12px; border-radius: 14px; background: var(--hatch), var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
  .au-strip i { flex: 1 1 10px; max-width: 22px; height: 2px; background: var(--line-strong); }
  .au-strip-trigger, .au-strip-step, .au-strip-more { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 11px; font-weight: 800; }
  .au-strip-trigger { background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); color: #fff; border: 0; }
  .au-strip-step svg, .au-strip-trigger svg { width: 15px; height: 15px; }
  .au-strip-step.is-wait { border-style: dashed; color: var(--text-muted); }
  .au-strip-step.is-send_email { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
  .au-strip-step.is-branch { background: var(--assist-soft); color: var(--assist-text); border-color: transparent; }

  /* Builder */
  .au-hero { align-items: flex-end; flex-wrap: wrap; }
  @media (max-width: 760px) { .au-hero { flex-direction: column; align-items: stretch; } .au-hero > div { width: 100%; } .au-hero .page-actions { flex-wrap: wrap; } }
  .au-builder { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .au-builder { grid-template-columns: minmax(0, 1fr) 400px; } .au-back { display: none; } }
  @media (max-width: 1099px) { .au-builder[data-pane="canvas"] .au-inspector { display: none; } .au-builder[data-pane="inspector"] .au-canvas { display: none; } }
  .au-canvas { border-radius: var(--r-xl); border: 1px solid var(--line); background: radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--ink) 12%, transparent) 1px, transparent 0) 0 0 / 18px 18px, var(--surface-2); padding: clamp(18px, 3vw, 36px) 12px; overflow-x: auto; min-height: 420px; }
  .au-flow { display: grid; justify-items: center; min-width: min-content; }
  .au-node-wrap { display: grid; justify-items: center; width: 100%; }
  .au-card-node { position: relative; width: min(100%, 400px); min-width: 260px; display: flex; align-items: center; gap: 4px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--e1); transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); text-align: left; }
  .au-card-node:hover { border-color: var(--line-strong); box-shadow: var(--e2); }
  .au-card-node.is-selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--e2); }
  button.au-card-node { padding: 14px 16px; gap: 12px; color: inherit; }
  .au-card-node.is-trigger { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--violet-400), var(--emerald-400)) border-box; border-color: transparent; }
  .au-card-node.is-wait { border-style: dashed; background: color-mix(in oklab, var(--surface) 70%, transparent); box-shadow: none; }
  .au-card-node.is-end { width: auto; min-width: 0; border-radius: 99px; }
  .au-node-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 4px 12px 14px; background: none; border: 0; text-align: left; color: inherit; }
  .au-node-icon { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
  .au-node-icon svg { width: 18px; height: 18px; }
  .au-node-icon.g-card { background: var(--grad-violet); color: #fff; }
  .au-node-icon.g-card svg { color: #fff; }
  .au-node-icon.is-send_email { background: var(--accent-soft); color: var(--accent-text); }
  .au-node-icon.is-notify { background: var(--warning-soft); color: var(--warning); }
  .au-node-icon.is-branch { background: var(--assist-soft); color: var(--assist-text); }
  .au-node-icon.is-webhook { background: var(--info-soft); color: var(--info); }
  .au-node-icon.is-end { background: var(--ink); color: var(--text-on-ink); }
  .au-node-text { display: grid; min-width: 0; gap: 1px; }
  .au-node-text small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); }
  .au-node-text b { color: var(--ink); font-size: 14px; }
  .au-node-text em { font-style: normal; font-size: 12px; color: var(--text-muted); }
  .au-node-tools { display: flex; align-items: center; padding-right: 8px; opacity: .55; transition: opacity var(--t-fast); }
  .au-card-node:hover .au-node-tools, .au-card-node.is-selected .au-node-tools, .au-card-node:focus-within .au-node-tools { opacity: 1; }
  .au-node-tools .icon-btn { width: 30px; height: 30px; }

  .au-line { width: 2px; height: 28px; background: var(--line-strong); }
  .au-add { position: relative; display: grid; justify-items: center; height: 46px; }
  .au-add::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--line-strong); }
  .au-add-btn { position: relative; z-index: 1; align-self: center; width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--text-muted); transition: transform var(--t-fast) var(--ease-spring), background var(--t-fast), color var(--t-fast); }
  .au-add-btn svg { width: 14px; height: 14px; }
  .au-add-btn:hover, .au-add-btn[aria-expanded="true"] { background: var(--ink); color: var(--text-on-ink); border-color: var(--ink); transform: scale(1.15); }
  .au-add-menu { position: absolute; top: 40px; z-index: 30; width: 300px; max-height: 420px; overflow: auto; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e3); display: grid; gap: 4px; }
  .au-add-group small { display: block; padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .au-add-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: none; border: 0; text-align: left; color: inherit; }
  .au-add-item:hover { background: var(--surface-hover); }
  .au-add-item b { display: block; font-size: 13.5px; color: var(--ink); } .au-add-item small { color: var(--text-muted); font-size: 12px; }
  .au-add-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); }
  .au-add-icon svg { width: 16px; height: 16px; }
  .au-add-icon.is-send_email { background: var(--accent-soft); color: var(--accent-text); }
  .au-add-icon.is-branch { background: var(--assist-soft); color: var(--assist-text); }

  .au-branch { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 28px; width: 100%; padding-top: 22px; position: relative; align-items: stretch; }
  .au-branch::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 22px; border: 2px solid var(--line-strong); border-bottom: 0; border-radius: 14px 14px 0 0; }
  .au-branch::after { content: ""; position: absolute; top: -12px; left: 50%; width: 2px; height: 12px; margin-left: -1px; background: var(--line-strong); }
  .au-branch-col { display: flex; flex-direction: column; align-items: center; padding: 0 6px; min-width: 0; }
  .au-branch-col > .au-node-wrap { width: 100%; }
  .au-fill { flex: 1; width: 2px; min-height: 10px; background: var(--line-strong); }
  .au-merge { position: relative; width: 100%; height: 22px; }
  .au-merge::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 22px; border: 2px solid var(--line-strong); border-top: 0; border-radius: 0 0 14px 14px; }
  .au-branch-label { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
  .au-branch-col.is-yes .au-branch-label { background: var(--success-soft); color: var(--success); }
  .au-branch-col.is-no .au-branch-label { background: var(--danger-soft); color: var(--danger); }
  .au-finish { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
  .au-finish svg { width: 15px; height: 15px; color: var(--success); }
  .au-hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

  .au-inspector { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); display: grid; gap: 10px; min-width: 0; }
  .au-inspect { border: 1px solid var(--line); margin: 0; padding: 0; min-width: 0; }
  .au-inspect .kicker { display: block; margin-bottom: 2px; }
  .au-triggers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .au-trigger-opt { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink); min-height: 48px; }
  .au-trigger-opt svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
  .au-trigger-opt:hover { border-color: var(--line-strong); }
  .au-trigger-opt.is-active { border-color: var(--violet-500); background: var(--assist-soft); }
  .au-trigger-opt.is-active svg { color: var(--assist-text); }
  .au-cond { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
  @media (max-width: 520px) { .au-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .au-cond > :nth-child(3) { grid-column: 1 / 3; } }
  .au-preview-frame { display: block; width: 100%; height: min(640px, 70vh); border: 0; background: #F1F2EE; border-radius: 0 0 var(--r-lg) var(--r-lg); }

  /* Run history */
  .au-run { gap: 8px; }
  .au-run.is-open { background: var(--surface-2); }
  .au-run-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; color: inherit; padding: 0; }
  .au-run-status { flex: none; height: 22px; padding: 0 9px; border-radius: 99px; display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-sunken); color: var(--text-muted); }
  .au-run-status.is-waiting, .au-run-status.is-running { background: var(--assist-soft); color: var(--assist-text); }
  .au-run-status.is-completed { background: var(--success-soft); color: var(--success); }
  .au-run-status.is-failed { background: var(--danger-soft); color: var(--danger); }
  .au-log { list-style: none; margin: 0; padding: 6px 18px 16px 62px; display: grid; gap: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .au-log li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
  .au-log li::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
  .au-log li:last-child::before { display: none; }
  .au-log-dot { width: 10px; height: 10px; margin-top: 5px; flex: none; border-radius: 99px; background: var(--success); }
  .au-log li.is-waiting .au-log-dot { background: var(--violet-500); } .au-log li.is-skipped .au-log-dot { background: var(--text-subtle); } .au-log li.is-failed .au-log-dot { background: var(--danger); }
  .au-log li.is-no .au-log-dot { background: var(--tangerine-500); }
  .au-log b { display: block; font-size: 13.5px; color: var(--ink); } .au-log small { color: var(--text-muted); font-size: 12.5px; }
}
@layer components {
  /* Phones: the two paths of an if / else stack, each marked with its colour, instead of scrolling sideways. */
  @media (max-width: 700px) {
    .au-branch { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
    .au-branch::before, .au-merge::before { display: none; }
    .au-merge { height: 10px; }
    .au-branch-col { padding: 12px 8px 4px; border-radius: 20px; border: 1.5px dashed var(--line-strong); }
    .au-branch-col.is-yes { border-color: color-mix(in oklab, var(--success) 45%, transparent); }
    .au-branch-col.is-no { border-color: color-mix(in oklab, var(--danger) 40%, transparent); }
    .au-fill { display: none; }
    .au-card-node { min-width: 0; }
  }
}

/* css/components/notifications.css */
/* Notifications (ADR-0021): the bell, its panel, the inbox and settings ------------------------------------------ */
@layer components {
  .nb { position: relative; }
  .nb-btn { position: relative; }
  .nb-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center;
    background: var(--tangerine-500); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--surface); animation: nb-pop .35s var(--ease-spring); }
  @keyframes nb-pop { from { transform: scale(.4); } }
  @media (prefers-reduced-motion: reduce) { .nb-count { animation: none; } }
  .nb-panel { position: absolute; right: -8px; top: calc(100% + 10px); z-index: 60; width: min(380px, calc(100vw - 24px)); border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e3); overflow: hidden; }
  @media (max-width: 640px) { .nb-panel { position: fixed; right: 12px; left: 12px; width: auto; top: 64px; } }
  .nb-head, .nb-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px 16px; }
  .nb-head b { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); }
  .nb-foot { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 13px; font-weight: 600; }
  .nb-list { max-height: min(460px, 60vh); overflow: auto; border-top: 1px solid var(--line); }
  .nb-item { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; background: none; border: 0; text-align: left; color: inherit; position: relative; }
  .nb-item:hover { background: var(--surface-hover); }
  .nb-item.is-unread::after, .nb-row.is-unread .nb-item::after { content: ""; position: absolute; left: 6px; top: 22px; width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }
  .nb-icon { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
  .nb-icon svg { width: 16px; height: 16px; }
  .nb-icon.is-store-order { background: var(--success-soft); color: var(--success); }
  .nb-icon.is-forms-response, .nb-icon.is-automations-alert { background: var(--assist-soft); color: var(--assist-text); }
  .nb-icon.is-billing, .nb-icon.is-moderation { background: var(--warning-soft); color: var(--warning); }
  .nb-icon.is-email-finished { background: var(--accent-soft); color: var(--accent-text); }
  .nb-text { display: grid; gap: 1px; min-width: 0; }
  .nb-text b { font-size: 13.5px; color: var(--ink); line-height: 1.35; }
  .nb-text b em { font-style: normal; font-weight: 600; color: var(--text-muted); font-size: 12px; }
  .nb-text small { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .nb-text small.nb-meta { color: var(--text-subtle); font-size: 11.5px; }
  .nb-item:not(.is-unread) .nb-text b { font-weight: 600; }
  .nb-empty { display: grid; justify-items: center; gap: 4px; padding: 36px 20px; text-align: center; color: var(--text-muted); }
  .nb-empty svg { width: 22px; height: 22px; margin-bottom: 6px; color: var(--text-subtle); }
  .nb-empty b { color: var(--ink); } .nb-empty small { font-size: 12.5px; }

  .nb-page { max-width: 820px; }
  .nb-day { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); margin: 18px 4px 8px; }
  .nb-card { overflow: hidden; }
  .nb-row { display: flex; align-items: center; gap: 4px; padding-right: 10px; border-bottom: 1px solid var(--line); }
  .nb-row:last-child { border-bottom: 0; }
  .nb-row.is-unread { background: color-mix(in oklab, var(--accent-soft) 45%, transparent); }
  .nb-row .nb-item { flex: 1; min-width: 0; }

  .nb-cols { display: flex; gap: 22px; font-size: 12px; font-weight: 700; color: var(--text-subtle); }
  .nb-prefs { display: grid; }
  .nb-pref { display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .nb-pref b { display: block; color: var(--ink); font-size: 14px; }
  .nb-pref small { color: var(--text-muted); font-size: 12.5px; }
  .nb-req { color: var(--accent-text); font-weight: 600; }
  .nb-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .nb-toggle-label { display: none; font-size: 12px; color: var(--text-muted); }
  .nb-toggle input:disabled + .switch-track { opacity: .55; }
  @media (max-width: 640px) { .nb-pref { flex-wrap: wrap; gap: 10px 16px; } .nb-pref > .grow { flex-basis: 100%; } .nb-toggle-label { display: inline; } }
}

/* css/components/bookings.css */
/* Bookings (ADR-0022): agenda, services, schedule editor ------------------------------------------------------------ */
@layer components {
  .bk-empty { padding: clamp(24px, 4vw, 44px); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); overflow: hidden; margin-bottom: 24px; }
  @media (min-width: 980px) { .bk-empty { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
  .bk-empty h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .bk-empty h2 em.accent { color: #FFF3C4; font-style: italic; }
  .bk-empty p { color: rgb(255 255 255 / .82); max-width: 54ch; }
  .bk-empty-art { display: grid; place-items: center; }
  .bk-mock { width: min(300px, 90%); padding: 18px; border-radius: 22px; background: #fff; color: #101512; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5); transform: rotate(-2deg); display: grid; gap: 12px; }
  .bk-mock b { font-family: var(--font-display); font-size: 18px; }
  .bk-mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bk-mock-grid i { font-style: normal; text-align: center; padding: 9px 0; border-radius: 10px; border: 1.5px solid #E3E8E5; font-weight: 700; font-size: 13px; }
  .bk-mock-grid i.is-on { background: #FF7A3D; border-color: #FF7A3D; color: #fff; }
  .bk-mock em { font-style: normal; text-align: center; padding: 12px; border-radius: 12px; background: #101512; color: #fff; font-weight: 800; }

  .bk-services { display: grid; gap: 10px; }
  .bk-service { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); color: inherit; text-decoration: none; transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .bk-service:hover { box-shadow: var(--e2); transform: translateY(-1px); }
  .bk-service > span.grow { display: grid; }
  .bk-service b { color: var(--ink); }
  .bk-service-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-sunset); color: #fff; flex: none; }
  .bk-service-icon.is-event { background: var(--grad-violet); }
  .bk-service-icon svg { width: 19px; height: 19px; }

  .bk-agenda-day { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
  @media (max-width: 560px) { .bk-agenda-day { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
  .bk-agenda-date { display: flex; align-items: center; gap: 10px; align-self: start; position: sticky; top: calc(var(--topbar-h, 64px) + 12px); }
  @media (min-width: 561px) { .bk-agenda-date { flex-direction: column; gap: 0; padding-top: 6px; } }
  .bk-agenda-date b { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--ink); letter-spacing: -0.04em; }
  .bk-agenda-date span { display: grid; justify-items: center; font-weight: 700; font-size: 13px; color: var(--ink); }
  .bk-agenda-date small { font-size: 11px; color: var(--text-subtle); font-weight: 600; }
  .bk-agenda-list { display: grid; gap: 8px; }
  .bk-slotcard { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); text-align: left; color: inherit; position: relative; overflow: hidden; transition: box-shadow var(--t-fast); }
  .bk-slotcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tangerine-500); }
  .bk-slotcard.is-attended::before { background: var(--success); } .bk-slotcard.is-no_show::before, .bk-slotcard.is-cancelled::before { background: var(--line-strong); }
  .bk-slotcard:hover { box-shadow: var(--e2); }
  .bk-slotcard > .grow { display: grid; }
  .bk-slotcard b { color: var(--ink); } .bk-slotcard small { color: var(--text-muted); font-size: 12.5px; }
  .bk-slotcard-time { display: grid; min-width: 52px; }
  .bk-slotcard-time b { font-family: var(--font-display); font-size: 1.05rem; }
  .bk-status { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--warning-soft); color: var(--tangerine-600); }
  .bk-status.is-attended { background: var(--success-soft); color: var(--success); }
  .bk-status.is-no_show, .bk-status.is-cancelled { background: var(--surface-sunken); color: var(--text-muted); }
  .bk-drawer .dl { margin: 0; }

  .bk-week { display: grid; gap: 4px; }
  .bk-week-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 10px; border-radius: 12px; }
  .bk-week-row.is-on { background: var(--surface-2); }
  .bk-week-row > b { width: 100px; font-size: 14px; color: var(--ink); }
  .bk-week-times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .bk-week-times .input { width: 118px; height: 38px; }
  .bk-week-times span { color: var(--text-muted); font-size: 13px; }
  @media (max-width: 520px) { .bk-week-row { flex-wrap: wrap; } .bk-week-row > b { width: auto; flex: 1; } .bk-week-times { width: 100%; padding-left: 48px; } }
  .bk-sessions { display: grid; gap: 8px; }
  .bk-session { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
  .bk-session > .grow { display: grid; }
  .bk-session-date { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; align-content: center; background: var(--grad-violet); color: #fff; flex: none; }
  .bk-session-date b { font-size: 17px; line-height: 1; } .bk-session-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
  .chip-x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; border: 0; background: none; color: inherit; border-radius: 99px; }
  .chip-x svg { width: 12px; height: 12px; }
  .pe-side { min-width: 0; }
  @media (min-width: 1100px) { .pe-side { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); } }
  .bk-prev-day { display: grid; gap: 6px; }
  .bk-prev-day b { font-size: 13px; color: var(--ink); }
  .bk-prev-day span { display: flex; flex-wrap: wrap; gap: 6px; }
  .bk-prev-day i { font-style: normal; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
  .bk-prev-day em { font-style: normal; font-size: 12px; color: var(--text-muted); align-self: center; }
}

/* css/components/courses.css */
/* Courses (ADR-0023) ------------------------------------------------------------------------------------------------ */
@layer components {
  .cr-empty { padding: clamp(24px, 4vw, 44px); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); overflow: hidden; margin-bottom: 24px; }
  @media (min-width: 980px) { .cr-empty { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
  .cr-empty h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .cr-empty h2 em.accent { color: #C2F45B; font-style: italic; }
  .cr-empty p { color: rgb(255 255 255 / .8); max-width: 54ch; }
  .cr-empty-art { display: grid; place-items: center; }
  .cr-mock { width: min(300px, 90%); padding: 14px; border-radius: 20px; background: #fff; color: #101512; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5); transform: rotate(2deg); display: grid; gap: 10px; }
  .cr-mock-video { aspect-ratio: 16/9; border-radius: 12px; background: linear-gradient(135deg, #1F2925, #3B2A8F); display: grid; place-items: center; color: #fff; }
  .cr-mock-video svg { width: 34px; height: 34px; }
  .cr-mock i { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #7C5CFF var(--w), #E6E9E4 var(--w)); }
  .cr-mock em { font-style: normal; text-align: center; padding: 10px; border-radius: 10px; background: #0BC284; color: #04140D; font-weight: 800; font-size: 13px; }

  .cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
  .cr-card { display: grid; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); overflow: hidden; color: inherit; text-decoration: none; transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .cr-card:hover { box-shadow: var(--e2); transform: translateY(-2px); }
  .cr-card-art { position: relative; height: 150px; display: grid; place-items: center; color: #fff; }
  .cr-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .cr-card-art > svg { width: 38px; height: 38px; }
  .cr-card-state { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: rgb(255 255 255 / .9); color: #101512; font-size: 11.5px; font-weight: 700; }
  .cr-card-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
  .cr-card-body > b { font-family: var(--font-display); font-size: 1.08rem; color: var(--ink); }
  .cr-card-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
  .cr-card-stats b { color: var(--ink); }

  .cr-builder { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .cr-builder { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } .cr-editor { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); } }
  .cr-lessons { display: grid; }
  .cr-section { margin: 0; padding: 12px 18px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); border-top: 1px solid var(--line); }
  .cr-lesson { display: flex; align-items: center; border-top: 1px solid var(--line); }
  .cr-lesson.is-selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
  .cr-lesson-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; background: none; border: 0; text-align: left; color: inherit; }
  .cr-lesson-main > .grow { display: grid; }
  .cr-lesson-main b { color: var(--ink); font-size: 14px; }
  .cr-lesson-main small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
  .cr-lesson-main small svg { width: 13px; height: 13px; }
  .cr-lesson-n { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-sunken); font-weight: 800; font-size: 12.5px; color: var(--ink); }
  .cr-lesson.is-selected .cr-lesson-n { background: var(--ink); color: var(--text-on-ink); }
  .cr-lesson-tools { display: flex; padding-right: 8px; opacity: .6; } .cr-lesson:hover .cr-lesson-tools { opacity: 1; }
  .cr-lesson-tools .icon-btn { width: 30px; height: 30px; }
  .cr-pill { display: inline-flex; height: 18px; padding: 0 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 11px; align-items: center; }
  .cr-pill.is-drip { background: var(--assist-soft); color: var(--assist-text); }
  .cr-add { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--hatch), var(--surface-2); }
  .cr-add .input { flex: 1; }
  .cr-video { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; }
  .cr-video iframe { width: 100%; height: 100%; border: 0; }
  .cr-invite { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
  @media (max-width: 720px) { .cr-invite { grid-template-columns: minmax(0, 1fr); } }
  .cr-student.is-revoked { opacity: .6; }
  .cr-progress { width: 90px; height: 7px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; flex: none; }
  .cr-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-500), var(--emerald-500)); border-radius: inherit; }
  .cr-pct { width: 42px; text-align: right; font-weight: 700; font-size: 13px; color: var(--ink); flex: none; }
  @media (max-width: 560px) { .cr-progress { display: none; } }

  /* Course depth (ADR-0041): lesson kinds, quiz and assignment settings, question bank, handed-in work, discussion,
     certificate designer and instructors ------------------------------------------------------------------------ */
  .cr-editor .card-body > *, .cr-quiz > * { min-width: 0; }
  .cr-qlist { grid-template-columns: minmax(0, 1fr); } .cr-qlist li, .cr-qlist li > .grow { min-width: 0; }
  .cr-add-kind { width: auto; flex: none; max-width: 140px; }
  @media (max-width: 520px) { .cr-add { flex-wrap: wrap; } .cr-add-kind { max-width: none; flex: 1 1 100%; } }
  .cr-lesson-n svg { width: 14px; height: 14px; }
  .cr-lesson-n.is-quiz { background: var(--violet-100, #EDE7FF); color: var(--violet-600, #5B3FE0); }
  .cr-lesson-n.is-assignment { background: var(--amber-100, #FEF3C7); color: var(--amber-700, #B45309); }
  .cr-pill.is-quiz { background: var(--violet-100, #EDE7FF); color: var(--violet-700, #4B2FC7); }
  .cr-pill.is-assignment { background: var(--amber-100, #FEF3C7); color: var(--amber-800, #92400E); }
  .cr-quiz { display: grid; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--hatch), var(--surface-2); border: 1px solid var(--line); }
  .cr-quiz-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
  .cr-quiz-head b { color: var(--ink); }
  .cr-quiz-label { margin: 4px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); display: flex; gap: 6px; }
  .cr-quiz-label span { color: var(--ink); }
  .cr-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: cq; }
  .cr-qlist li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 4px 4px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
  .cr-qlist:not(.is-bank) li:not(.muted)::before { counter-increment: cq; content: counter(cq); font-weight: 800; font-size: 12px; color: var(--text-subtle); width: 14px; }
  .cr-qlist.is-bank li { background: transparent; border-style: dashed; }
  .cr-qlist li.muted { border-style: dashed; background: transparent; padding: 10px 12px; }
  .cr-q-type { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--text-subtle); width: 92px; }
  @media (max-width: 520px) { .cr-q-type { display: none; } }

  .qb-list { display: grid; }
  .qb-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-top: 1px solid var(--line); }
  .qb-n { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--violet-100, #EDE7FF); color: var(--violet-700, #4B2FC7); font-weight: 800; font-size: 12.5px; }
  .qb-prompt { margin: 0 0 6px; color: var(--ink); font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
  .qb-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
  .qb-answer { display: inline-flex; align-items: center; gap: 4px; color: var(--emerald-700, #047857); font-weight: 600; min-width: 0; }
  .qb-answer svg { width: 13px; height: 13px; flex: none; }
  .qb-types { flex-wrap: wrap; }
  .qb-options { display: grid; gap: 8px; }
  .qb-option { display: flex; gap: 8px; align-items: center; }
  .qb-option .input { flex: 1; }
  .qb-mark { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1.5px solid var(--line-strong, var(--line)); color: transparent; cursor: pointer; transition: all var(--t-fast); }
  .qb-mark input { position: absolute; opacity: 0; pointer-events: none; }
  .qb-mark svg { width: 16px; height: 16px; }
  .qb-option.is-right .qb-mark { background: var(--emerald-500, #10B981); border-color: var(--emerald-500, #10B981); color: #fff; }
  .qb-mark:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

  .wq-row { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; }
  .wq-row:hover { background: var(--surface-2); }
  .wq-row small svg { width: 12px; height: 12px; vertical-align: -1px; }
  .wq-status { flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-sunken); color: var(--text-muted); }
  .wq-status.is-submitted { background: var(--violet-100, #EDE7FF); color: var(--violet-700, #4B2FC7); }
  .wq-status.is-changes_requested { background: var(--amber-100, #FEF3C7); color: var(--amber-800, #92400E); }
  .wq-status.is-approved { background: var(--emerald-100, #D1FAE5); color: var(--emerald-800, #065F46); }
  .wq-body { padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; color: var(--ink); max-height: 42vh; overflow: auto; }
  .wq-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; }
  .wq-file:hover { border-color: var(--accent); }
  .wq-file > span { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); }
  .wq-file b { flex: 1; min-width: 0; font-size: 14px; }
  .wq-file small { color: var(--text-muted); flex: none; }
  .wq-file svg { width: 16px; height: 16px; flex: none; }

  .dc-switch.is-on { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
  .dc-threads { display: grid; gap: 12px; }
  .dc-thread { padding: 4px 0; overflow: hidden; }
  .dc-thread.is-hidden > .dc-c:first-child, .dc-c.is-hidden { opacity: .55; }
  .dc-c { padding: 14px 18px; }
  .dc-c header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
  .dc-c header b { color: var(--ink); }
  .dc-c header small { color: var(--text-muted); font-size: 12px; }
  .dc-c p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--text); font-size: 14.5px; line-height: 1.55; }
  .dc-c.is-reply { margin: 0 18px 10px clamp(18px, 4vw, 44px); padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
  .dc-c.is-team { box-shadow: inset 3px 0 0 var(--accent); }
  .dc-tools { display: flex; gap: 4px; margin: 6px 0 0 -8px; }
  .dc-reply { display: grid; gap: 8px; padding: 0 18px 16px clamp(18px, 4vw, 44px); }

  .cd-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .cd-layout { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } .cd-preview-wrap { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); } }
  .cd-controls { margin: 0; min-width: 0; }
  .cd-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .cd-style { display: grid; gap: 6px; justify-items: center; font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
  .cd-style.is-on { color: var(--ink); }
  .cd-thumb { width: 100%; aspect-ratio: 1.414; border-radius: 8px; background: #fff; border: 1.5px solid var(--line); display: grid; align-content: center; justify-items: center; gap: 5px; position: relative; overflow: hidden; }
  .cd-style.is-on .cd-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .cd-thumb i { display: block; height: 4px; border-radius: 4px; background: #D8DDD9; width: 50%; }
  .cd-thumb i:nth-child(2) { width: 70%; height: 6px; background: #14201A; }
  .cd-thumb-classic { outline: 2px solid var(--cert-accent); outline-offset: -6px; }
  .cd-thumb-modern { justify-items: start; padding-left: 20%; }
  .cd-thumb-modern::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 9%; background: var(--cert-accent); }
  .cd-thumb-minimal i:first-child { background: var(--cert-accent); width: 18%; }
  .cd-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
  .cd-swatch { width: 32px; height: 32px; border-radius: 99px; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1); transition: transform var(--t-fast); }
  .cd-swatch.is-on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sw); transform: scale(1.05); }
  .cd-swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
  .cd-preview-label { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
  .cd-preview { --cert-accent: #7C5CFF; aspect-ratio: 1.414; background: #fff; border-radius: 14px; box-shadow: var(--e3); padding: clamp(10px, 2vw, 20px); color: #14201A; font-family: Georgia, 'Times New Roman', serif; position: relative; overflow: hidden; container-type: inline-size; transition: opacity var(--t-fast); }
  .cd-preview.is-refreshing { opacity: .6; }
  .cd-inner { height: 100%; display: grid; align-content: center; justify-items: center; text-align: center; gap: 2px; padding: 4%; border-radius: 8px; }
  .cd-classic .cd-inner { border: 2px solid color-mix(in oklab, var(--cert-accent) 45%, #D9CFB0); outline: 1px solid color-mix(in oklab, var(--cert-accent) 45%, #D9CFB0); outline-offset: -8px; }
  .cd-modern { font-family: var(--font-body, system-ui), sans-serif; }
  .cd-modern::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2.4cqw; background: var(--cert-accent); }
  .cd-modern .cd-inner { justify-items: start; text-align: left; padding-left: 9%; }
  .cd-modern .cd-heading { font-weight: 800; letter-spacing: -0.02em; }
  .cd-modern .cd-name { font-weight: 800; border-bottom: 3px solid var(--cert-accent); padding-left: 0; }
  .cd-modern .cd-meta { justify-content: flex-start; }
  .cd-minimal .cd-heading::before { content: ''; display: block; width: 8cqw; height: 3px; margin: 0 auto 2cqw; background: var(--cert-accent); border-radius: 3px; }
  .cd-minimal .cd-name { border-bottom: 0; }
  .cd-logo { max-height: 5cqw; max-width: 30%; object-fit: contain; margin-bottom: 1cqw; }
  .cd-org { margin: 0; font-family: system-ui, sans-serif; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 1.4cqw; color: var(--cert-accent); }
  .cd-heading { margin: .6cqw 0 1.6cqw; font-size: 3.4cqw; }
  .cd-small { margin: 0; font-style: italic; color: #56655E; font-size: 1.6cqw; }
  .cd-name { margin: .6cqw 0; font-size: 5.4cqw; border-bottom: 1px solid #D9CFB0; padding: 0 5% .6cqw; line-height: 1.15; }
  .cd-course { margin: .6cqw 0 2cqw; font-size: 2.8cqw; font-weight: 700; }
  .cd-meta { display: flex; gap: 4cqw; flex-wrap: wrap; justify-content: center; font-family: system-ui, sans-serif; }
  .cd-meta span { display: grid; } .cd-meta small { font-size: 1.2cqw; color: #8A9690; text-transform: uppercase; letter-spacing: .08em; } .cd-meta b { font-size: 1.6cqw; }
  .cd-sign { justify-items: center; } .cd-modern .cd-sign { justify-items: start; }
  .cd-sign i { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 2.8cqw; line-height: 1; border-bottom: 1px solid #C9CFCB; padding: 0 1.2cqw 2px; }

  .in-list { display: grid; }
  .in-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 18px; border-top: 1px solid var(--line); }
  .in-photo { flex: none; width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center; background: var(--violet-100, #EDE7FF) center / cover no-repeat; color: var(--violet-700, #4B2FC7); font-weight: 800; }
  .in-photo.is-lg { width: 72px; height: 72px; font-size: 24px; } .in-photo.is-lg svg { width: 28px; height: 28px; }
  .in-photo-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
  .in-empty { margin: 0; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
}

/* css/components/community.css */
/* Community (ADR-0024) ---------------------------------------------------------------------------------------------- */
@layer components {
  .cm-hero { padding: clamp(24px, 4vw, 44px); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); overflow: hidden; margin-bottom: 24px; }
  @media (min-width: 980px) { .cm-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
  .cm-hero h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; line-height: 1.05; margin: 14px 0 10px; }
  .cm-hero h2 em.accent { color: #FFB3CF; font-style: italic; }
  .cm-hero p { color: rgb(255 255 255 / .8); max-width: 54ch; }
  .cm-hero-art { display: grid; place-items: center; }
  .cm-mock { width: min(320px, 92%); padding: 12px; border-radius: 20px; background: #fff; color: #101512; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5); transform: rotate(-2deg); display: grid; gap: 8px; }
  .cm-mock-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; column-gap: 10px; padding: 10px; border-radius: 12px; background: #F4F6F3; font-size: 13px; }
  .cm-mock-row i { grid-row: span 2; width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: linear-gradient(145deg, #FF7AA8, #8468FF); }
  .cm-mock-row:first-child i { background: linear-gradient(145deg, #1F2925, #5B3BE8); }
  .cm-mock-row small { grid-column: 2; color: #6B776F; font-size: 11.5px; }
  .cm-mock-row em { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; color: #fff; background: #1F2925; }
  .cm-card-flag { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 800; }
  .cm-card-flag svg { width: 12px; height: 12px; }

  .cmm-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .cmm-layout { grid-template-columns: minmax(0, 1fr) 300px; } .cmm-layout > aside { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); } }
  .cmm-compose-head { display: flex; gap: 10px; align-items: center; }
  .cmm-compose-head > div { display: grid; }
  .cmm-av { width: 36px; height: 36px; flex: none; border-radius: 99px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink); background: color-mix(in oklab, var(--accent) 16%, var(--surface)); }
  .cmm-av.is-team { color: #fff; background: linear-gradient(145deg, #1F2925, #5B3BE8); }
  .cmm-av-sm { width: 28px; height: 28px; font-size: 12px; }
  .cmm-filter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cmm-post.is-hidden { opacity: .65; border-style: dashed; }
  .cmm-post-head { display: flex; gap: 10px; align-items: center; }
  .cmm-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .cmm-meta b { color: var(--ink); }
  .cmm-meta .badge svg { width: 11px; height: 11px; }
  .cmm-post-title { margin: 12px 0 0; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -0.02em; color: var(--ink); }
  .cmm-text { font-size: var(--fs-body, 15px); line-height: 1.6; overflow-wrap: anywhere; margin-top: 6px; }
  .cmm-text p { margin: 0 0 6px; } .cmm-text h2 { font-size: 1rem; margin: 10px 0 4px; } .cmm-text ul { margin: 0 0 6px; padding-left: 20px; }
  .cmm-post-foot { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-muted); }
  .cmm-post-foot > span, .cmm-link { display: inline-flex; align-items: center; gap: 6px; }
  .cmm-post-foot svg { width: 15px; height: 15px; }
  .cmm-link { font: inherit; font-weight: 600; color: var(--text-muted); background: none; border: 0; padding: 0; cursor: pointer; }
  .cmm-link:hover { color: var(--ink); }
  .cmm-comments { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border-radius: var(--r-lg); background: var(--surface-2, color-mix(in oklab, var(--ink) 3%, var(--surface))); }
  .cmm-comment { display: flex; gap: 10px; align-items: flex-start; }
  .cmm-comment.is-hidden { opacity: .6; }
  .cmm-comment .cmm-text { margin-top: 2px; font-size: 14px; }
  .cmm-reply { display: grid; gap: 8px; margin-top: 4px; }
  .cmm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cmm-stats span { display: grid; padding: 10px; border-radius: var(--r-md); background: color-mix(in oklab, var(--ink) 4%, transparent); }
  .cmm-stats b { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
  .cmm-stats small { font-size: 12px; color: var(--text-muted); }
  .cmm-stats .is-alert b { color: var(--danger); }
  .tab-count.is-alert { background: var(--danger); color: #fff; }

  .cmm-spaces { display: grid; }
  .cmm-space { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
  .cmm-space-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--accent-text, var(--ink)); }
  .cmm-space-icon svg { width: 17px; height: 17px; }
  .cmm-space-fields { flex: 1; min-width: 0; display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
  .cmm-space-fields > .input:first-child { font-weight: 700; }
  .cmm-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
  .cmm-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
  .cmm-space-tools { display: flex; gap: 2px; }
  .cmm-report { align-items: flex-start; }
  .cmm-report-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
  .cmm-report-icon svg { width: 15px; height: 15px; }
  .cmm-quote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--line-strong); color: var(--text-muted); font-size: 13.5px; white-space: pre-line; }
}

/* css/components/ai.css */
/* AI gateway: console and workspace settings (ADR-0025) ---------------------------------------------------------- */
@layer components {
  .ai-picks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
  .ai-prices { display: grid; grid-template-columns: minmax(90px, auto) 1fr 1fr; gap: 8px 12px; align-items: center; max-width: 460px; }
  .ai-set { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .ai-set { grid-template-columns: minmax(0, 1fr) 320px; } .ai-set > aside { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); } }
  .ai-tones { display: flex; flex-wrap: wrap; gap: 6px; }
  .ai-tones .chip { cursor: pointer; }
  .card.is-muted { opacity: .6; }
  .ai-credits { background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
  .ai-credits-n { margin: 0; font-family: var(--font-display); font-size: 2rem; letter-spacing: -0.03em; color: var(--ink); }
  .ai-credits-n small { font-family: var(--font-sans, inherit); font-size: 13px; letter-spacing: 0; color: var(--text-muted); font-weight: 500; }
  .ai-meter { height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
  .ai-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8468FF, var(--accent)); }
  .ai-meter.is-low span { background: var(--danger); }
}

/* Write with AI (ADR-0043) ---------------------------------------------------------------------------------------- */
@layer components {
  .aid-brief, .aid-result { display: grid; gap: 14px; }
  .aid-wrap { flex-wrap: wrap; }
  .aid-meta { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
  .aid-meta svg { width: 14px; height: 14px; color: var(--violet-500, #7C5CFF); flex: none; }
  .aid-label { margin: 4px 0 -6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .aid-picks { display: grid; gap: 6px; }
  .aid-pick { display: block; padding: 11px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; color: var(--ink); transition: border-color var(--t-fast), background var(--t-fast); }
  .aid-pick.is-on { border-color: var(--violet-500, #7C5CFF); background: color-mix(in oklab, var(--violet-500, #7C5CFF) 8%, var(--surface)); }
  .aid-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .aid-pre, .aid-tag { margin: 0; font-weight: 600; color: var(--ink); }
  .aid-pre { font-weight: 500; color: var(--text-muted); }
  .aid-doc { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); max-height: 44vh; overflow: auto; display: grid; gap: 10px; }
  .aid-doc h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }
  .aid-doc p { margin: 0; white-space: pre-line; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
  .aid-btn { justify-self: start; display: inline-flex; padding: 8px 16px; border-radius: 99px; background: var(--ink); color: var(--text-on-ink); font-weight: 700; font-size: 13.5px; }
  .aid-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
  .aid-lessons, .aid-quiz { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow: auto; counter-reset: al; }
  .aid-lessons li:not(.aid-sec) { counter-increment: al; padding: 10px 12px 10px 42px; border-radius: var(--r-md); background: var(--surface-2); position: relative; }
  .aid-lessons li:not(.aid-sec)::before { content: counter(al); position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-sunken); font-size: 11.5px; font-weight: 800; }
  .aid-lessons b, .aid-quiz b { display: block; color: var(--ink); font-size: 14px; }
  .aid-lessons small, .aid-quiz small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
  .aid-sec { margin-top: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .aid-quiz li { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
  .aid-opt { display: inline-flex; margin: 6px 6px 0 0; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-muted); }
  .aid-opt.is-right { border-color: var(--emerald-500, #10B981); background: color-mix(in oklab, var(--emerald-500, #10B981) 12%, var(--surface)); color: var(--ink); font-weight: 600; }
}

/* Assist copilot and insights (ADR-0044) ------------------------------------------------------------------------- */
@layer components {
  @media (max-width: 640px) { .assist-pill { padding: 0 12px; } }
  .cop { width: min(460px, calc(100vw - 16px)); }
  .cop-head { align-items: center; }
  .cop-mark { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #9A83FF, #7C5CFF 50%, #5B3BE8); box-shadow: 0 10px 22px -12px rgb(124 92 255 / .9); }
  .cop-mark svg { width: 18px; height: 18px; }
  .cop-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
  .cop-intro { display: grid; gap: 14px; }
  .cop-hello { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.5; }
  .cop-starters { display: flex; flex-wrap: wrap; gap: 8px; }
  .cop-chip { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
  .cop-chip:hover { border-color: #9A83FF; background: color-mix(in oklab, #7C5CFF 6%, var(--surface)); }
  .cop-design { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--hatch), var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
  .cop-design span { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); flex: none; }
  .cop-design b { flex: 1; font-size: 14px; }
  .cop-design svg { width: 16px; height: 16px; }
  .cop-q { align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--text-on-ink); font-size: 14.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
  .cop-a { align-self: stretch; display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); }
  .cop-text { font-size: 14.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
  .cop-text p { margin: 0 0 8px; } .cop-text p:last-child { margin-bottom: 0; }
  .cop-text ul { margin: 4px 0 8px; padding-left: 18px; }
  .cop-text b { color: var(--ink); }
  .cop-links { display: flex; flex-wrap: wrap; gap: 6px; }
  .cop-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
  .cop-link:hover { border-color: #9A83FF; }
  .cop-link svg { width: 13px; height: 13px; }
  .cop-link.is-guide { font-weight: 500; }
  .cop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .cop-foot small { color: var(--text-subtle); font-size: 11.5px; }
  .cop-foot .icon-btn { width: 28px; height: 28px; } .cop-foot .icon-btn svg { width: 14px; height: 14px; }
  .cop-thinking { align-self: flex-start; gap: 5px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
  .cop-thinking span { width: 7px; height: 7px; border-radius: 99px; background: #9A83FF; animation: cop-dot 1s infinite ease-in-out; }
  .cop-thinking span:nth-child(2) { animation-delay: .15s; } .cop-thinking span:nth-child(3) { animation-delay: .3s; }
  @keyframes cop-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
  @media (prefers-reduced-motion: reduce) { .cop-thinking span { animation: none; } }
  .cop-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
  .cop-ask textarea { resize: none; min-height: 44px; max-height: 140px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-size: 14.5px; color: var(--ink); field-sizing: content; }
  .cop-ask textarea:focus { outline: 2px solid #9A83FF; outline-offset: 0; }
  .cop-ask .btn { width: 44px; height: 44px; border-radius: 14px; }

  .ins-card { overflow: hidden; }
  .ins-grid { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 960px) { .ins-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .ins-exp { border-left: 1px solid var(--line); } }
  .ins-col { padding: 16px 20px 20px; display: grid; gap: 12px; align-content: start; }
  .ins-exp { background: var(--hatch), var(--surface-2); }
  .ins-label { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .ins-obs { display: flex; gap: 12px; align-items: flex-start; }
  .ins-trend { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); }
  .ins-trend svg { width: 15px; height: 15px; }
  .ins-trend.is-up { background: var(--emerald-100, #D1FAE5); color: var(--emerald-700, #047857); }
  .ins-trend.is-down { background: #FEE2E2; color: #B91C1C; }
  .ins-obs b, .ins-x b { display: block; color: var(--ink); font-size: 14px; }
  .ins-obs p, .ins-x p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
  .ins-x { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
  .ins-x a { justify-self: start; font-size: 13px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
  .ins-x a svg { width: 13px; height: 13px; }
  .ins-empty { padding: 20px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}

/* Automation drafts (ADR-0045) */
@layer components {
  .aid-flow { display: grid; gap: 8px; max-height: 50vh; overflow: auto; padding: 2px; }
  .aid-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .aid-step > span { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--text-muted); }
  .aid-step > span svg { width: 15px; height: 15px; }
  .aid-step > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
  .aid-step b { color: var(--ink); font-size: 14px; }
  .aid-step small { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
  .aid-step.is-trigger { background: color-mix(in oklab, #7C5CFF 8%, var(--surface)); border-color: color-mix(in oklab, #7C5CFF 35%, var(--line)); }
  .aid-step.is-trigger > span { background: #7C5CFF; color: #fff; }
  .aid-branch { margin-top: 6px; padding: 8px 0 0 12px; border-left: 2px solid var(--emerald-500, #10B981); display: grid; gap: 6px; }
  .aid-branch.is-no { border-left-color: #F59E0B; }
  .aid-branch > p { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); }
  .tpl-card.is-describe { border-style: dashed; border-color: color-mix(in oklab, #7C5CFF 45%, var(--line)); }
}

/* css/components/workspace.css */
/* Wave F2 (ADR-0027): activity log, role matrix, action center, account data ---------------------------------- */
@layer components {
  /* Settings → Activity */
  .act-head { flex-wrap: wrap; gap: 14px; }
  .act-filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .act-filters .select { width: auto; min-width: 150px; }
  .act-body { transition: opacity .2s var(--ease-out, ease); }
  .act-body { position: relative; }
  .act-day { padding: 6px 20px 14px; border-top: 1px solid var(--line); }
  .act-day-label { position: sticky; top: 0; z-index: 1; margin: 0; padding: 12px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); background: var(--surface); }
  .act-list { list-style: none; margin: 0; padding: 0; position: relative; }
  .act-list::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
  .act-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
  .act-icon { position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--line); }
  .act-icon svg { width: 17px; height: 17px; }
  .act-icon.is-team { background: color-mix(in oklab, var(--chart-1) 14%, var(--surface)); color: var(--chart-1); }
  .act-icon.is-presence { background: color-mix(in oklab, var(--chart-2) 14%, var(--surface)); color: var(--chart-2); }
  .act-icon.is-audience { background: color-mix(in oklab, var(--chart-3) 14%, var(--surface)); color: var(--chart-3); }
  .act-icon.is-sales { background: color-mix(in oklab, var(--chart-4) 16%, var(--surface)); color: var(--chart-4); }
  .act-icon.is-programmes { background: color-mix(in oklab, var(--chart-5) 14%, var(--surface)); color: var(--chart-5); }
  .act-icon.is-messaging { background: color-mix(in oklab, var(--chart-6) 14%, var(--surface)); color: var(--chart-6); }
  .act-icon.is-weesify { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .act-line { display: block; color: var(--text-muted); font-size: var(--fs-small); line-height: 1.4; overflow-wrap: anywhere; }
  .act-line b { color: var(--ink); font-weight: 650; }
  .act-meta { display: block; font-size: 12px; color: var(--text-subtle); margin-top: 1px; }
  .act-detail { color: var(--text-muted); font-weight: 600; }

  /* Members → What each role can do */
  .role-matrix-summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
  .role-matrix-summary::-webkit-details-marker { display: none; }
  .role-matrix-card[open] .role-matrix-summary > svg { transform: rotate(180deg); }
  .role-matrix-summary > svg { transition: transform .2s var(--ease-out, ease); color: var(--text-subtle); }
  .role-matrix-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
  .role-matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-small); min-width: 640px; }
  .role-matrix th, .role-matrix td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .role-matrix thead th { font-size: 12px; font-weight: 700; color: var(--text-subtle); letter-spacing: .04em; text-transform: uppercase; background: var(--surface-2); }
  .role-matrix tbody th { color: var(--ink); font-weight: 600; position: sticky; left: 0; background: var(--surface); }
  .rm-level { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12.5px; padding: 3px 9px; border-radius: 99px; }
  .rm-level.is-full { background: color-mix(in oklab, var(--success) 14%, transparent); color: color-mix(in oklab, var(--success) 70%, var(--ink)); }
  .rm-level.is-some { background: var(--accent-soft); color: var(--accent-text); }
  .rm-level.is-view { background: var(--surface-2); color: var(--text-muted); }
  .rm-level.is-none { color: var(--text-subtle); padding-left: 12px; }

  @media (max-width: 640px) {
    .act-filters { width: 100%; }
    .act-filters .select { flex: 1 1 140px; min-width: 0; }
    .act-day { padding: 4px 14px 12px; }
  }
}

/* Home → Needs you (action center) */
@layer components {
  .needs-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 6px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--text-on-ink); vertical-align: 2px; }
  .next-action { position: relative; }
  .next-action.is-urgent { border-color: color-mix(in oklab, var(--danger) 35%, var(--line)); background: color-mix(in oklab, var(--danger) 6%, var(--surface)); }
  .next-action.is-urgent .next-action-icon { background: color-mix(in oklab, var(--danger) 14%, var(--surface)); color: var(--danger); }
  .next-action.is-todo .next-action-icon { background: var(--accent-soft); color: var(--accent-text); }
  .next-action-cta { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--ink); padding: 6px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); transition: all var(--t-fast); }
  .next-action:hover .next-action-cta { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .next-action.is-urgent .next-action-cta { background: var(--danger); color: #fff; border-color: transparent; }
  .needs-clear { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: color-mix(in oklab, var(--success) 8%, var(--surface)); border: 1px dashed color-mix(in oklab, var(--success) 35%, var(--line)); }
  .needs-clear b { color: var(--ink); font-size: var(--fs-small); }
  .needs-clear-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklab, var(--success) 16%, var(--surface)); color: var(--success); flex: none; }
  .needs-clear-icon svg { width: 18px; height: 18px; }
  @media (max-width: 480px) { .next-action-cta { display: none; } }
}

/* Account → Your data */
@layer components {
  .data-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
  .data-badge svg { width: 19px; height: 19px; }
  .data-badge.is-danger { background: var(--danger-soft); color: var(--danger); }
  .data-includes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
  .data-includes li { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-small); color: var(--ink); font-weight: 550; }
  .data-includes svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
  .data-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
  .data-row .field { min-width: 220px; }
  .danger-zone { border-color: color-mix(in oklab, var(--danger) 30%, var(--line)); }
  .close-plan { display: grid; gap: 10px; }
  .close-plan-group { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
  .close-plan-group b { color: var(--ink); font-size: var(--fs-small); }
  .close-plan-group ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .close-plan-group li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink); }
  .close-plan-group li svg { width: 14px; height: 14px; color: var(--text-muted); }
  .close-blockers { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-small); color: var(--text-muted); }
  .callout.is-warning { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 35%, transparent); }
  .callout.is-warning > svg { color: var(--warning); }
}
@layer components {
  .needs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
  .needs-grid > .needs-clear { grid-column: 1 / -1; }
  .needs-card { container-type: inline-size; }
  @container (max-width: 460px) { .next-action-cta .cta-t { display: none; } .next-action-cta { padding: 7px; } }
}

/* Media library (ADR-0028) */
@layer components {
  .media-split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .media-split.has-open { grid-template-columns: minmax(0, 1fr) 360px; } .media-detail { position: sticky; top: 88px; } }
  .media-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .media-tile { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); }
  .media-tile:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: var(--line-strong); }
  .media-tile.is-open { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
  .media-thumb { aspect-ratio: 4 / 3; display: block; background-color: var(--surface-2); background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%), linear-gradient(-45deg, var(--line) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--line) 75%), linear-gradient(-45deg, transparent 75%, var(--line) 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
  .media-thumb { position: relative; min-height: 0; overflow: hidden; flex: none; }
  .media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
  .media-meta { display: grid; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
  .media-meta b { color: var(--ink); font-size: 13px; font-weight: 650; }
  .media-meta small { color: var(--text-subtle); font-size: 12px; }
  .media-use { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgb(0 0 0 / .55); color: #fff; backdrop-filter: blur(6px); }
  .media-use.is-used { background: color-mix(in oklab, var(--success) 88%, black); }
  .media-detail { overflow: hidden; }
  .media-detail-img { background: var(--surface-2); display: grid; place-items: center; max-height: 300px; border-bottom: 1px solid var(--line); }
  .media-detail-img img { max-width: 100%; max-height: 300px; object-fit: contain; display: block; }
  .dl-compact { grid-template-columns: 70px 1fr; row-gap: 4px; font-size: var(--fs-small); }
  .media-used-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); font-size: var(--fs-small); min-width: 0; }
  .media-used-row:hover { background: var(--surface-2); }
  @media (max-width: 1099px) { .media-split.has-open > div:first-child { display: none; } }
}
@layer components {
  .picker-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 56vh; overflow: auto; }
  .picker-tile { display: grid; gap: 6px; width: 100%; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; text-align: left; color: var(--text-muted); font-size: 12px; transition: border-color var(--t-fast), transform var(--t-fast); }
  .picker-tile:hover, .picker-tile:focus-visible { border-color: var(--ink); transform: translateY(-1px); }
  .picker-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: block; }
}
@layer components {
  .brand-apply { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px dashed color-mix(in oklab, var(--assist, #7C5CFF) 45%, var(--line)); background: color-mix(in oklab, var(--assist, #7C5CFF) 6%, var(--surface)); text-align: left; font: inherit; color: var(--text-muted); cursor: pointer; transition: all var(--t-fast); }
  .brand-apply:hover { border-style: solid; transform: translateY(-1px); box-shadow: var(--e1); }
  .brand-apply b { display: block; color: var(--ink); font-size: 13px; }
  .brand-apply small { display: block; font-size: 12px; line-height: 1.35; }
  .brand-apply-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--assist-soft); color: var(--assist-text); }
  .brand-apply-icon svg { width: 16px; height: 16px; }
}

/* Settings → Brand (ADR-0028) */
@layer components {
  .brand-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .brand-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); } .brand-preview { position: sticky; top: 88px; } }
  .brand-logo-preview img { object-fit: contain; padding: 6px; }
  .brand-preview { display: grid; gap: 14px; }
  .brand-page { border-radius: 26px; overflow: hidden; background: var(--site-bg); color: var(--site-text); font-family: var(--site-font); box-shadow: var(--e2); border: 1px solid var(--line); }
  .brand-page-cover { height: 86px; background: var(--site-cover, var(--site-accent)); }
  .brand-page-cover[style*="none"] { background: var(--site-accent); }
  .brand-page-body { display: grid; justify-items: center; gap: 8px; padding: 0 22px 24px; text-align: center; }
  .brand-page-avatar { width: 64px; height: 64px; margin-top: -32px; border-radius: 22px; display: grid; place-items: center; background: var(--site-surface); border: 3px solid var(--site-bg-base); font-family: var(--site-heading); font-weight: 800; font-size: 26px; color: var(--site-accent); overflow: hidden; }
  .brand-page-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
  .brand-page h3 { margin: 4px 0 0; font-family: var(--site-heading); font-size: 22px; letter-spacing: -.02em; color: var(--site-text); }
  .brand-page p { margin: 0 0 6px; color: var(--site-muted); font-size: 13.5px; }
  .brand-page-btn { width: 100%; padding: 12px; border-radius: var(--site-radius); background: var(--site-btn-bg); color: var(--site-btn-text); font-weight: 650; font-size: 14px; }
  .brand-page-btn.is-soft { background: var(--site-surface); color: var(--site-text); border: 1px solid color-mix(in oklab, var(--site-text) 12%, transparent); }
  .brand-email { padding: 18px; border-radius: 22px; background: var(--em-bg); border: 1px solid var(--line); }
  .brand-email-card { background: var(--em-card); border-radius: 14px; padding: 20px; display: grid; gap: 8px; justify-items: start; color: #1d2320; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
  .brand-email-logo { max-height: 34px; max-width: 160px; object-fit: contain; }
  .brand-email-name { font-size: 15px; }
  .brand-email h4 { margin: 6px 0 0; font-size: 20px; font-family: inherit; }
  .brand-email p { margin: 0; font-size: 13.5px; color: #55605a; }
  .brand-email-btn { margin-top: 6px; padding: 10px 16px; border-radius: 10px; background: var(--em-accent); color: var(--em-accent-text, #fff); font-weight: 650; font-size: 13.5px; }
}
@layer components {
  .saved-list { display: grid; gap: 8px; }
  .saved-row { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
  .saved-row.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .saved-pick { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--text-muted); min-width: 0; border-radius: 12px; }
  .saved-pick:hover { background: var(--surface-2); }
  .saved-pick b { display: block; color: var(--ink); font-size: 14px; }
  .saved-pick small { display: block; font-size: 12px; }
  .saved-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
  .saved-icon svg { width: 18px; height: 18px; }
}

/* What's new (ADR-0028) */
@layer components {
  .wn { position: relative; }
  .wn-btn { position: relative; }
  .wn-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 99px; background: var(--assist, #7C5CFF); box-shadow: 0 0 0 2px var(--surface); animation: wn-pulse 2.4s ease-in-out infinite; }
  @keyframes wn-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
  .wn-overlay { position: fixed; inset: 0; z-index: 80; background: rgb(8 10 9 / .28); backdrop-filter: blur(2px); animation: fade-in .2s ease both; }
  .wn-panel { position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 81; width: min(420px, calc(100vw - 20px)); display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e3); overflow: hidden; animation: wn-in .32s var(--ease-out, cubic-bezier(.2,.8,.2,1)) both; }
  @keyframes wn-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  .wn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 14px; background: radial-gradient(120% 120% at 100% 0%, color-mix(in oklab, var(--assist, #7C5CFF) 16%, transparent) 0%, transparent 60%); border-bottom: 1px solid var(--line); }
  .wn-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -.02em; color: var(--ink); }
  .wn-list { list-style: none; margin: 0; padding: 8px 22px; overflow-y: auto; flex: 1; }
  .wn-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .wn-item:last-child { border-bottom: 0; }
  .wn-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-subtle); font-weight: 600; }
  .wn-tag { padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
  .wn-tag.is-ai { background: var(--assist-soft); color: var(--assist-text); }
  .wn-tag.is-improved { background: var(--surface-2); color: var(--text-muted); }
  .wn-item h3 { margin: 8px 0 4px; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
  .wn-item p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
  .wn-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
  @media (prefers-reduced-motion: reduce) { .wn-dot, .wn-panel, .wn-overlay { animation: none; } }
}

/* F2c mobile polish (ADR-0029) */
@layer components {
  .sheet-handle { display: none; }
  @media (max-width: 640px) {
    .sheet-handle { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 10px auto 0; }
    .launcher-dialog .dialog-header { padding-top: 12px; }
    .launcher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .launcher-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; min-height: 104px; }
    .launcher-tile .launcher-desc, .launcher-tile .kbd { display: none; }
    .launcher-icon { width: 38px; height: 38px; border-radius: 11px; }
    .launcher-title { font-size: 14px; }
    .launcher-soon { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Scrollable tab rows say so: a soft fade on whichever edge has more. */
    .tabs.has-more-right { mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
    .tabs.has-more-left { mask-image: linear-gradient(90deg, transparent, #000 44px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); }
    .tabs.has-more-left.has-more-right { mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }

    /* Members: the invite form stacks. */
    .invite-row { flex-wrap: wrap; }
    .invite-row > .grow { flex: 1 1 100%; }
    .invite-row .select { flex: 1; width: auto !important; }

    /* The support notice collapses to one line. */
    .support-note { padding: 8px 12px; font-size: 13px; }
    .support-note .support-note-long { display: none; }

    /* Larger text: KPI footnotes wrap instead of pushing past the card. */
    .kpi-foot { flex-wrap: wrap; min-width: 0; }
    .kpi-foot > span { min-width: 0; overflow-wrap: anywhere; }
  }
}

/* F2c display & accessibility preferences (ADR-0029). Set per person in Account → Display, written on <html>. */
@layer components {
  /* Text size scales the whole interface the way browser zoom does, so px and rem sizes grow together. */
  html[data-text="large"] { zoom: 1.1; }
  html[data-text="larger"] { zoom: 1.22; }

  html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }

  html[data-contrast="high"] { --text: #111513; --text-muted: #3A423C; --text-subtle: #505A53; --line: #B9C0B8; --line-strong: #8C958D; }
  html[data-contrast="high"][data-theme="dark"] { --text: #F4F6F5; --text-muted: #C9D0CC; --text-subtle: #AAB3AE; --line: rgb(255 255 255 / .28); --line-strong: rgb(255 255 255 / .42); }
  html[data-contrast="high"] :focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 2px; }

  html[data-underline] main a:not(.btn):not(.menu-item):not(.nav-item):not(.tab):not(.card-link):not(.media-used-row),
  html[data-underline] .page-desc a, html[data-underline] .text-sm a { text-decoration: underline; text-underline-offset: 3px; }

  /* The display settings screen */
  .ds-grid { display: grid; gap: 16px; }
  .ds-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); }
  .ds-row:first-child { border-top: 0; }
  .ds-row .grow { min-width: 0; }
  .ds-row b { display: block; color: var(--ink); font-size: 14px; }
  .ds-row small { display: block; color: var(--text-muted); font-size: 13px; margin-top: 2px; }
  .ds-sample { padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .ds-sample h3 { margin-bottom: 4px; }
  .ds-sample p { color: var(--text-muted); }
  @media (max-width: 640px) {
    .ds-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
    .ds-row .segmented { width: 100%; display: flex; }
    .ds-row .segmented > button { flex: 1; }
  }
}

@layer components {
  .offline-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); }
  .offline-card { max-width: 420px; text-align: center; display: grid; gap: 12px; justify-items: center; }
  .offline-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-muted); }
  .offline-icon svg { width: 28px; height: 28px; }
  .offline-card p { color: var(--text-muted); }
}

/* Refreshing lists (ADR-0029): the old results dim and a thin shimmer runs along the top while new ones load. */
@layer components {
  .is-refreshing { position: relative; pointer-events: none; }
  .is-refreshing > * { opacity: .5; transition: opacity var(--t-fast); }
  .is-refreshing::before { content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 3px; border-radius: 99px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat;
    animation: refreshing 1s ease-in-out infinite; }
  @keyframes refreshing { from { background-position: -50% 0; } to { background-position: 150% 0; } }
  @media (prefers-reduced-motion: reduce) { .is-refreshing::before { animation: none; background: var(--accent); opacity: .5; } }
}

/* First-run tour (ADR-0029) */
@layer components {
  .tour-card { position: fixed; z-index: 55; right: 24px; bottom: 24px; width: min(360px, calc(100vw - 32px)); padding: 18px 18px 14px; border-radius: 20px;
    background: var(--ink); color: var(--text-on-ink); box-shadow: 0 24px 60px -20px rgb(8 12 10 / .55); outline: none; }
  .tour-head { display: flex; align-items: center; gap: 10px; }
  .tour-head .icon-btn { margin-left: auto; color: rgb(255 255 255 / .7); }
  .tour-head .icon-btn:hover { background: rgb(255 255 255 / .1); color: #fff; }
  .tour-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #C2F45B; color: #0B0F0D; }
  .tour-icon svg { width: 18px; height: 18px; }
  .tour-count { font-size: 12px; font-weight: 700; color: rgb(255 255 255 / .6); letter-spacing: .02em; }
  .tour-title { margin: 12px 0 4px; font-size: 18px; color: #fff; }
  .tour-text { font-size: 14px; line-height: 1.55; color: rgb(255 255 255 / .78); }
  .tour-foot { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
  .tour-foot .btn-ghost { color: rgb(255 255 255 / .8); }
  .tour-foot .btn-ghost:hover { background: rgb(255 255 255 / .1); color: #fff; }
  .tour-foot .btn-primary, .tour-foot .btn-primary:hover, .tour-foot .btn-primary:focus-visible { background: #C2F45B; color: #0B0F0D; border-color: transparent; }
  .tour-foot .btn-primary:hover { filter: brightness(1.06); }
  .tour-dots { display: flex; gap: 5px; }
  .tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: rgb(255 255 255 / .25); transition: width var(--t-fast), background var(--t-fast); }
  .tour-dots i.is-on { width: 18px; background: #C2F45B; }
  .tour-target { position: relative; z-index: 5; outline: 3px solid #C2F45B !important; outline-offset: 4px; border-radius: 14px; box-shadow: 0 0 0 9999px rgb(8 12 10 / .28); transition: box-shadow var(--t-base); }
  @media (max-width: 640px) {
    .tour-card { left: 12px; right: 12px; width: auto; bottom: calc(104px + env(safe-area-inset-bottom)); }
  }
}

/* Passkeys list (ADR-0030) */
@layer components {
  .pk-list { display: grid; gap: 8px; }
  .pk-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
  .pk-row small { display: block; font-size: 12.5px; }
  .pk-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
  .pk-icon svg { width: 18px; height: 18px; }
}

/* Leaving: exit survey and pause (ADR-0030) */
@layer components {
  .leave-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .leave-reason { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast); }
  .leave-reason:hover { border-color: var(--line-strong); }
  .leave-reason.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: 0 0 0 1px var(--accent) inset; }
  .leave-reason:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .leave-pause { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }
  .leave-pause .segmented { display: flex; } .leave-pause .segmented > button { flex: 1; }
  .leave-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
  @media (max-width: 640px) { .leave-reason { font-size: 13px; padding: 8px 10px; line-height: 1.3; } }
}

/* Domain DNS guidance (ADR-0031) */
@layer components {
  .dns-full { display: block; color: var(--text-subtle); font-size: 11px; margin-top: 2px; }
  .dns-diag { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in oklab, var(--warning, #D97706) 8%, var(--surface)); border: 1px solid color-mix(in oklab, var(--warning, #D97706) 30%, transparent); }
  .dns-diag-head { display: flex; align-items: center; gap: 8px; margin: 0; }
  .dns-diag-head svg { width: 16px; height: 16px; }
  .dns-steps { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
  .dns-steps li { font-size: 13.5px; line-height: 1.5; }
  .dns-steps li b { display: block; color: var(--ink); }
  .dns-steps li > span { display: block; color: var(--text-muted); overflow-wrap: anywhere; }
  .dns-steps .dns-fix { color: var(--ink); font-weight: 600; margin-top: 2px; }
  .dns-steps .dns-fix svg { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
  @media (max-width: 640px) {
    .dns-table thead { display: none; }
    .dns-table, .dns-table tbody, .dns-table tr, .dns-table td { display: block; width: 100%; }
    .dns-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .dns-table td { padding: 0 !important; border: 0 !important; }
    .dns-table td:nth-child(2) { grid-column: 2 / 4; }
    .dns-table td:nth-child(3) { grid-column: 1 / 3; word-break: break-all; }
    .dns-table td:nth-child(4) { grid-column: 3; grid-row: 2; }
  }
}

/* QR studio (ADR-0032) */
@layer components {
  .qr-campaigns { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
  .qr-camp { flex: 0 0 auto; min-width: 150px; max-width: 220px; display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .qr-camp:hover { border-color: var(--line-strong); }
  .qr-camp.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
  .qr-camp b { font-size: 14px; color: var(--ink); }
  .qr-camp small { font-size: 12px; color: var(--text-muted); }
  .qr-camp-bar { height: 4px; border-radius: 99px; background: var(--surface-sunken); margin-top: 6px; overflow: hidden; }
  .qr-camp-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
  .qr-layout { display: grid; gap: 18px; }
  .qr-layout.has-open { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  .qr-card { overflow: hidden; transition: box-shadow var(--t-fast), border-color var(--t-fast); }
  .qr-card.is-open { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .qr-card-art { display: grid; place-items: center; width: 100%; padding: 20px; background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), var(--surface-2)); border-bottom: 1px solid var(--line); cursor: pointer; }
  .qr-card-code { width: 128px; height: 128px; border-radius: 14px; overflow: hidden; box-shadow: var(--e2); background: #fff; transition: transform var(--t-base) var(--ease-out); }
  .qr-card-art:hover .qr-card-code { transform: scale(1.04) rotate(-1deg); }
  .qr-card-code svg { width: 100%; height: 100%; }
  .qr-card-body { display: grid; gap: 10px; padding: 14px 16px; }
  .qr-card-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .qr-card-num { font-size: 13px; color: var(--text-muted); }
  .qr-card-num b { font-size: 20px; color: var(--ink); font-family: var(--font-display); letter-spacing: -.02em; }
  .qr-spark { color: var(--accent); flex: none; }
  .qr-spark svg { width: 96px; height: 30px; }
  .qr-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-sunken); color: var(--text); border: 1px solid var(--line); cursor: pointer; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qr-tag:hover { border-color: var(--line-strong); }
  .qr-detail { position: sticky; top: calc(var(--topbar-h, 64px) + 12px); }
  .qr-detail-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .qr-detail-kpis > div { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; }
  .qr-detail-kpis b { font-size: 22px; color: var(--ink); font-family: var(--font-display); }
  @media (max-width: 1100px) { .qr-layout.has-open { grid-template-columns: 1fr; } .qr-detail { position: static; order: -1; } }
  @media (max-width: 640px) { .qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .qr-card-art { padding: 14px; } .qr-card-code { width: 100%; height: auto; aspect-ratio: 1; } .qr-card-body { padding: 12px; } .qr-card-stats .qr-spark { display: none; } }
}

/* Visit-to-sale funnel (ADR-0032) */
@layer components {
  .funnel { display: grid; gap: 14px; }
  .funnel-step { display: grid; gap: 6px; }
  .funnel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .funnel-label { font-size: 14px; font-weight: 600; color: var(--ink); }
  .funnel-head b { font-size: 20px; font-family: var(--font-display); color: var(--ink); letter-spacing: -.02em; }
  .funnel-bar { height: 14px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
  .funnel-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #7C5CFF)); transition: width var(--t-base) var(--ease-out); }
  .funnel-step:last-child .funnel-bar i { background: linear-gradient(90deg, #C2F45B, var(--accent)); }
  .funnel-foot { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
  .funnel-drop { color: var(--danger, #C2410C); font-weight: 600; }
  @media (max-width: 640px) { .funnel-card .card-header { flex-wrap: wrap; } .funnel-card .card-header select { max-width: 100% !important; width: 100% !important; } }
}

@layer components {
  @media (max-width: 640px) { .toolbar { flex-wrap: wrap; } .toolbar > .input-icon.grow { flex: 1 1 100% !important; width: 100%; } }
  .qr-card-body > * { min-width: 0; }
  .qr-card-body .cluster { flex-wrap: wrap; min-width: 0; } .qr-tag { max-width: 100%; }
}

/* css/components/console.css */
/* Super Admin console (ADR-0013): a dark "control room" rail, the same calm canvas for work. */
@layer components {
  .console-sidebar { background: radial-gradient(120% 60% at 0% 0%, color-mix(in oklab, var(--lime-400) 16%, transparent), transparent 60%), var(--forest-950); border-radius: 26px; padding: 14px 10px; color: rgb(255 255 255 / .74); box-shadow: 0 30px 60px -30px rgb(4 20 12 / .7); }
  .console-sidebar .brand-mark { color: #fff; }
  .cs-tag { margin-left: 2px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--lime-400); color: var(--forest-950); }
  .console-sidebar .nav-section { color: rgb(255 255 255 / .42); }
  .console-sidebar .nav-item { color: rgb(255 255 255 / .72); }
  .console-sidebar .nav-item:hover { background: rgb(255 255 255 / .07); color: #fff; }
  .console-sidebar .nav-item[aria-current="page"] { background: #fff; color: var(--forest-950); box-shadow: 0 12px 24px -14px rgb(0 0 0 / .8); }
  .console-sidebar .user-chip { color: #fff; background: rgb(255 255 255 / .06); border-color: transparent; }
  .console-sidebar .sidebar-foot { gap: 2px; flex: none; }
  /* The menu scrolls on its own, with a visible scrollbar and a fade when more is below, so nothing is hidden on a
     laptop-height screen; the brand, role and the lock/account foot stay in place. */
  .console-sidebar { overflow: hidden; }
  .console-sidebar .sidebar-brand, .console-sidebar .cs-role { flex: none; }
  .console-sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding-bottom: 28px; margin-right: -4px; padding-right: 4px;
    scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .28) transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
  .console-sidebar .nav::-webkit-scrollbar { display: block; width: 6px; }
  .console-sidebar .nav::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .28); border-radius: 6px; }
  @media (max-height: 920px) {
    .console-sidebar .nav-item { height: 33px; }
    .console-sidebar .nav-section { margin-top: 10px; padding-bottom: 4px; }
    .console-sidebar .sidebar-brand { padding-bottom: 8px; }
  }
  .cs-foot-btn { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; }
  .cs-role { display: flex; align-items: center; gap: 10px; margin: 6px 4px 8px; padding: 10px 12px; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .08); }
  .cs-role b { display: block; color: #fff; font-size: 13px; }
  .cs-role small { display: block; font-size: 11px; color: rgb(255 255 255 / .5); }
  .cs-role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime-400); box-shadow: 0 0 0 4px color-mix(in oklab, var(--lime-400) 25%, transparent); flex: none; animation: cs-pulse 2.4s var(--ease-out) infinite; }
  @keyframes cs-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in oklab, var(--lime-400) 0%, transparent); } }
  @media (prefers-reduced-motion: reduce) { .cs-role-dot { animation: none; } }
  .cs-crumb-tag { padding: 3px 9px; border-radius: 999px; background: var(--forest-950); color: var(--lime-400); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

  .cs-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
  @media (min-width: 1000px) { .cs-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
  .cs-money { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cs-money:last-child { border-bottom: 0; }
  .cs-money b { font-family: var(--font-display); font-size: 26px; color: var(--ink); letter-spacing: -.02em; }
  .cs-cur { min-width: 44px; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); font-size: 11px; font-weight: 800; text-align: center; color: var(--text-muted); }
  .cs-health { display: grid; gap: 2px; }
  .cs-health-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); min-width: 0; }
  .cs-health-row:last-child { border-bottom: 0; }
  .cs-health-row b { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
  .os-dot.is-danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
  .cs-roadmap { display: grid; gap: 4px; }
  @media (min-width: 900px) { .cs-roadmap { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
  .cs-road-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: var(--fs-small); color: var(--text); }
  .cs-road-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); flex: none; }
  .cs-road-icon svg { width: 17px; height: 17px; }

  .cs-split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1100px) { .cs-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .cs-detail { position: sticky; top: 88px; } .cs-back { display: none; } }
  @media (max-width: 1099px) { .cs-split.has-open .cs-list { display: none; } .cs-split:not(.has-open) .cs-detail { display: none; } }
  .cs-list { padding: 6px; display: grid; gap: 2px; }
  .cs-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
  .cs-row:hover { background: var(--surface-hover); }
  .cs-row.is-open { background: var(--surface-2); border-color: var(--line-strong); }
  .cs-row b { color: var(--ink); font-size: var(--fs-small); }
  .cs-detail { padding: 20px; display: grid; gap: 16px; min-height: 320px; align-content: start; }
  .cs-detail-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); min-width: 0; }
  .cs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
  .cs-facts dt { font-size: 12px; color: var(--text-muted); font-weight: 600; }
  .cs-facts dd { margin: 3px 0 0; color: var(--ink); font-weight: 600; font-size: var(--fs-small); }
  .cs-mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: var(--fs-small); min-width: 0; }
  .cs-mini-row:hover { border-color: var(--line-strong); }
  .cs-mini-row svg { width: 16px; height: 16px; flex: none; }
  .cs-actions { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); justify-items: start; }
  .cs-actions .field { width: 100%; }
  .cs-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .cs-stats div { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
  .cs-stats b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--ink); }
  .cs-stats small { color: var(--text-muted); font-size: 12px; }

  .cs-mods { display: grid; gap: 8px; }
  @media (min-width: 900px) { .cs-mods { grid-template-columns: 1fr 1fr; } }
  .cs-mod { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); min-width: 0; transition: opacity var(--t-fast), background var(--t-fast); }
  .cs-mod.is-off { background: var(--surface-sunken); }
  .cs-mod.is-off .cs-road-icon, .cs-mod.is-off p { opacity: .55; }
  .cs-switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; transition: background var(--t-fast); }
  .cs-switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform var(--t-fast) var(--ease-out); }
  .cs-switch[aria-checked="true"] { background: var(--accent); }
  .cs-switch[aria-checked="true"] span { transform: translateX(18px); }
  .cs-switch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

  .cs-pay.is-on { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent), var(--e1); }
  .cs-pay-head { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
  .cs-pay-head .badge { margin-left: 6px; vertical-align: 2px; }
  .cs-pay-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px; flex: none; }
  .cs-pay-paystack { background: linear-gradient(140deg, #0BA4DB, #011B33); }
  .cs-pay-flutterwave { background: linear-gradient(140deg, #F5A623, #FB4E20); }
  .cs-pay-stripe { background: linear-gradient(140deg, #8B7CFF, #533AFD); }
  .cs-pay-form { padding-top: 14px; border-top: 1px dashed var(--line-strong); }
  .cs-chip { cursor: pointer; }
  .cs-chip:has(input:checked) { background: var(--ink); color: var(--text-on-ink); border-color: var(--ink); }
  .cs-chip:has(input:focus-visible) { box-shadow: var(--focus-ring); }

  .cs-roles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .cs-role-card { padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; }
  .cs-role-card b { color: var(--ink); font-family: var(--font-display); font-size: 17px; }
  .cs-role-card small { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
  .cs-role-card.is-super_admin { background: var(--forest-950); border-color: transparent; }
  .cs-role-card.is-super_admin b { color: var(--lime-400); }
  .cs-role-card.is-super_admin small { color: rgb(255 255 255 / .7); }
  .cs-add { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: end; }
  @media (min-width: 720px) { .cs-add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; } }
  .cs-team { display: grid; }
  .cs-team-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); min-width: 0; }
  .cs-team-row b { color: var(--ink); font-size: var(--fs-small); }
  .cs-role-select { width: auto; min-width: 128px; height: 36px; }
  @media (max-width: 560px) { .cs-team-row { flex-wrap: wrap; padding: 12px 16px; } .cs-team-row > .grow { flex-basis: calc(100% - 52px); } .cs-role-select { flex: 1; } }

  .cs-audit { padding: 4px 0; }
  .cs-audit-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-width: 0; }
  .cs-audit-row:last-of-type { border-bottom: 0; }
  .cs-audit-row b { color: var(--ink); }
  .cs-audit-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); flex: none; }
  .cs-audit-dot.is-warn { background: var(--warning); }
  .cs-props { margin-top: 3px; overflow-wrap: anywhere; }

  .cs-enrol { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
  .cs-qr { width: 148px; height: 148px; padding: 8px; border-radius: 14px; background: #fff; flex: none; }
  .cs-qr svg { width: 100%; height: 100%; display: block; }
  .cs-secret { display: block; font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; color: var(--ink); overflow-wrap: anywhere; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
  .cs-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
  .cs-recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
  .cs-recovery code { font-family: var(--font-mono); font-size: 14px; color: var(--ink); text-align: center; padding: 8px; border-radius: 10px; background: var(--surface-2); }
  .link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); font-weight: 600; cursor: pointer; }
  .link-btn:hover { text-decoration: underline; }
}

@layer components {
  .cs-models { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 1000px) { .cs-models { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .cs-model { display: grid; gap: 8px; align-content: start; text-align: left; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
  .cs-model:hover { border-color: var(--line-strong); transform: translateY(-1px); }
  .cs-model.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--e2); }
  .cs-model b { color: var(--ink); font-family: var(--font-display); font-size: 18px; }
  .cs-model small { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
  .cs-model-top { display: flex; justify-content: space-between; align-items: center; }
  .cs-model-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--forest-950); color: var(--lime-400); }
  .cs-model-icon svg { width: 19px; height: 19px; }
  .cs-model-warn { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: 12px; font-weight: 600; line-height: 1.4; }
  .cs-model-warn svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
  .cs-rules { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 800px) { .cs-rules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .cs-pay-sandbox { background: linear-gradient(140deg, #5B6B63, #1D2621); }
  .cs-webhook { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
  .cs-webhook code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
}

@layer components {
  .pl-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1200px) { .pl-layout.has-editor { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } .pl-editor { position: sticky; top: 88px; max-height: calc(100dvh - 110px); overflow-y: auto; } }
  .pl-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .pl-layout.has-editor .pl-list { grid-template-columns: minmax(0, 1fr); }
  .pl-card { border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
  .pl-card.is-open { box-shadow: 0 0 0 2px var(--ink); }
  .pl-card.is-muted { opacity: .7; }
  .pl-card-head { padding: 18px; color: #fff; display: grid; gap: 10px; }
  .pl-card-head b, .pl-card-head .pl-price { font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
  .pl-card-head .pl-price { font-size: 1.15rem; }
  .pl-card-head .badge { background: rgb(255 255 255 / .16); color: #fff; border-color: rgb(255 255 255 / .25); }
  .pl-price { font-family: var(--font-display); font-size: 1.15rem; }
  .pl-price small { opacity: .7; font-size: 12px; }
  .pl-card-body { padding: 14px 18px; display: grid; gap: 10px; }
  .pl-prices { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
  .pl-features { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 700px) { .pl-features { grid-template-columns: 1fr 1fr; } }
  .pl-feature { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
}
.cs-comp { padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); } .cs-comp summary { cursor: pointer; }

/* ---- Marketing page builder (ADR-0016) ---- */
@layer components {
  .input.is-static { display: flex; align-items: center; color: var(--text-muted); background: var(--surface-sunken); }
  .icon-btn.is-active { background: var(--ink); color: var(--surface); }
  .mb { display: grid; gap: 12px; padding: 12px; }
  .mb-inspector .card-header { flex-wrap: nowrap; gap: 10px; }
  .mb-inspector .card-header > .cluster:last-child { flex-wrap: nowrap; flex: none; }
  .mb-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
  .mb-top-title { display: grid; min-width: 0; flex: 1 1 180px; }
  .mb-top-title b { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -0.02em; }
  .mb-top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .mb-top .segmented button { padding: 6px 10px; }
  .mb-top .segmented svg { width: 16px; height: 16px; }
  .mb-panes { display: none; }
  .mb-grid { display: grid; grid-template-columns: 250px 380px minmax(0, 1fr); gap: 12px; height: calc(100dvh - 180px); min-height: 560px; }
  .mb-outline, .mb-inspector { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
  .mb-outline { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
  .mb-outline-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; }
  .mb-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 0; margin: 0; list-style: none; }
  .mb-outline-head .label, .mb-list .label, .field > .label { font-weight: 700; font-size: 13px; color: var(--ink); }
  .mb-sec { display: flex; align-items: center; gap: 2px; border-radius: 14px; border: 1px solid transparent; transition: background var(--t-fast), border-color var(--t-fast); }
  .mb-sec:hover { background: var(--surface-hover); }
  .mb-sec.is-open { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 35%, transparent); }
  .mb-sec.is-hidden .mb-sec-main { opacity: .55; }
  .mb-sec-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left; }
  .mb-sec-main b { display: block; font-size: 13.5px; }
  .mb-sec-main small { display: block; font-size: 12px; color: var(--text-muted); }
  .mb-sec-tools { display: none; padding-right: 4px; }
  .mb-sec:hover .mb-sec-tools, .mb-sec.is-open .mb-sec-tools { display: flex; }
  .mb-sec-tools .icon-btn { width: 26px; height: 26px; }
  .mb-sec-tools svg { width: 14px; height: 14px; }
  .mb-sec-icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
  .mb-sec-icon svg { width: 16px; height: 16px; }
  .mb-sec-icon.is-lg { width: 40px; height: 40px; border-radius: 12px; background: var(--grad-forest); color: var(--lime-400); }
  .mb-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--line-strong); font-weight: 700; color: var(--text-muted); margin-top: 4px; }
  .mb-add:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
  .mb-add svg { width: 16px; height: 16px; }
  .mb-library { display: grid; gap: 6px; }
  .mb-lib { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .mb-lib:hover { border-color: var(--accent); box-shadow: var(--e1); }
  .mb-lib b { display: block; font-size: 13.5px; }
  .mb-lib small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
  .mb-inspector { display: flex; flex-direction: column; }
  .mb-inspector .card-body { flex: 1; }
  .mb-publish-note { position: sticky; bottom: 0; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--line); }
  .mb-code { font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
  .mb-toggle { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 14px; }
  .mb-toggle span { display: grid; gap: 2px; }
  .mb-icon-pick { display: flex; gap: 8px; align-items: center; }
  .mb-icon-now { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); }
  .mb-icon-now svg { width: 18px; height: 18px; }
  .mb-image { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .mb-image-thumb { width: 64px; height: 48px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-subtle); border: 1px solid var(--line); }
  .mb-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .mb-image label { cursor: pointer; }
  .mb-list { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
  .mb-item { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
  .mb-item-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
  .mb-item-bar .icon-btn { width: 28px; height: 28px; }
  .mb-item-bar svg { width: 14px; height: 14px; }
  .mb-item-fields { padding: 12px; display: grid; gap: 12px; }
  .mb-preview { position: relative; min-height: 0; border-radius: 24px; background: var(--surface-sunken); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: stretch; }
  .mb-frame { position: relative; overflow: hidden; }
  .mb-frame.is-desktop iframe { width: 1440px; height: calc(100% / var(--s, 1)); transform: scale(var(--s, 1)); transform-origin: 0 0; border: 0; display: block; background: #fff; }
  .mb-frame.is-mobile { display: grid; place-items: center; padding: 16px; }
  .mb-frame.is-mobile iframe { width: 390px; max-width: 100%; height: 100%; border: 10px solid #0B0D0C; border-radius: 42px; background: #fff; box-shadow: var(--e3); }
  .mb-saving { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 700; }
  .mb-saving svg { width: 14px; height: 14px; }
  @media (max-width: 1280px) { .mb-grid { grid-template-columns: 230px 340px minmax(0, 1fr); } }
  @media (max-width: 1100px) {
    .mb-panes { display: flex; width: 100%; }
    .mb-panes button { flex: 1; }
    .mb-grid { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
    .mb-outline, .mb-inspector, .mb-preview { display: none; }
    .mb-outline.is-shown, .mb-inspector.is-shown { display: flex; max-height: none; }
    .mb-preview.is-shown { display: grid; height: calc(100dvh - 200px); min-height: 520px; }
    .mb-sec-tools { display: flex; }
  }
}

/* ---- Marketing site screen ---- */
@layer components {
  .ms-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .ms-page { border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); display: flex; flex-direction: column; }
  .ms-page-head { display: grid; gap: 6px; padding: 18px; min-height: 130px; align-content: end; color: #fff; }
  .ms-page-head b { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.03em; color: #fff; }
  .ms-page-path { font-size: 12px; opacity: .75; font-weight: 600; }
  .ms-page-count { font-size: 12px; opacity: .7; }
  .ms-page-body { padding: 14px 18px 18px; display: grid; gap: 10px; }
  .ms-link { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
  .ms-link.is-compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .ms-link.is-nav { grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, .9fr) auto; }
  .ms-menu { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--surface); }
  .ms-menu > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
  .ms-menu > summary::-webkit-details-marker { display: none; }
  .ms-menu > summary svg { width: 18px; height: 18px; flex: none; color: var(--brand, currentColor); }
  .ms-menu[open] > summary { margin-bottom: 4px; }
  .ms-mcard, .ms-mcol { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2, var(--bg)); border: 1px solid var(--line); }
  .ms-mcard-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
  .ms-mitem { display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, .9fr) auto auto; gap: 8px; align-items: center; }
  .ms-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
  .ms-starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ms-starter { display: grid; gap: 4px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); }
  .ms-starter small { color: var(--text-muted); line-height: 1.45; }
  .ms-starter:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--focus-ring); }
  .ms-announce-preview { padding: 18px; border-radius: 18px; background: var(--grad-ink); }
  .ms-announce-preview .mk-announce { max-width: max-content; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 650; }
  .ms-announce-preview .mk-announce a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; font-weight: 750; }
  .ms-announce-preview svg { width: 14px; height: 14px; }
  .ms-announce-preview .is-ink { background: rgb(12 14 13 / .86); color: #fff; } .ms-announce-preview .is-ink a { background: var(--lime-400); color: var(--forest-950); }
  .ms-announce-preview .is-brand { background: var(--grad-brand); color: var(--forest-950); } .ms-announce-preview .is-brand a { background: rgb(3 23 15 / .9); color: #fff; }
  .ms-announce-preview .is-violet { background: var(--grad-violet); color: #fff; } .ms-announce-preview .is-violet a { background: #fff; color: var(--violet-700); }
  @media (max-width: 640px) {
    .ms-link, .ms-link.is-compact { grid-template-columns: minmax(0, 1fr) auto; }
    .ms-link.is-nav { grid-template-columns: minmax(0, 1fr) auto; } .ms-link.is-nav > :nth-child(3) { grid-column: 1; grid-row: 3; } .ms-link.is-nav > :nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
    .ms-mcard-row, .ms-mitem { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ms-link > :nth-child(1) { grid-column: 1; grid-row: 1; } .ms-link > :nth-child(2) { grid-column: 1; grid-row: 2; } .ms-link > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
    .ms-starters { grid-template-columns: minmax(0, 1fr); }
  }
}

/* ---- Appearance ---- */
@layer components {
  .ap-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
  .ap-preview-wrap { position: sticky; top: 88px; }
  .ap-thumb-logo { width: 120px; }
  .ap-thumb-logo img { object-fit: contain; padding: 6px; }
  .ap-thumb-logo svg { width: 34px; height: 28px; }
  .ap-thumb-favicon { width: 48px; }
  .ap-thumb-favicon img { object-fit: contain; padding: 8px; }
  .ap-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .ap-palette, .ap-font { display: grid; gap: 4px; padding: 10px; border-radius: 18px; border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .ap-palette:has(input:checked), .ap-font:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 14%, transparent); }
  .ap-palette small, .ap-font small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
  .ap-swatch { height: 70px; border-radius: 12px; display: flex; align-items: flex-end; gap: 5px; padding: 8px; margin-bottom: 4px; }
  .ap-swatch i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .6); }
  .ap-fonts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ap-font-sample { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.04em; color: var(--ink); line-height: 1.1; }
  .ap-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
  .ap-preview { border-radius: 28px; background: var(--canvas); border: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; box-shadow: var(--e2); overflow: hidden; }
  .ap-nav { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--e1); }
  .ap-nav .brand-mark { font-size: 1rem; }
  .ap-nav-links { display: flex; gap: 6px; margin: 0 auto; } .ap-nav-links i { width: 34px; height: 8px; border-radius: 4px; background: var(--line-strong); }
  .ap-hero { border-radius: 22px; padding: 22px; color: #fff; display: grid; gap: 10px; }
  .ap-hero h3 { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.05; letter-spacing: -0.045em; color: #fff; font-weight: 700; }
  .ap-hero h3 em.accent { font-family: var(--font-accent); font-weight: 400; background: linear-gradient(95deg, var(--lime-400), #B9A9FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .ap-hero p { color: rgb(255 255 255 / .72); font-size: 14px; }
  .ap-chip { justify-self: start; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .12); font-size: 12px; font-weight: 700; }
  .ap-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ap-card { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
  .ap-card .mk-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
  .ap-card .mk-icon svg { width: 18px; height: 18px; }
  .ap-bar { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; } .ap-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
  .ap-tab { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px 12px 4px 4px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
  .ap-fav img { width: 16px; height: 16px; display: block; object-fit: contain; }
  @media (max-width: 1100px) { .ap-grid { grid-template-columns: minmax(0, 1fr); } .ap-preview-wrap { position: static; order: -1; } }
  @media (max-width: 640px) { .ap-fonts { grid-template-columns: minmax(0, 1fr); } }
}

/* ---- Support access (ADR-0017) ---- */
@layer components {
  .support-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; margin: 10px 16px 0; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--grad-violet); color: #fff; font-size: 14px; box-shadow: var(--e3); }
  .support-bar-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / .25); animation: pulse 1.6s infinite; flex: none; }
  .support-bar-end { background: #fff; color: var(--violet-700); font-weight: 750; }
  .support-bar-end svg { width: 14px; height: 14px; }
  .support-note { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 14px; border-radius: 14px; background: var(--assist-soft); color: var(--assist-text); font-size: 14px; font-weight: 600; }
  .support-note.is-pending { background: var(--grad-violet); color: #fff; }
  .support-note.is-danger { background: var(--danger-soft); color: var(--danger); }
  .support-note svg { width: 16px; height: 16px; flex: none; }
  .support-note b { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .sa-request { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 16px; border-radius: 22px; background: var(--surface); border: 1.5px solid var(--violet-300); box-shadow: var(--e2); }
  .sa-request p { margin-top: 4px; color: var(--ink); font-weight: 600; }
  .sa-request-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
  .sa-request-icon svg { width: 22px; height: 22px; }
  .sa-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
  .sa-status { border-radius: 26px; padding: 24px; color: #fff; display: grid; gap: 8px; }
  .sa-status h2 { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: -0.04em; color: #fff; }
  .sa-status p { color: rgb(255 255 255 / .74); }
  .sa-status-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .16); }
  .sa-revoke { background: #fff; color: var(--danger); font-weight: 750; }
  .sa-scopes { display: grid; gap: 8px; }
  .sa-scope { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; padding: 14px; border-radius: 18px; border: 1.5px solid var(--line); cursor: pointer; }
  .sa-scope:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--focus-ring); }
  .sa-scope-icon { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
  .sa-scope-icon svg { width: 18px; height: 18px; }
  .sa-scope small { color: var(--text-muted); line-height: 1.45; }
  .cs-support { display: grid; gap: 10px; }
  @media (max-width: 960px) { .sa-grid { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 640px) { .support-bar { margin: 8px; flex-wrap: wrap; } .sa-request { flex-wrap: wrap; } }
}

/* ---- Moderation (ADR-0017) ---- */
@layer components {
  .md-count { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-sunken); color: var(--ink); }
  .md-count.is-hot { background: var(--grad-sunset); color: #fff; }
  .md-icon { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
  .md-icon svg { width: 22px; height: 22px; }
  .md-reports { display: grid; gap: 8px; }
  .md-report { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
  .md-report p { color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
  .md-action { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  .md-appeal { padding: 12px 14px; border-radius: 14px; background: var(--assist-soft); font-size: 14px; }
  .md-appeal p { margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
  .notice-card { border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); overflow: hidden; }
  .notice-head { display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--danger-soft); }
  .notice-head.is-lifted { background: var(--accent-soft); }
  .notice-head .md-icon { width: 44px; height: 44px; }
  .notice-body { padding: 18px; display: grid; gap: 12px; }
}

/* ---- Account & security (ADR-0018) ---- */
@layer components {
  .ac-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
  .ac-enrol { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
  .ac-enrol .cs-qr { width: 180px; padding: 10px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
  .ac-codes { padding: 16px; border-radius: 18px; background: var(--heat-soft); display: grid; gap: 12px; }
  .ac-codes ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding-left: 1.4em; list-style: decimal; font-family: var(--font-mono); }
  .tfa-input { font-family: var(--font-mono); letter-spacing: .2em; font-size: 1.15rem; }
  @media (max-width: 960px) { .ac-grid { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 520px) { .ac-enrol { grid-template-columns: minmax(0, 1fr); justify-items: start; } }
}
@layer components {
  .sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .sc-wide { grid-column: 1 / -1; }
  .sc-save { grid-column: 1 / -1; position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
  @media (max-width: 960px) { .sc-grid { grid-template-columns: minmax(0, 1fr); } }
}

/* ---- Overview (ADR-0018) ---- */
@layer components {
  .ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .ov-grid > .ov-wide:first-child { grid-column: span 1; }
  @media (min-width: 1100px) { .ov-grid:has(.ov-wide) { grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr); } .ov-grid:has(.ov-wide:last-child) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); } }
  .ov-row { transition: background var(--t-fast); }
  a.ov-row:hover { background: var(--surface-hover); }
  .ov-hot { background: var(--heat-soft); color: var(--heat); }
  .ov-count { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.03em; color: var(--ink); }
  @media (max-width: 960px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
}
@layer components { .ac-grid .grid-2, .sc-grid .grid-2 { align-items: start; } }

/* Why people leave (ADR-0030) */
@layer components {
  .exit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .exit-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--r-md) var(--r-md) 0; }
  .exit-quote p { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
  .exit-quote small { display: block; margin-top: 4px; font-size: 12px; }
  @media (max-width: 900px) { .exit-grid { grid-template-columns: 1fr; } }
}

/* Console → Migration centre (ADR-0051) */
@layer components {
  .mg-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1000px) { .mg-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
  .mg-gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .mg-gates li { display: flex; gap: 10px; align-items: flex-start; }
  .mg-gates li > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--muted); }
  .mg-gates li.is-ok > svg { color: var(--accent); }
  .mg-gates b { display: block; font-size: 14px; }
  .mg-gates small { display: block; font-size: 12px; }
  .mg-bad { color: var(--danger); }
  .mg-legacy { display: flex; gap: 6px; align-items: center; }
  .mg-legacy svg { width: 16px; height: 16px; flex: none; }
  .mg-kinds { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .mg-kind { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
  .mg-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .mg-kind input { margin-top: 3px; accent-color: var(--accent); }
  .mg-kind b { display: block; font-size: 14px; }
  .mg-kind small { display: block; font-size: 12px; }
  .mg-table { width: 100%; font-size: 13px; }
  .mg-table th[scope="row"] { text-transform: capitalize; font-weight: 600; white-space: nowrap; }
  .mg-table tr.is-off td, .mg-table tr.is-off th { color: var(--danger); }
  .mg-detail { overflow-wrap: anywhere; max-width: 32ch; }
  .mg-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
  .mg-list li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
  .mg-reasons .badge { text-transform: none; }
  .mg-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
}

/* css/components/support.css */
/* Help & support in the app and console (ADR-0034) ------------------------------------------ */
@layer components {
  /* In-app help centre */
  .hc-hero { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 44px); border-radius: var(--r-2xl); color: #fff; }
  .hc-hero-inner { position: relative; z-index: 1; display: grid; gap: 14px; justify-items: start; max-width: 680px; }
  .hc-hero h1 { color: #fff; margin: 0; font-family: var(--font-display); font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); letter-spacing: -0.035em; line-height: 1.05; }
  .hc-search { position: relative; display: flex; align-items: center; width: 100%; }
  .hc-search > svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
  .hc-search input { width: 100%; height: 54px; padding: 0 48px 0 46px; border-radius: var(--r-pill); border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; box-shadow: 0 18px 40px -20px rgb(0 0 0 / .55); }
  .hc-search input:focus { outline: none; box-shadow: 0 0 0 4px rgb(194 244 91 / .45), 0 18px 40px -20px rgb(0 0 0 / .55); }
  .hc-search-spin { position: absolute; right: 18px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
  .hc-hero-foot { margin: 0; font-size: 14px; opacity: .88; }
  .hc-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .hc-hero-art { position: absolute; right: -40px; top: -40px; width: 320px; height: 320px; pointer-events: none; }
  .hc-hero-art span { position: absolute; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .2); inset: 0; animation: hc-pulse 6s ease-in-out infinite; }
  .hc-hero-art span:nth-child(2) { inset: 50px; animation-delay: -2s; }
  .hc-hero-art span:nth-child(3) { inset: 100px; background: rgb(194 244 91 / .18); border-color: transparent; animation-delay: -4s; }
  @media (max-width: 640px) { .hc-hero-art { display: none; } }
  @keyframes hc-pulse { 50% { transform: scale(1.05); opacity: .7; } }
  @media (prefers-reduced-motion: reduce) { .hc-hero-art span { animation: none; } }

  .hc-layout { display: grid; gap: 20px; align-items: start; }
  @media (min-width: 1100px) { .hc-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
  .hc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
  .hc-cat { display: grid; gap: 6px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); color: var(--text); transition: transform var(--t-fast), box-shadow var(--t-fast); }
  .hc-cat:hover { transform: translateY(-2px); box-shadow: var(--e2); }
  .hc-cat b { color: var(--ink); }
  .hc-cat small { color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
  .hc-cat-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 4px; }
  .hc-cat-icon svg { width: 18px; height: 18px; }
  .hc-list, .hc-reqs { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; }
  .hc-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); }
  .hc-item:hover { background: var(--surface-hover); }
  .hc-item-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-muted); }
  .hc-item-icon svg { width: 16px; height: 16px; }
  .hc-item-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .hc-item-main b { color: var(--ink); font-size: var(--fs-small); }
  .hc-item-main small { color: var(--text-muted); font-size: 12.5px; }
  .hc-item-main em { font-style: normal; font-size: 12px; color: var(--text-subtle); }
  .hc-item-go { width: 14px; height: 14px; color: var(--text-subtle); flex: none; }
  .hc-req { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text); }
  .hc-req:hover { background: var(--surface-hover); }
  .hc-req-main { display: grid; min-width: 0; flex: 1; }
  .hc-req-main b { color: var(--ink); font-size: var(--fs-small); }
  .hc-req-main small { color: var(--text-muted); font-size: 12px; }
  .hc-reqs li + li .hc-req { border-top: 1px solid var(--line); border-radius: 0; }
  .hc-ideas { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-xl); color: #fff; }
  .hc-ideas span { display: grid; gap: 2px; flex: 1; }
  .hc-ideas small { opacity: .85; font-size: 13px; }
  .hc-ideas-icon { width: 42px; height: 42px; flex: none !important; border-radius: 14px; display: grid !important; place-items: center; background: rgb(255 255 255 / .18); }
  .hc-ideas-icon svg { width: 20px; height: 20px; }
  .hc-ideas-go { width: 18px; height: 18px; flex: none; transition: transform var(--t-fast); }
  .hc-ideas:hover .hc-ideas-go { transform: translateX(3px); }
  .hc-topics { border: 0; margin: 0; padding: 0; min-width: 0; }
  .hc-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 6px; }
  .hc-topic { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); transition: border-color var(--t-fast), background var(--t-fast); }
  .hc-topic svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
  .hc-topic:hover { background: var(--surface-hover); }
  .hc-topic.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
  .hc-topic.is-on svg { color: var(--accent-text); }
  .hc-topic:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .hc-suggest { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--assist-soft, var(--accent-soft)); }
  .hc-suggest p { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
  .hc-suggest p svg { width: 15px; height: 15px; color: var(--assist, var(--accent)); }
  .hc-suggest a, .hc-suggest button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
  .hc-suggest a:hover, .hc-suggest button:hover { text-decoration: underline; }
  .hc-suggest svg { width: 13px; height: 13px; }

  /* A request's conversation */
  .tk-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
  .tk-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-subtle); }
  .tk-status.is-open i { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  .tk-status.is-pending i { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
  .tk-status.is-solved i { background: var(--success); }
  .tk-sent { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--ink); }
  .tk-sent p { margin: 2px 0 0; font-size: var(--fs-small); color: var(--text); }
  .tk-sent-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent); color: #fff; }
  .tk-thread { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
  .tk-msg { display: flex; gap: 12px; align-items: flex-start; }
  .tk-msg.is-me { flex-direction: row-reverse; }
  .tk-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--ink); font-weight: 700; font-size: 13px; overflow: hidden; }
  .tk-msg.is-staff .tk-avatar { background: var(--ink); color: #C2F45B; }
  .tk-msg.is-staff .tk-avatar svg { width: 22px; height: 22px; }
  .tk-bubble { max-width: min(640px, 100%); min-width: 0; padding: 12px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
  .tk-msg.is-me .tk-bubble { background: var(--accent-soft); border-color: transparent; border-top-right-radius: 6px; }
  .tk-msg.is-staff .tk-bubble { border-top-left-radius: 6px; }
  .tk-msg.is-note .tk-bubble { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 30%, transparent); }
  .tk-thread.is-console .tk-msg.is-staff { flex-direction: row-reverse; }
  .tk-thread.is-console .tk-msg.is-staff .tk-bubble, .tk-thread.is-console .tk-msg.is-note .tk-bubble { margin-left: auto; }
  .tk-thread.is-console .tk-msg.is-note { justify-content: flex-end; }
  .tk-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; font-size: 12.5px; }
  .tk-meta b { color: var(--ink); }
  .tk-meta time { color: var(--text-subtle); }
  .tk-body { white-space: pre-line; overflow-wrap: anywhere; font-size: var(--fs-small); line-height: 1.6; color: var(--text); }
  .tk-sys { text-align: center; }
  .tk-sys span { display: inline-block; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-sunken); font-size: 12px; color: var(--text-muted); }
  .tk-reply { padding: 16px; display: grid; gap: 12px; }
  .tk-reply .between { gap: 12px; flex-wrap: wrap; }
  .tk-closed a { font-weight: 700; color: var(--accent-text); }
  .tk-rate { margin-top: 16px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .tk-rate p { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
  .tk-rate p svg { width: 16px; height: 16px; }

  /* Console inbox */
  .nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--accent); color: #fff; }
  .select-sm, .input-sm { height: 32px; font-size: 13px; }
  .tk-views { flex-wrap: wrap; }
  .tk-pri { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-strong); }
  .tk-pri.is-high { background: var(--warning); }
  .tk-pri.is-urgent { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
  .tk-pri.is-low { background: transparent; border: 1.5px solid var(--line-strong); }
  .tk-state { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-sunken); color: var(--text-muted); }
  .tk-state.is-open { background: var(--accent-soft); color: var(--accent-text); }
  .tk-state.is-pending { background: var(--warning-soft); color: var(--warning); }
  @media (max-width: 640px) { .tk-row .tk-state { display: none; } }
  .tk-detail { display: grid; gap: 14px; }
  .tk-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
  .tk-controls label { display: grid; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
  .tk-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
  .tk-history { font-size: 13px; }
  .tk-history summary { cursor: pointer; font-weight: 700; color: var(--text-muted); }
  .tk-history button { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
  .tk-history button:hover { background: var(--surface-hover); }
  .tk-thread.is-console { max-height: 56vh; overflow-y: auto; padding: 2px; margin: 0; }
  .tk-compose { display: grid; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
  .tk-compose.is-note { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 30%, transparent); }
  .tk-compose .between { gap: 10px; flex-wrap: wrap; }
  .tk-then { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
  .tk-guides { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .tk-guides .input-icon { flex: 1 1 220px; }
  .tk-guide { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .tk-guide svg { width: 12px; height: 12px; }

  /* Ideas */
  .idea-tools { flex-wrap: wrap; }
  .idea-tools > .select { width: auto; flex: 0 0 auto; min-width: 150px; }
  .idea-tools > .input-icon { flex: 1 1 260px; }
  @media (max-width: 640px) { .idea-tools > .select { flex: 1 1 40%; } }
  .idea-list { display: grid; gap: 8px; }
  .idea-row { display: flex; align-items: stretch; gap: 12px; padding: 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
  .idea-vote { display: grid; justify-items: center; align-content: center; gap: 0; width: 56px; flex: none; padding: 6px 0; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text-muted); font: inherit; cursor: pointer; transition: all var(--t-fast); }
  .idea-vote svg { width: 16px; height: 16px; }
  .idea-vote b { font-size: 15px; color: var(--ink); }
  .idea-vote:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
  .idea-vote.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .idea-vote.is-on b { color: #fff; }
  .idea-vote:disabled { opacity: .5; cursor: default; }
  .idea-vote.is-wide { display: inline-flex; width: auto; gap: 6px; padding: 8px 14px; font-weight: 700; }
  .idea-main { display: grid; gap: 6px; align-content: center; min-width: 0; flex: 1; padding: 4px 6px; border: 0; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; border-radius: 10px; }
  .idea-main:hover b { text-decoration: underline; text-underline-offset: 3px; }
  .idea-main b { color: var(--ink); overflow-wrap: anywhere; }
  .idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
  .idea-meta > span { display: inline-flex; align-items: center; gap: 4px; }
  .idea-meta svg { width: 13px; height: 13px; }
  .idea-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-sunken); color: var(--text-muted); }
  .idea-status svg { width: 13px; height: 13px; }
  .idea-status.is-review { background: var(--info-soft); color: var(--info); }
  .idea-status.is-planned { background: var(--assist-soft, var(--info-soft)); color: var(--assist-text, var(--info)); }
  .idea-status.is-progress { background: var(--warning-soft); color: var(--warning); }
  .idea-status.is-shipped { background: var(--accent-soft); color: var(--accent-text); }
  .idea-status.is-declined { background: var(--danger-soft); color: var(--danger); }
  .idea-body { white-space: pre-line; overflow-wrap: anywhere; font-size: var(--fs-small); line-height: 1.6; color: var(--text); }
  .idea-merged { margin: 0; font-size: var(--fs-small); color: var(--text-muted); }
  .idea-response { padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #E9F2EC; }
  .idea-response p { margin: 0; white-space: pre-line; font-size: var(--fs-small); line-height: 1.6; }
  .idea-response-by { display: flex !important; align-items: center; gap: 8px; margin-bottom: 6px !important; font-weight: 700; color: #C2F45B; font-size: 12.5px !important; }
  .idea-response-by svg { width: 18px; height: 18px; }
  .idea-comments { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
  .idea-comments li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: var(--fs-small); overflow-wrap: anywhere; }
  .idea-comments li p { margin: 0; white-space: pre-line; }
  .idea-comments li.is-staff { background: var(--accent-soft); }
  .idea-comments li.is-hidden { opacity: .55; }
  .idea-c-by { display: flex; align-items: center; gap: 8px; margin-bottom: 4px !important; font-size: 12.5px; }
  .idea-c-by b { color: var(--ink); }
  .idea-c-by time { color: var(--text-subtle); }
  .idea-c-by .icon-btn { margin-left: auto; width: 26px; height: 26px; }
  .idea-c-empty { color: var(--text-muted); background: none !important; padding-left: 0 !important; }

  /* Console help centre */
  .hlp-grid { display: grid; gap: 20px; align-items: start; }
  @media (min-width: 1000px) { .hlp-grid { grid-template-columns: 280px minmax(0, 1fr); } }
  .hlp-cats { padding-bottom: 8px; }
  .hlp-cat-row { position: relative; }
  .hlp-cat { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 0 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: var(--fs-small); color: var(--text); text-align: left; cursor: pointer; }
  .hlp-cat svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
  .hlp-cat:hover { background: var(--surface-hover); }
  .hlp-cat.is-on { background: var(--surface-active, var(--surface-2)); font-weight: 700; color: var(--ink); }
  .hlp-cat small { color: var(--text-subtle); }
  .hlp-cat-tools { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; gap: 0; background: var(--surface); border-radius: 8px; }
  .hlp-cat-row:hover .hlp-cat-tools, .hlp-cat-row:focus-within .hlp-cat-tools { display: flex; }
  .hlp-cat-tools .icon-btn { width: 26px; height: 26px; }
  .hlp-fb { list-style: none; margin: 0; padding: 0 20px 16px; display: grid; gap: 12px; }
  .hlp-fb p { margin: 0 0 2px; font-size: var(--fs-small); color: var(--text); }
  .hlp-icons { border: 0; margin: 0; padding: 0; }
  .hlp-icon-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .hlp-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1.5px solid var(--line); cursor: pointer; color: var(--text-muted); }
  .hlp-icon svg { width: 17px; height: 17px; }
  .hlp-icon.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
  .hlp-icon:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .hlp-editor { display: grid; gap: 20px; align-items: start; }
  @media (min-width: 1200px) { .hlp-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .hlp-preview { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; } }
  .hlp-md { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; min-height: 380px; }
  .hlp-preview { padding: 20px 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px dashed var(--line-strong); }
  .hlp-prose { font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
  .hlp-prose h1 { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 8px; color: var(--ink); }
  .hlp-prose h2 { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.02em; margin: 1.6em 0 .5em; color: var(--ink); }
  .hlp-prose h3 { font-size: 1.05rem; margin: 1.3em 0 .4em; color: var(--ink); }
  .hlp-prose code { font-family: var(--font-mono); font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--surface-sunken); }
  .hlp-prose pre { padding: 14px 16px; border-radius: 12px; background: var(--ink); color: #E9F2EC; overflow-x: auto; }
  .hlp-prose pre code { background: none; padding: 0; color: inherit; }
  .hlp-prose img { max-width: 100%; border-radius: 12px; }
  .hlp-prose blockquote { margin: 1em 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; }
  .hlp-prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .hlp-prose th, .hlp-prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
  .hlp-prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
  .hlp-lead { font-size: 1.05rem; color: var(--text-muted); }
}

/* Console → Status (ADR-0035) ----------------------------------------------------------------- */
@layer components {
  .stc-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--e1); }
  .stc-banner b { display: block; color: var(--ink); }
  .stc-banner small { color: var(--text-muted); font-size: 13px; }
  .stc-dot, .st-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--line-strong); }
  .stc-banner.is-ok .stc-dot, .st-dot.is-ok { background: var(--success, #10B981); box-shadow: 0 0 0 5px var(--success-soft); }
  .stc-banner.is-warn .stc-dot, .st-dot.is-warn { background: var(--warning); box-shadow: 0 0 0 5px var(--warning-soft); }
  .stc-banner.is-bad .stc-dot, .st-dot.is-bad { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }
  .stc-banner.is-maint .stc-dot, .st-dot.is-maint { background: var(--info); box-shadow: 0 0 0 5px var(--info-soft); }
  .st-dot { width: 9px; height: 9px; }
  .stc-grid { display: grid; gap: 20px; align-items: start; }
  @media (min-width: 1150px) { .stc-grid { grid-template-columns: minmax(0, 1fr) 380px; } }
  .stc-inc { display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
  .stc-inc-title { margin: 2px 0 0; font-size: 15.5px; color: var(--ink); }
  .stc-updates { list-style: none; margin: 0; padding: 0 0 0 12px; display: grid; gap: 8px; border-left: 2px solid var(--line); font-size: 13px; color: var(--text-muted); }
  .stc-updates b { color: var(--ink); }
  .stc-updates p { margin: 2px 0 0; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
  .stc-post { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
  .stc-post .select { justify-self: start; width: auto; min-width: 180px; }
  .stc-recent, .stc-comps, .stc-checks { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; }
  .stc-recent li, .stc-comps li, .stc-checks li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: var(--fs-small); min-width: 0; }
  .stc-recent li + li, .stc-comps li + li, .stc-checks li + li { border-top: 1px solid var(--line); }
  .stc-comps .select { width: auto; flex: none; max-width: 150px; }
  .stc-affects { border: 0; margin: 0; padding: 0; min-width: 0; }
  .stc-affect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 6px; }
}

/* The app-wide status notice (ADR-0035) */
@layer components {
  .status-note { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; min-width: 0; }
  .status-note.is-bad { background: var(--danger-soft); color: var(--danger); }
  .status-note.is-warn { background: var(--warning-soft); color: var(--warning); }
  .status-note.is-maint { background: var(--info-soft); color: var(--info); }
  .status-note b { color: inherit; }
  .status-note-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: currentColor; animation: status-pulse 1.8s ease-in-out infinite; }
  .status-note-go { display: inline-flex; align-items: center; gap: 4px; flex: none; }
  .status-note-go svg { width: 15px; height: 15px; }
  @keyframes status-pulse { 50% { opacity: .35; } }
  @media (prefers-reduced-motion: reduce) { .status-note-dot { animation: none; } }
  @media (max-width: 640px) { .status-note { margin: 8px 10px 0; padding: 8px 12px; font-size: 13px; } }
}

/* Console oversight: health, content, security events, announcements (ADR-0036) */
@layer components {
  .hl-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 1100px) { .hl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hl-grid > :first-child { grid-column: 1 / -1; } }
  .hl-state { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
  .hl-state.is-ok { background: var(--success-soft); color: var(--success); }
  .hl-state.is-warn { background: var(--warning-soft); color: var(--warning); }
  .hl-state.is-bad { background: var(--danger-soft); color: var(--danger); }
  .hl-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; }
  .hl-job { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); min-width: 0; }
  .hl-job small { display: block; }
  .hl-job small.hl-err { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 0; padding: 16px 20px; }
  .card-body .hl-stats { padding: 0; }
  .hl-stats.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hl-stats > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
  .hl-stats dt { font-size: 12px; color: var(--text-muted); }
  .hl-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; color: var(--ink); }
  .hl-stats > .is-bad { background: var(--danger-soft); } .hl-stats > .is-bad dd { color: var(--danger); }
  .hl-stats > .is-warn { background: var(--warning-soft); } .hl-stats > .is-warn dd { color: var(--warning); }
  .hl-errors { list-style: none; margin: 0; padding: 4px 8px 10px; display: grid; }
  .card-body .hl-errors { padding: 0; }
  .hl-errors li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: var(--fs-small); min-width: 0; }
  .hl-errors li + li { border-top: 1px solid var(--line); }
  .hl-errors .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress.is-bad > span { background: var(--danger); }

  .card > .pager { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg, 16px) var(--r-lg, 16px); }
  .ct-select { width: auto; flex: none; max-width: 190px; }
  .table tr.is-dim > td > :not(.badge) { opacity: .55; }
  .ct-take > td { background: var(--surface-2); }
  .ct-take-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
  .ct-take-form .select { width: auto; }
  @media (max-width: 640px) { .toolbar .ct-select { max-width: none; flex: 1 1 140px; } .ct-take-form > * { flex: 1 1 100%; } }

  .se-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 20px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
  .se-row:hover { background: var(--surface-hover, var(--surface-2)); }
  .se-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .se-count { flex: none; min-width: 38px; padding: 4px 8px; border-radius: 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-sunken); color: var(--ink); }
  .se-count.is-hot { background: var(--danger-soft); color: var(--danger); }
  .se-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
  .se-dot.is-bad { background: var(--danger); }
  .se-dot.is-warn { background: var(--warning); }

  .an-grid { align-items: start; }
  .an-row { display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
  .an-row:first-child { border-top: 0; }
  .an-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
  .an-meta .cluster { margin-left: auto; }
  .checkbox-row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-small); color: var(--ink); cursor: pointer; }
  .checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }
}

/* The in-app announcement bar (ADR-0036) */
@layer components {
  .annc { display: flex; align-items: center; gap: 12px; margin: 10px 16px 0; padding: 10px 12px 10px 14px; border-radius: 14px; font-size: 14px; min-width: 0; background: var(--info-soft); color: var(--ink); }
  .annc.is-preview { margin: 0; }
  .annc.is-success { background: var(--success-soft); }
  .annc.is-warning { background: var(--warning-soft); }
  .annc.is-promo { background: linear-gradient(100deg, var(--violet-600), #6d28d9 55%, #0f766e); color: #fff; }
  .annc-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgb(255 255 255 / .55); color: var(--info); }
  .annc.is-success .annc-icon { color: var(--success); }
  .annc.is-warning .annc-icon { color: var(--warning); }
  .annc.is-promo .annc-icon { background: rgb(255 255 255 / .16); color: #C2F45B; }
  .annc-icon svg { width: 17px; height: 17px; }
  .annc-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 8px; }
  .annc-text b { color: inherit; font-weight: 700; }
  .annc-text span { opacity: .82; overflow-wrap: anywhere; }
  .annc-go { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--surface); color: var(--ink); text-decoration: none; }
  .annc.is-promo .annc-go { background: #fff; color: var(--violet-700); }
  .annc-go svg { width: 14px; height: 14px; }
  .annc-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 10px; background: none; color: inherit; opacity: .7; cursor: pointer; }
  .annc-x:hover { opacity: 1; background: rgb(0 0 0 / .06); }
  .annc-x svg { width: 16px; height: 16px; }
  @media (max-width: 640px) {
    .annc { margin: 8px 10px 0; flex-wrap: wrap; font-size: 13px; }
    .annc-text { flex-basis: calc(100% - 90px); }
    .annc-go { order: 3; margin-left: 42px; }
  }
}

/* css/components/auth.css */
/* Auth + onboarding: split stage. Left = calm form on an aurora canvas, right = dark living showcase. */
@layer components {
  .auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); min-height: 100dvh; gap: 0; background: var(--canvas); }
  .auth-main { position: relative; display: flex; flex-direction: column; min-height: 100dvh; overflow: hidden; isolation: isolate; }
  .auth-aurora { position: absolute; z-index: -1; opacity: .75; }
  :root[data-theme="dark"] .auth-aurora { opacity: .55; }
  .auth-top { display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(20px, 5vw, 56px); }
  .auth-content { flex: 1; display: grid; align-items: center; padding: 12px clamp(20px, 5vw, 56px) 32px; }
  .auth-panel { width: 100%; max-width: 440px; margin: 0 auto; }
  .auth-title { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.1rem); line-height: 1.02; letter-spacing: -0.045em; margin: 18px 0 10px; }
  .auth-title em.accent, .onb-title em.accent { font-size: 1.08em; letter-spacing: -0.02em; background: linear-gradient(95deg, var(--emerald-600), var(--violet-500)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
  :root[data-theme="dark"] .auth-title em.accent, :root[data-theme="dark"] .onb-title em.accent { background: linear-gradient(95deg, #5FE6AE, #B9A9FF); -webkit-background-clip: text; background-clip: text; }
  .auth-sub { color: var(--text-muted); font-size: 0.975rem; max-width: 380px; }
  .auth-form { margin-top: 28px; display: grid; gap: 16px; }
  .auth-alt { margin-top: 26px; font-size: var(--fs-body); color: var(--text-muted); }
  .auth-alt a { color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
  .auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px clamp(20px, 5vw, 56px) 22px; font-size: var(--fs-small); color: var(--text-subtle); }
  .auth-foot a:hover { color: var(--ink); }
  .auth-fineprint { font-size: var(--fs-micro); color: var(--text-subtle); text-align: center; }
  .auth-fineprint a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

  .field-icon { position: relative; }
  .field-icon > svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--text-subtle); pointer-events: none; z-index: 1; transition: color var(--t-fast); }
  .field-icon > .input { padding-left: 46px; }
  .field-icon:focus-within > svg { color: var(--accent-text); }
  .field-icon > .field-action { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--text-subtle); }
  .field-icon > .field-action:hover { color: var(--ink); background: var(--surface-hover); }
  .field-icon > .field-action svg { width: 18px; height: 18px; }
  .field-icon > .input:has(+ .field-action), .field-icon > .input.has-action { padding-right: 52px; }
  .auth .input-lg { background: var(--glass-strong); border-color: var(--line-strong); }
  :root[data-theme="dark"] .auth .input-lg { background: rgb(255 255 255 / .03); }

  .strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
  .strength > i { height: 4px; border-radius: 4px; background: var(--line-strong); transition: background var(--t-base); }
  .strength[data-score="1"] > i:nth-child(-n+1) { background: var(--danger); }
  .strength[data-score="2"] > i:nth-child(-n+2) { background: var(--tangerine-500); }
  .strength[data-score="3"] > i:nth-child(-n+3) { background: var(--lime-500); }
  .strength[data-score="4"] > i { background: var(--emerald-500); }

  .theme-icon-light { display: none; }
  :root[data-theme="dark"] .theme-icon-light { display: block; }
  :root[data-theme="dark"] .theme-icon-dark { display: none; }

  .brand-mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.03em; }
  .brand-mark svg { width: 34px; height: 34px; }

  /* ---- Stage ---- */
  .auth-stage { position: sticky; top: 0; height: 100dvh; margin: 12px 12px 12px 0; height: calc(100dvh - 24px); border-radius: var(--r-2xl); overflow: hidden; color: #fff; background: var(--grad-ink); box-shadow: var(--e3); }
  .stage-glow { position: absolute; inset: -20%; background: radial-gradient(40% 35% at 30% 30%, rgb(43 227 162 / .28), transparent 70%), radial-gradient(35% 35% at 75% 25%, rgb(124 92 255 / .38), transparent 70%), radial-gradient(40% 40% at 60% 90%, rgb(255 122 61 / .18), transparent 70%); animation: aurora-drift 24s ease-in-out infinite alternate; pointer-events: none; }
  .stage-inner { position: relative; z-index: 1; height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(24px, 3vw, 40px); }
  .stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .stage-kicker { font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .5); font-weight: 600; }
  .stage-visual { position: relative; display: grid; place-items: center; min-height: 0; }
  .scene { position: absolute; inset: 0; display: grid; place-items: center; }
  .scene-enter { transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out), filter 600ms var(--ease-out); }
  .scene-leave { transition: opacity 300ms var(--ease-in); position: absolute; }
  .scene-start { opacity: 0; transform: translateY(16px) scale(.98); filter: blur(8px); }
  .stage-copy { text-align: center; max-width: 460px; margin: 0 auto; min-height: 132px; }
  .stage-copy h2 { color: #fff; font-size: clamp(1.6rem, 1.1rem + 1.3vw, 2.2rem); line-height: 1.08; letter-spacing: -0.035em; }
  .stage-copy h2 em.accent { color: #C2F45B; font-size: 1.1em; }
  .stage-copy p { margin-top: 10px; color: rgb(255 255 255 / .62); font-size: .95rem; }
  .stage-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
  .stage-dots button { width: 8px; height: 8px; border-radius: 8px; background: rgb(255 255 255 / .25); transition: width var(--t-base) var(--ease-out), background var(--t-base); }
  .stage-dots button.is-on { width: 28px; background: #fff; }

  .auth-stage .phone { width: min(250px, 58%); }
  .auth-stage .glass, .onb-stage .glass { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .12); box-shadow: 0 20px 50px -20px rgb(0 0 0 / .6); color: #fff; }
  .float-card { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; min-width: 180px; }
  .float-card small { display: block; font-size: 11px; color: rgb(255 255 255 / .62); font-weight: 600; }
  .float-card b { display: block; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1.2; }
  .float-card.g-brand small { color: rgb(3 23 15 / .6); } .float-card.g-brand b { color: var(--forest-950); }
  .float-card > svg { width: 20px; height: 20px; }
  .fc-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
  .fc-icon svg { width: 18px; height: 18px; }
  .fc-qr { width: 64px; height: 64px; padding: 6px; background: #fff; border-radius: 12px; }
  .fc-qr svg { width: 100%; height: 100%; }
  .float-card .delta-up { background: rgb(194 244 91 / .18); color: #C2F45B; }

  /* Mini page inside phones */
  .mini-page { height: 100%; overflow: hidden; background: linear-gradient(180deg, #FFF6EE, #FFFFFF 55%); color: #111; text-align: center; font-family: var(--font-sans); }
  .mini-cover { height: 30%; background: var(--grad-sunset); border-radius: 0 0 28px 28px; }
  .mini-avatar { width: 64px; height: 64px; margin: -34px auto 0; border-radius: 50%; border: 3px solid #fff; background: linear-gradient(135deg, #0B3B2A, #0BC284); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; box-shadow: 0 10px 20px -8px rgb(0 0 0 / .35); }
  .mini-name { margin-top: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 4px; }
  .mini-name svg { width: 14px; height: 14px; color: #0BC284; }
  .mini-bio { font-size: 11px; color: #6B736C; margin-top: 2px; }
  .mini-socials { display: flex; justify-content: center; gap: 8px; margin: 10px 0 12px; }
  .mini-socials i { width: 22px; height: 22px; border-radius: 50%; background: #111; opacity: .85; }
  .mini-link { margin: 0 14px 8px; height: 36px; border-radius: 14px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: #fff; box-shadow: 0 4px 14px -6px rgb(0 0 0 / .18), 0 0 0 1px rgb(0 0 0 / .05); }
  .mini-link.is-hero { background: #111; color: #fff; }
  .mini-card { margin: 12px 14px 0; padding: 12px; border-radius: 16px; background: #111; color: #fff; text-align: left; display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px; }
  .mini-card b { font-size: 12px; color: #fff; } .mini-card span { font-size: 10px; opacity: .6; grid-row: 2; }
  .mini-card i { grid-row: span 2; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: #FF7A3D; }

  .stage-panel { width: min(430px, 86%); padding: 22px; border-radius: 24px; }
  .sp-label { color: rgb(255 255 255 / .6); font-weight: 600; font-size: 12px; }
  .sp-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.04em; color: #fff; line-height: 1.1; }
  .sp-bars { height: 150px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; margin: 18px 0 12px; }
  .sp-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; }
  .sp-bar span { display: block; border-radius: 7px; }
  .sp-bar .seg-a { background: #EDEFEE; }
  .sp-bar .seg-b { background: #C2F45B; background-image: repeating-linear-gradient(135deg, rgb(0 0 0 / .18) 0 2px, transparent 2px 6px); }

  .assist-demo { display: grid; gap: 14px; }
  .ad-prompt { display: flex; gap: 10px; align-items: flex-start; }
  .ad-avatar { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--grad-violet); }
  .ad-avatar svg { width: 16px; height: 16px; }
  .ad-prompt p { font-size: 13.5px; line-height: 1.5; color: rgb(255 255 255 / .9); padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: rgb(124 92 255 / .28); border: 1px solid rgb(154 131 255 / .35); }
  .ad-build { display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: rgb(255 255 255 / .96); }
  .ad-block { height: 12px; border-radius: 8px; background: linear-gradient(90deg, #EEF0EC 25%, #F8F9F6 50%, #EEF0EC 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; margin: 0 auto; width: 80%; }
  .ad-cover { height: 58px; width: 100%; background: var(--grad-sunset); animation: none; border-radius: 12px; }
  .ad-btn { height: 30px; width: 100%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: #1D1410; animation: none; }
  .ad-btn.is-soft { background: #FFE6D6; color: #9A3A0C; }
  .ad-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; height: auto; background: none; animation: none; width: 100%; }
  .ad-row i { height: 44px; border-radius: 10px; background: #FFF1E7; }
  .ad-status { font-size: 12px; color: rgb(255 255 255 / .7); display: flex; align-items: center; gap: 8px; }
  .ad-status b { color: #fff; }
  @keyframes shimmer { to { background-position: -200% 0; } }

  /* ---- Onboarding ---- */
  .onb-top { padding-bottom: 8px; }
  .onb-progress { display: flex; align-items: center; gap: 14px; padding: 0 clamp(20px, 5vw, 56px); }
  .onb-progress .stepper { flex: 1; max-width: 520px; }
  .onb-content { align-items: start; padding-top: clamp(20px, 5vh, 56px); overflow-y: auto; }
  .onb-panel { width: 100%; max-width: 620px; margin: 0 auto; }
  .onb-title { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 10px; }
  .onb-kinds { display: grid; gap: 12px; margin-top: 28px; }
  .onb-kinds .pick-wide { padding: 18px 58px 18px 20px; }
  .onb-kind-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff; transform: rotate(-6deg); transition: transform var(--t-slow) var(--ease-spring); box-shadow: 0 14px 28px -14px rgb(0 0 0 / .5); }
  .onb-kind-art svg { width: 28px; height: 28px; }
  .onb-kind-personal { background: var(--grad-sunset); }
  .onb-kind-business { background: var(--grad-brand); color: var(--forest-950); }
  .onb-kind-agency { background: var(--grad-violet); }
  .onb-kind-organization { background: var(--grad-ink); }
  .pick:hover .onb-kind-art, .pick:has(input:checked) .onb-kind-art { transform: rotate(0) scale(1.05); }
  .onb-industries { margin-top: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .onb-industries .pick { min-height: 118px; }
  .onb-nav { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 18px clamp(20px, 5vw, 56px) 24px; background: linear-gradient(transparent, var(--canvas) 40%); z-index: 2; }
  .onb-nav > * { min-width: 120px; }
  .onb-advanced { margin-top: 4px; border-radius: 14px; border: 1px solid var(--line); padding: 12px 14px; background: var(--glass-strong); }
  .onb-advanced summary { cursor: pointer; font-size: var(--fs-small); color: var(--text-muted); display: flex; align-items: center; gap: 8px; list-style: none; }
  .onb-advanced summary::-webkit-details-marker { display: none; }
  .onb-advanced[open] summary { margin-bottom: 12px; }
  .my-5 { margin-top: 20px; margin-bottom: 20px; }
  .assist-box.is-active { box-shadow: var(--e-glow-violet); }

  .handle-field { display: flex; align-items: center; min-height: 60px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--glass-strong); padding: 0 8px 0 18px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .handle-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
  .handle-field.is-ok { border-color: var(--accent); }
  .handle-field.is-bad { border-color: var(--danger); }
  .handle-host { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text-subtle); letter-spacing: -0.02em; }
  .handle-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; height: 56px; }
  .handle-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: 700; padding: 0 10px; height: 32px; border-radius: 10px; white-space: nowrap; }
  .handle-state svg { width: 15px; height: 15px; }
  .is-ok .handle-state { color: var(--accent-text); background: var(--accent-soft); }
  .is-bad .handle-state { color: var(--danger); background: var(--danger-soft); }
  :root[data-theme="dark"] .handle-field { background: rgb(255 255 255 / .03); }

  .onb-done { padding-top: 4vh; }
  .avatar-stack { display: flex; margin-bottom: 22px; }
  .avatar-stack .avatar { border: 3px solid var(--canvas); margin-left: -10px; font-family: var(--font-display); font-weight: 700; }
  .avatar-stack .avatar:first-child { margin-left: 0; }
  .onb-next { display: grid; gap: 10px; margin-top: 30px; }
  .onb-next-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; transition: transform var(--t-base) var(--ease-out); }
  .onb-next-card:hover { transform: translateX(4px); }
  .onb-next-card > span:nth-child(2) { flex: 1; display: grid; }
  .onb-next-card b { font-family: var(--font-display); color: var(--ink); font-size: 1rem; }
  .onb-next-card small { color: var(--text-muted); font-size: var(--fs-small); }
  .onb-next-card .fc-icon { color: #fff; }

  .onb-os { width: min(460px, 100%); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 10px; }
  .onb-os-node { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 12px; border-radius: var(--r-pill); color: rgb(255 255 255 / .55); font-size: var(--fs-small); font-weight: 600; background: rgb(255 255 255 / .05); border: 1px dashed rgb(255 255 255 / .2); transition: all var(--t-base) var(--ease-spring); }
  .onb-os-node svg { width: 16px; height: 16px; }
  .onb-os-node.is-on { color: #fff; border: 1px solid rgb(194 244 91 / .5); background: rgb(194 244 91 / .12); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgb(194 244 91 / .5); }
  .onb-os-node.is-on svg { color: var(--lime-400); }
  .onb-mod { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--text-subtle); }
  .onb-mod .os-dot { width: 6px; height: 6px; }
  .onb-mod.is-live { color: var(--accent-text); }
  .onb-mod.is-building { color: var(--assist-text); }
  .onb-fan { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
  .onb-fan .phone { position: absolute; width: 210px; transition: transform var(--t-lazy) var(--ease-out); }
  .onb-fan-0 { transform: translateX(-62%) rotate(-9deg) scale(.9); z-index: 1; opacity: .9; }
  .onb-fan-1 { transform: translateY(-2%) scale(1.06); z-index: 3; }
  .onb-fan-2 { transform: translateX(62%) rotate(9deg) scale(.9); z-index: 2; opacity: .9; }
  .onb-fan .page-preview { --scale: .5 !important; }
  .onb-phone-wrap { display: grid; justify-items: center; gap: 14px; }
  .onb-phone-wrap .phone { width: 270px; max-width: 62vw; }
  .onb-phone-wrap .phone-screen { transition: opacity var(--t-base), filter var(--t-base); }
  .onb-phone-wrap .phone-screen.is-loading { opacity: .5; filter: blur(3px); }
  .onb-urlbar { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: #fff; }
  .onb-urlbar svg { width: 14px; height: 14px; color: #C2F45B; }
  .onb-celebrate { animation: celebrate 1.2s var(--ease-spring) both; }
  @keyframes celebrate { 0% { transform: translateY(30px) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }

  .auth-teaser { display: none; }
  /* ---- Responsive ---- */
  @media (max-width: 1023px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-stage { display: none; }
    .auth-content { align-items: start; padding-top: 3vh; }
    .onb-industries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .onb-content { padding-bottom: 12px; }
    .auth-teaser { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 34px -20px 0; padding: 4px 20px 24px; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; }
    .auth-teaser::-webkit-scrollbar { display: none; }
    .auth-teaser > div { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start; padding: 16px; border-radius: 20px; display: grid; gap: 10px; }
    .auth-teaser b { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.02em; color: inherit; }
    .auth-teaser p { font-size: 12.5px; opacity: .75; }
    .auth-teaser .fc-icon { background: rgb(255 255 255 / .16); }
  }
  @media (max-width: 640px) {
    .auth-top { padding: 16px 20px; }
    .auth-foot { justify-content: center; }
  }

  /* Legacy helpers still used by a few screens */
  .success-mark { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--grad-forest); color: #fff; box-shadow: var(--e-glow); animation: pop var(--t-slow) var(--ease-spring) both; }
  .success-mark svg { width: 30px; height: 30px; }
  .divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; }
  .divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Passkey sign-in (ADR-0030) */
@layer components {
  .auth-passkey { display: grid; gap: 12px; margin-top: 14px; }
  .auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
  .auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
}

/* Onboarding: your brand (ADR-0030) */
@layer components {
  .onb-brand-group { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
  .onb-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
  .onb-swatch { width: 44px; height: 44px; border-radius: 14px; background: var(--sw, var(--surface)); border: 1px solid rgb(0 0 0 / .08); display: grid; place-items: center; color: var(--text-muted); cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast); }
  .onb-swatch:hover { transform: translateY(-1px); }
  .onb-swatch.is-on { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--ink); }
  .onb-swatch.is-template, .onb-swatch.is-custom { background: var(--surface); border-color: var(--line-strong); }
  .onb-swatch.is-custom { background: conic-gradient(from 90deg, #F06A2A, #D4A017, #0A8A5F, #2F6BFF, #7C5CFF, #E0457B, #F06A2A); color: #fff; }
  .onb-swatch.is-custom svg { filter: drop-shadow(0 1px 2px rgb(0 0 0 / .4)); }
  .onb-swatch:focus-visible, .onb-swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
  .onb-swatch svg { width: 18px; height: 18px; }
  .onb-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .onb-font { display: grid; gap: 2px; justify-items: center; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast); }
  .onb-font b { font-size: 26px; line-height: 1.1; color: var(--ink); font-weight: 600; }
  .onb-font small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
  .onb-font.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
  .onb-logo { display: flex; align-items: center; gap: 14px; }
  .onb-logo-box { width: 72px; height: 72px; border-radius: 18px; border: 1px dashed var(--line-strong); background: var(--surface); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--text-subtle); }
  .onb-logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
  .onb-logo-box > svg { width: 26px; height: 26px; }
}

/* css/components/developers.css */
/* Developers: API tokens in settings and the public API reference (ADR-0046) -------- */
@layer components {
  .dv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 16px; align-items: start; }
  .dv-row.is-off { opacity: .62; }
  .dv-hint { font-family: var(--font-mono, ui-monospace, monospace); font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
  .dv-scopes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .dv-scopes .badge { font-family: var(--font-mono, ui-monospace, monospace); font-size: .6875rem; }
  .dv-reveal { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 22px; border: 1.5px solid var(--accent); background: var(--accent-soft); margin-bottom: 16px; }
  .dv-reveal-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
  .dv-reveal-icon svg { width: 20px; height: 20px; }
  .dv-token { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
  .dv-token code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .875rem; overflow-wrap: anywhere; flex: 1; min-width: 0; user-select: all; }
  .dv-code { margin: 0; padding: 14px 16px; border-radius: 16px; background: #14161a; color: #e8e6e1; font-family: var(--font-mono, ui-monospace, monospace); font-size: .8125rem; line-height: 1.6; overflow-x: auto; white-space: pre; }
  .dv-code code { font: inherit; color: inherit; background: none; }
  .dv-notes { list-style: none; display: grid; gap: 12px; margin: 0; }
  .dv-notes li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
  .dv-notes svg { width: 18px; height: 18px; color: var(--ink); margin-top: 1px; }
  .dv-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
  .dv-scope { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; }
  .dv-scope:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .dv-scope input { margin-top: 3px; }
  .dv-scope code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .6875rem; color: var(--text-muted); }
  .dv-scope small { display: block; color: var(--text-muted); font-size: .8125rem; }
  .dv-scope.is-off { opacity: .55; cursor: not-allowed; }

  /* Public reference */
  .dv-doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
  .dv-toc { position: sticky; top: 90px; display: grid; gap: 2px; font-size: .875rem; }
  .dv-toc a { padding: 6px 10px; border-radius: 10px; color: var(--text-muted); text-decoration: none; }
  .dv-toc a:hover { background: var(--surface-sunken); color: var(--ink); }
  .dv-toc b { padding: 14px 10px 4px; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
  .dv-sec { display: grid; gap: 14px; padding-bottom: 36px; scroll-margin-top: 90px; }
  .dv-sec h2 { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.03em; }
  .dv-sec p, .dv-sec li { color: var(--text-muted); line-height: 1.65; }
  .dv-sec ul { padding-left: 1.2em; display: grid; gap: 4px; }
  .dv-sec code:not(.dv-code code) { font-family: var(--font-mono, ui-monospace, monospace); font-size: .85em; background: var(--surface-sunken); padding: 1px 6px; border-radius: 6px; }
  .dv-ep { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; scroll-margin-top: 90px; }
  .dv-ep > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
  .dv-ep > summary::-webkit-details-marker { display: none; }
  .dv-ep[open] > summary { border-bottom: 1px solid var(--line); }
  .dv-verb { font-family: var(--font-mono, ui-monospace, monospace); font-size: .6875rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; min-width: 56px; text-align: center; background: var(--surface-sunken); }
  .dv-verb.is-get { background: #e3f1e8; color: #1f6b3d; }
  .dv-verb.is-post { background: #e6ecfb; color: #2d4fb3; }
  .dv-verb.is-patch { background: #fbf0dd; color: #8a5a10; }
  .dv-verb.is-delete { background: #fbe4e2; color: #a2322a; }
  .dv-path { font-family: var(--font-mono, ui-monospace, monospace); font-size: .875rem; font-weight: 600; }
  .dv-ep-body { padding: 14px 16px; display: grid; gap: 10px; }
  .dv-params { width: 100%; border-collapse: collapse; font-size: .8125rem; }
  .dv-params th, .dv-params td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
  .dv-params th { color: var(--text-muted); font-weight: 600; font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
  .dv-params td:first-child { font-family: var(--font-mono, ui-monospace, monospace); white-space: nowrap; }
  @media (max-width: 960px) { .dv-grid, .dv-doc { grid-template-columns: minmax(0, 1fr); } .dv-toc { position: static; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
  @media (max-width: 640px) { .dv-reveal { flex-wrap: wrap; } }
}
@layer components {
  .dv-subtabs { margin-bottom: 16px; }
  .wh-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
  .wh-list { display: grid; gap: 6px; padding: 10px; }
  .wh-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid transparent; text-align: left; width: 100%; background: none; cursor: pointer; }
  .wh-item:hover { background: var(--surface-2); }
  .wh-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
  .wh-kind { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); font-weight: 700; font-size: .8125rem; }
  .wh-kind svg { width: 18px; height: 18px; }
  .wh-kind.is-slack { background: #f4ede4; color: #611f69; }
  .wh-kind.is-discord { background: #e8eafd; color: #4752c4; }
  .wh-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
  .wh-head h2 { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
  .wh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wh-stat { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
  .wh-stat small { display: block; color: var(--text-muted); font-size: .75rem; }
  .wh-stat b { font-size: .9375rem; }
  .wh-events { display: flex; flex-wrap: wrap; gap: 4px; }
  .wh-log { display: grid; }
  .wh-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .875rem; }
  .wh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
  .wh-dot.is-delivered { background: var(--success, #1f8a4c); }
  .wh-dot.is-failed { background: var(--warning); }
  .wh-dot.is-dead { background: var(--danger); }
  .wh-row code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .8125rem; }
  .wh-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
  .wh-pick legend { grid-column: 1 / -1; }
  .wh-pick h4 { grid-column: 1 / -1; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-top: 8px; }
  .wh-check { display: flex; gap: 8px; align-items: center; font-size: .875rem; }
  .wh-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wh-kinds label { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: .875rem; }
  .wh-kinds label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .wh-json { max-height: 420px; overflow: auto; }
  .ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  .ig-card { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
  .ig-card header { display: flex; gap: 12px; align-items: center; }
  .ig-logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1rem; color: #fff; flex: none; }
  .ig-logo svg { width: 20px; height: 20px; }
  .ig-card p { color: var(--text-muted); font-size: .875rem; line-height: 1.5; }
  .ig-card details summary { cursor: pointer; font-size: .875rem; font-weight: 600; }
  .ig-card ol { padding-left: 1.2em; display: grid; gap: 6px; margin-top: 8px; font-size: .8125rem; color: var(--text-muted); line-height: 1.5; }
  .ig-card footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
  .ig-h { font-family: var(--font-display); font-size: 1.1rem; margin: 20px 0 10px; }
  @media (max-width: 960px) { .wh-grid { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 640px) { .wh-stats { grid-template-columns: minmax(0, 1fr); } .wh-pick { grid-template-columns: minmax(0, 1fr); } .wh-row { grid-template-columns: auto minmax(0, 1fr) auto; } .wh-row .wh-when { display: none; } }
}
/* Templates marketplace (ADR-0048) */
@layer components {
  .mp-search { display: flex; align-items: center; gap: 10px; max-width: 520px; margin-top: 18px; padding: 0 16px; height: 50px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
  .mp-search svg { width: 18px; height: 18px; color: var(--text-muted); }
  .mp-search input { flex: 1; border: 0; background: none; outline: none; font: inherit; min-width: 0; }
  .mp-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; align-items: center; }
  .mp-cats a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-muted); text-decoration: none; font-size: .875rem; background: var(--surface); }
  .mp-cats a.is-active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
  .mp-cats .grow { flex: 1; }
  .mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
  .mp-card { display: grid; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow var(--t-fast), transform var(--t-fast); }
  .mp-card:hover { box-shadow: var(--e2, 0 8px 30px rgb(0 0 0 / .08)); transform: translateY(-2px); }
  .mp-thumb { height: 300px; overflow: hidden; position: relative; background: var(--surface-sunken); display: flex; justify-content: center; }
  .mp-thumb .page-preview { flex: none; }
  .mp-meta { display: grid; gap: 2px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .mp-meta small { color: var(--text-muted); font-size: .8125rem; }
  .mp-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .mp-stage { display: flex; justify-content: center; padding: 28px; border-radius: 32px; background: var(--surface-sunken); }
  .mp-info { display: grid; gap: 16px; align-content: start; position: sticky; top: 100px; }
  .mp-info .btn { justify-self: start; }
  .mp-by { color: var(--text-muted); }
  .mp-notes { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; color: var(--text-muted); font-size: .9375rem; }
  .mp-notes li { display: flex; gap: 8px; align-items: center; }
  .mp-notes svg { width: 16px; height: 16px; color: var(--accent); }
  .mp-h { font-family: var(--font-display); font-size: 1.4rem; margin: 48px 0 16px; }
  .mk-row .mk-note { display: flex; gap: 6px; align-items: center; margin-top: 4px; color: var(--danger); font-size: .8125rem; }
  .mk-row .mk-note svg { width: 14px; height: 14px; }
  .mk-share { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; }
  .mk-share-preview { display: flex; justify-content: center; }
  .mk-share-preview .phone { transform: scale(.8); transform-origin: top center; }
  .mk-use { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
  .mk-review { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
  .mk-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .875rem; }
  .mk-facts dt { color: var(--text-muted); }
  @media (max-width: 960px) { .mp-detail, .mk-use, .mk-review { grid-template-columns: minmax(0, 1fr); } .mp-info { position: static; } .mk-share { grid-template-columns: minmax(0, 1fr); } .mk-share-preview { display: none; } }
}
@layer components {
  /* Reviewers see every block: the console preview scrolls instead of cropping. */
  .mk-review .phone { aspect-ratio: auto; height: 640px; }
  .mk-review .phone-screen { overflow-y: auto; }
}
@layer components {
  .mp-card { position: relative; }
  .mp-card-link { font-weight: 700; color: inherit; text-decoration: none; }
  .mp-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole card is the link */
  .mp-card-link:focus-visible { outline: none; }
  .mp-card:has(.mp-card-link:focus-visible) { box-shadow: var(--focus-ring); }
}
/* Partner programme (ADR-0049) */
@layer components {
  .pt-join { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
  .pt-pitch { padding: 28px; color: #fff; border-radius: 26px; display: grid; gap: 14px; }
  .pt-pitch h2 { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: -0.03em; color: #fff; }
  .pt-pitch ol { display: grid; gap: 10px; padding-left: 1.2em; color: rgb(255 255 255 / .85); line-height: 1.5; }
  .pt-pitch b { color: #fff; }
  .pt-link { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
  .pt-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 16px; align-items: start; }
  .pt-details { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono, ui-monospace, monospace); font-size: .875rem; padding: 12px; border-radius: 12px; background: var(--surface-sunken); margin-top: 4px; }
  @media (max-width: 960px) { .pt-join, .pt-grid { grid-template-columns: minmax(0, 1fr); } }
}
@layer components {
  .pt-saved { display: inline-flex; align-items: center; gap: 6px; }
  .pt-saved svg { width: 16px; height: 16px; color: var(--accent); }
}

/* css/site.css */
/* ==========================================================================
   Weesify public pages. Standalone (no app CSS). Themed entirely by --site-* tokens
   set inline from the document theme. Scoped under .ws-site so the builder canvas
   can include the same rules inside the app.
   ========================================================================== */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/Poppins-Regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/Poppins-Medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 600 700; font-display: swap; src: url("/fonts/Poppins-Bold.woff") format("woff"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/fonts/Lora-Italic-Variable.woff") format("woff"); }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url("/fonts/Manrope-Variable.woff") format("woff"); }
@font-face { font-family: "Urbanist"; font-weight: 100 900; font-display: swap; src: url("/fonts/Urbanist-Variable.woff") format("woff"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/InstrumentSerif-Italic.woff") format("woff"); }

.ws-site :is(h1, h2, h3, h4, p, summary, b, strong, blockquote, figcaption) { color: inherit; }
.ws-site :is(b, strong) { font-weight: 700; } /* never inherit the app theme inside the builder canvas / thumbnails */
.ws-page { margin: 0; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
.ws-page *, .ws-page *::before, .ws-page *::after { box-sizing: border-box; }
.ws-page main { min-height: 100dvh; }

.ws-site { --gap: 12px; position: relative; min-height: 100%; background: var(--site-bg); color: var(--site-text); font-family: var(--site-font); font-size: 15px; line-height: 1.55; font-weight: 500; -webkit-font-smoothing: antialiased; overflow: hidden; }
.ws-page .ws-site { min-height: 100dvh; }
.ws-site-inner { width: 100%; max-width: 560px; margin: 0 auto; padding: 44px 18px 40px; display: flex; flex-direction: column; gap: var(--gap); position: relative; }
.ws-site a { color: inherit; text-decoration: none; }
.ws-site svg { width: 18px; height: 18px; flex: none; }
.ws-block { position: relative; animation: ws-rise .5s cubic-bezier(.2,.8,.2,1) both; }
.ws-block:nth-child(2) { animation-delay: .04s } .ws-block:nth-child(3) { animation-delay: .08s } .ws-block:nth-child(4) { animation-delay: .12s } .ws-block:nth-child(5) { animation-delay: .16s } .ws-block:nth-child(n+6) { animation-delay: .2s }
@keyframes ws-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .ws-block { animation: none; } }

/* Profile */
.ws-profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 6px; }
.ws-profile-left { flex-direction: row; text-align: left; }
.ws-profile-hero .ws-avatar { width: 120px; height: 120px; }
.ws-profile-hero .ws-name { font-size: 1.7rem; }
.ws-avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: color-mix(in oklab, var(--site-accent) 22%, var(--site-surface)); color: var(--site-text); font-size: 2rem; font-weight: 600; box-shadow: 0 0 0 4px color-mix(in oklab, var(--site-surface) 70%, transparent), 0 10px 30px -10px rgb(0 0 0 / .25); }
.ws-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ws-name { margin: 0; font-family: var(--site-heading); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; display: inline-flex; align-items: center; gap: 6px; }
.ws-font-lora .ws-name, .ws-font-lora .ws-heading { font-family: "Lora", Georgia, serif; font-style: italic; }
.ws-heading-serif .ws-name, .ws-heading-serif .ws-heading, .ws-heading-serif .ws-card-title, .ws-heading-serif .ws-stats strong { font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.ws-heading-serif .ws-name { font-size: 2.1rem; }
.ws-heading-serif .ws-heading-sm { font-style: normal; font-family: var(--site-font); font-weight: 700; }
.ws-verified { color: var(--site-accent); width: 20px !important; height: 20px !important; }
.ws-bio { margin: 4px 0 0; color: var(--site-muted); max-width: 420px; }

/* Buttons (themed by .ws-btn-*) */
.ws-button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 18px; border-radius: var(--site-radius); font-weight: 700; letter-spacing: -0.01em; transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s, border-color .18s; }
.ws-button:hover { transform: translateY(-2px); }
.ws-button:active { transform: translateY(0) scale(.99); }
.ws-button:focus-visible { outline: 3px solid color-mix(in oklab, var(--site-accent) 60%, transparent); outline-offset: 2px; }
.ws-button-label { flex: 1; text-align: center; }
.ws-button-icon, .ws-button-arrow { width: 22px; display: grid; place-items: center; opacity: .85; }
.ws-button-arrow { opacity: 0; transform: translate(-4px, 4px); transition: opacity .18s, transform .18s; }
.ws-button:hover .ws-button-arrow { opacity: .7; transform: none; }
.ws-btn-solid .ws-button { background: var(--site-btn-bg); color: var(--site-btn-text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.ws-btn-solid .ws-button:hover { box-shadow: 0 10px 24px -12px rgb(0 0 0 / .45); }
.ws-btn-soft .ws-button { background: color-mix(in oklab, var(--site-btn-bg) 16%, transparent); color: var(--site-text); border: 1px solid color-mix(in oklab, var(--site-btn-bg) 30%, transparent); backdrop-filter: blur(8px); }
.ws-btn-soft .ws-button:hover { background: color-mix(in oklab, var(--site-btn-bg) 24%, transparent); }
.ws-btn-outline .ws-button { background: transparent; color: var(--site-text); border: 1.5px solid var(--site-text); }
.ws-btn-outline .ws-button:hover { background: var(--site-text); color: var(--site-bg-base); }
.ws-btn-shadow .ws-button { background: var(--site-surface); color: var(--site-text); box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 8px 22px -10px rgb(0 0 0 / .25); }
.ws-btn-shadow .ws-button:hover { box-shadow: 0 16px 32px -12px rgb(0 0 0 / .32); }
.ws-site .ws-button-featured { background: var(--site-accent) !important; color: var(--site-accent-text) !important; border-color: transparent !important; box-shadow: 0 12px 28px -14px var(--site-accent) !important; }
.ws-site .ws-button-outline { background: transparent !important; color: var(--site-text) !important; border: 1.5px solid currentColor !important; box-shadow: none !important; }

/* Text */
.ws-heading { margin: 16px 0 0; font-family: var(--site-heading); font-weight: 700; letter-spacing: -0.025em; }
.ws-heading-sm { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--site-muted); }
.ws-heading-md { font-size: 1.15rem; }
.ws-heading-lg { font-size: 1.5rem; }
.ws-text { color: var(--site-text); }
.ws-text p { margin: 0 0 .7em; } .ws-text p:last-child { margin-bottom: 0; }
.ws-text a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--site-accent) 70%, transparent); }
.ws-text ul, .ws-text ol { text-align: left; margin: 0 0 .7em; padding-left: 1.3em; }
.ws-divider { display: flex; justify-content: center; padding: 6px 0; }
.ws-divider-line span { display: block; width: 100%; height: 1px; background: color-mix(in oklab, var(--site-text) 14%, transparent); }
.ws-divider-dots span { display: block; width: 40px; height: 6px; background: radial-gradient(circle, color-mix(in oklab, var(--site-text) 35%, transparent) 2px, transparent 2.5px) 0 0 / 13px 6px repeat-x; }
.ws-divider-space span { height: 12px; }

/* Socials */
.ws-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ws-social { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--site-text); transition: background .18s, transform .18s; }
.ws-social:hover { background: color-mix(in oklab, var(--site-text) 8%, transparent); transform: translateY(-2px); }
.ws-socials-sm .ws-social { width: 36px; height: 36px; } .ws-socials-sm svg { width: 16px; height: 16px; }
.ws-socials-lg .ws-social { width: 50px; height: 50px; } .ws-socials-lg svg { width: 24px; height: 24px; }

/* Media */
.ws-image { display: block; margin: 0; overflow: hidden; border-radius: var(--site-radius); box-shadow: 0 10px 30px -18px rgb(0 0 0 / .4); }
.ws-image img { display: block; width: 100%; height: auto; }
.ws-image-square { border-radius: 0; }
.ws-image-wide img { aspect-ratio: 16 / 7; object-fit: cover; }
.ws-embed { width: 100%; overflow: hidden; border-radius: var(--site-radius); background: color-mix(in oklab, var(--site-text) 6%, transparent); }
.ws-embed iframe { display: block; width: 100%; height: 100%; min-height: 152px; border: 0; }
.ws-embed-spotify iframe, .ws-embed-soundcloud iframe { min-height: 152px; }
.ws-placeholder { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 16px; border-radius: var(--site-radius); border: 1.5px dashed color-mix(in oklab, var(--site-text) 22%, transparent); color: var(--site-muted); font-size: 14px; }
.ws-embed-preview { height: 100%; border-style: solid; }

/* Cards (capture, countdown) */
.ws-card { padding: 20px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); box-shadow: 0 12px 32px -22px rgb(0 0 0 / .35); text-align: center; }
.ws-card-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.ws-card-text { margin: 6px 0 0; color: var(--site-muted); font-size: 14px; }
.ws-capture-form { margin-top: 14px; display: grid; gap: 8px; }
.ws-capture-row { display: flex; gap: 8px; }
.ws-input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: calc(var(--site-radius) - 2px); border: 1px solid color-mix(in oklab, var(--site-text) 18%, transparent); background: color-mix(in oklab, var(--site-surface) 80%, white); color: #0E1A15; font: inherit; }
.ws-input:focus { outline: 3px solid color-mix(in oklab, var(--site-accent) 45%, transparent); border-color: var(--site-accent); }
.ws-submit { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 18px; border: 0; border-radius: calc(var(--site-radius) - 2px); background: var(--site-accent); color: var(--site-accent-text); font: inherit; font-weight: 600; cursor: pointer; transition: filter .15s, transform .15s; }
.ws-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ws-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--site-muted); text-align: left; }
.ws-consent input { margin-top: 3px; accent-color: var(--site-accent); }
.ws-success { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 14px 0 0; color: var(--site-text); font-weight: 500; }
.ws-success svg { color: var(--site-accent); }
.ws-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ws-countdown-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ws-countdown-grid div { display: grid; padding: 10px 4px; border-radius: calc(var(--site-radius) - 4px); background: color-mix(in oklab, var(--site-accent) 12%, transparent); }
.ws-countdown-grid strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ws-countdown-grid span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--site-muted); }
.ws-countdown-ended { margin: 10px 0 0; font-weight: 600; }

/* FAQ */
.ws-faq { display: grid; gap: 8px; }
.ws-faq-item { border-radius: var(--site-radius); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); }
.ws-faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 500; list-style: none; }
.ws-faq-item summary::-webkit-details-marker { display: none; }
.ws-faq-item summary span { transition: transform .2s; display: grid; }
.ws-faq-item[open] summary span { transform: rotate(45deg); }
.ws-faq-item p { margin: 0; padding: 0 16px 14px; color: var(--site-muted); font-size: 14px; }

/* Branding + empty */
.ws-branding { margin: 22px auto 0; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--site-text, #0E1A15); background: color-mix(in oklab, var(--site-surface, #fff) 70%, transparent); border: 1px solid color-mix(in oklab, var(--site-text, #0E1A15) 10%, transparent); backdrop-filter: blur(6px); opacity: .85; }
.ws-branding:hover { opacity: 1; }
.ws-branding svg { width: 16px !important; height: 14px !important; color: #0BC284; }
.ws-empty { padding: 40px 16px; text-align: center; color: var(--site-muted); border: 1.5px dashed color-mix(in oklab, var(--site-text) 18%, transparent); border-radius: var(--site-radius); }

/* System pages (gate / 404 / sensitive) */
.ws-system { --site-text: #0E1A15; --site-muted: #56655E; --site-accent: #0BC284; --site-accent-text: #fff; --site-surface: #fff; --site-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; font-family: "Poppins", system-ui, sans-serif; color: #0E1A15; background: radial-gradient(90% 60% at 50% 0%, #D6FAEA 0%, #F6FAF8 55%, #FFFFFF 100%); }
.ws-system main { min-height: 0; }
.ws-system-card { width: 100%; max-width: 400px; padding: 32px 28px; text-align: center; background: #fff; border: 1px solid #E3E9E6; border-radius: 22px; box-shadow: 0 30px 60px -30px rgb(8 50 36 / .35); }
.ws-system-card h1 { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.ws-system-card p { margin: 8px 0 0; color: #56655E; font-size: 14px; }
.ws-system-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: #EAFDF5; color: #067A53; }
.ws-system-icon svg { width: 24px; height: 24px; }
.ws-system-links { margin-top: 18px; font-size: 14px; color: #6B7280; }
.ws-system-links a { color: #067A53; font-weight: 600; text-decoration: none; }
.ws-system-links a:hover { text-decoration: underline; }
.ws-brand-icon svg { width: 32px; height: 26px; }
.ws-gate-form { margin-top: 18px; display: grid; gap: 10px; }
.ws-gate-form .ws-submit { width: 100%; }
.ws-error { margin: 0 !important; color: #C93434 !important; font-size: 13px !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 420px) { .ws-capture-row { flex-direction: column; } .ws-capture-row .ws-input { flex: none; width: 100%; } .ws-submit { width: 100%; } }
.ws-system a.ws-submit, .ws-branding { text-decoration: none; }


/* ==========================================================================
   v2 premium layer: cover profiles, glass cards, tiles, highlights, quotes
   ========================================================================== */
.ws-dark { color-scheme: dark; }
.ws-profile-cover { margin: -44px -18px 6px; gap: 10px; }
.ws-cover { width: 100%; height: 190px; background: var(--site-cover, none); background-size: cover; background-position: center; border-radius: 0 0 34px 34px; position: relative; overflow: hidden; }
.ws-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 80% 0%, rgb(255 255 255 / .28), transparent 60%); pointer-events: none; }
.ws-light .ws-cover:not([style]) { background: var(--site-cover); }
.ws-profile-cover .ws-avatar { position: relative; z-index: 1; width: 112px; height: 112px; margin-top: -64px; font-size: 2.3rem; font-family: var(--site-heading); font-weight: 700; box-shadow: 0 0 0 5px var(--site-bg-base), 0 18px 40px -16px rgb(0 0 0 / .45); background: linear-gradient(145deg, color-mix(in oklab, var(--site-accent) 70%, #000), var(--site-accent)); color: var(--site-accent-text); }
.ws-profile-cover .ws-profile-text { padding: 0 18px; }
.ws-profile-cover .ws-bio { margin: 6px auto 0; }
.ws-profile-hero .ws-avatar { width: 128px; height: 128px; }
.ws-profile-hero .ws-name { font-size: 2rem; }

.ws-btn-glass .ws-button { background: color-mix(in oklab, var(--site-surface) 100%, transparent); color: var(--site-text); border: 1px solid color-mix(in oklab, var(--site-text) 12%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 10px 30px -18px rgb(0 0 0 / .5); }
.ws-btn-glass .ws-button:hover { background: color-mix(in oklab, var(--site-text) 10%, transparent); border-color: color-mix(in oklab, var(--site-accent) 45%, transparent); }
.ws-button-icon { width: 34px; height: 34px; margin: -4px 0 -4px -6px; border-radius: calc(var(--site-radius) - 6px); background: color-mix(in oklab, currentColor 10%, transparent); opacity: 1; }
.ws-button-icon svg { width: 17px; height: 17px; }
.ws-button-featured { position: relative; overflow: hidden; }
.ws-button-featured::after { content: ""; position: absolute; top: -50%; bottom: -50%; left: -30%; width: 30%; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent); animation: ws-sheen 4.5s ease-in-out infinite; }
@keyframes ws-sheen { 0%, 60% { left: -40%; } 100% { left: 130%; } }

.ws-card-glass .ws-card, .ws-card-glass .ws-faq-item, .ws-card-glass .ws-quote, .ws-card-glass .ws-stats { background: var(--site-surface); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-color: color-mix(in oklab, var(--site-text) 11%, transparent); }
.ws-card { border-radius: calc(var(--site-radius) + 6px); padding: 22px; }
.ws-card-title { font-family: var(--site-heading); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.ws-dark .ws-input { background: rgb(255 255 255 / .08); color: var(--site-text); border-color: rgb(255 255 255 / .14); }
.ws-dark .ws-input::placeholder { color: color-mix(in oklab, var(--site-text) 50%, transparent); }
.ws-dark .ws-social:hover { background: rgb(255 255 255 / .08); }
.ws-social { background: color-mix(in oklab, var(--site-text) 6%, transparent); }

/* Tiles */
.ws-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ws-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 124px; padding: 14px; border-radius: calc(var(--site-radius) + 2px); overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; isolation: isolate; }
a.ws-tile:hover { transform: translateY(-3px); }
.ws-tile-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.ws-tile-text { display: grid; gap: 2px; }
.ws-tile-text b { font-family: var(--site-heading); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.ws-tile-text small { font-size: 12.5px; opacity: .72; font-weight: 600; }
.ws-tile-arrow { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .18); }
.ws-tile-arrow svg { width: 14px; height: 14px; }
.ws-tiles-gradient .ws-tile { color: #fff; box-shadow: 0 14px 30px -18px rgb(0 0 0 / .5); }
.ws-tiles-gradient .ws-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 90% at 100% 0%, rgb(255 255 255 / .35), transparent 55%), linear-gradient(150deg, color-mix(in oklab, var(--site-accent) 88%, #fff), color-mix(in oklab, var(--site-accent) 70%, #000)); }
.ws-tiles-gradient .ws-tile:nth-child(4n+2)::before { background: radial-gradient(90% 90% at 100% 0%, rgb(255 255 255 / .3), transparent 55%), linear-gradient(150deg, color-mix(in oklab, var(--site-text) 80%, var(--site-accent)), var(--site-text)); }
.ws-tiles-gradient .ws-tile:nth-child(4n+3)::before { background: radial-gradient(90% 90% at 100% 0%, rgb(255 255 255 / .3), transparent 55%), linear-gradient(150deg, color-mix(in oklab, var(--site-accent) 55%, #7C5CFF), color-mix(in oklab, var(--site-accent) 35%, #3A1FB0)); }
.ws-tiles-gradient .ws-tile-icon { background: rgb(255 255 255 / .18); }
.ws-tiles-gradient .ws-tile:nth-child(4n+2) { color: var(--site-bg-base); }
.ws-dark .ws-tiles-gradient .ws-tile:nth-child(4n+2) { color: #0A0B0B; }
.ws-tiles-surface .ws-tile { background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); box-shadow: 0 12px 30px -22px rgb(0 0 0 / .4); }
.ws-tiles-surface .ws-tile-icon { background: color-mix(in oklab, var(--site-accent) 16%, transparent); color: var(--site-accent); }
.ws-tiles-surface .ws-tile-arrow { background: color-mix(in oklab, var(--site-text) 7%, transparent); }
.ws-tiles-outline .ws-tile { border: 1.5px solid color-mix(in oklab, var(--site-text) 22%, transparent); }
.ws-tiles-outline .ws-tile-icon { border: 1.5px solid currentColor; }
.ws-card-glass .ws-tiles-surface .ws-tile { backdrop-filter: blur(16px); }

/* Highlights */
.ws-stats { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; padding: 16px 8px; border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); text-align: center; }
.ws-stats > div { display: grid; gap: 2px; position: relative; }
.ws-stats > div + div::before { content: ""; position: absolute; left: -2px; top: 12%; bottom: 12%; width: 1px; background: color-mix(in oklab, var(--site-text) 12%, transparent); }
.ws-stats strong { font-family: var(--site-heading); font-size: 1.65rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.ws-stats span { font-size: 12px; font-weight: 600; color: var(--site-muted); text-transform: uppercase; letter-spacing: .06em; }

/* Quote */
.ws-quote { margin: 0; padding: 22px 22px 20px; border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); position: relative; }
.ws-quote-mark { width: 30px !important; height: 30px !important; color: var(--site-accent); margin-bottom: 6px; }
.ws-quote blockquote { margin: 0; font-family: var(--site-heading); font-size: 1.15rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.015em; }
.ws-heading-serif .ws-quote blockquote { font-style: italic; font-weight: 400; font-size: 1.35rem; }
.ws-quote figcaption { margin-top: 12px; font-size: 13px; color: var(--site-muted); }
.ws-quote figcaption b { color: var(--site-text); }

.ws-dark .ws-branding { background: rgb(255 255 255 / .08); color: var(--site-text); border-color: rgb(255 255 255 / .12); }
@media (min-width: 720px) { .ws-cover { height: 220px; border-radius: 0 0 40px 40px; } .ws-page .ws-profile-cover { margin-top: -44px; } }

/* ---- Weesify Forms (hosted, embedded, builder canvas) ---- */
.wf { display: grid; gap: 18px; text-align: left; }
.wf-head { display: grid; gap: 8px; }
.wf-title { font-family: var(--site-heading); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.08; letter-spacing: -0.03em; color: var(--site-text); margin: 0; }
.wf-intro { color: var(--site-muted); font-size: 15px; line-height: 1.55; margin: 0; white-space: pre-line; }
.wf-progress { height: 6px; border-radius: 999px; background: color-mix(in oklab, var(--site-text) 10%, transparent); overflow: hidden; }
.wf-progress span { display: block; height: 100%; border-radius: inherit; background: var(--site-accent); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.wf-stepcount { margin: -8px 0 0; font-size: 12px; font-weight: 600; color: var(--site-muted); letter-spacing: .02em; }
.wf:not(.wf-js) .wf-stepcount, .wf:not(.wf-js) .wf-progress { display: none; }
.wf-step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
.wf-step[hidden] { display: none; }
.wf-step-title { font-family: var(--site-heading); font-size: 1.2rem; font-weight: 700; color: var(--site-text); padding: 0; margin-bottom: 4px; }
.wf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wf-field { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; position: relative; }
.wf-field.wf-w-half { grid-column: span 1; }
@media (max-width: 520px) { .wf-field.wf-w-half { grid-column: 1 / -1; } }
.wf-field[hidden] { display: none; }
.wf-label { font-weight: 600; font-size: 14px; color: var(--site-text); }
.wf-req { font-style: normal; color: var(--site-accent); margin-left: 3px; }
.wf-help { font-size: 12.5px; color: var(--site-muted); margin: -2px 0 2px; line-height: 1.45; }
.wf-input { box-sizing: border-box; width: 100%; height: 48px; padding: 0 14px; border-radius: calc(var(--site-radius) - 4px); border: 1px solid color-mix(in oklab, var(--site-text) 16%, transparent); background: color-mix(in oklab, var(--site-surface) 85%, white); color: #0E1A15; font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.ws-dark .wf-input { background: rgb(255 255 255 / .06); color: var(--site-text); border-color: rgb(255 255 255 / .16); }
.wf-input::placeholder { color: color-mix(in oklab, var(--site-muted) 80%, transparent); }
.wf-input:focus { outline: none; border-color: var(--site-accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--site-accent) 22%, transparent); }
.wf-textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.wf-select-wrap { position: relative; }
.wf-select-wrap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--site-muted); border-bottom: 2px solid var(--site-muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.wf-select { appearance: none; padding-right: 40px; }
.wf-choices { display: grid; gap: 8px; }
.wf-choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: calc(var(--site-radius) - 4px); border: 1px solid color-mix(in oklab, var(--site-text) 14%, transparent); background: color-mix(in oklab, var(--site-surface) 90%, transparent); cursor: pointer; font-size: 15px; color: var(--site-text); transition: border-color .15s, background .15s; }
.wf-choice input { position: absolute; opacity: 0; pointer-events: none; }
.wf-choice-mark { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--site-text) 30%, transparent); display: grid; place-items: center; transition: all .15s; }
.wf-t-checkboxes .wf-choice-mark { border-radius: 6px; }
.wf-choice:has(input:checked) { border-color: var(--site-accent); background: color-mix(in oklab, var(--site-accent) 10%, var(--site-surface)); }
.wf-choice input:checked + .wf-choice-mark { border-color: var(--site-accent); background: var(--site-accent); box-shadow: inset 0 0 0 3px var(--site-surface); }
.wf-t-checkboxes .wf-choice input:checked + .wf-choice-mark { box-shadow: none; background: var(--site-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.wf-choice:has(input:focus-visible) { box-shadow: 0 0 0 4px color-mix(in oklab, var(--site-accent) 22%, transparent); }
.wf-rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.wf-rating input { position: absolute; opacity: 0; pointer-events: none; }
.wf-rating label { cursor: pointer; color: color-mix(in oklab, var(--site-text) 22%, transparent); transition: color .12s, transform .12s; }
.wf-rating label svg { width: 34px; height: 34px; fill: currentColor; }
.wf-rating label:hover, .wf-rating label:hover ~ label, .wf-rating input:checked ~ label { color: #F5B82E; }
.wf-rating label:hover { transform: scale(1.08); }
.wf-rating input:focus-visible + label { outline: 3px solid color-mix(in oklab, var(--site-accent) 45%, transparent); border-radius: 8px; }
.wf-consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: calc(var(--site-radius) - 4px); background: color-mix(in oklab, var(--site-accent) 7%, transparent); font-size: 13.5px; line-height: 1.45; color: var(--site-text); cursor: pointer; }
.wf-consent input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--site-accent); flex: none; }
.wf-heading { font-family: var(--site-heading); font-size: 1.25rem; margin: 8px 0 0; color: var(--site-text); letter-spacing: -0.02em; }
.wf-paragraph { margin: 0; color: var(--site-muted); line-height: 1.55; white-space: pre-line; }
.wf-break { display: flex; align-items: center; gap: 10px; color: var(--site-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wf-break::before, .wf-break::after { content: ""; flex: 1; height: 1px; background: color-mix(in oklab, var(--site-text) 14%, transparent); }
.wf-break span { display: inline-flex; align-items: center; gap: 6px; }
.wf-break svg { width: 14px; height: 14px; }
.wf-field.has-error .wf-input, .wf-field.has-error .wf-choice { border-color: #E5484D; }
.wf-error { margin: 0; font-size: 12.5px; color: #E5484D; font-weight: 600; }
.wf-alert { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgb(229 72 77 / .1); color: #C4333A; font-size: 14px; font-weight: 600; }
.wf-alert svg { width: 18px; height: 18px; flex: none; }
.wf-nav { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 4px; }
.wf-nav .ws-submit { min-width: 140px; height: 50px; gap: 8px; }
.wf-nav .ws-submit svg { width: 16px; height: 16px; }
.wf-submit.is-sending { opacity: .7; }
.wf-back { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; background: none; border: 0; font: inherit; font-weight: 600; color: var(--site-muted); cursor: pointer; padding: 10px 4px; }
.wf-back svg { width: 16px; height: 16px; }
.wf-back[hidden], .wf-next[hidden], .wf-submit[hidden] { display: none; }
@media (max-width: 420px) { .wf-nav .ws-submit { flex: 1; } }
.wf-logic-badge { position: absolute; top: -9px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: #7C5CFF; z-index: 2; }
.wf-logic-badge svg { width: 11px; height: 11px; }

/* Hosted form page */
.wf-page { min-height: 100dvh; background: var(--site-bg); color: var(--site-text); font-family: var(--site-font); }
.wf-page-cover { height: clamp(120px, 22vw, 200px); background: var(--site-cover); }
.wf-page-inner { width: min(640px, 100% - 28px); margin: calc(-1 * clamp(60px, 10vw, 100px)) auto 40px; }
.wf-page-card { padding: clamp(22px, 5vw, 40px); border-radius: calc(var(--site-radius) + 10px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 8%, transparent); box-shadow: 0 30px 80px -40px rgb(0 0 0 / .45); backdrop-filter: blur(12px); }
.wf-page-by { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13px; font-weight: 600; color: var(--site-muted); }
.wf-page-by i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-style: normal; color: var(--site-accent-text); background: var(--site-accent); font-weight: 800; }
.wf-done { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 20px 0; }
.wf-done-icon { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; background: var(--site-accent); color: var(--site-accent-text); box-shadow: 0 20px 40px -20px var(--site-accent); animation: wf-pop .5s cubic-bezier(.2,1.4,.4,1); }
.wf-done-icon svg { width: 34px; height: 34px; }
.wf-done h1 { font-family: var(--site-heading); font-size: 1.8rem; margin: 6px 0 0; letter-spacing: -0.03em; }
.wf-done p { color: var(--site-muted); margin: 0; max-width: 44ch; line-height: 1.55; white-space: pre-line; }
.wf-done .wf-note { margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: color-mix(in oklab, var(--site-accent) 10%, transparent); color: var(--site-text); font-size: 14px; font-weight: 600; }
@keyframes wf-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wf-done-icon { animation: none; } .wf-progress span { transition: none; } }
.ws-block-form .ws-card { text-align: left; }

/* ---- Module actions: premium trigger card + sheet (forms today; store, bookings, courses next) ---- */
.ws-action-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); color: var(--site-text); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); box-shadow: 0 14px 34px -22px rgb(0 0 0 / .45); overflow: hidden; isolation: isolate; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; text-decoration: none; }
.ws-action-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--site-accent) 22%, transparent), transparent 55%); }
.ws-action-card:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -24px rgb(0 0 0 / .5); }
.ws-action-card:focus-visible { outline: 3px solid color-mix(in oklab, var(--site-accent) 60%, transparent); outline-offset: 2px; }
.ws-action-icon { width: 48px; height: 48px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--site-accent); color: var(--site-accent-text); box-shadow: 0 10px 22px -12px var(--site-accent); }
.ws-action-icon svg { width: 22px; height: 22px; }
.ws-action-text { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; }
.ws-action-text b { font-family: var(--site-heading); font-size: 16px; letter-spacing: -0.01em; }
.ws-action-text small { color: var(--site-muted); font-size: 12.5px; font-weight: 500; }
.ws-action-go { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--site-text) 7%, transparent); transition: transform .2s; }
.ws-action-go svg { width: 16px; height: 16px; }
.ws-action-card:hover .ws-action-go { transform: translateX(3px); background: var(--site-accent); color: var(--site-accent-text); }

.ws-sheet { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; justify-items: center; }
.ws-sheet[hidden] { display: none; }
.ws-sheet-backdrop { position: absolute; inset: 0; background: rgb(8 10 9 / .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .28s ease; }
.ws-sheet-panel { position: relative; width: min(560px, 100%); max-height: min(92dvh, 900px); overflow-y: auto; overscroll-behavior: contain; background: var(--site-bg-base); background-image: var(--site-bg); color: var(--site-text); font-family: var(--site-font); border-radius: 28px 28px 0 0; box-shadow: 0 -30px 80px -30px rgb(0 0 0 / .6); transform: translateY(40px); opacity: 0; transition: transform .38s cubic-bezier(.2,.9,.25,1), opacity .25s ease; padding-bottom: env(safe-area-inset-bottom); }
.ws-sheet.is-open .ws-sheet-backdrop { opacity: 1; }
.ws-sheet.is-open .ws-sheet-panel { transform: none; opacity: 1; }
@media (min-width: 640px) { .ws-sheet { align-items: center; padding: 24px; } .ws-sheet-panel { border-radius: 28px; transform: translateY(16px) scale(.98); } }
.ws-sheet-grab { display: block; width: 44px; height: 5px; border-radius: 999px; margin: 10px auto 0; background: color-mix(in oklab, var(--site-text) 22%, transparent); }
@media (min-width: 640px) { .ws-sheet-grab { display: none; } }
.ws-sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px 16px; background: linear-gradient(var(--site-bg-base) 70%, color-mix(in oklab, var(--site-bg-base) 0%, transparent)); }
.ws-sheet-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--site-cover); opacity: .9; }
.ws-sheet-icon { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--site-accent); color: var(--site-accent-text); box-shadow: 0 12px 24px -14px var(--site-accent); }
.ws-sheet-icon svg { width: 22px; height: 22px; }
.ws-sheet-titles { flex: 1; min-width: 0; }
.ws-sheet-titles h2 { margin: 2px 0 4px; font-family: var(--site-heading); font-size: 1.35rem; line-height: 1.15; letter-spacing: -0.025em; }
.ws-sheet-titles p { margin: 0; color: var(--site-muted); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.ws-sheet-close { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: color-mix(in oklab, var(--site-text) 8%, transparent); color: var(--site-text); cursor: pointer; }
.ws-sheet-close:hover { background: color-mix(in oklab, var(--site-text) 14%, transparent); }
.ws-sheet-close svg { width: 18px; height: 18px; }
.ws-sheet-body { padding: 4px 20px 24px; }
.ws-sheet-body .wf { background: var(--site-surface); padding: 18px; border-radius: calc(var(--site-radius) + 4px); border: 1px solid color-mix(in oklab, var(--site-text) 8%, transparent); }
html.ws-sheet-lock, html.ws-sheet-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .ws-sheet-panel, .ws-sheet-backdrop { transition: none; } }
.ws-action-thumb { width: 56px; height: 56px; flex: none; border-radius: 14px; object-fit: cover; box-shadow: 0 10px 22px -14px rgb(0 0 0 / .5); }
.ws-action-meta { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--site-accent); color: var(--site-accent-text); font-weight: 800; font-size: 13.5px; box-shadow: 0 10px 20px -12px var(--site-accent); }

/* ---- Shop: product details + checkout ---- */
.shop { display: grid; gap: 14px; text-align: left; }
.shop-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: calc(var(--site-radius) + 2px); box-shadow: 0 20px 44px -28px rgb(0 0 0 / .55); }
.shop-name { margin: 4px 0 0; font-family: var(--site-heading); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.08; letter-spacing: -0.03em; color: var(--site-text); }
.shop-tagline { margin: -6px 0 0; color: var(--site-muted); font-size: 15px; }
.shop-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0; }
.shop-price b { font-family: var(--site-heading); font-size: 1.7rem; letter-spacing: -0.03em; color: var(--site-text); }
.shop-price s { color: var(--site-muted); font-size: 15px; }
.shop-save { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: color-mix(in oklab, var(--site-accent) 16%, transparent); color: var(--site-text); }
.shop-desc { color: var(--site-text); opacity: .86; line-height: 1.6; white-space: pre-line; font-size: 15px; }
.shop-includes { list-style: none; margin: 0; padding: 14px; display: grid; gap: 9px; border-radius: calc(var(--site-radius) - 2px); background: color-mix(in oklab, var(--site-accent) 7%, transparent); }
.shop-includes li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; font-weight: 600; color: var(--site-text); }
.shop-includes svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--site-accent); stroke-width: 3; }
.shop-form { display: grid; gap: 14px; padding-top: 6px; border-top: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.shop-buy { width: 100%; height: 54px; gap: 10px; font-size: 16px; }
.shop-buy svg { width: 18px; height: 18px; }
.shop-trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--site-muted); text-align: center; }
.shop-trust svg { width: 14px; height: 14px; }
.shop-delivery-msg { margin: 6px 0 0; padding: 14px; border-radius: 14px; background: color-mix(in oklab, var(--site-accent) 8%, transparent); white-space: pre-line; line-height: 1.55; }
.shop-dl-title { margin: 18px 0 8px; font-family: var(--site-heading); font-size: 1.1rem; }
.shop-dl { display: grid; gap: 10px; }

/* Checkout in the sheet (ADR-0014): the details form gives way to Weesify's own pay page in a frame. */
.shop-payframe { display: block; width: 100%; min-height: 420px; border: 0; border-radius: calc(var(--site-radius) + 2px); background: transparent; }
.shop.is-paying > :not(.shop-payframe) { display: none; }
body.is-framed { background: transparent; }
body.is-framed .wf-page { min-height: 0; padding: 0; background: transparent; }
body.is-framed .wf-page-inner { padding: 0; }
body.is-framed .wf-page-card { box-shadow: none; padding: 4px 2px 12px; background: transparent; border: 0; }

/* Weesify pay page */
.pay { display: grid; gap: 16px; }
.pay-summary { display: grid; gap: 4px; padding: 16px 18px; border-radius: calc(var(--site-radius) + 2px); background: color-mix(in oklab, var(--site-accent) 7%, var(--site-card)); border: 1px solid color-mix(in oklab, var(--site-accent) 18%, transparent); }
.pay-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--site-text); }
.pay-line b { font-family: var(--site-heading); font-size: 1.6rem; letter-spacing: -0.03em; white-space: nowrap; }
.pay-line.is-muted { color: var(--site-muted); font-size: 13px; }
.pay-test { display: flex; gap: 8px; align-items: center; margin: 0; padding: 9px 12px; border-radius: 12px; background: #FFF6DB; color: #7A5A00; font-size: 13px; font-weight: 600; }
.pay-test svg, .pay-alert svg { width: 16px; height: 16px; flex: none; }
.pay-alert { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #FDECEC; color: #9B1C1C; font-size: 14px; }
.pay-alert[hidden] { display: none; }
.pay-form { display: grid; gap: 14px; }
.pay-element { min-height: 140px; }
.pay-card { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.pay-hint { margin: -4px 0 0; text-align: center; color: var(--site-muted); font-size: 12.5px; }
.shop-buy.is-busy { opacity: .7; pointer-events: none; }

/* Reporting (ADR-0017) */
.ws-report-link { display: block; width: max-content; margin: 10px auto 0; font-size: 12px; opacity: .55; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.ws-report-link:hover { opacity: .9; }
.ws-report { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.ws-field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.ws-field small { font-weight: 500; opacity: .7; }
.ws-field textarea.ws-input { height: auto; padding: 12px 14px; resize: vertical; }
.ws-field select.ws-input { appearance: auto; }
.ws-error { color: #D93A3A; font-weight: 600; opacity: 1 !important; }
.ws-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Bookings (ADR-0022): day chips, time grid, booking card ------------------------------------------------------- */
.bk { display: grid; gap: 12px; margin: 4px 0 18px; }
.bk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--site-muted); }
.bk-meta svg { width: 15px; height: 15px; }
.bk-meta span { opacity: .5; }
.bk-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.bk-day { flex: none; scroll-snap-align: start; cursor: pointer; }
.bk-day input { position: absolute; opacity: 0; pointer-events: none; }
.bk-day span { display: grid; justify-items: center; gap: 0; width: 60px; padding: 9px 0; border-radius: calc(var(--site-radius) + 2px); border: 1.5px solid color-mix(in oklab, var(--site-text) 14%, transparent); background: var(--site-surface); color: var(--site-text); transition: border-color .15s, background .15s, transform .15s; }
.bk-day span b { font-size: 20px; line-height: 1.15; font-weight: 800; }
.bk-day span small { font-size: 11px; color: var(--site-muted); font-weight: 600; }
.bk-day:hover span { transform: translateY(-1px); }
.bk-day input:checked + span { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-accent-text); }
.bk-day input:checked + span small { color: inherit; opacity: .85; }
.bk-day input:focus-visible + span { outline: 3px solid color-mix(in oklab, var(--site-accent) 45%, transparent); outline-offset: 2px; }
.bk-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.bk-times-head { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--site-heading); }
@supports selector(:has(a)) { .bk-times-head { display: none; } }
.bk-time { cursor: pointer; }
.bk-time input { position: absolute; opacity: 0; pointer-events: none; }
.bk-time span { display: grid; justify-items: center; padding: 11px 6px; border-radius: calc(var(--site-radius) - 2px); border: 1.5px solid color-mix(in oklab, var(--site-text) 14%, transparent); background: var(--site-surface); font-weight: 700; font-size: 15px; color: var(--site-text); transition: border-color .15s, background .15s; }
.bk-time span small { font-size: 11px; font-weight: 600; color: var(--site-muted); }
.bk-time:hover span { border-color: var(--site-accent); }
.bk-time input:checked + span { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-accent-text); }
.bk-time input:checked + span small { color: inherit; }
.bk-time input:focus-visible + span { outline: 3px solid color-mix(in oklab, var(--site-accent) 45%, transparent); outline-offset: 2px; }
.bk.has-error .bk-times { outline: 2px solid #D93A3A; outline-offset: 6px; border-radius: 8px; }
.bk-card { display: grid; gap: 8px; margin: 16px 0; padding: 16px 18px; border-radius: calc(var(--site-radius) + 4px); border: 1px solid color-mix(in oklab, var(--site-text) 12%, transparent); background: var(--site-surface); color: var(--site-text); font-size: 15px; }
.bk-card b { font-size: 18px; color: var(--site-heading); }
.bk-card span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-card svg { width: 16px; height: 16px; color: var(--site-muted); flex: none; }
.bk-card small { color: var(--site-muted); }
.bk-card a { color: var(--site-accent); font-weight: 700; }
.bk-cancel { margin-top: 14px; }
.bk-cancel summary { cursor: pointer; font-size: 14px; color: var(--site-muted); font-weight: 600; }
.bk-cancel details[open] summary { margin-bottom: 10px; }

/* Courses (ADR-0023): curriculum on the sales page, the student area, certificates ------------------------------- */
.cs-curr { margin: 6px 0 20px; padding: 16px; border-radius: calc(var(--site-radius) + 4px); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); background: color-mix(in oklab, var(--site-surface) 80%, transparent); }
.cs-curr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.cs-curr-head b { color: var(--site-heading); font-size: 16px; } .cs-curr-head span { font-size: 13px; color: var(--site-muted); }
.cs-curr-section { margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--site-muted); }
.cs-curr-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cs-curr-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid color-mix(in oklab, var(--site-text) 8%, transparent); font-size: 14.5px; color: var(--site-text); }
.cs-curr-list li:first-child { border-top: 0; }
.cs-curr-icon svg { width: 16px; height: 16px; color: var(--site-muted); display: block; }
.cs-curr-title { flex: 1; min-width: 0; }
.cs-curr-list small { color: var(--site-muted); font-size: 12px; }
.cs-curr-preview { font-size: 12.5px; font-weight: 700; color: var(--site-accent); text-decoration: none; padding: 3px 9px; border-radius: 99px; background: color-mix(in oklab, var(--site-accent) 12%, transparent); }
.cs-curr-by { margin: 10px 0 0; font-size: 13px; color: var(--site-muted); }
.cs-access { margin-top: 12px; font-size: 13.5px; }
.cs-access summary { cursor: pointer; color: var(--site-muted); font-weight: 600; }
.cs-access-form { display: grid; gap: 8px; margin-top: 10px; }

.lr { min-height: 100dvh; background: var(--site-bg-base); color: var(--site-text); font-family: var(--site-font); }
.lr-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 3vw, 28px); background: color-mix(in oklab, var(--site-surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.lr-bar-title { display: grid; flex: 1; min-width: 0; }
.lr-bar-title small { font-size: 11.5px; color: var(--site-muted); font-weight: 600; }
.lr-bar-title b { color: var(--site-heading); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-progress { width: min(200px, 30vw); height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--site-text) 10%, transparent); overflow: hidden; }
.lr-progress span { display: block; height: 100%; border-radius: inherit; background: var(--site-accent); transition: width .5s; }
.lr-pct { font-weight: 800; font-size: 13px; color: var(--site-heading); min-width: 38px; text-align: right; }
.lr-cta { font-weight: 800; font-size: 14px; padding: 9px 16px; border-radius: 99px; background: var(--site-accent); color: var(--site-accent-text); text-decoration: none; }
.lr-body { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1180px; margin: 0 auto; gap: 24px; padding: 20px clamp(14px, 3vw, 28px) 60px; }
@media (min-width: 960px) { .lr-body { grid-template-columns: 300px minmax(0, 1fr); } .lr-nav { position: sticky; top: 76px; align-self: start; max-height: calc(100dvh - 96px); overflow: auto; } }
.lr-nav-toggle { border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); padding: 6px; }
.lr-nav-toggle summary { display: flex; justify-content: space-between; padding: 10px 12px; font-weight: 800; cursor: pointer; color: var(--site-heading); list-style: none; }
.lr-nav-toggle summary span { color: var(--site-muted); font-weight: 600; font-size: 13px; }
.lr-nav-section { margin: 10px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--site-muted); }
.lr-nav ol { list-style: none; margin: 0; padding: 0; }
.lr-nav li a, .lr-nav-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; color: var(--site-text); text-decoration: none; font-size: 14px; }
.lr-nav li a:hover { background: color-mix(in oklab, var(--site-text) 6%, transparent); }
.lr-nav li.is-current a { background: color-mix(in oklab, var(--site-accent) 14%, transparent); font-weight: 700; }
.lr-nav li i { flex: none; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; border: 1.5px solid color-mix(in oklab, var(--site-text) 20%, transparent); }
.lr-nav li i svg { width: 12px; height: 12px; }
.lr-nav li.is-done i { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-accent-text); }
.lr-nav li.is-locked { opacity: .55; }
.lr-nav li small { display: block; font-size: 11.5px; color: var(--site-muted); }
.lr-main { min-width: 0; }
.lr-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--site-accent); }
.lr-title { margin: 0 0 16px; color: var(--site-heading); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.12; }
.lr-video { position: relative; aspect-ratio: 16 / 9; border-radius: calc(var(--site-radius) + 6px); overflow: hidden; background: #000; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .5); margin-bottom: 22px; }
.lr-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lr-text { font-size: 16.5px; line-height: 1.7; max-width: 70ch; }
.lr-text h2 { font-size: 1.3rem; color: var(--site-heading); margin: 24px 0 8px; }
.lr-text a { color: var(--site-accent); font-weight: 600; }
.lr-text ul { padding-left: 20px; }
.lr-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); flex-wrap: wrap; }
.lr-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--site-text); text-decoration: none; padding: 12px 14px; border-radius: 12px; }
.lr-btn svg, .lr-done svg { width: 16px; height: 16px; }
.lr-done { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 22px; }
.lr-empty, .lr-finished { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 40px 20px; border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); margin-bottom: 20px; }
.lr-empty svg { width: 28px; height: 28px; color: var(--site-muted); }
.lr-empty h1, .lr-finished h1 { margin: 6px 0 0; color: var(--site-heading); font-size: 1.5rem; }
.lr-finished span svg { width: 44px; height: 44px; color: var(--site-accent); }
.lr-finished .ws-submit { width: auto; padding: 0 24px; margin-top: 10px; display: inline-flex; align-items: center; text-decoration: none; }
.lr-preview-note { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--site-muted); margin: 0 0 12px; }
.lr-preview-note svg { width: 15px; height: 15px; }
.lr-preview-note a { color: var(--site-accent); font-weight: 700; }

.cert-page { margin: 0; min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #EDE7FF, transparent 50%), radial-gradient(circle at 90% 90%, #D8F7EA, transparent 50%), #F7F8F5; font-family: Georgia, 'Times New Roman', serif; color: #14201A; padding: 20px; }
.cert { width: min(900px, 100%); aspect-ratio: 1.414; max-height: 90dvh; background: #fff; border-radius: 14px; box-shadow: 0 50px 100px -40px rgb(20 32 26 / .35); padding: clamp(14px, 2.5vw, 26px); }
.cert-inner { height: 100%; border: 2px solid #D9CFB0; outline: 1px solid #D9CFB0; outline-offset: -8px; border-radius: 8px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 4%; gap: 4px; }
.cert-org { margin: 0; font-family: -apple-system, 'Segoe UI', sans-serif; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: clamp(10px, 1.3vw, 13px); color: #7C5CFF; }
.cert-kicker { margin: 6px 0 14px; font-size: clamp(18px, 3vw, 30px); letter-spacing: .02em; }
.cert-small { margin: 0; font-style: italic; color: #56655E; font-size: clamp(11px, 1.4vw, 15px); }
.cert-name { margin: 6px 0; font-size: clamp(24px, 5vw, 52px); font-weight: 400; border-bottom: 1px solid #D9CFB0; padding: 0 5% 6px; }
.cert-course { margin: 6px 0 16px; font-size: clamp(16px, 2.6vw, 26px); font-weight: 700; }
.cert-meta { display: flex; gap: clamp(14px, 4vw, 48px); flex-wrap: wrap; justify-content: center; font-family: -apple-system, 'Segoe UI', sans-serif; }
.cert-meta span { display: grid; } .cert-meta small { font-size: 11px; color: #8A9690; text-transform: uppercase; letter-spacing: .08em; } .cert-meta b { font-size: clamp(12px, 1.5vw, 15px); }
.cert-void { color: #C0392B; font-weight: 700; font-family: sans-serif; }
.cert-foot { margin: 18px 0 0; font-family: sans-serif; font-size: 11px; color: #8A9690; }
.cert { --cert-accent: #7C5CFF; }
.cert-page { align-content: center; gap: 14px; }
.cert-logo { max-height: clamp(26px, 5vw, 48px); max-width: 40%; object-fit: contain; margin-bottom: 6px; }
.cert-org { color: var(--cert-accent); }
.cert-classic .cert-inner { border-color: color-mix(in oklab, var(--cert-accent) 45%, #D9CFB0); outline-color: color-mix(in oklab, var(--cert-accent) 45%, #D9CFB0); }
.cert-modern { position: relative; overflow: hidden; font-family: -apple-system, 'Segoe UI', sans-serif; }
.cert-modern::before { content: ''; position: absolute; inset: 0 auto 0 0; width: clamp(10px, 2.2vw, 22px); background: var(--cert-accent); }
.cert-modern .cert-inner { border: 0; outline: 0; justify-items: start; text-align: left; padding-left: 9%; }
.cert-modern .cert-kicker { font-weight: 800; letter-spacing: -0.02em; }
.cert-modern .cert-name { font-weight: 800; letter-spacing: -0.03em; padding-left: 0; border-bottom-color: var(--cert-accent); border-bottom-width: 3px; }
.cert-modern .cert-meta { justify-content: flex-start; }
.cert-minimal .cert-inner { border: 0; outline: 0; }
.cert-minimal .cert-kicker::before { content: ''; display: block; width: 56px; height: 3px; margin: 0 auto 14px; background: var(--cert-accent); border-radius: 3px; }
.cert-minimal .cert-name { border-bottom: 0; }
.cert-sign { display: grid; justify-items: center; }
.cert-sign i { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: clamp(18px, 2.6vw, 28px); line-height: 1; border-bottom: 1px solid #C9CFCB; padding: 0 12px 2px; color: #14201A; }
.cert-modern .cert-sign { justify-items: start; }
.cert-actions { margin: 0; text-align: center; font-family: -apple-system, 'Segoe UI', sans-serif; }
.cert-actions a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px; background: #14201A; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.cert-actions svg { width: 16px; height: 16px; }
@media print { .cert-page { background: #fff; } .cert { box-shadow: none; } .cert-actions { display: none; } }

/* Course depth (ADR-0041): quizzes, assignments and lesson discussions in the student area ------------------------ */
.lr-note { margin: 0 0 12px; font-size: 14px; color: var(--site-muted); font-weight: 600; }
.lr-quiz, .lr-work { margin-top: 26px; display: grid; gap: 16px; }
.lr-questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: q; }
.lr-q { counter-increment: q; padding: 18px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.lr-q fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.lr-q-prompt { margin: 0; padding: 0; display: flex; gap: 10px; align-items: flex-start; font-weight: 700; color: var(--site-heading); font-size: 16px; line-height: 1.4; }
.lr-q-prompt::before { content: counter(q); flex: none; width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 12.5px; background: color-mix(in oklab, var(--site-accent) 14%, transparent); color: var(--site-accent); }
.lr-q legend.lr-q-prompt { margin-bottom: 12px; }
.lr-q-prompt small { font-weight: 500; color: var(--site-muted); }
.lr-q-mark { margin-left: auto; flex: none; width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; }
.lr-q-mark svg { width: 14px; height: 14px; }
.lr-q.is-right { border-color: color-mix(in oklab, #10B981 45%, transparent); }
.lr-q.is-right .lr-q-mark { background: #10B981; color: #fff; }
.lr-q.is-wrong { border-color: color-mix(in oklab, #EF4444 40%, transparent); }
.lr-q.is-wrong .lr-q-mark { background: #EF4444; color: #fff; }
.lr-q-answer { margin: 10px 0 0 36px; font-size: 14px; font-weight: 700; color: var(--site-text); }
.lr-q-why { margin: 6px 0 0 36px; font-size: 14px; color: var(--site-muted); line-height: 1.55; }
.lr-score { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 20px; border-radius: calc(var(--site-radius) + 6px); color: #fff; background: linear-gradient(135deg, #0F766E, #10B981); box-shadow: 0 30px 60px -34px rgb(16 185 129 / .7); }
.lr-score.is-fail { background: linear-gradient(135deg, #7C2D12, #F97316); box-shadow: 0 30px 60px -34px rgb(249 115 22 / .7); }
.lr-score b { font-size: clamp(2.6rem, 2rem + 3vw, 4rem); line-height: 1; letter-spacing: -0.04em; }
.lr-score span { font-weight: 700; opacity: .92; }
.lr-score small { opacity: .85; }
.lr-score .ws-submit { width: auto; padding: 0 22px; margin-top: 8px; display: inline-flex; align-items: center; text-decoration: none; background: #fff; color: #14201A; }
.lr-status { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.lr-status > svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--site-muted); }
.lr-status b { display: block; color: var(--site-heading); }
.lr-status small { color: var(--site-muted); font-size: 12.5px; }
.lr-status.is-approved { border-color: color-mix(in oklab, #10B981 45%, transparent); background: color-mix(in oklab, #10B981 8%, var(--site-surface)); }
.lr-status.is-approved > svg { color: #10B981; }
.lr-status.is-changes_requested { border-color: color-mix(in oklab, #F59E0B 50%, transparent); background: color-mix(in oklab, #F59E0B 8%, var(--site-surface)); }
.lr-status.is-changes_requested > svg { color: #D97706; }
.lr-feedback { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--site-accent); border-radius: 6px; background: color-mix(in oklab, var(--site-text) 4%, transparent); white-space: pre-line; font-size: 14.5px; }
.lr-mywork { padding: 14px 16px; border-radius: 12px; background: color-mix(in oklab, var(--site-text) 4%, transparent); }
.lr-mywork small { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--site-muted); }
.lr-mywork p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.lr-work .lr-btn { justify-self: start; padding-left: 0; }
.lr-work-form { display: grid; gap: 14px; padding: 20px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.lr-work-form h2 { margin: 0; font-size: 1.15rem; color: var(--site-heading); }
.lr-work-form .ws-submit, .lr-quiz-form .ws-submit { justify-self: start; }
.lr-quiz-form { display: grid; gap: 16px; }
.lr-disc { margin-top: 40px; padding-top: 24px; border-top: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); display: grid; gap: 14px; }
.lr-disc h2 { margin: 0; font-size: 1.2rem; color: var(--site-heading); display: flex; align-items: center; gap: 8px; }
.lr-disc h2 span { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: color-mix(in oklab, var(--site-text) 8%, transparent); color: var(--site-muted); }
.lr-c { padding: 14px 16px; border-radius: calc(var(--site-radius) + 2px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 9%, transparent); }
.lr-c header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.lr-c header b { color: var(--site-heading); }
.lr-c header small { color: var(--site-muted); font-size: 12px; margin-left: auto; }
.lr-c p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.lr-c.is-reply { margin: 10px 0 0 clamp(8px, 3vw, 24px); background: color-mix(in oklab, var(--site-text) 3%, transparent); }
.lr-c.is-team { border-color: color-mix(in oklab, var(--site-accent) 35%, transparent); }
.lr-c-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--site-accent); color: var(--site-accent-text); }
.lr-c-reply { margin-top: 8px; }
.lr-c-reply summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--site-accent); list-style: none; }
.lr-c-reply form { display: grid; gap: 8px; margin-top: 8px; }
.lr-c-reply .lr-btn { justify-self: start; padding: 8px 0; }
.lr-c-new { display: grid; gap: 10px; }
.lr-c-new .ws-submit { justify-self: start; width: auto; padding: 0 22px; }
.lr-nav li .lr-kind { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--site-accent); }

/* Instructors on the course sales page (ADR-0041) */
.crs-team { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.crs-person { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.crs-person-photo { flex: none; width: 56px; height: 56px; border-radius: 99px; background: color-mix(in oklab, var(--site-accent) 18%, transparent) center / cover no-repeat; display: grid; place-items: center; font-weight: 800; color: var(--site-accent); font-size: 20px; }
.crs-person b { display: block; color: var(--site-heading); }
.crs-person small { display: block; color: var(--site-muted); font-size: 13px; font-weight: 600; }
.crs-person p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; }

/* ---------------------------------------------------------------- community (ADR-0024) */
.cm, .cm-gate, .cm-inside { --cm-line: color-mix(in oklab, var(--site-text) 10%, transparent); --cm-soft: color-mix(in oklab, var(--site-text) 5%, transparent); }
.cm { min-height: 100dvh; background: var(--site-bg-base); color: var(--site-text); font-family: var(--site-font); }
.cm-bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px clamp(14px, 3vw, 28px); background: color-mix(in oklab, var(--site-surface) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--cm-line); }
.cm-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.cm-logo { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; object-fit: cover; font-weight: 800; color: var(--site-accent-text); background: linear-gradient(145deg, var(--site-accent), color-mix(in oklab, var(--site-accent) 55%, #7C5CFF)); }
.cm-brand-text { display: grid; min-width: 0; }
.cm-brand-text small { font-size: 11.5px; color: var(--site-muted); font-weight: 600; }
.cm-brand-text b { color: var(--site-heading); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-me { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--site-heading); font-weight: 700; font-size: 14px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--cm-line); background: var(--site-surface); }
.cm-me.is-active { border-color: var(--site-accent); }
.cm-me-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .cm-me-name { display: none; } .cm-me { padding: 3px; } }
.cm-av { width: 36px; height: 36px; border-radius: 99px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--site-heading); background: color-mix(in oklab, var(--site-accent) 18%, var(--site-surface)); }
.cm-av.is-team { color: #fff; background: linear-gradient(145deg, #1F2925, #5B3BE8); }
.cm-av-sm { width: 30px; height: 30px; font-size: 12.5px; }
.cm-av-lg { width: 48px; height: 48px; font-size: 18px; }

.cm-body { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1180px; margin: 0 auto; gap: 18px; padding: 14px clamp(14px, 3vw, 28px) 64px; }
.cm-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * clamp(14px, 3vw, 28px)); padding: 2px clamp(14px, 3vw, 28px); }
.cm-nav::-webkit-scrollbar { display: none; }
.cm-nav-item { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 8px 13px; border-radius: 99px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--site-text); background: var(--site-surface); border: 1px solid var(--cm-line); }
.cm-nav-item svg { width: 15px; height: 15px; color: var(--site-muted); }
.cm-nav-item small { color: var(--site-muted); font-weight: 600; font-size: 12px; }
.cm-nav-item.is-active { background: var(--site-accent); color: var(--site-accent-text); border-color: transparent; }
.cm-nav-item.is-active svg, .cm-nav-item.is-active small { color: inherit; opacity: .8; }
.cm-side { display: none; }
@media (min-width: 900px) {
  .cm-body { grid-template-columns: 230px minmax(0, 1fr); gap: 28px; padding-top: 24px; }
  .cm-nav { flex-direction: column; margin: 0; padding: 0; overflow: visible; position: sticky; top: 80px; align-self: start; }
  .cm-nav-item { border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; }
  .cm-nav-item span { flex: 1; }
  .cm-nav-item:hover { background: var(--cm-soft); }
  .cm-nav-item.is-active { background: var(--site-surface); color: var(--site-heading); box-shadow: 0 1px 0 var(--cm-line), 0 10px 24px -18px rgb(0 0 0 / .35); }
  .cm-nav-item.is-active svg { color: var(--site-accent); opacity: 1; }
}
@media (min-width: 1180px) { .cm-body { grid-template-columns: 230px minmax(0, 1fr) 280px; } .cm-side { display: grid; gap: 14px; align-content: start; position: sticky; top: 80px; align-self: start; } }
.cm-main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.cm-head h1 { margin: 0; color: var(--site-heading); font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.1; }
.cm-head p { margin: 6px 0 0; color: var(--site-muted); font-size: 15px; max-width: 60ch; }
.cm-card { background: var(--site-surface); border: 1px solid var(--cm-line); border-radius: calc(var(--site-radius) + 6px); padding: 16px; display: grid; gap: 8px; }
.cm-card b { color: var(--site-heading); }
.cm-card p { margin: 0; }
.cm-muted { color: var(--site-muted); font-size: 14px; }
.cm-pre { white-space: pre-line; }
.cm-stat { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.cm-stat svg { width: 15px; height: 15px; color: var(--site-accent); }
.cm-powered { font-size: 12px; color: var(--site-muted); margin: 4px 4px 0; }
.cm-powered a { color: inherit; }
.cm-alert, .cm-ok, .cm-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 14px; border-radius: 14px; font-size: 14px; }
.cm-alert { background: color-mix(in oklab, #E5484D 12%, var(--site-surface)); color: color-mix(in oklab, #E5484D 70%, var(--site-heading)); }
.cm-ok { background: color-mix(in oklab, var(--site-accent) 14%, var(--site-surface)); color: var(--site-heading); }
.cm-note { background: var(--cm-soft); color: var(--site-muted); }
.cm-note a { color: var(--site-accent); font-weight: 700; }
.cm-alert svg, .cm-ok svg, .cm-note svg { width: 16px; height: 16px; flex: none; }

.cm-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--site-text); background: var(--site-surface); border: 1px solid var(--cm-line); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.cm-input:focus { outline: 2px solid color-mix(in oklab, var(--site-accent) 45%, transparent); outline-offset: 1px; }
.cm-compose { display: flex; gap: 12px; align-items: flex-start; background: var(--site-surface); border: 1px solid var(--cm-line); border-radius: calc(var(--site-radius) + 6px); padding: 14px; box-shadow: 0 18px 40px -32px rgb(0 0 0 / .45); }
.cm-compose-fields { flex: 1; min-width: 0; display: grid; gap: 8px; }
.cm-compose .cm-input { border-color: transparent; background: var(--cm-soft); }
.cm-input-title { font-weight: 700; }
.cm-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cm-select { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--site-text); background: var(--cm-soft); border: 0; border-radius: 99px; padding: 8px 12px; max-width: 60vw; }
.cm-btn { width: auto; min-height: 40px; padding: 0 18px; display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.cm-btn svg { width: 15px; height: 15px; }
.cm-btn-ghost { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 700; color: var(--site-heading); background: transparent; border: 1px solid var(--cm-line); border-radius: 12px; padding: 9px 14px; cursor: pointer; }
.cm-btn-ghost svg { width: 15px; height: 15px; }
.cm-btn-ghost.is-danger { color: #D93036; border-color: color-mix(in oklab, #D93036 35%, transparent); }
.cm-rules summary { cursor: pointer; font-size: 13px; color: var(--site-muted); font-weight: 600; }
.cm-rules p { white-space: pre-line; font-size: 13.5px; color: var(--site-muted); margin: 6px 0 0; }

.cm-feed { display: grid; gap: 12px; }
.cm-post { position: relative; background: var(--site-surface); border: 1px solid var(--cm-line); border-radius: calc(var(--site-radius) + 6px); padding: 16px 16px 10px; }
.cm-post.is-pinned { border-color: color-mix(in oklab, var(--site-accent) 45%, transparent); }
.cm-post.is-hidden, .cm-comment.is-hidden { opacity: .6; border-style: dashed; }
.cm-post-head { display: flex; align-items: center; gap: 10px; }
.cm-meta { margin: 0; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 7px; row-gap: 0; font-size: 14px; }
.cm-meta b { color: var(--site-heading); }
.cm-meta-sub, .cm-meta time { color: var(--site-muted); font-size: 12.5px; }
.cm-post-head .cm-meta-sub { flex-basis: 100%; }
.cm-meta-sub a { color: inherit; font-weight: 600; text-decoration: none; }
.cm-badge { font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 99px; color: var(--site-accent); background: color-mix(in oklab, var(--site-accent) 13%, transparent); }
.cm-badge.is-team { color: #fff; background: linear-gradient(90deg, #1F2925, #5B3BE8); }
.cm-badge.is-hidden { color: #B25E00; background: color-mix(in oklab, #F5A524 18%, transparent); }
.cm-badge.is-you { color: var(--site-muted); background: var(--cm-soft); }
.cm-pin svg { width: 16px; height: 16px; color: var(--site-accent); }
.cm-post-title { margin: 12px 0 0; font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--site-heading); }
h1.cm-post-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); letter-spacing: -0.02em; }
.cm-post-title a { color: inherit; text-decoration: none; }
.cm-text { font-size: 15.5px; line-height: 1.6; margin-top: 8px; overflow-wrap: anywhere; }
.cm-text p { margin: 0 0 8px; } .cm-text h2 { font-size: 1.05rem; color: var(--site-heading); margin: 12px 0 6px; } .cm-text ul { margin: 0 0 8px; padding-left: 20px; }
.cm-text a { color: var(--site-accent); font-weight: 600; }
.cm-more { display: inline-block; font-size: 14px; font-weight: 700; color: var(--site-accent); text-decoration: none; margin-top: -2px; }
.cm-post-foot { display: flex; gap: 4px; margin-top: 8px; border-top: 1px solid var(--cm-line); padding-top: 6px; }
.cm-act { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--site-muted); background: transparent; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; text-decoration: none; }
.cm-act:hover { background: var(--cm-soft); color: var(--site-heading); }
.cm-act svg { width: 17px; height: 17px; }
.cm-act.is-liked { color: #E5486F; } .cm-act.is-liked svg { fill: currentColor; }
.cm-act.is-static { cursor: default; } .cm-act.is-static:hover { background: none; color: var(--site-muted); }
.cm-menu { position: relative; }
.cm-menu summary { list-style: none; cursor: pointer; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--site-muted); }
.cm-menu summary::-webkit-details-marker { display: none; }
.cm-menu summary svg { width: 18px; height: 18px; }
.cm-menu[open] summary { background: var(--cm-soft); }
.cm-menu-pop { position: absolute; right: 0; top: 36px; z-index: 4; width: 250px; display: grid; gap: 2px; padding: 6px; background: var(--site-surface); border: 1px solid var(--cm-line); border-radius: 14px; box-shadow: 0 24px 50px -20px rgb(0 0 0 / .35); }
.cm-menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; font: inherit; font-size: 14px; font-weight: 600; text-align: left; color: var(--site-text); background: transparent; border: 0; border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.cm-menu-pop button:hover { background: var(--cm-soft); }
.cm-menu-pop button svg { width: 15px; height: 15px; color: var(--site-muted); }
.cm-menu-pop .is-danger { color: #D93036; }
.cm-report-form { display: grid; gap: 6px; }
.cm-report-form .cm-input { font-size: 13.5px; padding: 8px 10px; }
.cm-empty { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 44px 20px; border-radius: calc(var(--site-radius) + 6px); border: 1px dashed var(--cm-line); color: var(--site-muted); }
.cm-empty svg { width: 28px; height: 28px; }
.cm-empty h2 { margin: 6px 0 0; font-size: 1.1rem; color: var(--site-heading); }
.cm-empty p { margin: 0; }
.cm-pager { display: flex; justify-content: space-between; }
.cm-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--site-muted); text-decoration: none; }
.cm-back svg { width: 15px; height: 15px; }

.cm-comments { display: grid; gap: 10px; }
.cm-comments h2 { margin: 6px 0 0; font-size: 1rem; color: var(--site-heading); }
.cm-comment { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--site-surface); border: 1px solid var(--cm-line); }
.cm-comment-main { flex: 1; min-width: 0; }
.cm-comment .cm-text { margin-top: 4px; font-size: 15px; }
.cm-comment-tools { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cm-link { font: inherit; font-size: 12.5px; font-weight: 700; color: var(--site-muted); background: none; border: 0; padding: 0; cursor: pointer; list-style: none; }
.cm-report summary::-webkit-details-marker { display: none; }
.cm-report[open] { flex-basis: 100%; }
.cm-report .cm-report-form { margin-top: 6px; grid-template-columns: 1fr auto; }
.cm-compose-comment { box-shadow: none; }

.cm-search { position: relative; }
.cm-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--site-muted); }
.cm-search .cm-input { padding-left: 36px; }
.cm-head .cm-search { margin-top: 14px; max-width: 460px; }
.cm-head .cm-search .cm-input { padding-right: 38px; border-radius: 99px; }
.cm-search-clear { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; color: var(--site-muted); }
.cm-search .cm-search-clear svg { position: static; translate: none; width: 14px; height: 14px; }
.cm-search-clear:hover { background: var(--cm-soft); color: var(--site-heading); }
.cm-search input[type=search]::-webkit-search-cancel-button { display: none; }
.cm-results { margin: 0; font-size: 14px; color: var(--site-muted); font-weight: 600; }
.cm-people { display: grid; gap: 10px; }
@media (min-width: 640px) { .cm-people { grid-template-columns: 1fr 1fr; } }
.cm-person { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--site-surface); border: 1px solid var(--cm-line); }
.cm-person-name { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .cm-person-name b { color: var(--site-heading); }
.cm-person-bio { margin: 3px 0; font-size: 14px; }
.cm-person small { color: var(--site-muted); font-size: 12.5px; }
.cm-form { gap: 12px; }
.cm-field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--site-heading); }
.cm-field small { color: var(--site-muted); font-weight: 500; }
.cm-check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.cm-check input { width: 18px; height: 18px; accent-color: var(--site-accent); }
.cm-danger summary { cursor: pointer; font-weight: 700; color: #D93036; }

.cm-inside-desc { display: block; font-size: 12.5px; color: var(--site-muted); }
.cm-gate { display: grid; justify-items: center; text-align: center; gap: 8px; }
.cm-gate-mark { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; overflow: hidden; color: var(--site-accent-text); background: linear-gradient(145deg, var(--site-accent), color-mix(in oklab, var(--site-accent) 55%, #7C5CFF)); box-shadow: 0 20px 40px -20px color-mix(in oklab, var(--site-accent) 80%, transparent); }
.cm-gate-mark svg { width: 30px; height: 30px; } .cm-gate-mark img { width: 100%; height: 100%; object-fit: cover; }
.cm-gate-by { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--site-muted); text-transform: uppercase; letter-spacing: .05em; }
.cm-gate h1 { margin: 0; color: var(--site-heading); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); letter-spacing: -0.03em; line-height: 1.1; }
.cm-gate-tag { margin: 0; color: var(--site-muted); font-size: 16px; }
.cm-gate-count { display: inline-flex; align-items: center; gap: 7px; margin: 6px 0; font-size: 14px; font-weight: 700; }
.cm-gate-count svg { width: 16px; height: 16px; color: var(--site-accent); }
.cm-gate-spaces { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cm-gate-spaces a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--site-text); border: 1px solid var(--cm-line); }
.cm-gate-spaces svg { width: 14px; height: 14px; color: var(--site-muted); } .cm-gate-spaces small { color: var(--site-accent); font-weight: 700; }
.cm-gate-join { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; margin-top: 8px; }
.cm-gate-join svg { width: 18px; height: 18px; }
.cm-gate .cs-access { width: 100%; }
.cm-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-gate-av { font-size: 26px; font-weight: 800; color: var(--site-accent-text); background: var(--site-accent); }

/* In-community notifications (ADR-0031) */
.cm-bell { position: relative; margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 99px; border: 1px solid var(--cm-line); background: var(--site-surface); color: var(--site-heading); flex: none; }
.cm-bell svg { width: 18px; height: 18px; }
.cm-bell.is-active { border-color: var(--site-accent); }
.cm-bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--site-accent); color: var(--site-on-accent, #fff); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--site-bg, #fff); }
.cm-inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cm-note-item a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: calc(var(--site-radius) + 4px); border: 1px solid var(--cm-line); background: var(--site-surface); text-decoration: none; color: var(--site-text); }
.cm-note-item a:hover { border-color: color-mix(in oklab, var(--site-accent) 45%, var(--cm-line)); }
.cm-note-item a { position: relative; }
.cm-note-item.is-new a { border-color: color-mix(in oklab, var(--site-accent) 45%, var(--cm-line)); box-shadow: inset 3px 0 0 var(--site-accent); }
.cm-note-item.is-new time::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--site-accent); margin-right: 6px; vertical-align: 1px; }
.cm-note-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--cm-soft); color: var(--site-heading); }
.cm-note-icon svg { width: 16px; height: 16px; }
.cm-note-icon.is-announcement { background: color-mix(in oklab, var(--site-accent) 16%, transparent); color: var(--site-accent); }
.cm-note-text { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cm-note-text b { color: var(--site-heading); }
.cm-note-text small { display: block; margin-top: 3px; color: var(--site-muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cm-note-item time { font-size: 12px; color: var(--site-muted); white-space: nowrap; }

/* Product options (ADR-0037) */
.shop-variants { border: 0; margin: 0; padding: 0; min-width: 0; }
.shop-variants legend { padding: 0; margin-bottom: 8px; }
.shop-variant { justify-content: flex-start; }
.shop-variant-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.shop-variant-name small { display: block; font-weight: 500; font-size: 12.5px; color: var(--site-muted); }
.shop-variant-price { flex: none; display: inline-flex; align-items: baseline; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-variant-price s { font-weight: 500; font-size: 13px; color: var(--site-muted); }
.shop-variant.is-out { opacity: .55; cursor: not-allowed; }
.shop-variant.is-out .shop-variant-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.shop-add { margin-top: 10px; }

/* Discounts (ADR-0038) */
.shop-sale { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin: 0; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in oklab, var(--site-accent) 14%, transparent); color: var(--site-text); }
.shop-sale svg { width: 15px; height: 15px; color: var(--site-accent); }
.shop-price s { color: var(--site-muted); font-size: 15px; }
.shop-code { border-radius: calc(var(--site-radius) - 4px); border: 1px dashed color-mix(in oklab, var(--site-text) 22%, transparent); padding: 10px 14px; font-size: 14px; }
.shop-code summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--site-text); list-style: none; }
.shop-code summary::-webkit-details-marker { display: none; }
.shop-code summary svg { width: 16px; height: 16px; }
.shop-code .wf-input { margin-top: 10px; text-transform: uppercase; letter-spacing: .04em; }
.shop-code[open] { border-style: solid; }

/* Licence keys on the order page (ADR-0039) */
.lic-list { display: grid; gap: 10px; }
.lic { display: grid; gap: 6px; padding: 12px 14px; border-radius: calc(var(--site-radius) - 4px); border: 1px solid color-mix(in oklab, var(--site-text) 12%, transparent); background: color-mix(in oklab, var(--site-surface) 92%, transparent); min-width: 0; }
.lic small { color: var(--site-muted); font-size: 13px; }
.lic-key { display: block; padding: 10px 12px; border-radius: 10px; background: color-mix(in oklab, var(--site-text) 6%, transparent); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .04em; color: var(--site-text); overflow-wrap: anywhere; user-select: all; cursor: copy; }
.lic-key.is-copied { outline: 2px solid var(--site-accent); }
.lic-devices { margin: 2px 0 0; font-size: 13px; color: var(--site-muted); }
.lic-device { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.lic-device span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.lic-device svg { width: 15px; height: 15px; flex: none; }
.lic-device button { flex: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--site-accent); cursor: pointer; }

.shop-tax { margin: -4px 0 0; font-size: 13px; color: var(--site-muted); }

/* css/storefront.css */
/* ==========================================================================
   Storefront, cart and "find my orders" (ADR-0033). Public pages, themed by --site-* tokens.
   Mobile-first: one column of cards, a sticky cart bar; two to three columns from tablet up.
   ========================================================================== */
.sf { overflow: visible; overflow-x: clip; --sf-line: color-mix(in oklab, var(--site-text) 10%, transparent); --sf-soft: color-mix(in oklab, var(--site-accent) 10%, transparent); }
.sf svg { width: 16px; height: 16px; }

/* Top bar */
.sf-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-left), calc((100% - 1080px) / 2)); padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in oklab, var(--site-bg-base) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--sf-line); }
.sf-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.sf-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--site-heading); letter-spacing: -0.01em; }
.sf-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; font-style: normal; font-weight: 800; background: var(--site-accent); color: var(--site-accent-text); }
.sf-logo { width: 30px; height: 30px; border-radius: 10px; object-fit: cover; flex: none; }
.sf-cart-btn, .sf-back { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 14px; flex: none;
    background: var(--site-surface); border: 1px solid var(--sf-line); box-shadow: 0 8px 20px -14px rgb(0 0 0 / .4); transition: transform .15s, box-shadow .15s; }
.sf-cart-btn:hover, .sf-back:hover { transform: translateY(-1px); }
.sf-cart-btn.has-items { background: var(--site-accent); color: var(--site-accent-text); border-color: transparent; }
.sf .sf-badge { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; font-size: 12px; background: var(--site-accent-text); color: var(--site-accent); }
.sf-cart-btn:focus-visible, .sf-back:focus-visible, .sf-btn:focus-visible, .sf-chip:focus-visible { outline: 3px solid color-mix(in oklab, var(--site-accent) 55%, transparent); outline-offset: 2px; }

/* Hero */
.sf-hero { position: relative; }
.sf-hero-cover { height: clamp(110px, 20vw, 190px); background: var(--site-cover); }
.sf-hero-inner { width: min(1080px, 100% - 32px); margin: calc(-1 * clamp(44px, 7vw, 64px)) auto 0; position: relative; display: grid; justify-items: start; gap: 8px; }
.sf-hero-mark, .sf-hero-logo { width: clamp(76px, 12vw, 96px); height: clamp(76px, 12vw, 96px); border-radius: 26px; border: 4px solid var(--site-bg-base); box-shadow: 0 18px 40px -20px rgb(0 0 0 / .5); }
.sf-hero-mark { display: grid; place-items: center; font-family: var(--site-heading); font-size: clamp(2rem, 1.5rem + 2vw, 2.7rem); font-weight: 800; background: var(--site-accent); color: var(--site-accent-text); }
.sf-hero-logo { object-fit: cover; background: var(--site-surface); }
.sf-title { margin: 6px 0 0; font-family: var(--site-heading); font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); line-height: 1.02; letter-spacing: -0.035em; }
.sf-intro { margin: 0; max-width: 62ch; color: var(--site-muted); font-size: 15.5px; line-height: 1.55; }
.sf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--site-muted); }
.sf-meta svg { width: 14px; height: 14px; }

/* Body */
.sf-body { width: min(1080px, 100% - 32px); margin: 22px auto 0; display: grid; gap: 16px; }
.sf-alert { margin: 0; }
.sf-note { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--sf-soft); font-size: 14px; font-weight: 600; }

.sf-toast { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); border: 1px solid var(--sf-line); box-shadow: 0 18px 40px -24px rgb(0 0 0 / .5); animation: sf-drop .45s cubic-bezier(.2,1.2,.4,1) both; }
.sf-toast-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--site-accent); color: var(--site-accent-text); }
.sf-toast-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.sf-toast-text small { color: var(--site-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf a.sf-toast-go { flex: none; padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 13.5px; background: var(--site-text); color: var(--site-bg-base); }
@keyframes sf-drop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

.sf-tools { display: grid; gap: 12px; }
.sf-search { position: relative; display: flex; align-items: center; }
.sf-search svg { position: absolute; left: 14px; color: var(--site-muted); pointer-events: none; }
.sf-search input { width: 100%; height: 46px; padding: 0 14px 0 40px; border-radius: 999px; border: 1px solid var(--sf-line); background: var(--site-surface); color: var(--site-text); font: inherit; font-size: 15px; }
.sf-search input:focus { outline: none; border-color: var(--site-accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--site-accent) 18%, transparent); }
.sf-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.sf-chips::-webkit-scrollbar { display: none; }
.sf-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; border: 1px solid var(--sf-line); background: var(--site-surface); color: var(--site-text); }
.sf-chip svg { width: 15px; height: 15px; opacity: .8; }
.sf-chip.is-on { background: var(--site-text); color: var(--site-bg-base); border-color: transparent; }

/* Product grid */
.sf-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sf-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid var(--sf-line); overflow: hidden;
    box-shadow: 0 16px 36px -28px rgb(0 0 0 / .5); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; animation: ws-rise .45s cubic-bezier(.2,.8,.2,1) both; }
.sf-card:hover { transform: translateY(-3px); box-shadow: 0 26px 50px -30px rgb(0 0 0 / .55); }
.sf-card.is-added { box-shadow: 0 0 0 3px color-mix(in oklab, var(--site-accent) 45%, transparent), 0 26px 50px -30px rgb(0 0 0 / .55); }
.sf-card-media { position: relative; display: grid; place-items: center; min-height: 112px; min-width: 0; background: var(--sf-soft); color: var(--site-accent); overflow: hidden; }
.sf-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.sf-card:hover .sf-card-media img { transform: scale(1.04); }
.sf-card-media.is-blank { background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--site-accent) 30%, transparent), transparent 60%), var(--sf-soft); }
.sf-card-media.is-blank > svg { width: 34px; height: 34px; stroke-width: 1.6; }
.sf-kind { display: none; }
.sf-save { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--site-accent); color: var(--site-accent-text); }
.sf-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-width: 0; }
.sf-card-name { margin: 0; font-family: var(--site-heading); font-size: 1.05rem; line-height: 1.2; letter-spacing: -0.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-card-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sf-card-tag { margin: 0; font-size: 13.5px; color: var(--site-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sf-price { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.sf-price b { font-family: var(--site-heading); font-size: 1.12rem; letter-spacing: -0.02em; }
.sf-price s { font-size: 13px; color: var(--site-muted); }
.sf-add { margin: 0; }
.sf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: calc(var(--site-radius) - 4px); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
    background: var(--site-btn-bg); color: var(--site-btn-text); transition: transform .15s, filter .15s; white-space: nowrap; }
.sf-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.sf-btn.is-ghost { background: transparent; color: var(--site-text); box-shadow: inset 0 0 0 1.5px var(--sf-line); }
.sf-btn.is-in { background: var(--sf-soft); color: var(--site-text); }
.sf-btn.is-off { background: transparent; color: var(--site-muted); cursor: default; box-shadow: inset 0 0 0 1.5px var(--sf-line); }
.sf-btn.is-busy, .ws-submit.is-busy { opacity: .7; pointer-events: none; }

.sf-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px; border-radius: calc(var(--site-radius) + 6px); border: 1.5px dashed var(--sf-line); }
.sf-empty-icon { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--sf-soft); color: var(--site-accent); }
.sf-empty-icon svg { width: 28px; height: 28px; }
.sf-empty h2 { margin: 6px 0 0; font-family: var(--site-heading); font-size: 1.35rem; letter-spacing: -0.02em; }
.sf-empty p { margin: 0 0 8px; color: var(--site-muted); }

.sf-foot { width: min(1080px, 100% - 32px); margin: 36px auto 0; padding: 18px 0 calc(110px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--sf-line); font-size: 13px; font-weight: 600; color: var(--site-muted); }
.sf-foot > a:first-child { display: inline-flex; align-items: center; gap: 6px; }
.sf-foot > a:first-child:hover { color: var(--site-text); }
.sf-foot .ws-branding { margin: 0; }

/* Sticky cart bar (phones) */
.sf a.sf-bar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 999px;
    background: var(--site-text); color: var(--site-bg-base); box-shadow: 0 20px 44px -16px rgb(0 0 0 / .55); animation: sf-up .5s cubic-bezier(.2,1.2,.4,1) both; }
.sf-bar-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.sf-bar-total { flex: 1; font-weight: 700; font-size: 14px; opacity: .85; }
.sf .sf-bar-go { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; background: var(--site-accent); color: var(--site-accent-text); }
@keyframes sf-up { from { opacity: 0; transform: translateY(20px); } }

/* Cart page */
.sf-cart-title { margin: 6px 0 0; font-family: var(--site-heading); font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); letter-spacing: -0.035em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sf-cart-title small { font-family: var(--site-font); font-size: 14px; font-weight: 700; color: var(--site-muted); letter-spacing: 0; }
.sf-cart-grid { display: grid; gap: 16px; align-items: start; }
.sf-lines { display: grid; margin: 0; border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid var(--sf-line); overflow: hidden; transition: opacity .2s; }
.sf-lines.is-saving { opacity: .6; }
.sf-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; }
.sf-line + .sf-line { border-top: 1px solid var(--sf-line); }
.sf-line-img { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--sf-soft); color: var(--site-accent); }
.sf-line-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sf-line-main { display: grid; gap: 3px; min-width: 0; }
.sf-line-name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.sf-line-variant { display: block; font-size: 13px; color: var(--site-muted); margin-top: 1px; }
.sf-line-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--site-muted); }
.sf-line-note svg { width: 13px; height: 13px; }
.sf-line-ctl { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sf-qty select { height: 34px; padding: 0 28px 0 12px; border-radius: 10px; border: 1px solid var(--sf-line); background: var(--site-surface); color: var(--site-text); font: inherit; font-weight: 700; font-size: 14px; }
.sf-qty-one { font-size: 13px; font-weight: 700; color: var(--site-muted); }
.sf-remove { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--site-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sf-remove:hover { color: #C4333A; background: rgb(229 72 77 / .08); }
.sf-remove svg { width: 14px; height: 14px; }
.sf-line-price { display: grid; justify-items: end; gap: 2px; text-align: right; }
.sf-line-price b { font-family: var(--site-heading); font-size: 1.02rem; white-space: nowrap; }
.sf-line-price small { font-size: 12px; color: var(--site-muted); white-space: nowrap; }
.sf-update { padding: 0 14px 14px; }
.sf-summary { display: grid; gap: 16px; padding: 18px; border-radius: calc(var(--site-radius) + 6px); background: var(--site-surface); border: 1px solid var(--sf-line); box-shadow: 0 26px 60px -40px rgb(0 0 0 / .5); }
.sf-sum-rows { display: grid; gap: 8px; }
.sf-sum-rows p { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--site-muted); }
.sf-sum-total { padding-top: 10px; border-top: 1px solid var(--sf-line); color: var(--site-text) !important; font-weight: 700; }
.sf-sum-total b { font-family: var(--site-heading); font-size: 1.45rem; letter-spacing: -0.02em; }
.sf-checkout { border-top: 0; padding-top: 0; }
.sf-foot-by { font-weight: 600; }

/* Find my orders */
.sf-lookup { display: grid; gap: 12px; }
.sf-lookup-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--site-accent); color: var(--site-accent-text); box-shadow: 0 18px 36px -18px var(--site-accent); }
.sf-lookup-icon svg { width: 26px; height: 26px; }
.sf-lookup-title { margin: 6px 0 0; font-family: var(--site-heading); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem); letter-spacing: -0.035em; }
.sf-lookup-text { margin: 0 0 4px; color: var(--site-muted); line-height: 1.55; }

/* Receipt: the lines of a cart order */
.ord-lines { display: grid; margin: 4px 0 0; padding: 0; list-style: none; border-top: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); }
.ord-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid color-mix(in oklab, var(--site-text) 10%, transparent); font-size: 14.5px; }
.ord-lines li span { min-width: 0; overflow-wrap: anywhere; }
.ord-lines li small { color: var(--site-muted); font-weight: 700; }
.ord-lines li b { white-space: nowrap; }
.ord-lines li.is-total { border-bottom: 0; font-weight: 800; }
.ord-find { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--site-muted); }
.ord-find a { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 640px) {
    .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .sf-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sf-card-media { aspect-ratio: 4 / 3; min-height: 0; }
    .sf-kind { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
        background: color-mix(in oklab, var(--site-surface) 82%, transparent); color: var(--site-text); backdrop-filter: blur(8px); }
    .sf-kind svg { width: 13px; height: 13px; }
    .sf-save { top: 10px; left: 10px; }
    .sf-card-body { padding: 16px 18px 18px; gap: 6px; }
    .sf-card-name { font-size: 1.18rem; }
    .sf-tools { grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); align-items: center; }
    .sf-chips { margin: 0; padding: 2px 0; mask-image: none; flex-wrap: wrap; overflow: visible; }
    .sf-foot { padding-bottom: 40px; }
    .sf a.sf-bar { left: auto; right: 24px; bottom: 24px; min-width: 340px; }
}
@media (min-width: 960px) {
    .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sf-cart-grid { grid-template-columns: minmax(0, 1fr) 380px; }
    .sf-summary { position: sticky; top: 76px; }
}
@media (prefers-reduced-motion: reduce) { .sf-card, .sf-toast, .sf-bar { animation: none; } .sf-card:hover { transform: none; } }

/* On a product page: add to the shop's cart instead of buying now */
.sf-also { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed color-mix(in oklab, var(--site-text) 14%, transparent); }
.sf-also form { margin: 0; }
.sf-also-btn { width: 100%; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: calc(var(--site-radius) - 2px); font: inherit; font-weight: 700; cursor: pointer;
    background: transparent; color: var(--site-text); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--site-text) 16%, transparent); transition: background .15s; }
.sf-also-btn:hover { background: color-mix(in oklab, var(--site-accent) 10%, transparent); }
.sf-also-btn svg, .sf-also-link svg { width: 16px; height: 16px; }
.sf-also-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--site-muted); }
.sf-also-link:hover { color: var(--site-text); }

/* The small live preview on the Storefront settings screen (app). Unlayered, like the rest of this file, so it wins over the page's own breakpoints. */
.sfa-mini { height: 560px; border-radius: 26px; overflow: hidden auto; scrollbar-width: none; font-size: 13px; }
.sfa-mini .sf-hero-cover { height: 84px; }
.sfa-mini .sf-hero-inner { width: calc(100% - 24px); margin-top: -34px; gap: 4px; }
.sfa-mini .sf-hero-mark, .sfa-mini .sf-hero-logo { width: 60px; height: 60px; border-radius: 18px; font-size: 1.5rem; border-width: 3px; }
.sfa-mini .sf-title { font-size: 1.4rem; margin-top: 2px; }
.sfa-mini .sf-intro { font-size: 12.5px; }
.sfa-mini .sf-body { width: calc(100% - 24px); margin-top: 14px; padding-bottom: 20px; }
.sfa-mini .sf-grid { grid-template-columns: 1fr; gap: 10px; }
.sfa-mini .sf-card { grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: none; animation: none; }
.sfa-mini .sf-card-media { aspect-ratio: 1; }
.sfa-mini .sf-card-body { padding: 10px 12px; }
.sfa-mini .sf-card-name { font-size: .92rem; }
.sfa-mini .sf-price b { font-size: .95rem; }
.sfa-mini .sf-btn { height: 30px; padding: 0 10px; font-size: 12px; }
.sfa-mini .sf-kind { display: none; }
.sfa-mini .sf-empty { padding: 28px 12px; }
.sfa-mini .sf-hero-inner { margin: -34px auto 0; }
.sfa-mini .sf-card:hover { transform: none; }

/* Discounts (ADR-0038) */
.sf-sum-rows .sf-sum-off { color: var(--site-accent); font-weight: 600; }
.sf-sum-off span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sf-sum-off svg { width: 15px; height: 15px; flex: none; }
.sf-sum-off small { font-weight: 500; color: var(--site-muted); }
.sf-code { border-radius: calc(var(--site-radius) - 2px); border: 1px dashed var(--sf-line); padding: 10px 12px; font-size: 14px; }
.sf-code summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--site-text); list-style: none; }
.sf-code summary::-webkit-details-marker { display: none; }
.sf-code svg { width: 16px; height: 16px; flex: none; }
.sf-code-form { display: flex; gap: 8px; margin-top: 10px; }
.sf-code-form .wf-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.sf-code-form .sf-btn { flex: none; }
.sf-code .wf-error { margin: 8px 0 0; }
.sf-code.is-on { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-style: solid; background: color-mix(in oklab, var(--site-accent) 8%, transparent); }
.sf-code.is-on span { display: inline-flex; align-items: center; gap: 6px; }

/* css/components/builder.css */
/* Pages list + three-pane builder ---------------------------------------- */
@layer components {
  /* ---- Page hero (shared by list screens) ---- */
  .page-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
  .page-hero .page-title { font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.6rem); letter-spacing: -0.045em; margin-top: 4px; }

  /* ---- Pages grid ---- */
  .site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
  .site-card { position: relative; display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); overflow: hidden; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); text-align: left; }
  .site-card:hover { transform: translateY(-4px); box-shadow: var(--e3); }
  .stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .site-card .badge { position: relative; z-index: 2; }
  .site-thumb { position: relative; height: 250px; overflow: hidden; margin: 8px 8px 0; border-radius: 18px; pointer-events: none; }
  .site-thumb .page-preview { position: absolute; left: 50%; top: 0; translate: -50% 0; }
  .site-thumb::after { content: ""; position: absolute; inset: auto 0 0; height: 70px; background: linear-gradient(transparent, rgb(0 0 0 / .08)); }
  .site-thumb-actions { position: absolute; right: 10px; bottom: 10px; z-index: 3; pointer-events: auto; opacity: 0; transform: translateY(6px); transition: all var(--t-base) var(--ease-out); }
  .site-card:hover .site-thumb-actions { opacity: 1; transform: none; }
  .site-card-body { padding: 14px 18px 16px; }
  .site-card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .site-card-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: var(--fs-micro); color: var(--text-muted); }
  .site-card-stats span { display: inline-flex; align-items: center; gap: 5px; }
  .site-card-stats b { color: var(--ink); font-weight: 700; }
  .site-card-new { align-items: center; justify-content: center; gap: 8px; min-height: 340px; border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; }
  .site-card-new b { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
  .site-card-new-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--grad-brand); color: var(--forest-950); box-shadow: var(--e-glow); margin-bottom: 6px; }
  .site-card-new-icon svg { width: 24px; height: 24px; }
  .site-card-new:hover { border-color: var(--accent); background: var(--accent-soft); }

  /* Scaled, non-interactive render of a page document */
  .page-preview { width: 390px; transform: scale(var(--scale, .6)); transform-origin: top center; margin-bottom: calc(-100% * (1 - var(--scale, .6))); pointer-events: none; }
  .page-preview-inner .ws-block { animation: none; cursor: default; }
  .page-preview-inner .ws-site { min-height: 820px; }
  .page-preview.is-phone { position: absolute; left: 50%; top: 0; translate: -50% 0; }

  /* Empty hero */
  .empty-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 24px; padding: clamp(28px, 5vw, 56px); border-radius: 32px; min-height: 420px; }
  .empty-hero-copy h2 { color: #fff; font-size: clamp(2rem, 1.3rem + 2.4vw, 3.2rem); letter-spacing: -0.045em; line-height: 1.02; margin-top: 16px; }
  .empty-hero-copy h2 em.accent { color: #C2F45B; }
  .empty-hero-copy p { color: rgb(255 255 255 / .7); margin-top: 12px; max-width: 460px; font-size: 1rem; }
  .empty-hero-art { display: grid; place-items: center; }
  .empty-hero-art .phone { width: 230px; }
  @media (max-width: 800px) { .empty-hero { grid-template-columns: 1fr; } .empty-hero-art { display: none; } }

  /* ---- Create studio ---- */
  .studio-wrap { position: fixed; inset: 0; z-index: 61; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
  .studio { width: min(1180px, 100%); height: min(820px, calc(100dvh - 32px)); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); background: var(--surface); border-radius: 32px; overflow: hidden; box-shadow: var(--e3); border: 1px solid var(--line); }
  .studio-main { display: flex; flex-direction: column; min-height: 0; }
  .studio-head { display: flex; justify-content: space-between; gap: 16px; padding: 26px 28px 8px; }
  .studio-title { font-size: 2rem; letter-spacing: -0.045em; }
  .studio-title em.accent { background: linear-gradient(95deg, var(--emerald-600), var(--violet-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .studio-tabs { display: flex; gap: 6px; padding: 10px 28px 0; }
  .studio-tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; color: var(--text-muted); border: 1px solid transparent; transition: all var(--t-fast); }
  .studio-tab svg { width: 16px; height: 16px; }
  .studio-tab:hover { color: var(--ink); background: var(--surface-hover); }
  .studio-tab[aria-selected="true"] { background: var(--ink); color: var(--text-on-ink); }
  .studio-tab.is-assist[aria-selected="true"] { background: linear-gradient(135deg, #9A83FF, #7C5CFF 50%, #5B3BE8); color: #fff; box-shadow: var(--e-glow-violet); }
  .studio-body { flex: 1; overflow-y: auto; padding: 20px 28px; }
  .studio-fields { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
  .studio-foot { display: flex; align-items: center; gap: 8px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface-2); }
  .studio-preview-toggle { display: none; }
  .studio-stage { position: relative; overflow: hidden; background: var(--grad-ink); isolation: isolate; }
  .studio-stage-inner { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; align-content: center; gap: 18px; padding: 28px; }
  .studio-stage .phone { width: 290px; }
  .studio-stage .phone-screen { transition: opacity var(--t-base), filter var(--t-base); }
  .studio-stage .phone-screen.is-loading { opacity: .5; filter: blur(3px); }
  .studio-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 14px; padding: 30px; text-align: center; color: var(--text-muted); background: linear-gradient(180deg, #F4F1FF, #fff); }
  .studio-empty p { color: #6B6488; font-size: 13px; }

  .assist-box { position: relative; border-radius: 22px; padding: 18px; background: linear-gradient(180deg, var(--assist-soft), var(--surface) 70%); }
  .assist-label { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
  .assist-orb { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-violet); color: #fff; box-shadow: var(--e-glow-violet); flex: none; }
  .assist-orb svg { width: 17px; height: 17px; }
  .assist-orb.is-lg { width: 56px; height: 56px; border-radius: 18px; }
  .assist-orb.is-lg svg { width: 26px; height: 26px; }
  .assist-input { width: 100%; margin-top: 12px; border: 0; background: transparent; resize: none; font-size: 1.05rem; line-height: 1.55; color: var(--ink); outline: none; font-weight: 500; }
  .assist-input::placeholder { color: var(--text-subtle); }
  .assist-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
  .assist-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
  .assist-notes .chip svg { color: var(--accent-text); }

  .template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
  .template-card { position: relative; display: grid; gap: 10px; padding: 8px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-fast); }
  .template-card:hover { transform: translateY(-3px); box-shadow: var(--e2); }
  .template-card.is-selected { border-color: transparent; box-shadow: 0 0 0 2px var(--ink), var(--e2); }
  .template-swatch { position: relative; display: grid; align-content: start; justify-items: center; gap: 5px; height: 132px; padding-bottom: 10px; border-radius: 14px; overflow: hidden; }
  .template-swatch-cover { width: 100%; height: 42px; margin-bottom: -8px; }
  .template-swatch-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .9); box-shadow: 0 4px 10px -4px rgb(0 0 0 / .4); }
  .template-swatch-line { width: 48%; height: 5px; border-radius: 4px; opacity: .8; }
  .template-swatch-line.is-short { width: 30%; opacity: .35; }
  .template-swatch-btn { width: 76%; height: 13px; border-radius: 6px; margin-top: 2px; }
  .template-meta { display: grid; padding: 0 4px 4px; }
  .template-meta b { font-family: var(--font-display); font-size: .98rem; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
  .template-meta small { font-size: 11.5px; color: var(--text-muted); }
  .template-check { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--text-on-ink); box-shadow: var(--e2); }
  .template-check svg { width: 14px; height: 14px; }

  @media (max-width: 900px) {
    .studio { grid-template-columns: 1fr; height: calc(100dvh - 24px); border-radius: 26px; }
    .studio-stage { position: absolute; inset: auto 0 72px 0; height: 0; transition: height var(--t-slow) var(--ease-out); z-index: 5; border-radius: 26px 26px 0 0; }
    .studio-stage.is-open { height: calc(100% - 120px); }
    .studio-preview-toggle { display: inline-flex; }
    .studio-fields { grid-template-columns: 1fr; }
    .studio-head, .studio-tabs, .studio-body, .studio-foot { padding-left: 18px; padding-right: 18px; }
    .studio .studio-fields { margin-left: 18px !important; margin-right: 18px !important; }
    .studio-foot .btn-ghost { display: none; }
  }

  /* ---- Builder frame ---- */
  body.is-builder { overflow: hidden; }
  .builder { height: 100dvh; display: grid; grid-template-rows: 56px minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); background: var(--canvas); }
  .builder-bar > * { min-width: 0; }
  .builder-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .builder-bar > :last-child { justify-self: end; }
  .builder-center { justify-self: center; }
  .save-state { display: inline-flex; align-items: center; min-width: 110px; justify-content: flex-end; }
  .save-state svg { display: inline; vertical-align: -2px; }
  .spin { animation: spin .8s linear infinite; }

  .builder-body { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; min-height: 0; }
  .builder-left, .builder-right { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
  .builder-left { border-right: 1px solid var(--line); }
  .builder-right { border-left: 1px solid var(--line); }
  .builder-tabs { display: flex; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
  .builder-tabs .tab { padding: 13px 0 11px; }
  .builder-tabs .tab:disabled { opacity: .4; cursor: not-allowed; }
  .builder-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 32px; }

  /* ---- Outline ---- */
  .outline { grid-template-columns: minmax(0, 1fr); display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
  .outline-item { position: relative; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 11px; border: 1px solid transparent; background: var(--surface); transition: background var(--t-instant), border-color var(--t-fast), box-shadow var(--t-fast); }
  .outline-item:hover { background: var(--surface-hover); }
  .outline-item.is-selected { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent); }
  .outline-item.is-hidden .outline-main { opacity: .45; }
  .outline-item.sortable-ghost { opacity: .35; }
  .outline-item.sortable-chosen { box-shadow: var(--e2); background: var(--surface); }
  .outline-handle { display: grid; place-items: center; width: 20px; height: 34px; color: var(--text-subtle); cursor: grab; flex: none; }
  .outline-handle:active { cursor: grabbing; }
  .outline-handle svg { width: 14px; height: 14px; }
  .outline-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 4px; text-align: left; border-radius: 8px; }
  .outline-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-sunken); border: 1px solid var(--line); color: var(--ink); }
  .outline-icon svg { width: 15px; height: 15px; }
  .outline-item.is-selected .outline-icon { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .outline-title { display: block; font-size: var(--fs-small); font-weight: 500; color: var(--ink); line-height: 1.25; }
  .outline-sub { display: block; font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.3; }
  .outline-actions { display: flex; opacity: 0; transition: opacity var(--t-fast); }
  .outline-item:hover .outline-actions, .outline-item.is-selected .outline-actions, .outline-item:focus-within .outline-actions { opacity: 1; }
  .outline-add { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: 1.5px dashed var(--line-strong); border-radius: 11px; color: var(--text-muted); font-weight: 500; transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast); }
  .outline-add:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
  .outline-add svg { width: 16px; height: 16px; }

  /* ---- Palette ---- */
  .block-palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
  .block-tile { display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
  .block-tile:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); box-shadow: var(--e2); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
  .block-tile:active { transform: translateY(0) scale(.97); }
  .block-tile-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--line); }
  .block-tile:hover .block-tile-icon { background: var(--ink); color: var(--text-on-ink); border-color: transparent; }
  .block-tile-icon svg { width: 17px; height: 17px; }
  .block-tile-label { font-size: 11.5px; font-weight: 500; color: var(--ink); text-align: center; line-height: 1.2; }

  /* ---- Canvas + device ---- */
  .builder-canvas { position: relative; overflow-y: auto; padding: 28px 24px 60px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .device { width: 390px; max-width: 100%; transition: width var(--t-slow) var(--ease-out); flex: none; }
  .device.is-desktop { width: min(980px, 100%); }
  .device-screen { border-radius: 36px; overflow: hidden; min-height: 720px; box-shadow: 0 0 0 10px #0E1A15, 0 0 0 11px #2A3631, 0 40px 80px -30px rgb(8 50 36 / .55); position: relative; }
  .device.is-desktop .device-screen { border-radius: 14px; box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px -30px rgb(8 50 36 / .45); min-height: 640px; }
  .device-screen .ws-site { min-height: 720px; }
  .device.is-desktop .device-screen .ws-site { min-height: 640px; }
  .device-screen .ws-block { cursor: pointer; outline: 2px solid transparent; outline-offset: 5px; border-radius: calc(var(--site-radius) + 4px); transition: outline-color var(--t-fast); }
  .device-screen .ws-block:hover { outline-color: color-mix(in oklab, #0BC284 45%, transparent); }
  .device-screen .ws-block.is-selected { outline-color: #0BC284; }
  .device-screen .ws-block.is-hidden { opacity: .35; }
  .device-screen a, .device-screen button, .device-screen input, .device-screen summary { pointer-events: none; }
  .canvas-warn { max-width: 390px; }

  /* ---- Inspector ---- */
  .inspector-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
  .inspector-section { border-top: 1px solid var(--line); padding-top: 12px; }
  .inspector-section summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: var(--fs-small); font-weight: 500; color: var(--ink); }
  .inspector-section summary::-webkit-details-marker { display: none; }
  .image-field { display: flex; gap: 12px; align-items: flex-start; }
  .image-field-preview { width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text-subtle); }
  .image-field-preview img { width: 100%; height: 100%; object-fit: cover; }
  .theme-swatch { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: 10px 10px; gap: 4px; width: 62%; align-items: center; }
  .theme-swatch > span:first-child { grid-row: span 2; }
  .theme-swatch > span:not(:first-child) { height: 10px; }
  .btn-sample { display: block; width: 60%; height: 16px; border-radius: 6px; }
  .btn-sample-solid { background: var(--ink); }
  .btn-sample-soft { background: color-mix(in oklab, var(--accent) 22%, transparent); border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
  .btn-sample-outline { border: 1.5px solid var(--ink); }
  .btn-sample-shadow { background: var(--surface); box-shadow: 0 4px 10px -3px rgb(0 0 0 / .3); }

  .builder-mobile-tabs { display: none; }

  @media (max-width: 1180px) { .builder-body { grid-template-columns: 260px minmax(0, 1fr) 300px; } }
  @media (max-width: 1023px) {
    .builder { grid-template-rows: 56px minmax(0, 1fr) 60px; }
    .builder-bar { grid-template-columns: minmax(0, 1fr) auto; }
    .builder-center { display: none; }
    .builder-body { grid-template-columns: minmax(0, 1fr); }
    .builder-left, .builder-right, .builder-canvas { display: none; }
    .builder-body[data-pane="blocks"] .builder-left, .builder-body[data-pane="inspector"] .builder-right { display: flex; border: 0; }
    .builder-body[data-pane="canvas"] .builder-canvas { display: flex; padding: 18px 12px 40px; }
    .builder-mobile-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); }
    .builder-mobile-tabs button { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
    .builder-mobile-tabs button svg { width: 20px; height: 20px; }
    .builder-mobile-tabs button[aria-pressed="true"] { color: var(--ink); }
    .builder-mobile-tabs button[aria-pressed="true"] svg { color: var(--accent-text); }
    .device-screen { box-shadow: 0 0 0 1px var(--line-strong), 0 20px 40px -24px rgb(8 50 36 / .45); border-radius: 22px; min-height: 600px; }
  }
}

/* ---- Builder v2: premium chrome ---- */
@layer components {
  .builder { grid-template-rows: 64px minmax(0, 1fr); background: var(--canvas); background-image: var(--grad-mesh); }
  .builder-bar { background: color-mix(in oklab, var(--surface) 86%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); padding: 0 16px; }
  .builder-site-dot { width: 34px; height: 34px; border-radius: 11px; flex: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3), var(--e1); }
  .builder-assist-btn { height: 34px; padding: 0 12px; border-radius: 10px; }
  .builder-body { grid-template-columns: 300px minmax(0, 1fr) 360px; gap: 10px; padding: 10px; }
  .builder-left, .builder-right { border: 1px solid var(--line) !important; border-radius: 22px; overflow: hidden; box-shadow: var(--e1); }
  .builder-tabs { gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
  .builder-tabs .tab { padding: 0 12px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-muted); border: 0; }
  .builder-tabs .tab:hover { background: var(--surface-hover); color: var(--ink); }
  .builder-tabs .tab.is-active { background: var(--ink); color: var(--text-on-ink); }
  .builder-tabs .tab::after { display: none; }
  .builder-canvas { border-radius: 22px; background: radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--text-subtle) 40%, transparent) 1px, transparent 0) 0 0 / 20px 20px; padding-top: 18px; }
  .canvas-url { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--e1); font-size: 12.5px; font-weight: 700; color: var(--ink); backdrop-filter: blur(10px); }
  .device-screen { box-shadow: 0 0 0 10px #111413, 0 0 0 11px #2B302D, 0 50px 90px -40px rgb(0 0 0 / .55), 0 30px 60px -30px rgb(11 194 132 / .25); border-radius: 40px; }
  :root[data-theme="dark"] .device-screen { box-shadow: 0 0 0 10px #1C201F, 0 0 0 11px #353B38, 0 50px 90px -40px rgb(0 0 0 / .9), 0 30px 60px -30px rgb(124 92 255 / .3); }
  .device-screen .ws-block.is-selected { outline-color: var(--violet-500); }
  .device-screen .ws-block:hover { outline-color: color-mix(in oklab, var(--violet-500) 45%, transparent); }

  .builder-quick { display: grid; gap: 8px; margin-bottom: 14px; }
  .builder-quick-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-align: left; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base); }
  .builder-quick-card:hover { transform: translateY(-2px); }
  .builder-quick-card > svg { width: 20px; height: 20px; flex: none; }
  .builder-quick-card b { display: block; font-family: var(--font-display); font-size: .98rem; letter-spacing: -0.01em; color: inherit; }
  .builder-quick-card small { display: block; font-size: 11.5px; opacity: .75; }
  .builder-quick-card.is-plain { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
  .builder-quick-card.is-plain:hover { box-shadow: var(--e2); }

  .outline-item { border-radius: 14px; padding: 5px; }
  .outline-item.is-selected { border-color: color-mix(in oklab, var(--violet-500) 45%, var(--line)); background: var(--assist-soft); box-shadow: 0 0 0 1px color-mix(in oklab, var(--violet-500) 25%, transparent); }
  .outline-item.is-selected .outline-icon { background: var(--grad-violet); color: #fff; }
  .outline-icon { border-radius: 11px; width: 34px; height: 34px; }
  .outline-title { font-weight: 700; }
  .block-tile { border-radius: 16px; padding: 14px 6px 12px; }
  .block-tile-icon { border-radius: 12px; width: 38px; height: 38px; }
  .block-tile:hover .block-tile-icon { background: var(--grad-violet); color: #fff; }

  .builder-dialog { overflow: hidden; }
  .image-field-preview svg { width: 22px; height: 22px; }
  .builder-dialog-hero { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 0; }

  .theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .theme-card { display: grid; gap: 6px; text-align: center; font-size: var(--fs-micro); font-weight: 700; color: var(--text-muted); }
  .theme-card-preview { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; height: 96px; padding-bottom: 8px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base); }
  .theme-card:hover .theme-card-preview { transform: translateY(-2px); box-shadow: var(--e2); }
  .theme-card.is-selected .theme-card-preview { box-shadow: 0 0 0 2px var(--ink), var(--e2); }
  .theme-card.is-selected { color: var(--ink); }
  .theme-card-cover { width: 100%; height: 28px; margin-bottom: -8px; }
  .theme-card-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .9); }
  .theme-card-btn { width: 72%; height: 11px; }
  .theme-card-btn.is-2 { opacity: .14; }
  .btn-sample-glass { background: color-mix(in oklab, var(--ink) 10%, transparent); border: 1px solid var(--line-strong); backdrop-filter: blur(4px); }

  @media (max-width: 1180px) { .builder-body { grid-template-columns: 270px minmax(0, 1fr) 320px; } }
  @media (max-width: 1023px) {
    .builder { grid-template-rows: 60px minmax(0, 1fr) 64px; }
    .builder-body { padding: 0; gap: 0; grid-template-columns: minmax(0, 1fr); }
    .builder-left, .builder-right { border-radius: 0; border: 0 !important; box-shadow: none; }
    .builder-canvas { border-radius: 0; }
    .canvas-url { display: none; }
  }
}

/* Version history (ADR-0031) */
@layer components {
  .hist-save { display: flex; gap: 6px; }
  .hist-save .input { flex: 1; min-width: 0; }
  .hist-empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 28px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--text-muted); }
  .hist-empty > svg { width: 22px; height: 22px; }
  .hist-list { display: grid; gap: 0; position: relative; }
  .hist-item { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
  .hist-item + .hist-item::before { content: ""; position: absolute; left: 15px; top: -10px; height: 20px; width: 2px; background: var(--line); }
  .hist-dot { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--line); }
  .hist-dot svg { width: 15px; height: 15px; }
  .hist-dot.is-published { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
  .hist-dot.is-live { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent); }
  .hist-body { flex: 1; min-width: 0; }
  .hist-body > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .hist-name { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
  .hist-body small { display: block; font-size: 12px; margin-top: 2px; }
}

/* Share preview (ADR-0032) */
@layer components {
  .share-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--e1); }
  .share-card-img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface-sunken); }
  .share-card-body { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
  .share-card-body small { font-size: 11px; color: var(--text-subtle); text-transform: lowercase; }
  .share-card-body b { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .share-card-body span { font-size: 12px; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* css/utilities.css */
/* Small, deliberate utility layer (ADR-0005). Prefer components. ---------- */
@layer utilities {
  .stack { display: grid; gap: var(--gap, 16px); }
  .stack-sm { display: grid; gap: 8px; }
  .stack-lg { display: grid; gap: 24px; }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
  .between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .center { display: grid; place-items: center; }
  .grow { flex: 1; min-width: 0; }
  .nowrap { white-space: nowrap; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .muted { color: var(--text-muted); }
  .subtle { color: var(--text-subtle); }
  .ink { color: var(--ink); }
  .accent-text { color: var(--accent-text); }
  .danger-text { color: var(--danger); }
  .text-sm { font-size: var(--fs-small); }
  .text-xs { font-size: var(--fs-micro); }
  .text-lg { font-size: var(--fs-h3); }
  .fw-500 { font-weight: 500; }
  .mono { font-family: var(--font-mono); }
  .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
  .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
  .w-full { width: 100%; }
  .icon-14 { width: 14px; height: 14px; } .icon-16 { width: 16px; height: 16px; } .icon-18 { width: 18px; height: 18px; } .icon-20 { width: 20px; height: 20px; }
  .hide-mobile { } @media (max-width: 640px) { .hide-mobile { display: none !important; } }
  .show-mobile { display: none !important; } @media (max-width: 640px) { .show-mobile { display: revert !important; } }
  .fade-in { animation: fade-in var(--t-slow) var(--ease-out) both; }
  .rise-in { animation: rise-in var(--t-slow) var(--ease-out) both; }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
}
