:root {
  color-scheme: light;
  --ink: #20192c;
  --muted: #6c6475;
  --paper: #fffdfa;
  --canvas: #fff8f2;
  --line: #e9dfd8;
  --coral: #a8323c;
  --violet: #663e9d;
  --focus: #146fc1;
  --content: 1100px;
  --shadow: 0 20px 55px rgba(52, 33, 67, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: radial-gradient(circle at 12% 2%, #ffe9da, transparent 27rem), var(--canvas); font: 16px/1.55 "Segoe UI", Aptos, Arial, sans-serif; }
button, textarea, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(calc(100% - 48px), var(--content)); margin-inline: auto; }
.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: fixed; z-index: 20; top: 12px; left: 12px; padding: 9px 14px; color: white; background: var(--ink); border-radius: 10px; font-weight: 800; text-decoration: none; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 10; top: 0; border-bottom: 1px solid rgba(233, 223, 216, .85); background: rgba(255, 250, 245, .91); backdrop-filter: blur(18px); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 18px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; font-size: 1.08rem; font-weight: 850; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; padding: 4px; color: var(--coral); background: linear-gradient(145deg, #ffe6d7, #efdfff); border-radius: 14px; }
.nav-list { display: flex; gap: 4px; padding: 0; margin: 0; list-style: none; }
.nav-list a, .lang-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 999px; font-size: .9rem; font-weight: 750; text-decoration: none; }
.nav-list a { padding: 7px 12px; color: #51475a; }
.nav-list a:hover { color: var(--ink); background: #f3e9e4; }
.product-menu { position: relative; }
.product-menu details { position: relative; }
.product-menu summary { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 42px; padding: 7px 12px; border-radius: 999px; color: #51475a; font-size: .9rem; font-weight: 750; cursor: pointer; list-style: none; }
.product-menu summary::-webkit-details-marker { display: none; }
.product-menu summary:hover, .product-menu details[open] summary { color: var(--ink); background: #f3e9e4; }
.current-product summary { color: white; background: var(--ink); }
.current-product summary:hover, .current-product details[open] summary { color: white; background: #38284d; }
.product-menu summary span { font-size: .8em; transition: transform .16s ease; }
.product-menu details[open] summary span { transform: rotate(180deg); }
.product-dropdown { position: absolute; z-index: 40; top: calc(100% + 7px); right: 0; display: grid; min-width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.product-dropdown a { display: flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 8px 10px; border-radius: 9px; white-space: nowrap; }
.product-dropdown a[aria-current="page"] { color: var(--ink); background: #f3e9e4; }
.lang-switch { min-width: 35px; padding: 0 8px; border: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

.chat-page { min-height: calc(100vh - 78px); padding: clamp(32px, 6vw, 72px) 24px 48px; }
.chat-shell { width: min(100%, 900px); margin-inline: auto; }
.chat-intro { margin-bottom: 20px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--coral); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.chat-intro h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.7rem); letter-spacing: -.055em; line-height: 1.02; }
.chat-intro p:last-child { margin: 11px 0 0; color: var(--muted); }
.not-found { max-width: 640px; padding-top: clamp(36px, 9vw, 104px); text-align: center; }
.not-found h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.7rem); letter-spacing: -.055em; line-height: 1.02; }
.not-found p:not(.eyebrow) { margin: 14px 0 24px; color: var(--muted); }
.not-found-link { display: inline-flex; align-items: center; justify-content: center; min-height: 47px; padding: 11px 17px; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--coral), var(--violet)); font-weight: 850; text-decoration: none; }
.cli-link { display: flex; align-items: center; gap: 12px; width: fit-content; margin: 0 auto 15px; padding: 8px 12px 8px 9px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(255, 253, 250, .8); font-size: .84rem; text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.cli-link:hover { border-color: #cbb9dc; transform: translateY(-1px); }
.cli-link-icon { display: grid; width: 29px; height: 29px; place-items: center; color: white; background: var(--ink); border-radius: 8px; font-size: 1.1rem; }
.cli-link strong, .cli-link small { display: block; }
.cli-link strong { color: var(--ink); }
.cli-link small { font-size: .75rem; }
.cli-link-action { padding-left: 12px; color: var(--violet); font-weight: 800; }

.web-chat { overflow: hidden; border: 1px solid rgba(35, 26, 45, .11); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.chat-toolbar { display: flex; align-items: center; min-height: 44px; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(255, 253, 250, .95); font-size: .78rem; }
.chat-toolbar a, .logout-form button { color: var(--violet); font-weight: 800; text-decoration: none; }
.account-name { color: var(--ink); font-weight: 760; }
.account-usage { margin-left: auto; }
.logout-form { margin-left: 4px; }
.logout-form button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.web-chat-messages { display: flex; flex-direction: column; gap: 15px; min-height: min(48vh, 480px); max-height: min(58vh, 650px); padding: clamp(18px, 4vw, 30px); overflow-y: auto; background: linear-gradient(180deg, #fffdfa, #faf5ff); }
.chat-message { width: fit-content; max-width: min(88%, 700px); padding: 13px 16px; border-radius: 17px; box-shadow: 0 6px 18px rgba(52, 33, 67, .07); }
.chat-message.assistant { align-self: flex-start; color: #fffbff; background: linear-gradient(135deg, #39264d, #292043); border-bottom-left-radius: 5px; }
.chat-message.user { align-self: flex-end; color: var(--ink); background: linear-gradient(135deg, #ffe8dc, #f1e7ff); border-bottom-right-radius: 5px; }
.chat-message-label { display: block; opacity: .75; font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.chat-message > p { margin: 4px 0 0; overflow-wrap: anywhere; } /* static greeting bubbles */
.chat-message-body { overflow-wrap: anywhere; }
.chat-message.user .chat-message-body { white-space: pre-wrap; }
.chat-message-body > :first-child { margin-top: 4px; }
.chat-message-body p { margin: 8px 0 0; }
.chat-message-body h2, .chat-message-body h3, .chat-message-body h4, .chat-message-body h5 { margin: 12px 0 4px; font-size: 1em; font-weight: 820; line-height: 1.3; }
.chat-message-body ul, .chat-message-body ol { margin: 6px 0 0; padding-left: 1.35em; }
.chat-message-body li { margin: 3px 0; }
.chat-message-body li::marker { color: #c9a6ef; }
.chat-message-body code { padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .13); font-size: .88em; }
.chat-message.user .chat-message-body code { background: rgba(52, 33, 67, .1); }
.chat-message-body pre { margin: 8px 0 0; padding: 10px 12px; overflow-x: auto; border-radius: 10px; background: rgba(10, 6, 18, .35); }
.chat-message.user .chat-message-body pre { background: rgba(52, 33, 67, .08); }
.chat-message-body pre code { padding: 0; border-radius: 0; background: none; font-size: .85em; line-height: 1.5; }
.chat-message-body blockquote { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid #d7b4ff; color: #ded0f4; }
.chat-message-body a { color: #e7d5ff; text-decoration: underline; }
.chat-message.user .chat-message-body a { color: var(--violet); }
.chat-reasoning { margin-top: 9px; border-left: 2px solid #d7b4ff; background: rgba(255, 255, 255, .07); border-radius: 0 8px 8px 0; font-size: .86rem; }
.chat-reasoning[hidden] { display: none; }
.chat-reasoning summary { padding: 6px 10px; color: #d9c8f4; font-weight: 750; list-style: none; cursor: pointer; }
.chat-reasoning summary::-webkit-details-marker { display: none; }
.chat-reasoning summary::before { content: "▸ "; }
.chat-reasoning[open] summary::before { content: "▾ "; }
.chat-reasoning-body { padding: 0 10px 9px; color: #ece2fb; white-space: pre-wrap; overflow-wrap: anywhere; }
.web-chat-form { padding: 13px; border-top: 1px solid var(--line); background: white; }
.web-chat-form textarea { display: block; width: 100%; min-height: 48px; max-height: 210px; padding: 12px 13px; resize: none; color: var(--ink); background: #fffdfa; border: 1px solid transparent; border-radius: 13px; line-height: 1.45; }
.web-chat-form textarea:focus { border-color: #b78ce1; background: white; outline: 3px solid rgba(155, 93, 229, .17); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px 0; }
.composer-left { display: flex; align-items: center; min-width: 0; gap: 10px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attach-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: .81rem; font-weight: 750; cursor: pointer; }
.attach-button:hover { border-color: #c8b6da; color: var(--ink); }
.composer-help { overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.send-button { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--coral), var(--violet)); font-size: 1.18rem; font-weight: 900; cursor: pointer; transition: transform .16s ease, opacity .16s ease; }
.send-button:hover { transform: translateY(-1px); }
.send-button:disabled { cursor: wait; opacity: .55; transform: none; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; }
.attachment-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin-bottom: 8px; padding: 5px 8px; border-radius: 8px; color: var(--violet); background: #f6efff; font-size: .78rem; font-weight: 750; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { padding: 0; border: 0; color: inherit; background: transparent; font-size: 1rem; cursor: pointer; }
.web-chat-status { min-height: 1.25em; margin: 7px 4px 0; color: var(--muted); font-size: .75rem; }
.chat-footnote { margin: 13px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.release-details { margin: 9px auto 0; color: var(--muted); font-size: .71rem; text-align: center; }
.release-details summary { width: fit-content; margin: auto; cursor: pointer; }
.release-details p { max-width: 620px; margin: 8px auto 0; overflow-wrap: anywhere; }
.release-details code { color: var(--ink); font-family: Consolas, "Cascadia Mono", monospace; }

.login-dialog { width: min(calc(100% - 36px), 430px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 24px 70px rgba(36, 26, 51, .27); }
.login-dialog::backdrop { background: rgba(29, 21, 38, .48); backdrop-filter: blur(3px); }
.login-dialog form { position: relative; padding: 30px; }
.login-dialog h2 { margin: 0 0 12px; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.035em; }
.login-dialog p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: #f8f1ec; font-size: 1.45rem; cursor: pointer; }
.dialog-login { display: inline-flex; align-items: center; justify-content: center; min-height: 47px; padding: 11px 17px; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--coral), var(--violet)); font-weight: 850; text-decoration: none; }

.site-footer { padding: 27px 0; color: var(--muted); background: #fff4eb; font-size: .85rem; }
.footer-wrap, .footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-wrap { justify-content: space-between; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .nav-wrap { min-height: 66px; gap: 7px; }
  .brand span { display: none; }
  .nav-list { gap: 0; }
  .nav-list a { padding: 6px 8px; font-size: .76rem; }
  .chat-page { min-height: calc(100vh - 66px); padding: 34px 16px 38px; }
  .web-chat-messages { min-height: 48vh; }
  .chat-toolbar { flex-wrap: wrap; }
  .account-usage { margin-left: 0; }
  .logout-form { margin-left: auto; }
  .composer-help { display: none; }
}
@media (max-width: 430px) {
  .shell { width: min(calc(100% - 28px), var(--content)); }
  .nav-list a { padding-inline: 5px; font-size: .7rem; }
  .lang-switch { min-width: 29px; padding-inline: 5px; }
  .cli-link { width: 100%; }
  .cli-link-action { margin-left: auto; padding-left: 4px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
