:root {
  color-scheme: light;
  --ground: #f4f5f7;
  --ink: #151619;
  --muted: #505a6d;
  --line: #dfe2e7;
  --lime: #c6f432;
  --warning: #fff0bd;
  --rail: clamp(208px, 17.35vw, 268px);
  --column: 744px;
  font-family: Arial, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--ground); font-size: 16px; line-height: 1.55; }
button, input, textarea, summary { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-underline-offset: 3px; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 3px solid #487315; outline-offset: 3px; }
.sidebar :focus-visible, .mobile-header :focus-visible { outline-color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 5; padding: 10px; background: white; color: var(--ink); }
.skip-link:focus { top: 8px; }
.workspace { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100dvh; }
.mobile-header { display: none; }
.sidebar { margin: 0; width: var(--rail); padding: 24px 12px; border: 0; background: var(--ink); color: white; flex-direction: column; min-height: 0; line-height: 1.4; }
@media (min-width: 761px) {
  .sidebar[popover] { display: flex; position: static; height: 100%; }
}
.new-chat, .mobile-new { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; background: var(--lime); color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.2; border-radius: 12px; }
.new-chat { padding: 0 14px; min-height: 49px; flex: none; }
.new-chat span { font-size: 22px; font-weight: 400; }
.sidebar-label { margin: 24px 12px 8px; color: #b8bfca; font-size: 13px; }
.history-list { overflow-y: auto; min-height: 0; }
.history-list a, .profile summary { display: block; padding: 12px; border-radius: 10px; text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.history-list [aria-current="page"] { background: #2b2d34; font-weight: 600; }
.profile { margin-top: auto; padding-top: 16px; }
.profile summary { list-style: none; }
.profile summary::-webkit-details-marker { display: none; }
.profile-content { display: grid; gap: 2px; padding: 0 12px; overflow-wrap: anywhere; color: #c7cbd4; font-size: 14px; }
.profile-menu-link { display: flex; align-items: center; min-height: 44px; width: fit-content; color: white; }
.text-action { padding: 5px 0; min-height: 40px; background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.chat { position: relative; min-height: 0; display: flex; flex-direction: column; }
.chat-main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: 40px 0 8px; }
.chat-column { width: min(var(--column), calc(100% - 64px)); margin-inline: auto; }
.chat--empty .chat-main { display: flex; flex-direction: column; padding-block: 36px; }
.chat--empty .chat-column { margin-block: auto; }
.empty-state h1, .auth-content h1 { margin: 0; font-size: clamp(36px, 4vw, 58px); line-height: 1.07; font-weight: 750; letter-spacing: -.045em; }
.empty-state > p, .auth-description { color: var(--muted); font-size: 18px; line-height: 1.5; margin: 16px 0 32px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.example { min-height: 44px; border: 1px solid var(--line); border-radius: 24px; padding: 8px 16px; background: white; color: var(--ink); font-size: 15px; line-height: 1.25; }
.demo-notice { color: var(--muted); text-align: center; font-size: 12px; line-height: 1.45; padding-inline: 16px; margin: 0 0 10px; }

.composer { position: relative; background: white; border: 1px solid var(--ink); border-radius: 32px; }
.composer:focus-within { box-shadow: 0 0 0 1px var(--ink); }
.composer textarea { display: block; width: 100%; resize: none; field-sizing: content; min-height: 60px; max-height: max(138px, 25dvh); padding: 17px 74px 17px 24px; background: transparent; border: none; border-radius: inherit; outline: none; color: var(--ink); font-size: 16px; line-height: 26px; }
.composer textarea::placeholder { color: #646975; }
.composer-footer { position: absolute; right: 7px; bottom: 7px; display: flex; align-items: center; gap: 12px; }
.send-button { display: inline-grid; place-items: center; border: 0; border-radius: 50%; width: 46px; height: 46px; padding: 0; background: var(--ink); color: var(--lime); }
.send-button svg { width: 20px; height: 20px; stroke-width: 2; }
.send-button:disabled { background: #dadde1; color: #616873; }
.composer-hint { color: var(--muted); font-size: 13px; }
.reply-composer { padding-block: 12px max(16px, env(safe-area-inset-bottom)); }
.reply-composer .composer-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat--empty .composer { border-radius: 24px; }
.chat--empty .composer textarea { min-height: 138px; padding: 25px 24px 68px; font-size: 18px; }
.chat--empty .composer-footer { left: 24px; right: 16px; bottom: 15px; justify-content: space-between; }
.chat--empty .send-button { width: 48px; height: 48px; }
.form-error, .answer-error { border-radius: 12px; background: var(--warning); padding: 14px 18px; margin: 12px 0; }
.answer-error p { margin: 0; }

.exchange { margin-bottom: 32px; }
.message--user { display: flex; justify-content: flex-end; margin-bottom: 28px; }
.user-bubble { max-width: 88%; background: var(--ink); color: white; padding: 12px 19px; border-radius: 20px 20px 4px 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-text { overflow-wrap: anywhere; }
.message-text p, .message-text ul, .message-text ol, .message-text pre, .message-text blockquote { margin: 0 0 16px; }
.message-text > :first-child { margin-top: 0; }
.message-text > :last-child, .message-text li p:last-child { margin-bottom: 0; }
.message-text :is(h1,h2,h3,h4,h5,h6) { margin: 24px 0 12px; line-height: 1.17; letter-spacing: -.035em; }
.message-text h1, .message-text h2 { font-size: 30px; }
.message-text h3 { font-size: 21px; }
.message-text pre { white-space: pre-wrap; }
.message-text blockquote, .message-text--warning { padding: 16px 20px; background: var(--warning); border-radius: 14px; }
.message-text ul { padding-left: 24px; }
.message-text ol { list-style: none; padding: 0; counter-reset: step; }
.message-text ol > li { position: relative; padding: 2px 0 26px 48px; counter-increment: step; min-height: 38px; }
.message-text ol > li::before { content: counter(step); position: absolute; top: 0; left: 0; background: var(--ink); color: white; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.message-text ol > li:not(:last-child)::after { content: ""; position: absolute; top: 34px; bottom: 0; left: 16px; width: 2px; background: var(--line); }
.message-text ol > li:last-child { padding-bottom: 0; }
.answer-status { color: var(--muted); font-size: 14px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #658200; }
.recommendations { margin-top: 24px; }
.recommendations-heading { font-size: 17px; margin: 0 0 12px; }
.product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(195px, 100%), 1fr)); align-items: stretch; gap: 12px; }
.product-card { min-width: 0; border-radius: 16px; background: white; border: 1px solid var(--line); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.product-photo { height: 90px; display: grid; place-items: center; border-radius: 15px 15px 0 0; background: #e8ebef; color: #737c8a; }
.product-body { display: flex; flex-direction: column; flex: 1; align-items: flex-start; padding: 14px 16px 16px; }
.product-body h3 { font-size: 15px; line-height: 1.4; margin: 0; }
.product-price { margin-top: auto; padding-top: 12px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.product-reason, .product-attributes, .product-topline { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 6px 0 0; }
.product-attributes { padding-left: 16px; }
.product-topline { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.ad-label { font-weight: 700; }

.app-header { padding: 22px 32px; background: var(--ink); color: white; }
.brand { display: inline-flex; align-items: center; gap: 20px; text-decoration: none; }
.brand-word { color: var(--lime); font-size: 24px; line-height: 1; letter-spacing: -.04em; font-weight: 700; }
.brand-note { font-size: 14px; }
.auth-content { width: min(440px, calc(100% - 40px)); margin: clamp(32px, 15vh, 140px) auto; }
.auth-content h1 { font-size: 40px; }
.auth-form, .auth-field { display: grid; }
.auth-form { gap: 18px; }
.auth-field { gap: 6px; }
.auth-field label { font-size: 14px; }
.auth-field input { width: 100%; padding: 12px 16px; border: 1px solid #969ba4; border-radius: 12px; color: var(--ink); background: white; }
.auth-form .send-button { width: 100%; border-radius: 12px; background: var(--lime); color: var(--ink); font-weight: 700; }

@media (hover: hover) {
  .example:hover { border-color: var(--ink); }
  .new-chat:hover, .mobile-new:hover, .auth-form .send-button:hover { background: #d5ff54; }
  .history-list a:hover, .profile summary:hover { background: #303238; }
  .composer .send-button:not(:disabled):hover { background: #34363b; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: white; min-height: 58px; padding: 6px 16px; }
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; color: white; background: none; }
  .mobile-new { min-height: 40px; padding-inline: 14px; }
  .sidebar:popover-open { display: flex; position: fixed; inset: 58px auto auto 0; width: min(300px, 84vw); height: calc(100dvh - 58px); max-height: none; }
  .sidebar::backdrop { background: rgb(21 22 25 / 35%); }
  .chat-column { width: calc(100% - 36px); }
  .chat-main { padding-top: 20px; }
  .chat--empty .chat-main { padding-block: 24px; }
  .empty-state h1 { font-size: clamp(32px, 8vw, 46px); }
  .empty-state > p { font-size: 16px; margin: 12px 0 24px; }
  .example { font-size: 14px; padding: 8px 12px; }
  .chat--empty .composer textarea { padding-left: 16px; font-size: 16px; }
  .chat--empty .composer-footer { left: 16px; }
  .user-bubble { max-width: 95%; }
  .product-list { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
  .demo-notice { font-size: 11px; }
}

/* Profile */
.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 10px; }
.profile-back, .profile-source, .profile-start { display: inline-flex; align-items: center; min-height: 44px; }
.profile-back { font-size: 15px; }
.profile-header :focus-visible { outline-color: var(--lime); }
.profile-page { width: min(1080px, calc(100% - 64px)); margin-inline: auto; padding-block: 52px 72px; }
.profile-heading { margin-bottom: 36px; }
.profile-heading h1 { margin: 0; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.12; letter-spacing: -.035em; }
.profile-heading > p { margin: 12px 0 0; color: var(--muted); font-size: 17px; }
.profile-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 48px; align-items: start; }
.profile-outline { position: sticky; top: 24px; font-size: 14px; }
.profile-outline nav { display: grid; gap: 4px; margin-bottom: 28px; }
.profile-outline nav a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-size: 15px; font-weight: 700; }
.profile-outline nav a:first-child { background: white; }
.profile-outline nav a span { color: var(--muted); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.profile-outline p { margin: 0 12px 16px; color: var(--muted); line-height: 1.55; }
.profile-sections { display: grid; gap: 32px; min-width: 0; }
.profile-brief { padding: 24px 28px; background: var(--ink); color: white; border-radius: 16px; }
.profile-brief h2 { margin: 0 0 12px; color: var(--lime); font-size: 16px; font-weight: 700; }
.profile-brief ul { margin: 0; padding-left: 19px; display: grid; gap: 8px; font-size: 17px; line-height: 1.5; }
.profile-brief li { padding-left: 3px; overflow-wrap: anywhere; }
.profile-section { scroll-margin-top: 24px; }
.profile-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.profile-section-heading h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
.profile-section-heading > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.profile-entry-list { display: grid; gap: 12px; }
.profile-entry { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px 10px; min-width: 0; }
.profile-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; font-size: 12px; line-height: 1.4; }
.profile-state { display: inline-flex; align-items: center; gap: 7px; color: #385b0e; font-weight: 700; }
.profile-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.profile-state--paused { color: #8b5c0b; }
.profile-state--completed, .profile-state--cancelled, .profile-state--muted { color: var(--muted); }
.profile-corrected { color: var(--muted); }
.profile-entry-text { margin: 0; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.profile-expiry { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.profile-entry-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0 16px; margin-top: 10px; }
.profile-source { color: var(--muted); font-size: 13px; gap: 4px; width: fit-content; }
.profile-edit > summary { display: flex; align-items: center; justify-content: end; min-height: 44px; list-style: none; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.profile-edit > summary::-webkit-details-marker { display: none; }
.profile-edit[open] { grid-column: 1 / -1; }
.profile-edit[open] > summary { color: var(--muted); }
.profile-edit-form { display: grid; gap: 20px; padding: 20px 0 14px; border-top: 1px solid var(--line); }
.profile-edit-field { display: grid; gap: 7px; min-width: 0; }
.profile-edit-field > label { font-size: 13px; font-weight: 700; }
.profile-edit-field :is(textarea, input, select) { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #bcc2cb; border-radius: 9px; background: white; color: var(--ink); padding: 10px 12px; font: inherit; }
.profile-edit-field textarea { resize: vertical; line-height: 1.45; }
.profile-edit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.profile-field-hint { font-size: 12px; color: var(--muted); }
.profile-checkbox { display: flex; align-items: center; gap: 10px; min-height: 44px; width: fit-content; font-size: 14px; }
.profile-checkbox input { accent-color: #426715; width: 18px; height: 18px; flex: none; }
.profile-original { padding-left: 14px; border-left: 2px solid var(--line); }
.profile-original > span { color: var(--muted); font-size: 12px; }
.profile-original blockquote { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.profile-edit-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.profile-save, .profile-start { border: 0; background: var(--lime); color: var(--ink); border-radius: 10px; padding: 11px 16px; min-height: 44px; font-size: 14px; font-weight: 700; text-decoration: none; }
.profile-edit-footer > span { font-size: 12px; color: var(--muted); }
.profile-history { margin-top: 12px; }
.profile-history > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); font-size: 14px; width: fit-content; }
.profile-history > summary::before { content: "+"; font-size: 18px; width: 12px; }
.profile-history[open] > summary::before { content: "−"; }
.profile-history > summary span { font-variant-numeric: tabular-nums; }
.profile-history[open] > summary { margin-bottom: 8px; }
.profile-section-empty { padding: 20px 0; margin: 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.profile-feedback { padding: 14px 18px; margin: 0 0 28px; border-radius: 10px; background: #e8f2d9; color: #304d10; font-size: 14px; }
.profile-feedback--error { background: var(--warning); color: var(--ink); }
.profile-empty { max-width: 560px; padding: 32px 0; border-top: 1px solid var(--line); }
.profile-empty h2 { margin: 0 0 10px; font-size: 23px; }
.profile-empty p { margin: 0 0 24px; color: var(--muted); }
@media (hover: hover) {
  .profile-outline nav a:hover { background: white; }
  .profile-save:hover, .profile-start:hover { background: #b8e62a; }
}
@media (max-width: 760px) {
  .profile-page { width: calc(100% - 36px); padding-block: 30px 48px; }
  .profile-heading { margin-bottom: 24px; }
  .profile-heading > p { font-size: 16px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .profile-outline { position: static; }
  .profile-outline nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 12px; }
  .profile-outline nav a { gap: 10px; padding-inline: 10px; font-size: 14px; }
  .profile-outline p { margin: 0 0 8px; font-size: 12px; }
  .profile-outline p:first-of-type { display: none; }
  .profile-brief { padding: 20px; }
  .profile-brief ul { font-size: 16px; }
  .profile-entry { padding: 18px 18px 8px; }
  .profile-entry-text { font-size: 17px; }
  .profile-entry-actions { gap: 0 10px; }
  .profile-source, .profile-edit > summary { font-size: 12px; }
  .profile-edit-fields { grid-template-columns: minmax(0, 1fr); }
}
.exchange:target { scroll-margin-top: 24px; }
.exchange:target .user-bubble { box-shadow: 0 0 0 3px var(--lime); }
