:root {
  color-scheme: light;
  --ink: #173c36;
  --muted: #6b7a74;
  --line: #e0e7e1;
  --paper: #ffffff;
  --canvas: #f4f6f2;
  --accent: #1b6d55;
  --accent-hover: #13543f;
  --soft: #eaf3e9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #72b6a0; outline-offset: 3px; }
button:disabled { opacity: .48; }
.page-shell { width: min(1140px, calc(100% - 64px)); margin: 0 auto; }
.page-header { height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 450; letter-spacing: -.6px; }
.brand strong { font-weight: 700; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: #e1edbc; font-weight: 700; font-size: 23px; }
.device-badge { display: inline-flex; align-items: center; gap: 13px; border: 1px solid #d5ded3; border-radius: 30px; padding: 7px 12px; color: #65736a; font-size: 12px; }
.device-badge span { font-size: 16px; color: var(--accent); }
.boot-view { min-height: 65vh; display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; color: var(--muted); }
.login-layout { min-height: calc(100dvh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 0 50px; }
.login-card { width: min(100%, 470px); padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 16px 45px #244a2e08; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.8px; color: #799077; }
.login-card h1 { margin: 19px 0 18px; font-size: clamp(32px, 4vw, 43px); line-height: 1.15; font-weight: 600; letter-spacing: -1.8px; }
.login-description { line-height: 1.65; color: var(--muted); margin: 0 0 28px; }
.login-card label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.login-card input { width: 100%; height: 49px; border: 1px solid #d7e0d7; border-radius: 9px; padding: 0 14px; background: #fcfdfb; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #8b9690; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border-radius: 9px; padding: 9px 14px; border: 1px solid transparent; font-size: 12px; font-weight: 600; transition: background .15s; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover:not(:disabled), .send-button:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { background: white; border-color: var(--line); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: #f2f5ef; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover:not(:disabled) { background: #eef3ec; }
.login-button { width: 100%; margin-top: 14px; min-height: 48px; justify-content: space-between; font-size: 14px; padding: 12px 17px; }
.login-button span { font-size: 20px; font-weight: 400; }
.login-footnote { margin: 22px 0 0; text-align: center; color: #8a978d; font-size: 11px; }
.login-caption { max-width: 360px; text-align: center; color: #8a978d; font-size: 12px; line-height: 1.6; margin: 22px 16px 0; }
.chat-panel { height: max(620px, calc(100dvh - 144px)); max-height: 1100px; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 30px #244a2e04; }
.chat-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 23px 29px 22px; border-bottom: 1px solid var(--line); }
.chat-header h1 { font-size: 19px; letter-spacing: -.5px; margin: 7px 0 0; font-weight: 600; }
.chat-header h1 span { font-size: 13px; letter-spacing: 0; color: #80907e; font-weight: 500; margin-left: 5px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 32px; scrollbar-width: thin; scrollbar-color: #cbd6cb transparent; overscroll-behavior: contain; }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 12px; }
.empty-mark { display: grid; place-items: center; width: 55px; height: 55px; background: #f0f5e8; border-radius: 18px; color: #73935f; font-size: 39px; }
.empty-state h2 { font-size: 22px; font-weight: 500; letter-spacing: -.6px; margin: 23px 0 10px; }
.empty-state p { color: var(--muted); max-width: 370px; line-height: 1.7; margin: 0; font-size: 13px; }
.messages { width: min(100%, 880px); margin: auto; }
.message { margin-bottom: 28px; }
.message:last-child { margin-bottom: 0; }
.message-label { font-size: 9px; font-weight: 750; letter-spacing: 1.3px; color: #76917b; margin-bottom: 9px; }
.message-content { line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.message-user { max-width: 86%; width: fit-content; min-width: 92px; margin-left: auto; padding: 15px 19px; border: 1px solid #e4ecd8; border-radius: 15px 15px 4px 15px; background: #f1f6e9; }
.message-user .message-label { color: #869677; }
.message-assistant { padding: 6px 0 1px; }
.message-assistant .message-content { color: #253e37; }
.message-pending { opacity: .7; }
.answer-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; }
.thinking-badge { padding: 4px 7px; font-size: 10px; border: 1px solid #e1e8e1; border-radius: 5px; color: #7a8c7e; background: #fafcf8; }
.copy-button { border: 0; background: transparent; color: #7a8c7e; font-size: 11px; padding: 4px; }
.copy-button:hover { color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 10px 0 0; padding: 13px 0; border-top: 1px solid #e8ede5; gap: 12px; }
.metrics dt { font-size: 10px; color: #8b968c; line-height: 1.4; }
.metrics dd { margin: 5px 0 0; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: #557561; }
.pending { display: flex; align-items: center; gap: 10px; width: min(100%, 880px); margin: 25px auto 0; font-size: 12px; color: var(--muted); }
.spinner { display: inline-block; width: 15px; height: 15px; flex-shrink: 0; border: 2px solid #dbe8d8; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.elapsed { margin-left: auto; color: #8a978d; font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer-area { flex-shrink: 0; padding: 17px 29px 18px; border-top: 1px solid var(--line); background: #fdfefb; }
.settings-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 13px; }
.setting { display: flex; align-items: center; gap: 8px; }
.setting label { font-size: 11px; font-weight: 500; color: var(--muted); }
.setting select { max-width: 150px; padding: 6px 25px 6px 8px; background: white; border: 1px solid #dfe6db; border-radius: 6px; color: #47624d; font-size: 11px; }
.setting-note { font-size: 10px; color: #8b9788; margin-left: auto; }
.input-box { position: relative; border: 1px solid #d9e3d5; border-radius: 11px; background: white; box-shadow: 0 2px 3px #1c461106; }
.input-box:focus-within { border-color: #86a991; }
textarea { display: block; width: 100%; min-height: 89px; max-height: 190px; resize: vertical; padding: 14px 62px 13px 16px; color: var(--ink); border: 0; border-radius: inherit; background: transparent; line-height: 1.6; font-size: 13px; }
textarea:focus { outline: none; }
textarea:disabled { color: #728575; }
.send-button { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--accent); color: white; font-size: 24px; line-height: 1; transition: background .15s; }
.composer-footer { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; color: #93a08f; margin-top: 10px; }
.composer-footer span span { padding: 0 4px; }
.error-message { padding: 11px 13px; border: 1px solid #f0d4c8; border-radius: 8px; background: #fff5ef; color: #9e4e2d; font-size: 12px; line-height: 1.6; margin: 12px 0; }
.composer-area > .error-message { margin: 0 0 13px; }
.page-footer { display: flex; justify-content: center; align-items: center; gap: 10px; height: 54px; font-size: 10px; color: #8f9a8e; }
.page-footer span { color: #bbc5b6; }
.noscript-message { position: fixed; inset: 30% 20% auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 780px) {
  .page-shell { width: calc(100% - 30px); }
  .page-header { height: 74px; }
  .chat-panel { height: max(580px, calc(100dvh - 122px)); border-radius: 16px; }
  .chat-header { padding: 18px 20px; }
  .conversation { padding: 22px 21px; }
  .composer-area { padding: 15px 20px; }
  .setting-note { width: 100%; margin: 0; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .page-footer { height: 48px; }
}
@media (max-width: 460px) {
  .page-shell { width: calc(100% - 20px); }
  .page-header { height: 65px; padding: 0 5px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 20px; }
  .device-badge { font-size: 10px; gap: 8px; padding: 5px 9px; }
  .login-layout { min-height: calc(100dvh - 128px); padding: 20px 5px; }
  .login-card { padding: 30px 25px; border-radius: 18px; }
  .login-card h1 { font-size: 36px; }
  .chat-panel { height: max(570px, calc(100dvh - 113px)); border-radius: 13px; }
  .chat-header { padding: 16px; }
  .chat-header h1 { font-size: 17px; }
  .chat-header h1 span { font-size: 11px; }
  .header-actions { gap: 1px; }
  .header-actions .button { padding: 7px 9px; font-size: 11px; min-height: 34px; }
  .conversation { padding: 22px 17px; }
  .empty-state h2 { font-size: 21px; }
  .empty-state p { font-size: 12px; }
  .message-content { font-size: 13px; }
  .message-user { max-width: 92%; }
  .composer-area { padding: 13px; }
  .settings-row { gap: 9px 11px; }
  .setting { gap: 6px; }
  .setting label { font-size: 10px; }
  .setting select { font-size: 11px; padding-right: 19px; }
  textarea, .login-card input { font-size: 16px; }
  .composer-footer { font-size: 9px; gap: 5px; }
  .composer-footer span span { padding: 0 2px; }
  .pending { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
