:root {
  --bg: #111410;
  --panel: #181c17;
  --panel-strong: #20251f;
  --line: rgba(231, 239, 216, 0.11);
  --text: #eef2e8;
  --muted: #929b8c;
  --acid: #d9ff72;
  --acid-dark: #19220a;
  --orange: #ff9368;
  --radius: 22px;
  --app-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; max-width: 100%; height: 100%; min-height: 100%; overflow-x: hidden; background: var(--bg); }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; }
body.booting #pairView { visibility: hidden; }
button, textarea, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(100px); opacity: .12; }
.ambient-one { width: 42vw; height: 42vw; top: -18vw; right: -8vw; background: var(--acid); }
.ambient-two { width: 30vw; height: 30vw; bottom: -18vw; left: 18vw; background: #498a71; }

.pair-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.pair-card { width: min(100%, 470px); padding: 44px; border: 1px solid var(--line); border-radius: 30px; background: rgba(24, 28, 23, .88); box-shadow: 0 30px 80px rgba(0,0,0,.36); backdrop-filter: blur(20px); }
.brand-mark { position: relative; width: 49px; height: 49px; margin-bottom: 36px; }
.brand-mark span { position: absolute; width: 30px; height: 30px; border: 7px solid var(--acid); border-radius: 10px; transform: rotate(45deg); }
.brand-mark span:first-child { left: 1px; top: 1px; }
.brand-mark span:last-child { right: 1px; bottom: 1px; border-color: #7b9370; }
.brand-mark.small { width: 28px; height: 28px; margin: 0; }
.brand-mark.small span { width: 18px; height: 18px; border-width: 4px; border-radius: 6px; }
.eyebrow { color: var(--acid); font-size: 11px; letter-spacing: .19em; font-weight: 800; margin: 0 0 15px; }
.pair-card h1 { font-size: clamp(35px, 8vw, 54px); line-height: 1.02; letter-spacing: -.055em; margin: 0 0 22px; font-weight: 650; }
.pair-copy { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 32px; }
label { display: block; color: #b9c1b3; font-size: 12px; font-weight: 650; margin: 0 0 10px; }
#pairCode { width: 100%; height: 66px; border: 1px solid var(--line); border-radius: 16px; padding: 0 18px; color: var(--text); background: #10130f; font-size: 28px; letter-spacing: .32em; text-align: center; outline: none; }
#pairCode:focus { border-color: rgba(217,255,114,.7); box-shadow: 0 0 0 4px rgba(217,255,114,.08); }
#loginPassword, .modal-card input { width: 100%; height: 54px; border: 1px solid var(--line); border-radius: 14px; padding: 0 15px; color: var(--text); background: #10130f; outline: none; }
#loginPassword:focus, .modal-card input:focus { border-color: rgba(217,255,114,.7); box-shadow: 0 0 0 4px rgba(217,255,114,.08); }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: -8px 0 20px; border: 1px solid var(--line); border-radius: 13px; background: #10130f; }
.auth-switch button { height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; }
.auth-switch button.active { color: var(--text); background: var(--panel-strong); }
.primary-button { width: 100%; height: 58px; margin-top: 14px; border: 0; border-radius: 16px; background: var(--acid); color: #15190f; font-weight: 800; cursor: pointer; }
.primary-button span { float: right; font-size: 20px; }
.form-error { min-height: 20px; color: var(--orange); font-size: 13px; margin: 10px 0 0; }
.pair-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 12px; }
.host-selector-link { color: var(--acid); text-decoration: none; }
.pair-meta .host-selector-link { margin-left: auto; white-space: nowrap; }
.host-selector-link:hover { text-decoration: underline; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px rgba(217,255,114,.7); }
.gateway-shell { position: relative; z-index: 1; width: 100%; height: 100dvh; overflow-y: auto; padding: clamp(18px, 4vw, 42px); }
.gateway-panel { width: min(980px, 100%); margin: 0 auto; }
.gateway-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.gateway-logout { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--muted); background: rgba(24,28,23,.8); cursor: pointer; }
.gateway-intro { max-width: 690px; padding: clamp(46px, 8vw, 76px) 0 clamp(38px, 6vw, 56px); }
.gateway-intro h1 { margin: 0 0 18px; font-size: clamp(38px, 7vw, 68px); line-height: 1.01; letter-spacing: -.055em; font-weight: 650; }
.gateway-intro > p:last-child { max-width: 610px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.gateway-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.gateway-section-title h2 { margin: 0; font-size: 13px; letter-spacing: .08em; }
.gateway-section-title span { color: #717a6d; font-size: 11px; }
.gateway-host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; padding-bottom: 34px; }
.gateway-host-card { min-width: 0; min-height: 210px; padding: 23px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; color: inherit; background: rgba(24,28,23,.86); box-shadow: 0 20px 55px rgba(0,0,0,.18); text-decoration: none; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.gateway-host-card:hover { transform: translateY(-2px); border-color: rgba(217,255,114,.35); background: rgba(31,36,30,.94); }
.gateway-host-top { display: flex; justify-content: space-between; align-items: flex-start; }
.gateway-host-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--acid); background: #10130f; font-size: 19px; }
.gateway-host-state { display: inline-flex; align-items: center; gap: 7px; color: #858e80; font-size: 10px; }
.gateway-host-state i { width: 6px; height: 6px; border-radius: 50%; background: #6f786c; }
.gateway-host-state b { font-weight: 650; }
.gateway-host-card.online .gateway-host-state { color: var(--acid); }
.gateway-host-card.online .gateway-host-state i { background: var(--acid); box-shadow: 0 0 10px rgba(217,255,114,.7); }
.gateway-host-card.offline .gateway-host-state { color: var(--orange); }
.gateway-host-card.offline .gateway-host-state i { background: var(--orange); }
.gateway-host-name { margin-top: 24px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 22px; letter-spacing: -.025em; }
.gateway-host-name em { margin-left: 8px; padding: 4px 7px; border-radius: 999px; color: var(--acid); background: rgba(217,255,114,.08); font-size: 9px; font-style: normal; vertical-align: 3px; }
.gateway-host-description { margin-top: 7px; color: #899384; font-size: 12px; line-height: 1.5; }
.gateway-host-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 24px; color: #687164; font-size: 11px; }
.gateway-host-workspace { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gateway-host-arrow { color: var(--acid); font-size: 17px; }
.gateway-error { padding: 18px; border: 1px solid rgba(255,147,104,.3); border-radius: 14px; color: var(--orange); background: rgba(255,147,104,.06); font-size: 13px; }

.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 290px minmax(0,1fr); width: 100%; height: min(var(--app-height), 100dvh); min-height: 0; overflow: hidden; }
.sidebar { border-right: 1px solid var(--line); padding: 24px 18px 18px; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: rgba(17,20,16,.83); backdrop-filter: blur(18px); }
.sidebar-head, .mini-brand { display: flex; align-items: center; justify-content: space-between; }
.mini-brand { justify-content: flex-start; gap: 12px; }
.mini-brand strong { font-size: 15px; letter-spacing: -.01em; }
.new-thread { border: 1px solid rgba(217,255,114,.28); color: var(--acid); background: rgba(217,255,114,.06); border-radius: 13px; padding: 12px 14px; text-align: left; margin: 30px 0; cursor: pointer; font-weight: 700; }
.section-label { color: #697164; font-size: 10px; letter-spacing: .16em; font-weight: 800; margin: 0 8px 10px; }
.thread-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 5px; }
.thread-button { width: 100%; border: 0; border-radius: 12px; background: transparent; padding: 11px 10px; text-align: left; cursor: pointer; }
.thread-button:hover { background: rgba(255,255,255,.035); }
.thread-button.active { background: var(--panel-strong); }
.thread-button strong { display: block; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.thread-button span { display: block; margin-top: 4px; color: #747d70; font-size: 10px; }
.sidebar-foot { flex: 0 0 auto; margin-top: 10px; border-top: 1px solid var(--line); padding: 18px 7px 0; color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot div { display: flex; align-items: center; gap: 8px; }
.sidebar-actions { gap: 3px !important; justify-content: flex-end; flex-wrap: wrap; }
.text-button { border: 0; padding: 0 2px; background: none; color: #757e71; font-size: 11px; cursor: pointer; text-decoration: none; }
.text-button:disabled { cursor: default; opacity: .7; }
#notificationButton[aria-pressed="true"] { color: var(--acid); }

.workspace { position: relative; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; grid-template-areas: "topbar" "content" "composer"; width: 100%; max-width: 100%; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: radial-gradient(circle at 50% 15%, rgba(85,105,75,.08), transparent 36%); }
.topbar { grid-area: topbar; width: 100%; max-width: 100%; min-width: 0; height: 82px; padding: 0 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; overflow: hidden; }
.topbar .eyebrow { color: #687064; margin: 0 0 4px; font-size: 9px; }
.topbar h2 { margin: 0; font-size: 15px; font-weight: 650; max-width: 55vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-status { min-width: 0; display: flex; align-items: center; gap: 9px; }
.usage-summary { border: 1px solid var(--line); background: rgba(24,28,23,.72); color: #9ca595; border-radius: 999px; padding: 7px 10px; font-size: 10px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.usage-summary i { width: 3px; height: 3px; border-radius: 50%; background: #586055; }
.usage-summary.warning { color: var(--orange); border-color: rgba(255,147,104,.25); }
.run-state { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 7px 11px; font-size: 10px; display: flex; align-items: center; gap: 7px; }
.run-state span { width: 5px; height: 5px; background: #737c70; border-radius: 50%; }
.run-state.running { color: var(--acid); border-color: rgba(217,255,114,.22); }
.run-state.running span { background: var(--acid); box-shadow: 0 0 10px var(--acid); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.empty-state { grid-area: content; align-self: center; justify-self: center; width: min(570px, calc(100% - 40px)); text-align: center; padding-bottom: 4vh; }
.empty-glyph { width: 56px; height: 56px; margin: 0 auto 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 18px; color: var(--acid); background: var(--panel); font-size: 30px; }
.empty-state h3 { font-size: clamp(27px, 4vw, 42px); letter-spacing: -.04em; margin: 0 0 14px; }
.empty-state > p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 440px; margin: 0 auto; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.suggestions button { border: 1px solid var(--line); background: rgba(31,36,30,.8); border-radius: 999px; padding: 9px 13px; color: #afb7aa; font-size: 11px; cursor: pointer; }
.suggestions button:hover { border-color: rgba(217,255,114,.35); color: var(--acid); }

.messages { grid-area: content; display: none; width: 100%; max-width: 100%; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 35px max(28px, calc((100% - 780px)/2)) 30px; scroll-behavior: smooth; }
.messages.active { display: block; }
.message { margin-bottom: 28px; }
.message.user { margin-left: auto; max-width: 78%; width: max-content; padding: 13px 16px; border-radius: 17px 17px 4px 17px; background: var(--acid); color: #15190f; white-space: pre-wrap; line-height: 1.52; font-size: 14px; }
.message.agent { width: 100%; max-width: 100%; min-width: 0; line-height: 1.66; color: #dfe5da; font-size: 14px; }
.message.agent .message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.message.agent .message-label, .activity .message-label { color: var(--acid); font-size: 9px; letter-spacing: .15em; font-weight: 800; }
.message-copy { flex: 0 0 auto; border: 0; padding: 5px 7px; border-radius: 7px; color: #8e9789; background: rgba(255,255,255,.035); cursor: pointer; font-size: 10px; }
.message-copy:hover, .message-copy:focus-visible { color: var(--acid); outline: 1px solid rgba(217,255,114,.28); }
.message.agent .content { width: 100%; max-width: 100%; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; -webkit-user-select: text; user-select: text; cursor: text; }
.activity { border: 1px solid var(--line); background: rgba(26,30,25,.8); border-radius: 14px; margin: 12px 0 24px; overflow: hidden; }
.activity summary { list-style: none; padding: 12px 14px; cursor: pointer; color: #a6afa1; font-size: 12px; }
.activity summary::-webkit-details-marker { display: none; }
.activity summary::before { content: "›"; display: inline-block; color: var(--acid); margin-right: 9px; transition: transform .2s; }
.activity[open] summary::before { transform: rotate(90deg); }
.activity pre, .activity .activity-body { border-top: 1px solid var(--line); margin: 0; padding: 13px 15px; color: #899285; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; }
.error-message { color: var(--orange); border-left: 2px solid var(--orange); padding: 8px 12px; font-size: 13px; margin: 15px 0; }
.working-indicator { display: flex; align-items: center; gap: 13px; width: min(100%, 360px); margin: 8px 0 28px; padding: 15px 17px; border: 1px solid rgba(217,255,114,.17); border-radius: 15px; background: rgba(26,30,25,.86); }
.working-dots { display: flex; align-items: center; gap: 4px; height: 22px; }
.working-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); animation: working-bounce 1.15s infinite ease-in-out; }
.working-dots span:nth-child(2) { animation-delay: .14s; }
.working-dots span:nth-child(3) { animation-delay: .28s; }
.working-copy { min-width: 0; }
.working-copy strong { display: block; color: #dce3d6; font-size: 12px; }
.working-copy span { display: block; margin-top: 3px; color: #737c70; font-size: 10px; }
@keyframes working-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .42; } 30% { transform: translateY(-6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .working-dots span { animation-duration: 2.4s; transform: none; } }

.composer-wrap { grid-area: composer; position: relative; z-index: 2; min-width: 0; padding: 14px max(28px, calc((100% - 780px)/2)) 14px; background: linear-gradient(transparent, var(--bg) 16%); }
.composer { border: 1px solid rgba(225,234,216,.15); background: #1a1e19; border-radius: 18px; padding: 10px 11px 9px 13px; box-shadow: 0 18px 45px rgba(0,0,0,.25); }
.composer:focus-within { border-color: rgba(217,255,114,.35); }
.composer textarea { width: 100%; max-height: 180px; resize: none; overflow-y: auto; padding: 5px 3px 10px; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.5; font-size: 14px; }
.composer textarea::placeholder { color: #737b70; }
.composer-foot { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-controls, .composer-actions { display: flex; min-width: 0; align-items: center; gap: 6px; }
.composer-controls { flex: 1 1 0; width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.composer-actions { flex: 0 0 auto; }
.composer-controls::-webkit-scrollbar { display: none; }
.composer-tool, .select-wrap { flex: 0 0 auto; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: #20251f; color: #a9b1a4; }
.composer-tool { width: 31px; padding: 0; cursor: pointer; font-size: 18px; line-height: 1; }
.workspace-tool { width: auto; max-width: 145px; padding: 0 9px; gap: 5px; display: inline-flex; align-items: center; font-size: 11px; }
.workspace-tool span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer-tool:disabled { opacity: .45; cursor: not-allowed; }
.select-wrap { position: relative; display: flex; align-items: center; max-width: 145px; }
.permission-wrap { max-width: 108px; }
.permission-wrap.danger { color: var(--orange); border-color: rgba(255,147,104,.42); background: rgba(255,147,104,.08); }
.select-wrap select { width: 100%; height: 100%; padding: 0 24px 0 9px; border: 0; outline: 0; color: inherit; background: transparent; font-size: 10px; appearance: none; text-overflow: ellipsis; }
.select-wrap::after { content: "⌄"; position: absolute; right: 7px; pointer-events: none; color: #747d70; font-size: 10px; }
.composer-chips { display: flex; gap: 6px; overflow-x: auto; padding: 1px 2px 7px; scrollbar-width: none; }
.composer-chips::-webkit-scrollbar { display: none; }
.composer-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; max-width: 220px; border: 1px solid rgba(217,255,114,.18); border-radius: 9px; padding: 5px 7px; color: #b8c1b1; background: rgba(217,255,114,.05); font-size: 10px; }
.composer-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer-chip button { border: 0; padding: 0; background: none; color: #778071; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.send-button, .cancel-button { border: 0; cursor: pointer; }
.send-button { width: 32px; height: 32px; border-radius: 10px; background: var(--acid); color: #171b11; font-weight: 900; font-size: 18px; }
.send-button:disabled { background: #3f463c; color: #788073; cursor: not-allowed; }
.cancel-button { border-radius: 9px; color: var(--orange); background: rgba(255,147,104,.1); padding: 8px 11px; margin-right: 7px; font-size: 11px; }
.composer-note { color: #596156; text-align: center; font-size: 9px; margin: 8px 0 0; }
.icon-button { border: 0; background: transparent; font-size: 21px; cursor: pointer; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border: 1px solid var(--line); background: #242923; color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 12px; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sidebar-backdrop { display: none; }
.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6,8,6,.75); backdrop-filter: blur(12px); }
.modal-card { width: min(100%, 430px); border: 1px solid var(--line); border-radius: 24px; padding: 28px; background: #181c17; box-shadow: 0 28px 80px rgba(0,0,0,.45); }
.modal-card h2 { margin: 0 0 10px; font-size: 24px; }
.modal-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-card label { margin-top: 14px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 8px; }
.modal-actions .primary-button { margin-top: 0; height: 50px; }
.secondary-button { height: 50px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: transparent; cursor: pointer; }
.folder-card { display: flex; flex-direction: column; max-height: min(720px, calc(100dvh - 32px)); }
.folder-card h2 { flex: 0 0 auto; }
.folder-path { flex: 0 0 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.folder-up { flex: 0 0 auto; align-self: flex-start; border: 0; padding: 7px 0; color: var(--acid); background: transparent; cursor: pointer; font-size: 12px; }
.folder-up:disabled { color: #596156; cursor: default; }
.create-folder { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin: 2px 0 9px; }
.create-folder input { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--text); background: #10130f; outline: none; font-size: 12px; }
.create-folder input:focus { border-color: rgba(217,255,114,.45); }
.create-folder button { border: 1px solid rgba(217,255,114,.24); border-radius: 10px; padding: 0 11px; color: var(--acid); background: rgba(217,255,114,.06); cursor: pointer; font-size: 11px; }
.folder-list { flex: 1 1 auto; min-height: 150px; overflow-y: auto; border: 1px solid var(--line); border-radius: 13px; padding: 6px; background: #10130f; }
.folder-entry { width: 100%; border: 0; border-radius: 9px; padding: 10px; color: #b9c1b3; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
.folder-entry:hover { background: var(--panel-strong); color: var(--text); }
.folder-empty { padding: 22px 10px; color: var(--muted); text-align: center; font-size: 12px; }

.thread-list, .messages, .activity pre, .composer textarea { scrollbar-width: thin; scrollbar-color: #687165 transparent; }
.thread-list::-webkit-scrollbar, .messages::-webkit-scrollbar, .activity pre::-webkit-scrollbar, .composer textarea::-webkit-scrollbar { width: 6px; }
.thread-list::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb, .activity pre::-webkit-scrollbar-thumb, .composer textarea::-webkit-scrollbar-thumb { background: #687165; border-radius: 999px; }
.thread-list::-webkit-scrollbar-track, .messages::-webkit-scrollbar-track, .activity pre::-webkit-scrollbar-track, .composer textarea::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 760px) {
  .mobile-only { display: inline-grid; place-items: center; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: min(86vw, 310px); transform: translateX(-105%); transition: transform .24s ease; box-shadow: 25px 0 70px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 9; inset: 0; background: rgba(0,0,0,.5); }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .workspace { height: 100%; }
  .topbar { height: 70px; padding: max(8px, env(safe-area-inset-top)) 16px 0; justify-content: flex-start; gap: 11px; }
  .topbar > div:nth-child(2) { min-width: 0; flex: 1; }
  .topbar h2 { max-width: 100%; }
  .topbar-status { margin-left: auto; gap: 6px; }
  .usage-summary { padding: 6px 8px; gap: 5px; }
  .run-state { padding: 6px 8px; }
  .messages { padding: 25px 11px 24px 17px; }
  .message.user { max-width: 90%; }
  .message-copy { min-width: 44px; min-height: 32px; }
  .composer-wrap { padding: 12px 13px max(10px, env(safe-area-inset-bottom)); }
  .select-wrap { width: 112px; max-width: 112px; }
  .permission-wrap { width: 94px; max-width: 94px; }
  #skillWrap { width: 76px; max-width: 76px; }
  .empty-state { padding-bottom: 12vh; }
  .pair-card { padding: 34px 24px; }
}

@media (max-width: 430px) {
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .topbar-status { align-items: flex-end; flex-direction: column-reverse; gap: 3px; }
  .run-state { border: 0; background: transparent; padding: 0 3px; }
  .usage-summary { border: 0; background: transparent; padding: 0 3px; }
  .composer-note { margin-top: 5px; }
}
