@layer reset, tokens, base, layout, components, views, utilities;

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(../fonts/jetbrains-mono-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

@font-face { font-family: "Jakarta Fallback"; font-weight: 100 549; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica"), local("Roboto");
  size-adjust: 106.30%; ascent-override: 97.8%; descent-override: 20.7%; line-gap-override: 0%; }
@font-face { font-family: "Jakarta Fallback"; font-weight: 550 699; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"), local("Roboto Bold");
  size-adjust: 101.20%; ascent-override: 102.8%; descent-override: 21.7%; line-gap-override: 0%; }
@font-face { font-family: "Jakarta Fallback"; font-weight: 700 900; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"), local("Roboto Bold");
  size-adjust: 102.70%; ascent-override: 101.3%; descent-override: 21.4%; line-gap-override: 0%; }
@font-face { font-family: "Jakarta Fallback DejaVu"; font-weight: 100 549; src: local("DejaVu Sans"), local("DejaVuSans");
  size-adjust: 92.48%; ascent-override: 112.5%; descent-override: 23.8%; line-gap-override: 0%; }
@font-face { font-family: "Jakarta Fallback DejaVu"; font-weight: 550 699; src: local("DejaVu Sans Bold"), local("DejaVuSans-Bold");
  size-adjust: 84.38%; ascent-override: 123.3%; descent-override: 26.1%; line-gap-override: 0%; }
@font-face { font-family: "Jakarta Fallback DejaVu"; font-weight: 700 900; src: local("DejaVu Sans Bold"), local("DejaVuSans-Bold");
  size-adjust: 84.10%; ascent-override: 123.7%; descent-override: 26.2%; line-gap-override: 0%; }
@font-face { font-family: "Mono Fallback"; src: local("Liberation Mono"), local("Courier New"), local("Menlo"), local("Consolas"), local("DejaVu Sans Mono");
  size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%; }

@layer tokens {
  :root {
    --blue-50: #EFF6FF; --blue-200: #BFDBFE; --blue-600: #2563EB; --blue-700: #1D4ED8; --blue-800: #1E40AF;
    --violet-50: #F5F3FF; --violet-200: #DDD6FE; --violet-600: #7C3AED; --violet-700: #6D28D9;
    --indigo-50: #EEF2FF; --indigo-200: #C7D2FE;
    --s50: #F8FAFC; --s100: #F1F5F9; --s200: #E2E8F0; --s300: #CBD5E1; --s400: #94A3B8; --s500: #64748B;
    --s600: #475569; --s700: #334155; --s800: #1E293B; --s900: #0F172A; --white: #FFFFFF;
    --green-700: #047857; --red-700: #B91C1C; --red-50: #FEF2F2; --amber-50: #FFFBEB; --amber-800: #92400E;
    --brand: linear-gradient(90deg, var(--blue-600), var(--violet-600));
    --brand-hover: linear-gradient(90deg, var(--blue-700), var(--violet-700));
    --bg: var(--white); --surface: var(--white); --surface-2: var(--s50); --surface-3: var(--s100); --surface-inverse: var(--s900);
    --text: var(--s900);
    --text-2: var(--s600);
    --text-3: var(--s500);
    --text-inverse: var(--white);
    --link: var(--blue-600); --focus: var(--blue-600);
    --border: var(--s200); --border-strong: var(--s300); --border-field: #7C8DA3; --border-active: var(--indigo-200);
    --success: var(--green-700); --danger: var(--red-700);
    --code-bg: var(--s900); --code-bar: var(--s800); --code-text: var(--s200); --code-muted: var(--s400);
    --glow-blue: rgb(191 219 254 / .55); --glow-violet: rgb(221 214 254 / .55);
    --shade: rgb(15 23 42 / .10); --dots: rgb(100 116 139 / .14); --scrim: rgb(15 23 42 / .28);
    --font-sans: "Plus Jakarta Sans", "Jakarta Fallback", "Jakarta Fallback DejaVu", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --fs-display: clamp(1.75rem, min(1rem + 3.6vw, 8.5vh), 5rem);
    --fs-title: clamp(1.5rem, min(1rem + 1.8vw, 6vh), 2.75rem);
    --fs-h2: clamp(1.125rem, 1rem + .5vw, 1.5rem);
    --fs-lede: clamp(1rem, .94rem + .3vw, 1.25rem);
    --fs-body: 1rem; --fs-ui: .9375rem; --fs-small: .875rem; --fs-min: .8125rem; --fs-badge: .75rem; --fs-code: .8125rem;

    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
    --gap-y: clamp(8px, 2.4vh, 32px);
    --gap-x: clamp(16px, 3vw, 72px);
    --pad-view: clamp(12px, 3vh, 48px);
    --gutter: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left), env(safe-area-inset-right));
    --container: 1280px;
    --header-h: 64px;
    --footer-h: 0px;
    --vvh: 100dvh;

    --r-xs: 6px; --r-sm: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 24px; --r-pill: 999px;
    --sh-sm: 0 1px 3px rgb(15 23 42 / .08), 0 1px 2px rgb(15 23 42 / .04);
    --sh-md: 0 8px 24px rgb(15 23 42 / .06);
    --sh-lg: 0 18px 45px rgb(37 99 235 / .14), 0 4px 14px rgb(15 23 42 / .06);
    --sh-xl: 0 24px 64px rgb(15 23 42 / .16);
    --sh-brand: 0 10px 24px rgb(124 58 237 / .22);

    --t-fast: 120ms; --t-mid: 200ms; --t-slow: 320ms; --ease-out: cubic-bezier(.22, 1, .36, 1);
    --z-header: 40; --z-menu: 50; --z-toast: 60; --z-skip: 70;
  }
  @supports (width: 1cqi) {
    :root {
      --fs-display: clamp(1.75rem, min(1rem + 3.6cqi, 8.5cqb), 5rem);
      --fs-title: clamp(1.5rem, min(1rem + 1.8cqi, 6cqb), 2.75rem);
      --fs-h2: clamp(1.125rem, 1rem + .5cqi, 1.5rem);
      --fs-lede: clamp(1rem, .94rem + .3cqi, 1.25rem);
      --gap-y: clamp(8px, 2.4cqb, 32px);
      --gap-x: clamp(16px, 3cqi, 72px);
      --pad-view: clamp(12px, 3cqb, 48px);
    }
  }
  @media (min-width: 1920px) { :root { --container: 1440px; } }
  @media (max-width: 767px) { :root { --header-h: 56px; } }
  @media (max-height: 559px) { :root { --header-h: 48px; } }
  @media (min-width: 768px) and (min-height: 600px) { :root { --footer-h: 40px; } }
  @media (min-width: 768px) and (min-height: 600px) and (pointer: coarse) { :root { --footer-h: 44px; } }
  @media (min-width: 1024px) { :root { --fs-code: .875rem; } }
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol, fieldset { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  legend { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  button:disabled { cursor: not-allowed; }
  a { color: inherit; }
  table { border-collapse: separate; border-spacing: 0; }
  summary { cursor: pointer; }
  summary::-webkit-details-marker { display: none; }
}

@layer base {
  html { height: 100%; scroll-padding-top: var(--header-h); }
  body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font-sans);
    font-size: var(--fs-body); line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; font-synthesis-weight: none; }
  h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; }
  p { text-wrap: pretty; }
  code, pre, kbd { font-family: var(--font-mono); font-size: var(--fs-code); }
  a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  :focus:not(:focus-visible) { outline: none; }
  ::selection { background: var(--indigo-200); color: var(--text); }
  .icon { width: 1.25em; height: 1.25em; max-width: none; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; }
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
}

@layer layout {
  .app { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: var(--vvh);
    overflow: hidden; isolation: isolate; }
  .view { position: relative; container: view / size; min-height: 0; overflow: auto; overscroll-behavior: contain; outline: none;
    background:
      radial-gradient(40rem 22rem at 8% 0%, var(--glow-blue), transparent 70%),
      radial-gradient(36rem 22rem at 96% 18%, var(--glow-violet), transparent 70%),
      var(--bg); }
  .view > * { height: 100%; }
  .container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

  @media (max-height: 319px) {
    body { overflow: auto; height: auto; }
    .app { height: auto; min-height: 100vh; overflow: visible; }
    .view { container-type: inline-size; overflow: visible; }
    .view > * { height: auto; }
  }
  @media print {
    body { overflow: visible; height: auto; }
    .app { display: block; height: auto; overflow: visible; }
    .view { container-type: normal; overflow: visible; background: none; }
    .view > * { height: auto; }
    .site-header, .site-footer, .menu, .chat__chips, .composer, .toast-region { display: none; }
  }
}

@layer components {
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-5);
    border-radius: var(--r-pill); border: 1px solid transparent; font-size: var(--fs-ui); font-weight: 600; line-height: 1.2;
    text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
    transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
  .btn:active:not(:disabled) { transform: translateY(1px); }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
  .btn--sm { min-height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-small); }
  .btn--md { min-height: 44px; }
  .btn--lg { min-height: 52px; padding: 0 var(--sp-6); font-size: 1rem; }
  .btn--block { width: 100%; }
  .btn--primary { background: var(--brand); color: var(--text-inverse); box-shadow: var(--sh-brand); }
  .btn--primary:hover { background: var(--brand-hover); }
  .btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-sm); }
  .btn--secondary:hover { border-color: var(--s400); background: var(--surface-2); }
  .btn--ghost { color: var(--text-2); }
  .btn--ghost:hover { background: var(--surface-3); color: var(--text); }
  .btn--dark { background: var(--s800); color: var(--code-text); border-color: rgb(255 255 255 / .08); }
  .btn--dark:hover { background: var(--s700); color: var(--text-inverse); }
  .btn--icon { min-width: 44px; padding: 0; }
  .btn--icon.btn--sm { min-width: 36px; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-pill);
    color: var(--text-3); transition: background-color var(--t-fast), color var(--t-fast); }
  .icon-btn:hover { background: var(--surface-3); color: var(--text); }
  .icon-btn .icon { width: 16px; height: 16px; }

  .badge { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 22px; padding: 0 var(--sp-2); border-radius: var(--r-pill);
    background: var(--surface-3); color: var(--text-2); font-size: var(--fs-badge); font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; white-space: nowrap; }
  .badge--brand { background: var(--brand); color: var(--text-inverse); }
  .badge--model { background: var(--violet-50); color: var(--violet-700); text-transform: none; letter-spacing: 0; }
  .brand__badge { background: var(--blue-50); color: var(--blue-700); }
  .pill { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill);
    border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-small); color: var(--text-2); }

  .chip-row { display: flex; gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    padding-block: 2px; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 var(--sp-3);
    border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--s700);
    font-size: var(--fs-min); font-weight: 600; box-shadow: var(--sh-sm); scroll-snap-align: start;
    transition: border-color var(--t-fast), background-color var(--t-fast); }
  .chip:hover:not(:disabled) { border-color: var(--border-active); background: var(--surface-2); }
  .chip:disabled { opacity: .55; cursor: not-allowed; }
  .chip--sparkle { border-color: var(--violet-200); background: var(--violet-50); color: var(--violet-700); }
  .chip__icon { width: 15px; height: 15px; }
  @media (max-width: 639px) { .chip--wide { display: none; } }

  .eyebrow { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); font-weight: 600; color: var(--blue-700); }
  .title { font-size: var(--fs-title); font-weight: 800; line-height: 1.1; letter-spacing: -.025em; color: var(--text); outline: none; }
  .title--display { font-size: var(--fs-display); line-height: 1.04; letter-spacing: -.035em; }
  .title__line { display: inline; }
  .grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--text-2); max-width: 46ch; text-wrap: balance; }
  .cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
  .fineprint { font-size: var(--fs-min); color: var(--text-3); line-height: 1.5; }
  .notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
    background: var(--amber-50); color: var(--amber-800); font-size: var(--fs-small); }
  .notice .icon { margin-top: 2px; }
  .logo { flex: none; border-radius: 50%; }
  .logo--empty { display: inline-block; background: var(--brand); }

  .scroll-region { min-height: clamp(120px, 30vh, 100%); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
    scroll-padding-top: 44px; border-radius: var(--r-lg);
    background:
      linear-gradient(var(--surface) 30%, transparent) center top / 100% 24px no-repeat local,
      linear-gradient(transparent, var(--surface) 70%) center bottom / 100% 24px no-repeat local,
      radial-gradient(farthest-side at 50% 0, var(--shade), transparent) center top / 100% 8px no-repeat scroll,
      radial-gradient(farthest-side at 50% 100%, var(--shade), transparent) center bottom / 100% 8px no-repeat scroll,
      var(--surface); }
  @supports (height: 1cqb) { .scroll-region { min-height: clamp(120px, 30cqb, 100%); } }
  .scroll-region:focus-visible { outline-offset: -2px; }

  .data { width: 100%; font-size: var(--fs-small); }
  .data caption { text-align: left; }
  .data th, .data td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
  .data thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: var(--fs-badge); font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
  .data tbody th { font-weight: 600; }
  .data tbody tr:hover > * { background: var(--surface-2); }
  .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .data th.num, .data td.num { text-align: right; }

  .code { position: relative; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-lg); overflow: hidden;
    background: var(--code-bg); color: var(--code-text); border: 1px solid var(--s800); }
  .code__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px;
    padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-4); background: var(--code-bar); border-bottom: 1px solid rgb(255 255 255 / .06); }
  .code__lang { font-family: var(--font-mono); font-size: var(--fs-badge); color: var(--code-muted); text-transform: lowercase; }
  .code__pre { margin: 0; padding: var(--sp-4); overflow: auto; font-size: var(--fs-code); line-height: 1.65; tab-size: 2; color: var(--code-text);
    white-space: pre; outline-offset: -2px; }
  .code__copy { color: var(--code-muted); }
  .code__copy:hover { background: rgb(255 255 255 / .08); color: var(--text-inverse); }

  .seg { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-3);
    max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg__item { position: relative; display: inline-flex; flex: none; }
  .seg__item > span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-pill);
    font-size: var(--fs-min); font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap;
    transition: background-color var(--t-fast), color var(--t-fast); }
  .seg__item > input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
  .seg__item > input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
  .seg--chips { background: none; padding: 0; gap: var(--sp-2); }
  .seg--chips .seg__item > span { border: 1px solid var(--border); background: var(--surface); min-height: 32px; }
  .seg--chips .seg__item > input:checked + span { border-color: var(--blue-200); background: var(--blue-50); color: var(--blue-700); box-shadow: none; }
  .seg--dark { background: rgb(255 255 255 / .06); }
  .seg--dark .seg__item > span { color: var(--code-muted); }
  .seg--dark .seg__item > input:checked + span { background: var(--s700); color: var(--text-inverse); box-shadow: none; }
  .code :focus-visible, .seg--dark .seg__item > input:focus-visible + span { outline-color: var(--blue-200); }

  .search { position: relative; display: inline-flex; align-items: center; min-width: 0; }
  .search__icon { position: absolute; left: var(--sp-3); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
  .search__input { width: 100%; min-height: 40px; padding: 0 var(--sp-3) 0 36px; border-radius: var(--r-pill); border: 1px solid var(--border-field);
    background: var(--surface); font-size: 1rem; }
  .search__input::placeholder { color: var(--text-3); }
  .search__input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-50); }
  .select { position: relative; display: inline-flex; align-items: center; }
  .select > select { appearance: none; min-height: 36px; padding: 0 32px 0 var(--sp-3); border-radius: var(--r-sm);
    border: 1px solid var(--border-field); background: var(--surface); color: var(--text); font-size: var(--fs-small); max-width: 100%; }
  .select__icon { position: absolute; right: 10px; width: 16px; height: 16px; pointer-events: none; color: var(--text-3); }

  .tile { display: flex; flex-direction: column; gap: var(--sp-2); padding: clamp(14px, 2cqb, 20px); border-radius: var(--r-lg);
    border: 1px solid var(--border); background: var(--surface); }
  .tile__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md);
    background: var(--blue-50); color: var(--blue-600); flex: none; }
  .tile__icon .icon { width: 20px; height: 20px; }
  .tile__title { font-size: 1rem; font-weight: 700; }
  .tile__text { font-size: var(--fs-small); color: var(--text-2); line-height: 1.55; }

  .chat { position: relative; container: chat / inline-size; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    gap: var(--sp-2);
    height: 100%; min-height: 0; padding: var(--sp-3); border-radius: var(--r-2xl); border: 1px solid var(--border);
    background: var(--surface); box-shadow: var(--sh-md); }
  .chat__bar { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-1); }
  .chat__mark { width: 28px; height: 28px; }
  .chat__title { font-size: 1rem; font-weight: 800; }
  .chat__model { margin-right: auto; }
  .chat__quota { min-width: 0; text-align: right; font-size: var(--fs-min); color: var(--text-3); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; }
  .chat__new { flex: none; }
  .chat__new .icon { width: 16px; height: 16px; }
  .chat[data-state="idle"] .chat__new { display: none; }
  .chat__model { display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 22px; }

  @container chat (max-width: 500px) { .chat__new { min-width: 36px; padding: 0; } .chat__new-label { display: none; } }
  @container chat (max-width: 320px) { .chat__bar { flex-wrap: wrap; row-gap: 0; } .chat__quota { order: 9; flex: 1 0 100%; padding-left: 36px; text-align: left; line-height: 1.3; } }
  @container chat (max-width: 420px) {
    .chat[data-state="active"] .chat__bar { flex-wrap: wrap; row-gap: 0; }
    .chat[data-state="active"] .chat__quota { order: 9; flex: 1 0 100%; padding-left: 36px; text-align: left; line-height: 1.3; }
  }
  .chat__log { display: flex; flex-direction: column; gap: var(--sp-4); min-height: 0; padding: var(--sp-2) var(--sp-1);
    border-radius: var(--r-md); scroll-padding-top: 0; }
  .chat__log.scroll-region { min-height: 0; }
  .chat__chips { min-height: 40px; }
  .chat__notice { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--blue-50); color: var(--blue-800);
    font-size: var(--fs-min); text-align: center; }
  .chat__note { font-size: var(--fs-min); color: var(--text-3); text-align: center; }
  .chat__noscript { font-size: var(--fs-small); color: var(--text-2); text-align: center; padding: var(--sp-2); }
  .chat[data-chat="off"] .chat__log { opacity: .8; }

  .msg { display: grid; gap: 6px; max-width: 100%; animation: rise var(--t-mid) var(--ease-out) both; }
  .msg--greeting { animation: none; }
  .msg__head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-min); font-weight: 700; color: var(--s700); }
  .msg__avatar { width: 22px; height: 22px; }
  .msg__body { font-size: var(--fs-ui); line-height: 1.65; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
  .msg__body > * + * { margin-top: var(--sp-3); }
  .msg__body p { white-space: pre-line; }
  .msg__body ul, .msg__body ol { padding-left: 1.4em; }
  .msg__body li + li { margin-top: 4px; }
  .msg__body li::marker { color: var(--text-3); }
  .msg__body .code { margin-block: var(--sp-2); }
  .msg--user { justify-items: end; }
  .msg__bubble { max-width: 85%; padding: 10px var(--sp-4); border-radius: 18px; background: var(--surface-3); color: var(--text);
    font-size: var(--fs-ui); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
  @media (min-width: 768px) { .msg__bubble { max-width: 70%; } }
  .msg__actions { display: flex; align-items: center; gap: 2px; margin-left: -6px; }
  .msg__hint { margin-left: var(--sp-1); font-size: var(--fs-badge); color: var(--success); font-weight: 600; }
  .ic { padding: 1px 5px; border-radius: var(--r-xs); background: var(--surface-3); font-size: .875em; overflow-wrap: anywhere; }

  .typing { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; }
  .typing__dots { display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-2); }
  .typing__dots > span { width: 6px; height: 6px; border-radius: 50%; background: var(--violet-600); animation: pulse 1.1s ease-in-out infinite; }
  .typing__dots > span:nth-child(2) { animation-delay: .15s; }
  .typing__dots > span:nth-child(3) { animation-delay: .3s; }
  .typing__text { font-size: var(--fs-min); color: var(--text-3); }

  .msg--signup .signup-card { position: relative; display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-lg);
    border: 1px solid var(--indigo-200); box-shadow: 0 0 0 3px var(--indigo-50); background: var(--surface); }
  .signup-card__title { font-size: 1rem; font-weight: 700; }
  .signup-card:has(.signup-card__badge) .signup-card__title { padding-right: 7rem; }
  .signup-card__text { font-size: var(--fs-small); color: var(--text-2); line-height: 1.55; }
  .signup-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
  .signup-card__badge { position: absolute; top: var(--sp-3); right: var(--sp-3); }

  .composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-radius: var(--r-xl); border: 1px solid var(--border-field);
    background: var(--surface); transition: border-color var(--t-mid), box-shadow var(--t-mid); }
  .composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), var(--sh-lg); }
  .composer__input { display: block; width: 100%; min-height: 44px; max-height: 9.5em; padding: 10px 0; border: 0; resize: none;
    background: transparent; font-size: 1rem; line-height: 1.5; color: var(--text); outline: none; overflow-y: auto; }
  .composer__input::placeholder { color: var(--text-3); opacity: 1; }
  .composer__input:disabled { cursor: not-allowed; }
  .composer__actions { display: flex; gap: var(--sp-1); }
  .composer__send, .composer__stop { width: 44px; min-width: 44px; height: 44px; }
  .composer__send .icon, .composer__stop .icon { width: 20px; height: 20px; }
  .composer__hint { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 0 0;
    font-size: var(--fs-min); color: var(--text-3); }
  .composer__count { font-variant-numeric: tabular-nums; }
  .chat[data-busy] .composer__keys > span { display: none; }
  .chat[data-busy] .composer__keys::after { content: attr(data-busy); }
  .chat[data-chat="off"] .composer__hint { display: none; }
  .composer__count[data-over] { color: var(--danger); font-weight: 600; }

  .toast-region { position: fixed; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 12px); z-index: var(--z-toast);
    transform: translateX(-50%); display: grid; gap: var(--sp-2); justify-items: center; pointer-events: none; width: max-content;
    max-width: calc(100vw - 2 * var(--sp-4)); }
  .toast { padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--surface-inverse); color: var(--text-inverse);
    font-size: var(--fs-small); font-weight: 600; box-shadow: var(--sh-xl); animation: fade var(--t-mid) var(--ease-out) both; }

  .skip-link { position: fixed; left: var(--sp-3); top: var(--sp-3); z-index: var(--z-skip); padding: var(--sp-3) var(--sp-5);
    border-radius: var(--r-pill); background: var(--surface-inverse); color: var(--text-inverse); font-weight: 700;
    font-size: var(--fs-small); text-decoration: none; transform: translateY(-200%); }
  .skip-link:focus-visible { transform: none; }

  .site-header { position: relative; z-index: var(--z-header); height: var(--header-h); border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / .86); backdrop-filter: saturate(1.4) blur(10px); padding-top: env(safe-area-inset-top); box-sizing: content-box; }
  .site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--sp-4); }
  .brand { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--text); flex: none;
    border-radius: var(--r-sm); }
  .brand__mark { width: 32px; height: 32px; }
  .brand__name { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
  .brand__badge { display: none; }
  .nav { display: none; margin-inline: auto; }
  .nav__list { display: flex; align-items: center; gap: var(--sp-1); }
  .nav__link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-pill);
    font-size: var(--fs-ui); font-weight: 500; color: var(--text-2); text-decoration: none;
    transition: background-color var(--t-fast), color var(--t-fast); }
  .nav__link:hover { color: var(--text); background: var(--surface-3); }
  .nav__link[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
  .header__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
  .header__signin { display: none; }

  @media (min-width: 480px) { .header__signin { display: inline-flex; } }
  @media (min-width: 768px) { .brand__badge { display: inline-flex; } .brand__name { font-size: 1.375rem; } }
  @media (min-width: 1024px) and (min-height: 560px) {
    .nav { display: block; }
    .nav + .header__actions { margin-left: 0; }
    .menu { display: none; }
  }

  .menu { position: static; }
  .menu__button { list-style: none; }
  .menu__icon-close { display: none; }
  .menu[open] .menu__icon-open { display: none; }
  .menu[open] .menu__icon-close { display: block; }
  .menu__panel { position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-menu); max-height: calc(var(--vvh) - var(--header-h));
    overflow: auto; overscroll-behavior: contain; padding: var(--sp-3) var(--gutter) var(--sp-6); background: var(--surface);
    border-bottom: 1px solid var(--border); display: grid; gap: var(--sp-4);
    box-shadow: var(--sh-xl), 0 0 0 100vmax var(--scrim); clip-path: inset(0 -100vmax -100vmax); }

  .app:has(.menu[open]) .view, .app:has(.menu[open]) .site-footer { pointer-events: none; }
  .menu__cta { display: none; }
  @media (min-width: 480px) { .menu__actions { display: none; } }
  .menu__list { display: grid; gap: 2px; }
  .menu__link { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-3); border-radius: var(--r-md);
    font-weight: 600; text-decoration: none; color: var(--text); }
  .menu__link .icon { color: var(--text-3); }
  .menu__link:hover { background: var(--surface-2); }
  .menu__link[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); }
  .menu__link[aria-current="page"] .icon { color: var(--blue-600); }
  .menu__actions { display: grid; gap: var(--sp-2); }
  .menu__more { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) var(--sp-3) 0; border-top: 1px solid var(--border); }
  .menu__minor { display: inline-flex; align-items: center; min-height: 40px; color: var(--text-2); font-size: var(--fs-small); }
  @media (max-height: 559px) {
    .menu { display: block; }
    .menu__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (min-width: 1024px) and (max-height: 559px) { .nav { display: none; } }

  .site-footer { display: none; height: var(--footer-h); border-top: 1px solid var(--border); background: var(--surface);
    font-size: var(--fs-min); color: var(--text-3); padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; }
  .site-footer__inner { height: 100%; display: flex; align-items: center; gap: var(--sp-6); white-space: nowrap; overflow: hidden; }
  .site-footer__brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); font-weight: 600; }
  .site-footer__mark { width: 16px; height: 16px; }
  .site-footer__tagline { font-weight: 400; color: var(--text-3); }
  .site-footer__links { display: flex; gap: var(--sp-4); margin-inline: auto; }
  .site-footer__links a { color: var(--text-3); text-decoration: none; }
  .site-footer__links a:hover { color: var(--text); text-decoration: underline; }
  .site-footer__copy { margin-left: auto; }
  .site-footer__links + .site-footer__copy { margin-left: 0; }
  @media (min-width: 768px) and (min-height: 600px) { .site-footer { display: block; } }

  @media (pointer: coarse) {
    .btn--sm, .chip, .seg__item > span, .seg--chips .seg__item > span, .menu__minor, .search__input, .select > select, .brand, .nav__link { min-height: 44px; }
    .btn--icon.btn--sm, .chat__new { min-width: 44px; }
    .icon-btn { width: 44px; height: 44px; }
    .site-footer__links a, .seg__item > span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  }
  @media (max-width: 1279px) { .site-footer__tagline { display: none; } }

}

@layer utilities {
  [hidden] { display: none; }
  .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
  .copy-buffer { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

  @media (max-width: 639px) { .vt > span { display: none; } .vt::after { content: attr(data-short); } }
  @media (scripting: none) { [data-needs-js] { display: none !important; } }
  @media (scripting: enabled) { [data-no-js] { display: none !important; } }
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important;
    scroll-behavior: auto !important; }
  .typing__dots > span { animation: none !important; opacity: .7; }
}

@media (forced-colors: active) {
  .btn, .chip, .composer, .chat, .tile, .signup-card, .seg__item > span, .toast { border: 1px solid CanvasText; }
  .btn--primary, .badge--brand, .seg__item > input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .grad { background: none; color: CanvasText; }
  [aria-current="page"] { text-decoration: underline 2px; text-underline-offset: 6px; }
  .composer__input { background: Field; color: FieldText; }
  :focus-visible { outline-color: Highlight; }
}
