:root {
  color-scheme: dark;
  --rail-edge: #29292c;
  --header-edge: #2c2c2f;
  --active: #2b2b2e;
  --bubble: #303033;
  --card-edge: #424246;
  --selection: #aaaab2;
  --radio-edge: #77777e;
  --radio-on: #d6d6da;
  --radio-center: #353538;
  --button-bg: #eeeef0;
  --button-text: #212124;
  --button-hover: white;
  --disabled-bg: #404044;
  --disabled-text: #a8a8ad;
  --composer-edge: #47474c;
  --composer-focus: #75757e;
  --page:#1b1b1d; --sidebar:#141416; --panel:#242426; --field:#202022; --hover:#2c2c30;
  --line:#37373b; --text:#efeff1; --soft:#c2c2c8; --muted:#a2a2ab; --accent:#c8b290; --focus:#b1c9ec;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; font-size:15px; color:var(--text); background:var(--page);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page:#fff; --sidebar:#f6f6f8; --panel:#fafafb; --field:#f6f6f8; --hover:#e9e9ed;
  --line:#d8d8df; --text:#222329; --soft:#454650; --muted:#60616b; --accent:#795c31; --focus:#2d61a4;
  --rail-edge: #dedee3;
  --header-edge: #e3e3e7;
  --active: #e5e5ea;
  --bubble: #efeff2;
  --card-edge: #cdced5;
  --selection: #666972;
  --radio-edge: #737580;
  --radio-on: #444754;
  --radio-center: #fff;
  --button-bg: #27282d;
  --button-text: #fff;
  --button-hover: #151519;
  --disabled-bg: #e0e0e5;
  --disabled-text: #5d5e67;
  --composer-edge: #c9c9d0;
  --composer-focus: #747681;
}
#themeToggle { flex:none }
#themeToggle svg { pointer-events:none }
:root[data-theme="light"] .to-light, :root:not([data-theme="light"]) .to-dark { display:none }
* { box-sizing:border-box }
body { margin:0 }
button, input, textarea { font:inherit; color:inherit }
button { cursor:pointer; border:0; padding:0; background:transparent }
button:disabled { cursor:default }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline:2px solid var(--focus); outline-offset:2px }
svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; flex:none }
.shell { display:flex; height:100vh; height:100dvh; overflow:hidden }
aside { width:252px; flex:none; display:flex; flex-direction:column; background:var(--sidebar); padding:14px 12px 12px; border-right:1px solid var(--rail-edge) }
.brandrow, header, .brand, nav button, .project, .device, .compose-bar, .compose-bar span, .foot, .foot span, .dialog-head, .sender, .question-label { display:flex; align-items:center }
.brandrow { justify-content:space-between; margin:0 0 22px 10px }
.brand { gap:9px; font-weight:650; font-size:19px; letter-spacing:-.55px }
.mark { width:28px; height:27px; stroke:none }
.iconbtn { display:grid; place-items:center; width:38px; height:38px; border-radius:8px; color:var(--muted) }
.iconbtn:hover, nav button:hover, .thread:hover, .device:hover, #results button:hover { background:var(--hover); color:var(--text) }
nav button { gap:12px; width:100%; padding:0 11px; height:40px; border-radius:8px; text-align:left; font-size:14px }
nav svg, .project svg { color:var(--soft) }
kbd { font:11px inherit; font-family:inherit; font-size:11px; margin-left:auto; color:var(--muted) }
.sectionlabel { color:var(--muted); font-size:12px; font-weight:570; margin:27px 11px 7px }
.project { padding:7px 11px; gap:10px; font-size:14px }
.project strong { font-weight:550 }
.threads-label { margin-top:22px }
#threads { overflow:auto; flex:1 }
.thread { border-radius:8px; width:100%; display:flex; align-items:center; gap:9px; padding:0 12px; height:39px; text-align:left; font-size:13px; color:var(--soft) }
.thread span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.thread[aria-current=true] { background:var(--active); color:var(--text) }
i { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--muted); flex:none }
.thread i { margin-left:auto; width:6px; height:6px; background:var(--accent) }
.device { text-align:left; gap:11px; width:100%; border-radius:10px; padding:10px 8px; margin-top:18px }
.device-icon { display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; width:36px; height:36px }
.device b { font-size:13px; font-weight:600 }
.device small { display:flex; align-items:center; gap:6px; color:var(--muted); margin-top:3px; font-size:12px }
.device-chevron { margin-left:auto; width:15px; color:var(--muted) }
main { flex:1; min-width:0; display:flex; flex-direction:column }
header { height:55px; flex:none; padding:0 24px; gap:10px; border-bottom:1px solid var(--header-edge) }
.crumb, .slash { font-size:13px; color:var(--muted) }
.slash { opacity:.6 }
h1 { font-size:14px; font-weight:570; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.preview { flex:none; margin-left:auto; padding:4px 9px; border-radius:20px; border:1px solid var(--line); color:var(--muted); font-size:11px; font-weight:550 }
#openSide, #scrim, .collapsed aside { display:none }
.collapsed #openSide { display:grid }
.transcript { overflow:auto; min-height:0; flex:1; scrollbar-color:var(--line) transparent }
.content, .compose-wrap { width:min(100%, 810px); margin:0 auto; padding:36px 32px 24px }
.entry { margin:0 0 24px; line-height:1.55; overflow-wrap:anywhere }
.entry:last-child { margin-bottom:0 }
.entry p { margin:0; white-space:pre-wrap }
.user { margin-left:auto; width:fit-content; max-width:85%; padding:10px 16px; background:var(--bubble); border-radius:18px 18px 5px 18px }
.sender { gap:8px; font-size:13px; font-weight:650; margin-bottom:8px }
.sender svg { width:21px; height:19px; stroke:none }
.question { background:var(--field); border:1px solid var(--card-edge); border-radius:14px; overflow:hidden; margin-top:16px }
.q-body { padding:16px 18px }
.question-label { gap:7px; color:var(--accent); font-size:12px; font-weight:580; margin-bottom:8px }
.question-label svg { width:15px; height:15px }
.question h2 { margin:0; font-size:16px; line-height:1.5; font-weight:620; letter-spacing:-.18px }
.options { display:grid; gap:7px; margin-top:14px }
.option { display:flex; align-items:center; gap:10px; min-height:41px; padding:8px 12px; width:100%; text-align:left; border:1px solid var(--line); background:var(--panel); border-radius:8px; font-size:14px }
.option:hover { background:var(--hover) }
.option[aria-pressed=true] { border-color:var(--selection) }
.radio { width:15px; height:15px; border:1px solid var(--radio-edge); border-radius:50%; flex:none }
.option[aria-pressed=true] .radio { border:4px solid var(--radio-on); background:var(--radio-center) }
.q-actions { padding:10px 16px; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line) }
.action { font-size:13px; font-weight:580; padding:8px 13px; border-radius:8px; min-height:33px }
.secondary { color:var(--soft) }
.secondary:hover { background:var(--hover) }
.primary, .send { background:var(--button-bg); color:var(--button-text) }
.primary:hover, .send:hover { background:var(--button-hover) }
.primary:disabled, .send:disabled { background:var(--disabled-bg); color:var(--disabled-text) }
code { display:block; font:14px/1.5 Consolas,monospace; padding:10px 12px; margin-top:12px; background:var(--sidebar); border:1px solid var(--line); border-radius:8px }
.compose-wrap { padding:12px 32px max(13px,env(safe-area-inset-bottom)); flex:none }
.composer { background:var(--panel); border:1px solid var(--composer-edge); border-radius:17px; padding:12px 13px 9px }
.composer:focus-within { border-color:var(--composer-focus) }
textarea { display:block; width:100%; height:46px; resize:none; border:0; outline:0; background:transparent; padding:0 2px; line-height:1.55 }
textarea:focus-visible { outline:0 }
textarea::placeholder { color:var(--muted) }
.compose-bar { justify-content:space-between }
.compose-bar span { gap:7px; color:var(--muted); font-size:12px }
.compose-bar span svg { width:15px; height:15px }
.send { display:grid; place-items:center; width:33px; height:33px; border-radius:50% }
.foot { justify-content:space-between; gap:8px; color:var(--muted); font-size:11px; margin:8px 4px 0 }
.foot span { gap:6px }
.foot i { width:6px; height:6px }
.empty { display:grid; justify-items:center; text-align:center; margin: clamp(24px, 15vh, 140px) 0 30px; gap:12px }
.empty .mark { width:40px; height:40px }
.empty h2 { margin:0; font-size:24px; letter-spacing:-.5px }
dialog { width:min(440px, calc(100% - 32px)); max-height:80dvh; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--panel); color:var(--text); box-shadow:0 16px 80px #0006 }
dialog::backdrop { background:#0009 }
.dialog-head { justify-content:space-between; margin-bottom:10px }
.dialog-head h2 { font-size:18px; margin:0 }
dialog p { line-height:1.55; color:var(--soft); margin:0 0 6px }
#searchInput { border:1px solid var(--line); background:var(--sidebar); padding:10px 13px; width:100%; border-radius:8px }
#results { display:grid; margin-top:12px; gap:4px }
#results button { text-align:left; padding:10px; border-radius:8px; overflow-wrap:anywhere }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%) }
@media(max-width:740px) {
  aside, .collapsed aside { display:none }
  .side-open aside { display:flex; position:fixed; z-index:3; inset:0 auto 0 0; width:min(294px,86vw); box-shadow:8px 0 48px #0005 }
  .side-open #scrim { display:block; position:fixed; inset:0; z-index:2; background:#0008 }
  #openSide { display:grid }
  header { padding:0 12px 0 5px; gap:6px; height:51px }
  .crumb, .slash, kbd { display:none }
  .content { padding:21px 15px }
  .compose-wrap { padding:6px 10px max(8px,env(safe-area-inset-bottom)) }
  .composer { padding:10px 10px 6px }
  .entry { margin-bottom:18px }
  .q-body { padding:14px }
  .user { max-width:92% }
  .option, .action, .iconbtn, nav button, .thread, .send { min-height:44px }
  .iconbtn, .send { min-width:44px }
  .q-actions { padding:5px 9px }
  textarea, #searchInput { font-size:16px }
}
@media(max-height:510px) { .content { padding-top:14px } .foot { display:none } textarea { height:28px } }
pre { white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.6 Consolas,monospace; background:var(--sidebar); padding:12px; border-radius:8px }
.live-field { display:grid; gap:6px; margin:14px 0 8px }
.live-field textarea { border:1px solid var(--line); height:64px; padding:8px; border-radius:7px }
.live-requests { padding-top:0 }
.live-notice { margin:0 4px 8px; color:var(--accent) }
.compose-bar .action { margin-left:auto }
[hidden] { display:none!important }
