:root {
  --bg: #07070A;
  --side: #0B0A0F;
  --panel: #101015;
  --elev: #18181F;
  --hover: #22212A;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --text: #F5F5F7;
  --text-2: #A8A8B3;
  --muted: #7B7B86;
  --accent: #A35BFF;
  --accent-2: #8930FD;
  --accent-soft: rgba(163,91,255,.14);
  --danger: #FF6B7A;
  --warn: #FFC53D;
  --ok: #5CE0A0;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --fast: 140ms; --normal: 220ms;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; margin-left: auto; }
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 85% -10%, rgba(137,48,253,.13), transparent 60%), radial-gradient(700px 400px at -10% 110%, rgba(0,145,255,.07), transparent 60%); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); transition: transform var(--fast) var(--ease), background var(--fast), border-color var(--fast), box-shadow var(--fast); }
.btn:hover { background: rgba(255,255,255,.08); border-color: var(--line-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; font-weight: 600; box-shadow: 0 6px 24px rgba(137,48,253,.28); }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.primary:disabled { opacity: .55; transform: none; cursor: default; }
.btn.wide { width: 100%; height: 46px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: transparent; border: 0; color: var(--text-2); transition: background var(--fast), color var(--fast); }
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }

/* sign in */
.login { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); padding: 36px 28px 28px; border-radius: var(--r-xl); background: rgba(16,16,21,.78); border: 1px solid var(--line);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 30px 80px rgba(0,0,0,.45); text-align: center; animation: rise 360ms var(--ease); }
.login-mark { display: block; margin: 0 auto 14px; filter: drop-shadow(0 8px 24px rgba(163,91,255,.35)); }
.login h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.login .sub { margin: 6px 0 22px; color: var(--text-2); font-size: 14px; }
.field { position: relative; display: block; margin-bottom: 10px; }
.field input { width: 100%; height: 48px; padding: 0 46px 0 16px; border-radius: var(--r-md); background: rgba(255,255,255,.04); border: 1px solid var(--line);
  outline: none; transition: border-color var(--fast), box-shadow var(--fast); font-size: 15px; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input::placeholder { color: var(--muted); }
.field .icon-btn { position: absolute; right: 7px; top: 7px; }
.login-error { min-height: 20px; margin: 4px 0 10px; color: var(--danger); font-size: 13px; }
.fine { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.shake { animation: shake 380ms var(--ease); }

/* layout */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 272px 1fr; height: 100%; }
.sidebar { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; background: rgba(11,10,15,.9); border-right: 1px solid var(--line); min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; font-size: 16px; }
.new-chat { justify-content: flex-start; width: 100%; font-size: 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--muted); }
.search:focus-within { border-color: var(--line-2); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; color: var(--text); }
.conv-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.conv-group { margin: 14px 8px 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.conv { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--text-2);
  font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--fast), color var(--fast); }
.conv:hover { background: rgba(255,255,255,.05); color: var(--text); }
.conv.active { background: var(--accent-soft); color: var(--text); }
.conv .live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; animation: pulse 1.4s infinite; }
.conv-empty { padding: 16px 10px; color: var(--muted); font-size: 13px; }
.side-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.usage { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; background: none; text-align: left; transition: background var(--fast); }
.usage:hover { background: rgba(255,255,255,.05); }
.usage-main { flex: 1; min-width: 0; }
.usage-chev { color: var(--muted); }
.plan-badge { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; vertical-align: 1px;
  color: var(--text-2); background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.plan-badge.plus { color: #9FE3FF; background: rgba(0,145,255,.14); border-color: rgba(0,145,255,.35); }
.plan-badge.pro { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.plan-badge.big { margin: 0; padding: 4px 14px; font-size: 13px; }
.plan-now { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.plan-key { font: 13px var(--mono); color: var(--text); }
.plan-msg { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.plan-card { padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.plan-card.cur { border-color: rgba(163,91,255,.55); background: var(--accent-soft); }
.plan-card b { display: block; font-size: 14px; }
.plan-card span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.plan-card .big-num { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 6px; letter-spacing: -.01em; }
.key-form { margin-top: 4px; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: var(--r-md); background: rgba(255,255,255,.04); border: 1px solid var(--line); outline: none;
  font: 13.5px var(--mono); text-transform: uppercase; transition: border-color var(--fast), box-shadow var(--fast); }
.key-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.key-row input::placeholder { text-transform: none; color: var(--muted); font-family: var(--font); }
.key-row .btn { height: 42px; }
.key-note { margin: 8px 2px 0; font-size: 12.5px !important; color: var(--muted) !important; }
.key-note.ok { color: var(--ok) !important; } .key-note.bad { color: var(--warn) !important; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.plan-actions .btn { text-decoration: none; font-size: 14px; }
.usage-title { font-size: 12.5px; color: var(--text-2); }
.usage-sub { font-size: 11.5px; color: var(--muted); }
.who { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0 6px; }
.who-pc { font-size: 13px; font-weight: 600; }
.who-dev { font-size: 11.5px; color: var(--muted); }
.ring { transform: rotate(-90deg); }
.ring-bg { stroke: rgba(255,255,255,.09); stroke-width: 3.5; }
.ring-fg { stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset 600ms var(--ease), stroke 200ms; }
.ring.mini .ring-bg, .ring.mini .ring-fg { stroke-width: 4.5; stroke-dasharray: 87.96; }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.top h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px rgba(92,224,160,.6); }
.conn.off i { background: var(--danger); box-shadow: none; }

.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 24px 20px 12px; }
.messages, .empty { max-width: 780px; margin: 0 auto; }
.empty { text-align: center; padding-top: 12vh; animation: rise 400ms var(--ease); }
.empty h3 { margin: 16px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.empty p { margin: 0; color: var(--text-2); }
.suggest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 28px; text-align: left; }
.suggest button { text-align: left; padding: 14px 16px; border-radius: var(--r-md); background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px;
  transition: border-color var(--fast), background var(--fast), transform var(--fast) var(--ease); }
.suggest button:hover { background: rgba(255,255,255,.05); border-color: var(--line-2); color: var(--text); transform: translateY(-1px); }
.suggest b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

.msg { display: flex; margin: 0 0 22px; animation: rise 260ms var(--ease); }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { max-width: 80%; padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--elev); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant .bubble { width: 100%; }
.who-line { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.who-line img { width: 18px; height: 18px; }
.who-line b { color: var(--text-2); font-weight: 600; }
.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { margin: 20px 0 8px; line-height: 1.3; letter-spacing: -.01em; }
.md h1 { font-size: 21px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md a { color: #C79BFF; text-decoration: none; border-bottom: 1px solid rgba(199,155,255,.35); }
.md a:hover { border-color: #C79BFF; }
.md code { font: 13px var(--mono); background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; }
.md blockquote { margin: 0 0 12px; padding: 2px 14px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md table { border-collapse: collapse; margin: 0 0 14px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 6px 10px; text-align: left; }
.md th { background: rgba(255,255,255,.04); }
.md sup.cite a { border: 0; font-size: 11px; padding: 0 5px; border-radius: 6px; background: var(--accent-soft); color: #D9BCFF; }
.code { margin: 0 0 14px; border-radius: var(--r-md); background: #0C0C10; border: 1px solid var(--line); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font: 12px var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.code-head button { border: 0; background: none; color: var(--text-2); font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.code-head button:hover { background: rgba(255,255,255,.07); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13px/1.55 var(--mono); }
.code pre code { background: none; padding: 0; }
.caret::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; border-radius: 2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.pill.good { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--danger); }
.pill-btn { cursor: pointer; transition: border-color var(--fast), color var(--fast); }
.pill-btn:hover { border-color: var(--line-2); color: var(--text); }
.err { margin-top: 6px; padding: 10px 14px; border-radius: var(--r-md); background: rgba(255,107,122,.08); border: 1px solid rgba(255,107,122,.25); color: #FFB3BC; font-size: 14px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.src { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.035);
  border: 1px solid var(--line); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src:hover { border-color: var(--line-2); color: var(--text); }
.src b { color: #D9BCFF; font-weight: 600; }
.research { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.atts img { max-width: 220px; max-height: 180px; border-radius: 12px; border: 1px solid var(--line); display: block; }
.att { font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: var(--elev); border: 1px solid var(--line); color: var(--text-2); }

/* composer */
.composer-wrap { padding: 8px 20px 14px; }
.stage { max-width: 780px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); animation: fade 200ms var(--ease); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.composer { max-width: 780px; margin: 0 auto; padding: 10px 10px 8px 14px; border-radius: 22px; background: rgba(24,24,31,.85); border: 1px solid var(--line-2);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 12px 40px rgba(0,0,0,.35); transition: border-color var(--fast), box-shadow var(--fast); }
.composer:focus-within { border-color: rgba(163,91,255,.45); box-shadow: 0 12px 40px rgba(0,0,0,.35), 0 0 0 4px rgba(163,91,255,.08); }
.composer.drag { border-color: var(--accent); }
.composer textarea { display: block; width: 100%; max-height: 220px; resize: none; border: 0; outline: none; background: none; padding: 4px 2px 8px; font-size: 15px; line-height: 1.5; }
.composer textarea::placeholder { color: var(--muted); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bar-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.035);
  font-size: 13px; color: var(--text-2); white-space: nowrap; max-width: 100%; transition: border-color var(--fast), color var(--fast), background var(--fast); }
.chip-btn:hover { border-color: var(--line-2); color: var(--text); }
.chip-btn.on { color: #D9BCFF; border-color: rgba(163,91,255,.4); background: var(--accent-soft); }
.chip-btn .sep { color: var(--muted); }
.chip-btn .chev { color: var(--muted); }
#modelLabel { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.send { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(137,48,253,.35); transition: transform var(--fast) var(--ease), opacity var(--fast), filter var(--fast); }
.send:hover { filter: brightness(1.1); }
.send:active { transform: scale(.94); }
.send:disabled { opacity: .35; box-shadow: none; cursor: default; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
.send.stop { background: var(--text); color: var(--bg); box-shadow: none; }
.send.stop .i-send { display: none; } .send.stop .i-stop { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:not(:empty) { margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.chip.busy { opacity: .6; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.hint { max-width: 780px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* modals */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 180ms var(--ease); }
.sheet { width: min(520px, 100%); max-height: min(720px, 100%); overflow-y: auto; padding: 20px 20px 22px; border-radius: var(--r-xl); background: rgba(20,20,26,.96); border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px rgba(0,0,0,.5); animation: pop 240ms var(--ease); }
.sheet.small { width: min(420px, 100%); }
.sheet h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.sheet p { color: var(--text-2); font-size: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.label { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.seg button { height: 34px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 13.5px; transition: background var(--fast), color var(--fast); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--accent-soft); color: #E2CCFF; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(163,91,255,.35); }
.effort-desc { margin: 8px 2px 0; font-size: 13px !important; color: var(--muted) !important; min-height: 20px; }
.tiers { display: grid; gap: 6px; }
.tier { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; border-radius: var(--r-md); background: rgba(255,255,255,.025); border: 1px solid var(--line);
  transition: border-color var(--fast), background var(--fast); }
.tier:hover:not(:disabled) { border-color: var(--line-2); background: rgba(255,255,255,.045); }
.tier.sel { border-color: rgba(163,91,255,.55); background: var(--accent-soft); }
.tier:disabled { opacity: .45; cursor: default; }
.tier-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: linear-gradient(135deg, rgba(163,91,255,.35), rgba(0,145,255,.2)); flex: none; }
.tier-main { flex: 1; min-width: 0; }
.tier-name { font-size: 14px; font-weight: 600; }
.tier-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier.locked .tier-name, .tier.locked .tier-dot { opacity: .55; }
.tier-tag.need { font-weight: 700; }
.tier-tag.need.plus { color: #9FE3FF; border-color: rgba(0,145,255,.35); background: rgba(0,145,255,.12); }
.tier-tag.need.pro { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.tier-tag { font-size: 11px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; font-size: 13px; color: var(--text-2); padding: 6px 2px; }
.all-models { display: grid; gap: 4px; margin-top: 8px; }
.all-models .tier { padding: 8px 12px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

.toasts { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: rgba(28,28,36,.96); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.45); font-size: 14px; animation: rise 240ms var(--ease); }
.toast.error { border-color: rgba(255,107,122,.4); }
.toast b { display: block; margin-bottom: 2px; }

.only-mobile { display: none; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 260ms var(--ease); box-shadow: 20px 0 60px rgba(0,0,0,.5); background: #0B0A0F; }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity 260ms var(--ease); }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-grid; }
  .top { padding: 0 10px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .thread { padding: 16px 16px 8px; }
  .composer-wrap { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .suggest { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .plan-card .big-num { margin: 0; font-size: 15px; }
  .empty { padding-top: 6vh; }
  .msg.user .bubble { max-width: 88%; }
  .conn span { display: none; }
  kbd { display: none; }
  #modelLabel { max-width: 110px; }
  .hint { display: none; }
  .modal { align-items: end; padding: 0; }
  .sheet { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: up 280ms var(--ease); }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }
.plan-card .plan-models { color: var(--text-2); margin-top: 6px; font-size: 12px; }
.plan-card .plan-models:empty { display: none; }
