:root {
  color-scheme: light;
  --ink: #18241f;
  --muted: #6f7a74;
  --soft: #929b96;
  --line: #e2e8e2;
  --paper: #f5f7f2;
  --white: #fff;
  --green: #164f3f;
  --green-dark: #123e32;
  --mint: #e6f1e8;
  --lime: #d3ef6f;
  --orange: #e89a69;
  --shadow: 0 22px 62px rgba(26, 43, 34, .075), 0 3px 12px rgba(26, 43, 34, .035);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 88% 6%, rgba(205, 229, 187, .38), transparent 29rem),
    linear-gradient(180deg, #f8faf6 0%, var(--paper) 45rem, #f6f8f4 100%);
}

button, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1190px) / 2));
  border-bottom: 1px solid rgba(212, 222, 214, .75);
  background: rgba(250, 252, 248, .72);
  backdrop-filter: blur(14px);
}

.brand, .topbar-right, .privacy-pill, .source-link { display: inline-flex; align-items: center; }
.brand { gap: 10px; text-decoration: none; font-size: 16px; font-weight: 760; letter-spacing: -.045em; }
.brand-mark, .bot-avatar, .message-avatar {
  display: grid;
  place-items: center;
  color: var(--lime);
  background: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 750;
  letter-spacing: -.09em;
}
.brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 15px; }
.brand-muted { color: #839087; font-weight: 520; }
.topbar-right { gap: 26px; }
.privacy-pill { gap: 8px; color: #52645a; font-size: 12px; font-weight: 620; }
.privacy-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ea378; box-shadow: 0 0 0 3px rgba(78, 163, 120, .12); }
.source-link { gap: 5px; color: #52645a; font-size: 12px; font-weight: 650; text-decoration: none; transition: color .16s ease; }
.source-link:hover { color: var(--green); }

.layout { width: min(1190px, calc(100% - 56px)); margin: 0 auto; }
.intro { padding: 56px 0 29px; }
.eyebrow, .eyebrow-small { display: flex; align-items: center; gap: 9px; margin: 0; color: #687c70; font-size: 10px; font-weight: 760; letter-spacing: .14em; }
.eyebrow-line { width: 20px; height: 1px; background: #8ca195; }
h1 { margin: 15px 0 11px; font-size: clamp(42px, 5vw, 62px); line-height: .99; letter-spacing: -.065em; font-weight: 720; }
h1 span { color: var(--green); }
.intro-copy { max-width: 575px; margin: 15px 0 22px; color: #64716a; font-size: 15px; line-height: 1.62; }
.capability-row { display: flex; flex-wrap: wrap; gap: 8px; }
.capability-row span { padding: 7px 10px; border: 1px solid #dfe7dc; border-radius: 999px; color: #51645a; background: rgba(255, 255, 255, .53); font-size: 10px; font-weight: 620; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); align-items: start; gap: 20px; }
.chat-card, .try-panel { border: 1px solid rgba(218, 226, 218, .9); border-radius: 17px; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); }
.chat-card { overflow: hidden; }
.chat-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #edf0ec; }
.chat-title-wrap { display: flex; align-items: center; gap: 11px; }
.bot-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
.chat-header h2 { margin: 0 0 4px; font-size: 13px; font-weight: 730; letter-spacing: -.01em; }
.runtime-status { display: flex; align-items: center; gap: 7px; color: #728078; font-size: 10px; }
.runtime-status .status-dot { width: 6px; height: 6px; }
.runtime-status .status-dot.loading { background: #d2a04b; box-shadow: 0 0 0 3px rgba(210, 160, 75, .14); }
.runtime-status .status-dot.error { background: #c56a5b; box-shadow: 0 0 0 3px rgba(197, 106, 91, .13); }
.reset-button { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 8px 9px; border-radius: 9px; color: #738078; background: transparent; font-size: 11px; font-weight: 610; cursor: pointer; transition: color .15s ease, background .15s ease; }
.reset-button:not(:disabled):hover { color: var(--green); background: #f1f6f0; }
.reset-button:disabled { opacity: .5; cursor: not-allowed; }
.reset-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.messages { height: 386px; display: flex; flex-direction: column; gap: 17px; overflow-y: auto; padding: 22px 20px; scroll-behavior: smooth; }
.message { width: 100%; display: flex; align-items: flex-start; gap: 9px; }
.user-message { justify-content: flex-end; }
.message-avatar { flex: 0 0 25px; width: 25px; height: 25px; margin-top: 1px; border-radius: 8px; font-size: 11px; }
.message-content { max-width: min(82%, 570px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.user-message .message-content { align-items: flex-end; }
.message-meta { display: flex; align-items: center; gap: 6px; color: #929d95; font-size: 9px; font-weight: 600; }
.assistant-message .message-meta span:first-child { color: #51685a; font-weight: 710; }
.user-message .message-meta span:first-child { color: #596c60; }
.meta-separator { color: #c2cac3; }
.bubble { max-width: 100%; padding: 11px 13px; border: 1px solid #e6ece6; border-radius: 3px 12px 12px 12px; color: #3e4c44; background: #f7f9f5; font-size: 12px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.user-message .bubble { border-color: #dbe8d9; border-radius: 12px 3px 12px 12px; color: #254537; background: #eaf3e7; }
.message-avatar.user-avatar { color: #52655a; background: #edf0eb; letter-spacing: 0; font-family: inherit; font-size: 10px; }
.answer-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.module-label, .clarification-label { padding: 4px 7px; border-radius: 5px; color: #718178; background: #f1f4ef; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.clarification-label { color: #936c31; background: #fff5df; font-family: inherit; font-weight: 670; }
.source-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.source-link-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 5px 7px; border: 1px solid #dce9de; border-radius: 6px; color: #326349; background: #f5faf4; font-size: 9px; font-weight: 650; text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.source-link-chip:hover { border-color: #aecfb2; background: #edf7ed; }
.source-link-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-link-chip svg { flex: 0 0 10px; width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.composer { margin: 0 13px 13px; padding: 11px 12px 8px; border: 1px solid #dfe7df; border-radius: 13px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.composer:focus-within { border-color: #9cbda6; box-shadow: 0 0 0 3px rgba(67, 123, 85, .08); }
.composer textarea { display: block; width: 100%; min-height: 35px; max-height: 115px; resize: none; border: 0; outline: 0; padding: 4px 3px 7px; color: #2c3e33; background: transparent; font-size: 12px; line-height: 1.5; }
.composer textarea::placeholder { color: #9da69f; }
.composer textarea:disabled { cursor: not-allowed; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; }
.input-hint { color: #a0a8a1; font-size: 9px; }
.input-hint span { padding: 0 3px; }
.send-button { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 7px 10px; color: #ecf8e7; background: var(--green); font-size: 10px; font-weight: 690; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.send-button:not(:disabled):hover { background: var(--green-dark); transform: translateY(-1px); }
.send-button:disabled { opacity: .45; cursor: not-allowed; }
.send-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.try-panel { padding: 20px 18px 16px; }
.try-heading { display: flex; align-items: flex-start; justify-content: space-between; margin: 1px 2px 17px; }
.eyebrow-small { color: #849188; font-size: 8px; letter-spacing: .12em; }
.try-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.035em; }
.sparkle { color: #7fa285; font-size: 19px; line-height: 1; }
.prompt-list { display: flex; flex-direction: column; gap: 7px; }
.prompt-card { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) 13px; align-items: center; gap: 9px; border: 1px solid #e9eee8; border-radius: 11px; padding: 10px 9px; text-align: left; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease; }
.prompt-card:not(:disabled):hover { border-color: #c6d8c8; background: #fbfdf9; box-shadow: 0 5px 14px rgba(41, 73, 48, .06); transform: translateY(-1px); }
.prompt-card:disabled { opacity: .55; cursor: not-allowed; }
.prompt-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 650; }
.icon-people { color: #42745b; background: #eaf4e8; }
.icon-math { color: #7c65a6; background: #f0eefa; }
.icon-units { color: #bb7950; background: #fbefe5; }
.icon-source { color: #4c7897; background: #eaf3f8; }
.prompt-card strong, .prompt-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-card strong { margin-bottom: 3px; color: #3c4b41; font-size: 10px; font-weight: 710; }
.prompt-card small { color: #89948c; font-size: 9px; }
.prompt-arrow { color: #a5afa7; font-size: 14px; transition: transform .15s ease, color .15s ease; }
.prompt-card:hover .prompt-arrow { color: var(--green); transform: translateX(2px); }
.try-note { display: flex; gap: 7px; margin: 15px 2px 0; color: #849087; font-size: 9px; line-height: 1.55; }
.note-check { flex: 0 0 15px; width: 15px; height: 15px; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; color: #4d805b; background: #e9f3e7; font-size: 9px; font-weight: 800; }

.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px 3px 26px; color: #929c94; font-size: 9px; }
.page-footer span:last-child { text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (min-width: 1000px) {
  .intro { padding-top: 54px; }
}

@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .try-panel { order: -1; }
  .prompt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .try-note { max-width: 570px; }
  .intro { padding-top: 42px; }
}

@media (max-width: 580px) {
  .topbar { height: 61px; padding: 0 18px; }
  .topbar-right { gap: 14px; }
  .privacy-pill { font-size: 10px; }
  .source-link { font-size: 10px; }
  .layout { width: calc(100% - 32px); }
  .intro { padding: 34px 0 20px; }
  h1 { margin-top: 13px; font-size: clamp(39px, 13vw, 53px); }
  .intro-copy { margin: 13px 0 17px; font-size: 13px; }
  .capability-row { gap: 6px; }
  .capability-row span { padding: 6px 8px; font-size: 9px; }
  .workspace { gap: 13px; }
  .chat-header { min-height: 65px; padding: 12px 13px; }
  .bot-avatar { width: 34px; height: 34px; }
  .reset-button { padding: 7px 6px; font-size: 10px; }
  .messages { height: 390px; gap: 14px; padding: 17px 12px; }
  .message-content { max-width: 88%; }
  .bubble { padding: 10px 11px; font-size: 11px; }
  .composer { margin: 0 9px 9px; padding: 9px 9px 7px; }
  .input-hint { font-size: 8px; }
  .try-panel { padding: 17px 12px 13px; }
  .prompt-list { grid-template-columns: minmax(0, 1fr); }
  .prompt-card { padding: 9px; }
  .page-footer { flex-direction: column; gap: 5px; padding-top: 15px; font-size: 8px; }
  .page-footer span:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
