:root {
  color: #20271f;
  background: #f3f4ef;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --accent: #244d3a;
  --surface: #fff;
  --border: #dce2d8;
  --ink-soft: #59695e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100dvh; margin: 0; display: flex; flex-direction: column; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #467a59; outline-offset: 3px;
}
.topbar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 62px);
  border-bottom: 1px solid var(--border); background: #f3f4ef;
}
.brand, .top-actions, .composer-actions, .dialog-actions {
  display: flex; align-items: center; gap: 10px;
}
.brand { font-size: 1.2rem; font-weight: 690; letter-spacing: -.045em; }
.brand-mark {
  width: 30px; height: 30px; display: inline-grid; align-content: center;
  justify-items: center; gap: 3px; background: var(--accent); border-radius: 8px;
}
.brand-mark i { display: block; width: 13px; height: 2px; background: #dceadd; transform: skewX(-30deg); }
.brand-mark i:nth-child(2) { width: 16px; }
.brand-mark i:nth-child(3) { width: 19px; }
.status { color: var(--ink-soft); font-size: .875rem; white-space: nowrap; }
.status::before {
  content: ""; display: inline-block; margin-right: .42em; width: .45em; height: .45em;
  border-radius: 50%; background: #8a998e; vertical-align: .14em;
}
.status[data-state="ready"]::before { background: #27834f; }
.status[data-state="busy"]::before { background: #8d662d; }
.status[data-state="error"]::before { background: #a13f36; }
.quiet, .send { border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; white-space: nowrap; }
.quiet { background: #fafbf8; color: #334638; font-size: .875rem; }
.quiet:hover:enabled { background: #e7ede4; }
.send { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 640; }
.send:hover:enabled { background: #346147; }
.secondary { color: var(--accent); background: transparent; }
.secondary:hover:enabled { background: #e5efe7; }
.chat { flex: 1; width: min(790px, 100%); margin: auto; padding: 0 20px; }
.empty { text-align: center; padding: clamp(76px, 17vh, 190px) 0 70px; }
.empty-mark { width: 55px; height: 55px; border-radius: 15px; gap: 5px; }
.empty-mark i { height: 3px; width: 21px; }
.empty-mark i:nth-child(2) { width: 28px; }
.empty-mark i:nth-child(3) { width: 35px; }
h1 { margin: 17px 0 4px; letter-spacing: -.058em; font-size: clamp(2rem, 6.5vw, 4.15rem); line-height: 1.05; }
.metadata { color: var(--ink-soft); margin-top: 16px; }
.metadata span { padding: 0 .45em; }
.transcript { padding: 32px 0 20px; display: grid; gap: 24px; }
.turn { min-width: 0; max-width: 100%; }
.turn h2 { font-size: .875rem; margin: 0 0 8px; color: var(--ink-soft); }
.turn p { margin: 0; padding: 13px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn[data-role="user"] { justify-self: end; max-width: 90%; }
.turn[data-role="user"] h2 { text-align: right; }
.turn[data-role="user"] p { border-radius: 14px 14px 3px 14px; background: #dfe9df; }
.turn[data-role="assistant"] p { background: var(--surface); border: 1px solid var(--border); border-radius: 3px 14px 14px; }
.turn details { margin: 0 0 8px; color: var(--ink-soft); }
.turn summary { cursor: pointer; font-size: .875rem; }
.turn details p { padding: 8px 12px; border: 0; background: none; }
.dock {
  position: sticky; bottom: 0; background: #f3f4ef; padding: 14px 20px
  max(18px, env(safe-area-inset-bottom));
}
.composer {
  max-width: 750px; margin: 0 auto; padding: 12px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 15px; box-shadow: 0 6px 24px #2237250d;
}
.composer textarea {
  width: 100%; border: 0; border-radius: 6px; resize: vertical; min-height: 54px;
  max-height: min(30vh, 260px); padding: 5px 7px; color: inherit; background: transparent;
}
.composer-actions { justify-content: flex-end; min-height: 38px; }
.thinking { display: flex; align-items: center; gap: 5px; margin-right: auto; white-space: nowrap; font-size: .875rem; }
.thinking input { accent-color: var(--accent); }
.feedback { min-height: 1.4em; color: #923e35; font-size: .875rem; }
dialog {
  width: min(calc(100% - 32px), 410px); padding: 25px; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 85px #14291833;
}
dialog::backdrop { background: #16271b45; }
dialog h2 { margin: 0 0 17px; letter-spacing: -.035em; }
dialog input {
  margin: 6px 0 10px; padding: 9px 12px; width: 100%;
  border: 1px solid var(--border); border-radius: 9px; color: inherit;
}
.dialog-actions { justify-content: flex-end; margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 440px) {
  .topbar { gap: 8px; padding: 11px 12px; }
  .top-actions { gap: 6px; }
  .quiet { padding: 6px 8px; }
  .brand { gap: 5px; }
  .brand .brand-mark { width: 25px; height: 25px; }
  .chat { padding: 0 12px; }
  .dock { padding-left: 12px; padding-right: 12px; }
}
