@font-face { font-family: 'Inter'; src: url('assets/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('assets/plus-jakarta-sans.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('assets/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0b1322; --side: #0e1829; --panel: #122036; --panel-2: #172842; --line: rgba(147, 176, 214, .14); --line-2: rgba(147, 176, 214, .24);
  --text: #eef1f6; --text-2: #c3cad6; --muted: #8b96a8; --faint: #66728a;
  --gold: #f2c200; --gold-2: #ffe06b; --gold-ink: #1c1600; --gold-soft: rgba(242, 194, 0, .12);
  --green: #5fd49a; --green-soft: rgba(95, 212, 154, .13); --red: #ff7a7a; --red-soft: rgba(255, 122, 122, .13); --blue: #7fb2ff; --blue-soft: rgba(127, 178, 255, .12);
  --add-bg: rgba(95, 212, 154, .12); --del-bg: rgba(255, 122, 122, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --sans: 'Inter', system-ui, 'Segoe UI', sans-serif; --display: 'Plus Jakarta Sans', 'Inter', sans-serif; --mono: 'JetBrains Mono', Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --side: #eef1f7; --panel: #ffffff; --panel-2: #f1f4f9; --line: rgba(20, 40, 70, .1); --line-2: rgba(20, 40, 70, .18);
  --text: #122036; --text-2: #34445c; --muted: #5d6b82; --faint: #8390a5;
  --gold: #d9a900; --gold-2: #c79a00; --gold-soft: rgba(217, 169, 0, .14);
  --green: #1c9a62; --red: #d24545; --blue: #2f6fdb; --add-bg: rgba(28, 154, 98, .1); --del-bg: rgba(210, 69, 69, .1);
  --shadow: 0 18px 50px rgba(20, 40, 70, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .92em; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100%; }

/* ---------------------------------------------------------------- sidebar */
.sidebar { display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); min-height: 0; }
.side-top { padding: 16px 14px 10px; display: grid; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--display); letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand b { color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 8px 14px; font-weight: 600; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 6px 20px rgba(242, 194, 0, .22); }
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; }
.btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn-new { justify-content: flex-start; width: 100%; }
.side-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 0; }
.side-group { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 8px 6px; display: flex; align-items: center; gap: 6px; }
.side-group .ico { width: 13px; height: 13px; }
.sess { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; color: var(--text-2); }
.sess:hover { background: var(--panel); }
.sess.active { background: var(--panel-2); color: var(--text); }
.sess .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sess .when { font-size: 11px; color: var(--faint); flex: none; }
.sess .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.sess .del { opacity: 0; border: 0; background: none; padding: 2px; color: var(--muted); border-radius: 6px; }
.sess:hover .del { opacity: 1; }
.sess .del:hover { color: var(--red); }
.side-empty { color: var(--faint); font-size: 13px; padding: 14px 10px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.side-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text-2); padding: 6px 8px; border-radius: 8px; }
.side-btn:hover { background: var(--panel); color: var(--text); }
.ver { font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); min-height: 52px; }
.top-title { flex: 1; min-width: 0; font: 600 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-title input { width: 100%; background: var(--panel); border: 1px solid var(--gold); border-radius: 8px; padding: 4px 8px; outline: 0; font: inherit; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font: 12.5px var(--mono); color: var(--text-2); max-width: 46%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip .ico { width: 15px; height: 15px; color: var(--gold); }

.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; gap: 8px; }
.welcome-logo { width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 14px 40px rgba(242, 194, 0, .2); margin-bottom: 10px; }
.welcome h1 { font: 800 32px var(--display); letter-spacing: -.03em; margin: 0; }
.welcome p { max-width: 460px; margin: 0 0 18px; }
.recent { display: grid; gap: 6px; margin-top: 22px; width: min(460px, 100%); }
.recent h3 { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 2px; text-align: left; }
.recent button { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 12px; }
.recent button:hover { border-color: var(--gold); }
.recent .ico { color: var(--gold); }
.recent .name { font-weight: 600; }
.recent .path { color: var(--faint); font: 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; flex: 1; min-width: 0; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.transcript { flex: 1; overflow-y: auto; padding: 26px 24px 20px; scroll-behavior: auto; }
.transcript > * { max-width: 860px; margin-left: auto; margin-right: auto; }

.msg-user { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 11px 15px; margin-top: 18px; margin-bottom: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg-ai { margin: 6px auto 10px; color: var(--text); word-wrap: break-word; }
.msg-ai p { margin: 0 0 10px; }
.msg-ai ul, .msg-ai ol { margin: 0 0 10px; padding-left: 22px; }
.msg-ai li { margin: 3px 0; }
.msg-ai h3, .msg-ai h4, .msg-ai h5, .msg-ai h6 { font-family: var(--display); margin: 16px 0 8px; }
.msg-ai a { color: var(--gold); }
.msg-ai :not(pre) > code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.msg-ai blockquote { margin: 0 0 10px; border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; color: var(--text-2); }
.msg-ai hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 10px; }
.msg-ai table { border-collapse: collapse; font-size: 13px; }
.msg-ai th, .msg-ai td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.msg-ai th { background: var(--panel-2); }
.code-block { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 12px; background: var(--side); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font: 11.5px var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); background: var(--panel); }
.copy-code { border: 0; background: none; color: var(--muted); font-size: 11.5px; padding: 2px 6px; border-radius: 5px; }
.copy-code:hover { color: var(--text); background: var(--panel-2); }
.code-block pre { margin: 0; padding: 11px 13px; overflow-x: auto; font: 12.5px/1.55 var(--mono); }

/* tool rows */
.tool { border: 1px solid var(--line); border-radius: 11px; margin: 6px auto; background: var(--panel); overflow: hidden; }
.tool-head { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 8px 12px; text-align: left; }
.tool-head:hover { background: var(--panel-2); }
.tool-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.tool-ico .ico { width: 15px; height: 15px; }
.tool-title { font-weight: 650; flex: none; }
.tool-detail { font: 12.5px var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tool-stat { font: 12px var(--mono); flex: none; }
.tool-stat .add { color: var(--green); } .tool-stat .del { color: var(--red); }
.tool-state { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.tool-state .ico { width: 15px; height: 15px; }
.tool.is-done .tool-state { color: var(--green); }
.tool.is-failed .tool-state, .tool.is-error .tool-state, .tool.is-stopped .tool-state { color: var(--red); }
.tool.is-denied .tool-state { color: var(--muted); }
.tool.is-waiting { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.tool .chev { color: var(--faint); transition: transform .15s; width: 15px; height: 15px; }
.tool.open .chev { transform: rotate(90deg); }
.tool-body { border-top: 1px solid var(--line); background: var(--side); }
.tool-out { margin: 0; padding: 10px 13px; max-height: 340px; overflow: auto; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.diff { font: 12px/1.6 var(--mono); max-height: 420px; overflow: auto; }
.diff .hunk { color: var(--blue); background: var(--blue-soft); padding: 2px 13px; }
.diff .ln { display: grid; grid-template-columns: 44px 44px 16px minmax(0, 1fr); white-space: pre-wrap; word-break: break-word; }
.diff .n { color: var(--faint); text-align: right; padding-right: 8px; user-select: none; }
.diff .op { user-select: none; color: var(--faint); }
.diff .add { background: var(--add-bg); } .diff .add .op { color: var(--green); }
.diff .del { background: var(--del-bg); } .diff .del .op { color: var(--red); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; }

/* permission */
.ask { border-top: 1px solid var(--line); padding: 12px 13px; display: grid; gap: 10px; background: var(--panel); }
.ask-title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.ask-title .ico { color: var(--gold); }
.ask-cmd { font: 12.5px var(--mono); background: var(--side); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; }
.ask-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-btns .btn { padding: 6px 13px; font-size: 13px; }
.ask-note { display: flex; gap: 8px; }
.ask-note input { flex: 1; background: var(--side); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; outline: 0; }
.ask-note input:focus { border-color: var(--gold); }
.kbd { font: 11px var(--mono); color: var(--faint); margin-left: 2px; }

.notice, .error { display: flex; align-items: flex-start; gap: 9px; border-radius: 10px; padding: 9px 12px; margin: 8px auto; font-size: 13.5px; }
.notice { color: var(--muted); }
.error { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255, 122, 122, .25); }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 12px auto; font-size: 13.5px; }
.thinking .dots { display: inline-flex; gap: 4px; }
.thinking .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s infinite; }
.thinking .dots i:nth-child(2) { animation-delay: .15s; } .thinking .dots i:nth-child(3) { animation-delay: .3s; }
.empty-chat { text-align: center; color: var(--muted); margin-top: 12vh; }
.empty-chat img { width: 54px; height: 54px; border-radius: 15px; margin-bottom: 12px; }
.empty-chat h2 { font: 700 22px var(--display); color: var(--text); margin: 0 0 6px; }
.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.suggest button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--text-2); }
.suggest button:hover { border-color: var(--gold); color: var(--text); }

/* composer */
.composer-wrap { padding: 8px 24px 14px; }
.composer { max-width: 860px; margin: 0 auto; border: 1px solid var(--line-2); background: var(--panel); border-radius: 16px; padding: 10px 10px 8px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); transition: border-color .15s; }
.composer:focus-within { border-color: var(--gold); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; max-height: 240px; min-height: 24px; line-height: 1.5; padding: 2px 0 6px; }
.composer-row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.mode-pill .ico { width: 14px; height: 14px; }
.mode-pill.edits { color: var(--green); border-color: rgba(95, 212, 154, .35); }
.mode-pill.plan { color: var(--blue); border-color: rgba(127, 178, 255, .35); }
.mode-pill.bypass { color: var(--red); border-color: rgba(255, 122, 122, .35); }
.model-label { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .35; cursor: default; }
.send.stop { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); }
.hint { max-width: 860px; margin: 6px auto 0; font-size: 11.5px; color: var(--faint); text-align: center; }

/* menu */
.menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 260px; }
.menu button { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 8px 10px; }
.menu button:hover, .menu button.active { background: var(--panel-2); }
.menu .m-t { font-weight: 600; font-size: 13.5px; }
.menu .m-d { font-size: 12px; color: var(--muted); }
.menu .ico { margin-top: 2px; }

/* settings */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(3, 8, 16, .6); display: grid; place-items: center; padding: 20px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 18px var(--display); margin: 0; }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel); color: var(--text); }
.modal-body { padding: 18px 20px 22px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select { background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; outline: 0; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--gold); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 7px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg button.on { background: var(--gold); color: var(--gold-ink); }
.keybox { display: flex; gap: 8px; align-items: center; }
.keybox input { flex: 1; }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.test-out { font-size: 13px; }
.test-out.ok { color: var(--green); } .test-out.bad { color: var(--red); }
.section-title { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 4px 0 -8px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 900px) { .app { grid-template-columns: 220px minmax(0, 1fr); } }
.flush { margin: 0; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.upd { display: grid; gap: 10px; }
.upd-ver { font-weight: 600; }
.upd-new { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 11px; padding: 12px 14px; display: grid; gap: 8px; }
.upd-new ul { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; }
.upd-bar { flex: 1; height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.upd-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.side-btn { position: relative; }
.side-btn.has-update::after { content: ""; position: absolute; left: 20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--side); }

/* Smile account (Settings) */
.acct { display: grid; gap: 10px; }
.acct-who { display: flex; align-items: center; gap: 10px; }
.acct-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.acct-name { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.acct-name b, .acct-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-plan { font: 800 10.5px var(--sans); letter-spacing: .1em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.acct-plan.pro { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.acct-sync { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.acct-sync input { accent-color: var(--gold); width: 16px; height: 16px; }
.acct-sync input:disabled + span { opacity: .6; }
.acct-code { font: 700 22px var(--mono); letter-spacing: .12em; color: var(--gold); padding: 10px 14px; border: 1px dashed var(--gold); border-radius: 10px; background: var(--gold-soft); text-align: center; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
a.btn-primary { color: var(--gold-ink); }
textarea:disabled { opacity: .6; cursor: not-allowed; }

/* AI usage (web): the button at the bottom right, its panel, and the bar in the composer */
.usage-btn { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2); color: var(--green); box-shadow: var(--shadow); overflow: hidden; }
.usage-btn:hover { border-color: var(--gold); }
.usage-btn .ico { position: relative; z-index: 1; width: 21px; height: 21px; }
.usage-ring { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.usage-ring i { display: block; width: 100%; height: 0; background: var(--green-soft); transition: height .4s; }
.usage-btn.high { color: var(--gold); } .usage-btn.high .usage-ring i { background: var(--gold-soft); }
.usage-btn.full { color: var(--red); border-color: var(--red); } .usage-btn.full .usage-ring i { background: var(--red-soft); }
.usage-btn.unl { color: var(--gold); }
.usage-panel { position: fixed; right: 18px; bottom: 72px; z-index: 41; width: min(340px, calc(100vw - 36px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.up-head { display: flex; align-items: center; justify-content: space-between; }
.usage-panel .btn { justify-content: center; }
.small-note { font-size: 12.5px; }
.ubar { display: grid; gap: 5px; }
.ubar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.ubar-top span:last-child { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.ubar-track { height: 7px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.ubar-track i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--green); transition: width .4s; }
.ubar.high .ubar-track i { background: var(--gold); }
.ubar.full .ubar-track i { background: var(--red); }
.ubar small { color: var(--muted); font-size: 12px; }
.token-bar { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 2px 4px; color: var(--muted); font-size: 12px; border-radius: 6px; }
.token-bar:hover { color: var(--text); background: var(--panel-2); }
.tb-track { width: 64px; height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.tb-track i { display: block; height: 100%; width: 0; background: var(--green); transition: width .4s; }
.token-bar.high .tb-track i { background: var(--gold); }
.token-bar.full .tb-track i { background: var(--red); } .token-bar.full { color: var(--red); }
.token-bar.unl .tb-track i { background: var(--gold); }

/* Chat / Code switch, small, at the top right of the main area */
.mode-tabs { position: absolute; top: 10px; right: 16px; z-index: 6; display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.mode-tabs button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.mode-tabs button .ico { width: 14px; height: 14px; }
.mode-tabs button:hover { color: var(--text); }
.mode-tabs button.on { background: var(--gold); color: var(--gold-ink); }
.topbar { padding-right: 180px; }

/* You, at the bottom left: one row, and the menu above it */
.side-foot { gap: 6px; }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 6px 8px; border-radius: 10px; text-align: left; }
.side-user:hover, .side-user[aria-expanded="true"] { background: var(--panel); }
.su-avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2); font: 700 11.5px var(--sans); }
.su-avatar .ico { width: 15px; height: 15px; }
.side-user.pro .su-avatar { background: var(--gold-soft); border-color: rgba(242, 194, 0, .45); color: var(--gold); }
.su-line { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.su-line b { font-weight: 600; }
.su-plan { color: var(--muted); font-size: 13px; }
.side-user.out .su-line b { color: var(--gold); font-size: 13px; }
.su-chev { width: 14px; height: 14px; color: var(--faint); flex: none; margin-left: 2px; }
.side-btn.icon-only { flex: none; padding: 8px; margin-left: auto; }
.side-btn.icon-only span { display: none; }
.acct-menu { position: fixed; left: 8px; bottom: 58px; z-index: 60; width: 300px; max-height: calc(100vh - 80px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 1px; }
.am-email { padding: 6px 10px 4px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text); text-decoration: none; cursor: pointer; }
.am-item:hover, .am-item.open { background: var(--panel-2); }
.am-item > span { flex: 1; }
.am-item .ico { width: 17px; height: 17px; color: var(--text-2); }
.am-item kbd { font: 12px var(--sans); color: var(--muted); background: none; border: 0; padding: 0; }
.am-item.accent, .am-item.accent .ico { color: var(--blue); }
.am-go { width: 15px !important; height: 15px !important; color: var(--faint) !important; }
.am-bal { font: normal 12.5px var(--mono); color: var(--gold); }
.am-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.am-panel { display: grid; gap: 8px; padding: 4px 10px 10px; }
.am-panel input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; outline: 0; min-width: 0; font-size: 13px; }
.am-panel input:focus { border-color: var(--gold); }
.am-note { margin: 0; font-size: 12px; color: var(--muted); }
.am-full { width: 100%; }
.am-seg { margin: 0; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.brand.home { cursor: pointer; }
