:root {
  color-scheme: light;
  --ivory: #f8f7f3;
  --paper: #fffefa;
  --pine: #203731;
  --ink: #212e2a;
  --muted: #52625b;
  --line: #d9dfd6;
  --accent: #cfe4a9;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, textarea, a { font: inherit; }
button, a.primary { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #699833; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: clamp(208px, 19vw, 264px) minmax(0, 1fr); min-height: 100vh; height: 100dvh; }
.rail { padding: 34px 24px 22px; display: flex; flex-direction: column; color: #f6f7ef; background: var(--pine); }
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 750; letter-spacing: .055em; }
.brand-icon, .small-mark { display: inline-flex; gap: 3px; height: 22px; width: 26px; align-items: stretch; transform: skew(-18deg); }
.brand-icon i, .small-mark i { width: 5px; display: block; background: var(--accent); }
.brand-icon i:first-child, .small-mark i:first-child { margin-top: 7px; }
.brand-icon i:last-child, .small-mark i:last-child { margin-bottom: 7px; }
.rail-title { margin: 6px 0 32px 36px; font-size: 16px; color: #cbd8cd; letter-spacing: .02em; }
.new-chat { background: #2c453e; color: #fffefa; border: 1px solid #536b60; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; text-align: left; font-size: 14px; font-weight: 600; }
.new-chat:hover { background: #37544b; }
.new-chat span { font-size: 20px; line-height: 1; color: var(--accent); }
.rail-footer { margin-top: auto; padding-top: 17px; border-top: 1px solid #4a6056; display: flex; gap: 9px; align-items: center; }
.monogram { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; background: #dce7cf; color: var(--pine); border-radius: 50%; font-size: 12px; font-weight: 750; }
.account-info { min-width: 0; }
#user-email { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.logout { background: transparent; border: none; color: #d0dacf; padding: 4px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 65px; flex: 0 0 auto; display: flex; gap: 12px; align-items: center; padding: 0 clamp(20px, 3vw, 48px); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.slash { color: #97a297; }
.modes { margin-left:auto; display:flex; gap:3px; }
.modes button, .save-draft button, .save-draft select, .save-draft input { font:inherit; border:1px solid var(--line); border-radius:6px; background:white; padding:6px 10px; }
.modes button[aria-pressed="true"] { background:#203731; color:white; }
.save-draft { margin-top:14px; }
.save-draft summary { cursor:pointer; }
.save-draft form { margin-top:10px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.topbar strong { font-weight: 600; color: var(--ink); }
.sign-in { display: grid; place-items: center; flex: 1; padding: 28px; }
.sign-card { width: min(100%, 415px); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: clamp(24px, 4vw, 44px); box-shadow: 0 8px 34px #253b2608; }
.small-mark { height: 30px; margin-bottom: 22px; }
.small-mark i { background: #617f55; }
h1 { margin: 0; letter-spacing: -.045em; font-weight: 600; line-height: 1.15; }
.sign-card h1 { font-size: clamp(26px, 3vw, 33px); }
.sign-card p, .empty > p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 13px 0 26px; }
.primary, .secondary { display: inline-flex; justify-content: space-between; gap: 12px; align-items: center; border-radius: 6px; padding: 12px 16px; font-weight: 600; font-size: 14px; }
.primary { width: 100%; text-decoration: none; border: 1px solid var(--pine); background: var(--pine); color: white; }
.primary:hover { background: #335246; }
.primary span { color: var(--accent); font-size: 18px; }
.secondary { background: var(--paper); color: var(--pine); border: 1px solid #a2b09e; }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread-scroll { overflow: auto; flex: 1; min-height: 0; padding: 28px clamp(20px, 5vw, 80px); scrollbar-gutter: stable; }
.empty, .transcript, .compose-area { width: 100%; max-width: 810px; margin-inline: auto; }
.empty { padding-top: clamp(24px, 14vh, 128px); }
.empty h1 { font-size: clamp(27px, 3.1vw, 46px); }
.empty > p { max-width: 560px; margin-bottom: 26px; }
.examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.examples button { text-align: left; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: var(--paper); font-size: 14px; line-height: 1.4; color: var(--ink); font-weight: 600; }
.examples button:hover { background: #f1f4e9; border-color: #93a58d; }
.example-kind { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 12px; }
.example-kind span { color: #425f4d; font-size: 17px; line-height: 1; }
.transcript { display: grid; gap: 23px; }
.chat-item { min-width: 0; }
.chat-item.user { justify-self: end; max-width: 89%; padding: 12px 17px; border-radius: 14px 14px 3px 14px; background: #e4ecdf; }
.chat-item.user .body { white-space: pre-wrap; }
.speaker { font-size: 12px; font-weight: 650; color: #485c4c; margin-bottom: 6px; }
.body { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.body p, .body ul, .body ol { margin: .4em 0 .65em; }
.body strong { font-weight: 650; }
.body a { color: #295d44; text-underline-offset: 2px; }
.body h2, .body h3 { font-size: 17px; line-height: 1.45; font-weight: 650; margin: 14px 0 6px; }
.body ul, .body ol { padding-left: 1.6em; }
.body p { white-space: pre-line; }
.body pre, .body code { font: .91em/1.6 Consolas, monospace; background: #e9ece5; border-radius: 4px; }
.body code { padding: 1px 4px; }
.body pre { padding: 12px; overflow-x: auto; }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.body td, .body th { text-align: left; border: 1px solid var(--line); padding: 7px 10px; min-width: 80px; }
.body th { background: #eaf0e4; }
.compose-area { padding: 12px 0 14px; width: calc(100% - clamp(40px, 10vw, 160px)); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px; border: 1px solid #a2afa1; border-radius: 13px; background: var(--paper); }
.composer:focus-within { border-color: #4d7359; box-shadow: 0 0 0 2px #627f4d20; }
textarea { resize: vertical; flex: 1; min-width: 0; min-height: 42px; max-height: 18vh; border: none; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.45; padding: 4px 7px; }
textarea:focus-visible { outline: none; }
.send { background: var(--pine); color: white; border: none; border-radius: 8px; min-width: 40px; min-height: 40px; }
.send:hover:not(:disabled) { background: #335246; }
.send:disabled { background: #dee4db; color: #657268; }
.send span { font-size: 23px; }
.composer-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: 12px; padding: 7px 3px 0; min-height: 21px; }
.notice { color: #713a22; background: #f6ece2; border-radius: 6px; padding: 9px 13px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0; height: 100vh; height: 100dvh; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 13px; padding: 12px 16px; }
  .wordmark { font-size: 18px; gap: 7px; }
  .brand-icon { height: 17px; width: 20px; gap: 2px; }
  .brand-icon i { width: 4px; }
  .rail-title { margin: 0; font-size: 13px; }
  .new-chat { margin-left: auto; padding: 6px 9px; font-size: 12px; }
  .rail-footer { width: 100%; border: 0; margin: 0; padding: 0; }
  .monogram { display: none; }
  .account-info { display: flex; flex-wrap: wrap; width: 100%; gap: 10px; justify-content: space-between; align-items: center; }
  .logout { padding: 3px 0; }
  .topbar { height: 40px; padding: 0 16px; font-size: 12px; }
  .thread-scroll { padding: 20px 16px; scrollbar-gutter: auto; }
  .empty { padding-top: 12px; }
  .examples { grid-template-columns: 1fr; gap: 6px; }
  .examples button { flex-direction: row; gap: 12px; align-items: center; padding: 9px 12px; }
  .example-kind { min-width: 74px; }
  .empty > p { margin: 9px 0 14px; }
  .compose-area { width: calc(100% - 26px); padding: 5px 0 max(7px, env(safe-area-inset-bottom)); }
  .key-hint { display: none; }
  .sign-in { padding: 16px; overflow-y: auto; }
}
