:root {
  --page: #07101d;
  --panel: rgba(11, 24, 40, .9);
  --panel-soft: rgba(15, 31, 51, .78);
  --line: rgba(132, 169, 207, .18);
  --line-bright: rgba(70, 183, 247, .45);
  --ink: #e9f3ff;
  --muted: #91a7bd;
  --blue: #46b7f7;
  --cyan: #25c2e3;
  --cyan-soft: rgba(37, 194, 227, .12);
  --green: #43d39e;
  --gold: #ffbe0b;
  --red: #ff5c75;
  --shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html, body { width: 100%; max-width: 100%; min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 194, 227, .14), transparent 30rem),
    radial-gradient(circle at 85% 80%, rgba(70, 183, 247, .13), transparent 32rem),
    var(--page);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgba(126, 180, 221, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 180, 221, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, textarea:disabled { cursor: not-allowed; opacity: .52; }
.hidden { display: none !important; }
.login-screen { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-card { width: min(100%, 390px); padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); text-align: center; backdrop-filter: blur(18px); }
.login-card .brand-mark { width: 52px; height: 52px; margin: 0 auto 18px; }
.login-card .brand-logo { width: 34px; height: 34px; }
.login-card h1 { margin: 10px 0 8px; font-size: 25px; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.login-card form { display: grid; gap: 8px; text-align: left; }
.login-card label { margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: rgba(18, 38, 60, .72); }
.login-card input:focus { border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(37, 194, 227, .1); }
.password-field { display: flex; gap: 6px; }
.password-field input { min-width: 0; }
.password-field .icon-button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; }
.login-error { min-height: 20px; color: var(--red); font-size: 12px; }
.login-status { min-height: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.account-label { color: var(--muted); font-size: 11px; }

.ambient { position: fixed; z-index: -1; width: 20rem; height: 20rem; border-radius: 50%; filter: blur(80px); opacity: .18; pointer-events: none; }
.ambient-one { top: 12%; left: -8rem; background: var(--cyan); animation: drift 18s ease-in-out infinite alternate; }
.ambient-two { right: -8rem; bottom: 5%; background: var(--blue); animation: drift 23s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(4rem, -2rem) scale(1.18); } }

.app-shell { display: flex; width: 100%; max-width: 100%; height: 100vh; height: 100dvh; min-width: 0; min-height: 0; flex-direction: column; padding: 24px; overflow: hidden; }
.topbar, .command-header, .sidebar-heading, .composer-footer { display: flex; align-items: center; }
.topbar { justify-content: space-between; width: 100%; min-width: 0; max-width: 1540px; margin: 0 auto 16px; }
.brand {
  display: flex; min-width: 0; align-items: center; gap: 12px;
  padding: 4px 6px; border: 1px solid transparent; border-radius: 10px;
  color: inherit; background: transparent; text-align: left;
  transition: .2s ease;
}
.brand:hover, .brand:focus-visible { border-color: var(--line); background: rgba(37, 194, 227, .06); }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); box-shadow: 0 0 24px rgba(37, 194, 227, .16); font-weight: 800; }
.brand-logo { width: 22px; height: 22px; object-fit: contain; }
h1 { margin: 0; color: #fff; font-size: 20px; letter-spacing: .15em; }
.workspace, .eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .13em; }
.connection { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
#connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px currentColor; }
#connection-dot.connected { color: var(--green); background: var(--green); }
#connection-dot.reconnecting { color: var(--gold); background: var(--gold); animation: pulse 1s infinite; }

.app-grid {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  flex: 1 1 0;
  max-width: 1540px;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar { min-width: 0; min-height: 0; padding: 18px; border-right: 1px solid var(--line); background: rgba(5, 16, 29, .55); overflow-y: auto; }
.sidebar-heading { justify-content: space-between; margin: 24px 0 9px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.session-controls { display: grid; gap: 7px; }
.session-controls input, .session-controls select { min-width: 0; width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--muted); background: rgba(18, 38, 60, .72); font-size: 11px; }
.session-controls input:focus, .session-controls select:focus { border-color: var(--line-bright); }
.session-control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: rgba(17, 36, 57, .5); }
.selection-toolbar span { flex: 1 0 100%; color: var(--cyan); font-size: 11px; }
.session-list { display: grid; gap: 5px; min-width: 0; max-height: 330px; overflow-y: auto; }
.session-item { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 7px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; transition: .2s ease; }
.session-item:hover, .session-item.selected { border-color: var(--line-bright); color: var(--ink); background: var(--cyan-soft); }
.session-checkbox { flex: 0 0 auto; accent-color: var(--cyan); }
.session-open { display: grid; min-width: 0; flex: 1; padding: 2px; border: 0; color: inherit; background: transparent; text-align: left; }
.session-title, .session-open small, .session-open em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-open small, .session-open em { color: var(--muted); font-size: 10px; font-style: normal; }
.session-open em { margin-top: 2px; color: #7590a8; }
.session-delete { flex: 0 0 auto; padding: 2px 5px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
.session-delete:hover { color: var(--red); background: rgba(255, 92, 117, .12); }
.empty { padding: 10px 0; color: var(--muted); font-size: 12px; }
.quick-grid { display: grid; gap: 6px; }
.quick-command, .prompt-chip { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: rgba(17, 36, 57, .55); text-align: left; transition: .2s ease; }
.quick-command:hover, .prompt-chip:hover { border-color: var(--line-bright); color: var(--cyan); background: var(--cyan-soft); }

.conversation-panel { position: relative; display: flex; width: 100%; max-width: 100%; min-width: 0; min-height: 0; flex-direction: column; }
.command-header { flex: 0 0 auto; justify-content: space-between; min-height: 76px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(10, 27, 44, .65), transparent); }
.status-cluster { display: flex; min-width: 0; align-items: center; gap: 12px; }
.status-cluster strong { display: block; margin-top: 1px; color: #fff; font-size: 14px; letter-spacing: .12em; }
.status-detail { display: block; color: var(--muted); font-size: 11px; }
.status-orb { display: block; width: 18px; height: 18px; border: 2px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 22px currentColor; }
.status-orb.idle { color: var(--green); border-color: var(--green); }
.status-orb.thinking, .status-orb.listening, .status-orb.working, .status-orb.speaking { color: var(--cyan); animation: pulse 1.4s ease-in-out infinite; }
.status-orb.waiting { color: var(--gold); border-color: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.status-orb.completed { color: var(--green); border-color: var(--green); }
.status-orb.error { color: var(--red); border-color: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 7px currentColor; transform: scale(.78); } }
.header-metrics { display: flex; min-width: 0; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }

.git-menu { position: relative; }
.git-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 220;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 190px; padding: 8px; border: 1px solid var(--line-bright); border-radius: 10px;
  background: rgba(9, 22, 38, .97); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 20px rgba(37, 194, 227, .12);
  backdrop-filter: blur(10px);
}
.git-dropdown-label { padding: 4px 6px 2px; color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.git-dropdown-divider { height: 1px; margin: 5px 2px; background: var(--line); }
.git-repo-select { width: 100%; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #0f2036; font-size: 11px; }
.git-action {
  width: 100%; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px; text-align: left;
  color: var(--ink); background: transparent; font-size: 12px; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.git-action:hover, .git-action:focus-visible { border-color: var(--line-bright); background: rgba(37, 194, 227, .1); }
.git-action.danger-item { color: var(--red); }
.git-action.danger-item:hover { background: rgba(255, 92, 117, .12); border-color: rgba(255, 92, 117, .5); }
.git-status-line { padding: 0 22px 8px; color: var(--muted); font-size: 11px; }
.git-fix-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 22px 10px; padding: 9px 12px; border: 1px solid rgba(255, 92, 117, .45); border-radius: 8px; color: #ffd7de; background: rgba(255, 92, 117, .09); font-size: 11px; }
.git-fix-hint .git-fix-reason { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.git-fix-hint button { flex: 0 0 auto; padding: 5px 10px; border: 1px solid var(--line-bright); border-radius: 6px; color: var(--ink); background: rgba(37, 194, 227, .12); font-size: 11px; cursor: pointer; }
.git-fix-hint button:hover { background: rgba(37, 194, 227, .22); }

.conversation { flex: 1 1 auto; width: 100%; max-width: 100%; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 26px; scroll-behavior: smooth; overscroll-behavior: contain; }
.welcome { max-width: 650px; margin: 65px auto; color: var(--muted); text-align: center; }
.welcome h2 { margin: 14px 0 8px; color: #fff; font-size: clamp(20px, 3vw, 32px); letter-spacing: -.03em; line-height: 1.2; }
.welcome p { max-width: 530px; margin: 0 auto 20px; }
.welcome-orb { display: grid; width: 78px; height: 78px; margin: 0 auto; place-items: center; border: 1px solid var(--line-bright); border-radius: 50%; box-shadow: 0 0 45px rgba(37, 194, 227, .22), inset 0 0 25px rgba(37, 194, 227, .12); }
.welcome-orb span { width: 26px; height: 26px; border: 2px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 22px var(--cyan); animation: pulse 1.6s ease-in-out infinite; }
.voice-launch { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px; padding: 11px 16px; border: 1px solid var(--line-bright); border-radius: 8px; color: var(--cyan); background: var(--cyan-soft); }

/* Voice-first greeting: just the pulsing orb, the greeting line, and a
   live status hint. The floating mic (bottom-left) and close X (top-right)
   are the only interactive controls — everything else is spoken. */
.welcome.voice-first { max-width: 560px; margin: 0 auto; }
.welcome.voice-first .welcome-orb { width: 108px; height: 108px; }
.welcome.voice-first .welcome-orb span { width: 34px; height: 34px; }
.welcome.voice-first h2 { margin-top: 24px; font-size: clamp(24px, 4vw, 40px); }
.welcome-hint { max-width: 460px; margin: 0 auto; color: var(--cyan); font-size: 13px; letter-spacing: .02em; min-height: 18px; }

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 20%, rgba(37, 194, 227, .16), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(70, 183, 247, .14), transparent 45%),
    rgba(4, 10, 18, .94);
  background-size: 200% 200%;
  backdrop-filter: blur(22px);
  animation: welcome-fade .28s ease-out, welcome-drift 18s ease-in-out infinite;
}
.welcome-overlay.hidden { display: none; }
.welcome-overlay-content { width: 100%; }
.welcome-overlay-content .welcome { margin: 0 auto; }
.welcome-close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 201;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(17, 36, 57, .72);
  font-size: 15px;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.welcome-close:hover, .welcome-close:focus-visible { color: var(--cyan); background: var(--cyan-soft); border-color: var(--line-bright); transform: scale(1.05); }
@keyframes welcome-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes welcome-fade { from { opacity: 0; } to { opacity: 1; } }
.prompt-chip { font-size: 12px; text-align: center; }

.message-row { display: flex; width: 100%; min-width: 0; margin: 0 0 14px; animation: appear .25s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.message-row.user { justify-content: flex-end; }
.bubble { max-width: 84%; min-width: 0; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(24, 42, 63, .78); overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.user .bubble { border-color: rgba(37, 194, 227, .3); background: var(--cyan-soft); }
.message-row.streaming .bubble::after { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); content: ""; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.error .bubble { color: #ffb4ba; border-color: rgba(255, 92, 117, .35); background: rgba(103, 24, 36, .35); }
.activity .bubble { width: min(84%, 780px); color: var(--gold); border-color: rgba(255, 190, 11, .25); background: rgba(58, 45, 4, .3); }
.activity summary { cursor: pointer; font-weight: 600; }
.bubble pre { position: relative; max-width: 100%; margin: 10px 0 0; padding: 14px; overflow-x: auto; border-radius: 6px; color: #d9e8f8; background: #07111e; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bubble code { display: block; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: inherit; }
.copy-code, .copy-response { padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.copy-code { position: absolute; top: 7px; right: 7px; }
.copy-response { float: right; margin-left: 12px; }
.completion-card { margin-top: 10px; padding: 12px; border: 1px solid rgba(67, 211, 158, .35); border-radius: 8px; color: var(--green); background: rgba(22, 74, 55, .2); }

.debug-panel { margin: 0 22px 10px; border: 1px solid var(--line); border-radius: 7px; }
.debug-panel summary { padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.debug-panel pre { max-height: 220px; margin: 0; padding: 12px; overflow: auto; color: #acc5db; background: rgba(4, 13, 23, .72); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-card { margin: 0 22px 12px; padding: 15px; border: 1px solid rgba(255, 190, 11, .55); border-radius: 9px; color: var(--ink); background: rgba(61, 46, 4, .3); }
.request-card h3 { margin: 0 0 6px; color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.request-card pre { max-height: 160px; overflow: auto; padding: 10px; color: #dce9f5; background: rgba(0, 0, 0, .25); white-space: pre-wrap; overflow-wrap: anywhere; }
.request-actions, .input-row { display: flex; gap: 8px; margin-top: 10px; }
.jump-latest { position: absolute; right: 28px; bottom: 186px; z-index: 2; max-width: calc(100% - 56px); padding: 7px 11px; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--ink); background: rgba(9, 26, 43, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-size: 11px; white-space: normal; }
.routing-options { display: grid; gap: 6px; margin-top: 10px; }
.routing-choice { display: grid; gap: 2px; text-align: left; }
.routing-choice small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-row input { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: rgba(5, 16, 29, .75); }
.choice { margin: 5px 5px 0 0; }

.composer { flex: 0 0 auto; width: 100%; max-width: 100%; min-width: 0; padding: 14px 22px 18px; border-top: 1px solid var(--line); background: rgba(6, 17, 29, .45); }
.composer textarea { display: block; width: 100%; max-width: 100%; min-width: 0; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: rgba(18, 38, 60, .72); overflow-wrap: anywhere; }
.composer textarea:focus { border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(37, 194, 227, .1); }
.composer-footer { justify-content: space-between; gap: 12px; margin-top: 9px; }
.composer-tools, .composer-actions { display: flex; min-width: 0; align-items: center; gap: 10px; }
.composer-tools { flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.voice-status { min-width: 0; color: var(--red); overflow-wrap: anywhere; white-space: normal; }
.voice-status.ready { color: var(--green); }
.voice-status.listening { color: var(--cyan); }
.voice-status.processing { color: var(--gold); }
.mic-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--cyan); background: var(--cyan-soft); transition: box-shadow .2s ease, border-color .2s ease, color .2s ease, background .2s ease; }
.mic-button.listening { animation: pulse 1s infinite; }
.mic-button.active { border-color: var(--cyan); color: var(--page); background: var(--cyan); box-shadow: 0 0 0 4px rgba(37, 194, 227, .18), 0 0 14px rgba(37, 194, 227, .55); }
.mic-button.muted { border-color: var(--line); color: var(--muted); background: transparent; opacity: .65; }
.voice-duration { min-width: 3.2rem; color: var(--green); font-variant-numeric: tabular-nums; }
.secondary.small { padding: .35rem .55rem; font-size: .72rem; }

.global-voice-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 260;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(37, 194, 227, .28), rgba(11, 24, 40, .92));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 rgba(37, 194, 227, .5);
  font-size: 22px;
  transition: transform .15s ease, box-shadow .2s ease;
}
.global-voice-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(0, 0, 0, .45), 0 0 18px rgba(37, 194, 227, .35); }
.global-voice-fab.active { animation: pulse 1.1s infinite; border-color: var(--cyan); box-shadow: 0 0 0 6px rgba(37, 194, 227, .12), 0 10px 30px rgba(0, 0, 0, .4); }

.global-voice-panel {
  position: fixed;
  left: 24px;
  bottom: 92px;
  z-index: 261;
  width: min(320px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.global-voice-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.global-voice-panel-title { color: var(--cyan); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.global-voice-status { min-height: 1.2em; color: var(--ink); font-size: 13px; }
.global-voice-transcript { min-height: 1.2em; margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.global-voice-fallback { display: flex; gap: 6px; margin-top: 10px; }
.global-voice-fallback input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: rgba(5, 16, 29, .75); }
.global-voice-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.voice-diagnostics { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: rgba(4, 13, 23, .72); font-size: 11px; }
.voice-diagnostics dl { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); gap: 4px 12px; margin: 0; }
.voice-diagnostics dt { color: var(--muted); }
.voice-diagnostics dd { margin: 0; color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.toggle input { accent-color: var(--cyan); }
.voice-selector { width: 150px; max-width: 100%; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #10243a; font-size: 11px; }
.primary, .secondary, .danger, .icon-button { border-radius: 6px; }
.primary, .secondary, .danger { padding: 8px 14px; border: 1px solid transparent; }
.primary { color: #03101b; background: var(--cyan); box-shadow: 0 0 18px rgba(37, 194, 227, .16); }
.secondary { color: var(--muted); border-color: var(--line); background: rgba(17, 36, 57, .72); }
.danger { color: var(--red); border-color: rgba(255, 92, 117, .35); background: transparent; }
.small { padding: 5px 9px; font-size: 11px; }
.full-width { width: 100%; }
.icon-button { padding: 4px 7px; border: 0; color: var(--muted); background: transparent; font-size: 18px; }

.code-sidebar { padding-top: 18px; }
.code-tree { display: block; padding-top: 8px; font-size: 12px; }
.code-tree-item { display: flex; align-items: center; width: 100%; gap: 6px; padding: 5px 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.code-tree-item:hover, .code-tree-item:focus-visible { color: var(--ink); background: var(--cyan-soft); }
.code-tree-icon { flex: 0 0 auto; width: 12px; color: var(--cyan); font-size: 10px; }
.code-tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-tree-error { padding: 6px 8px; color: var(--red); font-size: 11px; }

.code-search-form { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.code-search-input { flex: 1 1 auto; min-width: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: rgba(4, 13, 23, .55); font-size: 12px; }
.code-search-input:focus-visible { outline: 0; border-color: var(--cyan); }
.code-search-form .icon-button { font-size: 13px; padding: 4px 6px; }
.code-search-results { max-height: 220px; margin-top: 8px; padding-right: 2px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.code-search-summary { padding: 4px 8px 8px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.code-search-hit { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.code-search-hit:hover, .code-search-hit:focus-visible { color: var(--ink); background: var(--cyan-soft); }
.code-search-hit-path { display: block; overflow: hidden; color: var(--cyan); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.code-search-hit-line { display: block; overflow: hidden; margin-top: 2px; font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.code-search-empty { padding: 8px; color: var(--muted); font-size: 11px; }

.code-find-bar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: rgba(4, 13, 23, .4); }
.code-find-input { flex: 0 1 240px; min-width: 0; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: rgba(4, 13, 23, .55); font-size: 12px; }
.code-find-input:focus-visible { outline: 0; border-color: var(--cyan); }
.code-find-count { min-width: 60px; color: var(--muted); font-size: 11px; }
.code-find-bar .icon-button { font-size: 13px; padding: 4px 6px; }

.code-panel { min-height: 0; }
.code-panel #code-file-path { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.code-editor-wrap { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
.code-gutter { flex: 0 0 auto; width: 46px; padding: 14px 8px; overflow: hidden; color: #5c7185; background: rgba(4, 13, 23, .55); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; white-space: pre; }
.code-editor { flex: 1 1 auto; min-width: 0; padding: 14px; border: 0; outline: 0; resize: none; color: var(--ink); background: transparent; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; overflow: auto; tab-size: 2; }

@media (max-width: 930px) {
  .header-metrics span { display: none; }
}
@media (min-width: 931px) {
  html, body { height: auto; min-height: 100%; }
  .app-shell { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .app-grid { height: auto; min-height: min(78vh, 860px); overflow: visible; }
  .sidebar { max-height: none; }
  .conversation-panel { min-height: min(70vh, 760px); overflow: visible; }
  .conversation { min-height: min(56vh, 640px); max-height: none; }
}
@media (max-width: 760px) {
  .app-shell { height: auto; min-height: 100vh; min-height: 100dvh; padding: 10px; overflow: visible; }
  .app-grid { grid-template-columns: 1fr; grid-template-rows: auto auto; flex: 0 0 auto; height: auto; overflow: visible; }
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .brand { flex: 1 1 180px; }
  .connection { flex: 1 1 180px; flex-wrap: wrap; justify-content: flex-end; }
  .sidebar { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .session-list { grid-template-columns: 1fr; max-height: 280px; }
  .session-control-row { grid-template-columns: 1fr; }
  .quick-section { display: none; }
  .conversation-panel { min-height: 0; }
  .conversation { flex: 0 0 auto; height: clamp(420px, 60dvh, 600px); min-height: 420px; max-height: 600px; padding: 16px; }
  .command-header { flex-wrap: wrap; gap: 8px; padding: 13px 15px; }
  .header-metrics { width: 100%; justify-content: flex-end; }
  .composer { padding: 12px 15px calc(15px + env(safe-area-inset-bottom)); }
  .composer-footer { align-items: flex-end; flex-direction: column; }
  .composer-tools, .composer-actions { width: 100%; }
  .composer-actions { justify-content: flex-end; }
  .bubble, .activity .bubble { max-width: 94%; }
  .jump-latest { right: 12px; bottom: 190px; max-width: calc(100% - 24px); }
  .toggle { white-space: normal; }
  .voice-selector { width: 100%; }
  .login-card { padding: 26px 20px; }
  .account-label { display: none; }
}
