:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --side: #edf1eb;
  --surface: #fff;
  --ink: #192620;
  --muted: #516158;
  --line: #dbe3d9;
  --green: #244e3e;
  --dark-green: #153b2d;
  --accent: #e0edbd;
  --sidebar: 236px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .68; }
:where(button, select, textarea, a):focus-visible { outline: 2px solid #3b775b; outline-offset: 3px; }
[hidden] { display: none !important; }
.layout { height: 100vh; height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  display: flex; flex-direction: column; min-height: 0; padding: 26px 17px 15px;
  background: var(--side); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0 6px 28px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 750; letter-spacing: -.055em; }
.brand-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--dark-green); color: #eef6dc; font-size: 23px; line-height: 1; }
.brand-dot { color: #5f805b; margin-left: -9px; }
.new-chat { min-height: 42px; padding: 0 11px; border: 1px solid #cbd9cb; border-radius: 10px; background: var(--surface); color: var(--green); text-align: left; font-size: 13px; font-weight: 700; }
.new-chat:hover, .side-action:hover { background: #e4ece2; }
.new-chat span { margin-right: 5px; font-size: 17px; vertical-align: -1px; }
.history-wrap { flex: 1; min-height: 0; overflow: auto; margin-top: 27px; }
.history-wrap h2 { margin: 0 8px 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-empty { margin: 0 8px; color: var(--muted); font-size: 12px; }
#history { margin: 0; padding: 0; list-style: none; }
#history button { width: 100%; padding: 9px 8px; border-radius: 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; font-size: 13px; color: var(--muted); }
#history button:hover, #history button[aria-current="true"] { background: #dce8dd; color: var(--dark-green); }
.side-bottom { border-top: 1px solid #d6e0d4; padding-top: 10px; }
.storage, .side-action { margin: 0; padding: 8px; color: var(--muted); font-size: 12px; }
.storage span, .side-action span { margin-right: 5px; color: #476d58; }
.side-action { width: 100%; border-radius: 8px; text-align: left; }
.main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 62px minmax(0,1fr) auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.context { flex: 1; font-size: 13px; font-weight: 700; }
.context-icon, .year-icon { color: #497459; margin-right: 5px; }
.year, .mode-picker { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #f3f6f0; color: var(--green); }
select { border: 0; background: transparent; padding: 6px 1px; font-size: 12px; }
option { background: var(--surface); color: var(--ink); }
.menu { display: none; }
.scroller { overflow: auto; scrollbar-width: thin; scrollbar-color: #a9bbae transparent; }
.content, .composer-content { width: min(100% - 52px, 860px); margin: 0 auto; }
.content { padding: 23px 0 18px; }
.hero {
  position: relative; display: flex; align-items: center; min-height: 186px; overflow: hidden; isolation: isolate;
  border: 1px solid #2c5444; border-radius: 19px;
  background: radial-gradient(ellipse at 94% 60%, #386452 0, transparent 54%), linear-gradient(115deg, #17392d, #204a39);
  color: #f9faf4;
}
.hero-copy { position: relative; z-index: 1; padding: 22px 30px; }
h1 { margin: 0; font-size: clamp(36px, 4.7vw, 60px); line-height: .98; font-weight: 740; letter-spacing: -.065em; }
h1 em { color: var(--accent); font-family: Georgia, serif; font-weight: 400; letter-spacing: -.06em; }
.hero p { margin: 12px 0 0; max-width: 325px; color: #d8e6d7; font-size: 13px; line-height: 1.45; }
.hero-art { position: absolute; inset: 0 0 0 auto; width: 48%; overflow: hidden; pointer-events: none; }
.hero-art::before {
  content: ""; position: absolute; width: 330px; aspect-ratio: 1; top: -69px; right: -12px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 10px, #e0edbd32 11px 12px);
  mask-image: linear-gradient(128deg, transparent 3%, #000 62%);
}
.hero-art::after {
  content: ""; position: absolute; width: 92px; aspect-ratio: 1; top: 46px; right: 105px; border-radius: 50%;
  background: radial-gradient(circle at 31% 28%, #f3f6d2, #b9d69d 44%, #6a9b79 75%, #42705b 100%);
  box-shadow: 0 0 38px #e0edbd36;
}
.modes, .starters { margin-top: 17px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 7px; }
.section-heading h2 { margin: 0; font-size: 14px; font-weight: 740; letter-spacing: -.02em; }
.section-heading > span { color: var(--muted); font-size: 11px; text-align: right; }
.mode-grid, .starter-grid { display: grid; gap: 8px; }
.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode, .starter { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-align: left; }
.mode { min-height: 56px; }
.mode:hover, .starter:hover { border-color: #a8bcaa; background: #f3f7ef; }
.mode[aria-checked="true"] { border-color: #71967a; background: #e9f2e5; box-shadow: inset 0 0 0 1px #71967a; }
.mode-icon, .starter-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; font-size: 19px; line-height: 1; }
.quick { color: #785627; background: #f7edd7; }
.focus { color: #315e47; background: #dae9d7; }
.deep { color: #5e4c73; background: #eee7f1; }
.mode strong, .starter strong { display: block; font-size: 13px; }
.mode small, .starter small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.radio { width: 12px; height: 12px; margin-left: auto; flex: none; border: 1px solid #889c90; border-radius: 50%; }
.mode[aria-checked="true"] .radio { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 39%, transparent 46%); }
.starter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.starter { min-height: 43px; padding: 6px 10px; }
.starter-icon { width: 27px; height: 27px; background: #e8f0e5; color: var(--green); font-size: 15px; }
.starter-arrow { margin-left: auto; color: #557363; font-size: 13px; }
.composer-wrap { padding: 4px 0 10px; }
.availability { margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.4; }
#composer { padding: 9px 10px 8px; border: 1px solid #cfdcd0; border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px #183a2b0a; }
#composer:focus-within { border-color: #779d82; box-shadow: 0 0 0 2px #dceadd; }
textarea { display: block; width: 100%; min-height: 40px; max-height: 150px; padding: 4px; resize: vertical; border: 0; outline: none !important; background: transparent; font-size: 15px; line-height: 1.4; }
textarea::placeholder { color: #607068; }
.composer-tools { display: flex; align-items: center; gap: 8px; }
.mode-picker select { padding: 4px 0; }
.shortcut { margin-left: auto; color: var(--muted); font-size: 11px; }
.send { width: 35px; height: 35px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--dark-green); color: #f6faee; font-size: 22px; line-height: 1; font-weight: 700; }
.send:hover, .primary:hover { background: #286047; }
.device-button { padding: 6px 8px; border: 1px solid #bed3bf; border-radius: 8px; background: #e9f2e4; color: var(--dark-green); font-size: 11px; font-weight: 700; }
.device-button:hover { background: #dcead8; }
.footer-note { margin: 7px 0 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.4; }
#chat { display: flex; flex-direction: column; gap: 17px; padding: 5px 0 12px; }
.message { width: fit-content; max-width: 100%; }
.message.user { align-self: flex-end; max-width: 88%; padding: 10px 14px; border: 1px solid #d4e1d1; border-radius: 14px 14px 4px 14px; background: #e9f0e5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant { align-self: flex-start; width: 100%; padding: 9px 0; }
.message-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.message-head .brand-icon { width: 25px; height: 25px; border-radius: 7px; font-size: 16px; }
.message-head small, .pending-label { color: var(--muted); font-size: 12px; font-weight: 550; }
.message-body, .stream-preview { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.stream-preview { margin-top: 6px; white-space: pre-wrap; }
.stream-preview:empty { display: none; }
.message-body :is(p, ul, ol, pre) { margin: 0 0 9px; }
.message-body h3 { margin: 13px 0 6px; font-size: 16px; }
.message-body pre { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #ecf2ec; white-space: pre-wrap; }
.message-body code { padding: 2px 4px; border-radius: 3px; background: #e7efe7; }
.message-body pre code { padding: 0; background: none; }
.message-actions { display: flex; gap: 9px; margin-top: 9px; }
.message-actions button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 11px; }
.message-actions button:hover { background: #e9f1e8; color: var(--ink); }
.message-error { color: #8e3925; }
dialog { width: min(100% - 32px, 465px); padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); }
dialog::backdrop, .scrim { background: #132a20a8; }
dialog h2 { margin: 0 35px 12px 0; }
dialog p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.dialog-actions button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.dialog-actions .primary { background: var(--dark-green); color: #fff; font-weight: 700; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.close { position: absolute; top: 16px; right: 16px; }
.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: 900px) {
  :root { --sidebar: 190px; }
  .content, .composer-content { width: min(100% - 36px, 860px); }
  .topbar { padding: 0 18px; }
}
@media (max-width: 690px) {
  .layout { display: block; }
  .main { height: 100%; grid-template-rows: 52px minmax(0,1fr) auto; }
  .sidebar { position: fixed; z-index: 3; inset: 0 auto 0 0; width: min(83vw, 260px); visibility: hidden; }
  .layout.menu-open .sidebar { visibility: visible; }
  .scrim { position: fixed; z-index: 2; inset: 0; }
  .menu { display: block; flex: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content, .composer-content { width: calc(100% - 24px); }
  .content { padding-top: 12px; }
  .hero { min-height: 161px; }
  .hero-copy { padding: 17px 15px; }
  .hero p { max-width: 220px; }
  .hero-art { width: 48%; opacity: .52; }
  .hero-art::before { right: -159px; }
  .hero-art::after { width: 57px; top: 33px; right: 22px; }
  h1 { font-size: clamp(34px, 9.5vw, 50px); }
  .mode-grid, .starter-grid { gap: 6px; }
  .mode { min-height: 55px; padding: 7px 5px; gap: 5px; }
  .mode-icon { width: 24px; height: 24px; font-size: 15px; }
  .radio, .starter-arrow { display: none; }
  .starter { padding: 6px; gap: 6px; }
  .mode strong, .starter strong { font-size: 12px; }
  .mode small, .starter small { font-size: 10px; }
  .shortcut { visibility: hidden; flex: 1; width: 0; overflow: hidden; }
}
@media (max-width: 360px) {
  .mode-icon { display: none; }
  .starter-icon { width: 22px; height: 22px; }
  .hero-art { opacity: .34; }
}

.web-toggle { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 11px; white-space: nowrap; cursor: pointer; }
.web-toggle input { margin: 0; width: 14px; height: 14px; accent-color: var(--green); cursor: pointer; }
.answer-sources { margin-top: 14px; }
.answer-sources h3 { margin: 0 0 6px; color: var(--green); font-size: 12px; }
.source-status { margin: 0; color: var(--muted); font-size: 11px; }
.source-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.source-link { position: relative; display: grid; gap: 2px; min-width: 130px; max-width: 100%; padding: 6px 24px 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--dark-green); text-decoration: none; }
.source-link:hover { border-color: #a8bcaa; background: #f3f7ef; }
.source-site { color: var(--muted); font-size: 10px; }
.source-title { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.source-arrow { position: absolute; top: 7px; right: 7px; color: var(--muted); font-size: 12px; }
@media (max-width: 375px) { .composer-tools { gap: 5px; } .mode-picker > span[aria-hidden] { display: none; } }
