:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-soft: #efefec;
  --sidebar: #eaeae6;
  --ink: #171816;
  --muted: #6f716c;
  --faint: #9a9c96;
  --line: rgba(23, 24, 22, .10);
  --line-strong: rgba(23, 24, 22, .17);
  --accent: #12654a;
  --accent-bright: #1b805f;
  --accent-soft: #dcece5;
  --danger: #a83b32;
  --warning: #b57019;
  --shadow: 0 22px 70px rgba(30, 34, 28, .12), 0 2px 10px rgba(30, 34, 28, .05);
  --sidebar-width: 286px;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }
.mobile-only { display: none !important; }
.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.login-view { min-height: 100%; display: grid; place-items: center; position: relative; overflow: hidden; padding: 24px; background: #efefeb; }
.login-home-link { position: absolute; z-index: 2; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); padding: 8px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 620; }
.login-home-link:hover { color: var(--ink); background: rgba(255,255,255,.58); }
.login-view::before { content: ""; position: absolute; inset: 0; opacity: .32; background-image: radial-gradient(rgba(29,35,30,.20) .55px, transparent .55px); background-size: 7px 7px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.login-atmosphere { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(2px); opacity: .42; }
.login-atmosphere-one { top: -300px; right: -130px; background: radial-gradient(circle, rgba(61,135,105,.38), rgba(61,135,105,0) 70%); }
.login-atmosphere-two { bottom: -370px; left: -100px; background: radial-gradient(circle, rgba(194,154,79,.30), rgba(194,154,79,0) 70%); }
.login-card { width: min(430px, 100%); position: relative; padding: 46px; border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: rgba(255,255,255,.74); backdrop-filter: blur(24px); box-shadow: var(--shadow); }
.login-card h1 { font-family: Georgia, "Songti SC", serif; font-weight: 500; font-size: 34px; letter-spacing: -.03em; margin: 18px 0 10px; }
.login-copy { color: var(--muted); margin: 0 0 32px; line-height: 1.6; }
.eyebrow { margin: 0; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .14em; }
.field-label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.password-field { display: grid; gap: 10px; }
.password-field input { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 13px 14px; outline: none; background: rgba(255,255,255,.76); transition: .18s; }
.password-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18,101,74,.10); }
.login-submit { border: 0; border-radius: 12px; background: var(--ink); color: white; padding: 13px 16px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-submit:hover { background: #30322e; }
.form-error { color: var(--danger); min-height: 20px; margin: 10px 0 0; font-size: 13px; }
.login-footnote { text-align: center; color: var(--faint); font-size: 11px; margin: 20px 0 0; }

.brand-mark { width: 27px; height: 27px; position: relative; display: inline-grid; place-items: center; }
.brand-mark span { position: absolute; width: 17px; height: 9px; border: 1.8px solid var(--ink); border-radius: 50%; transform: rotate(0deg); }
.brand-mark span:nth-child(2) { transform: rotate(60deg); }
.brand-mark span:nth-child(3) { transform: rotate(120deg); }
.brand-mark.large { width: 42px; height: 42px; }
.brand-mark.large span { width: 28px; height: 14px; border-width: 2px; }
.brand-mark.hero { width: 54px; height: 54px; }
.brand-mark.hero span { width: 36px; height: 18px; border-color: white; border-width: 2px; }

.app-shell { height: 100%; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { width: var(--sidebar-width); height: 100%; display: flex; flex-direction: column; padding: 14px 12px 12px; background: var(--sidebar); border-right: 1px solid var(--line); transition: transform .25s ease; z-index: 40; }
.sidebar-head { height: 42px; padding: 0 5px 0 9px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 17px; letter-spacing: -.02em; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.icon-button:hover { background: rgba(0,0,0,.055); color: var(--ink); }
.new-chat-button { height: 44px; border: 1px solid rgba(18,101,74,.12); border-radius: 11px; padding: 0 11px; margin: 14px 4px 10px; background: var(--accent); color: white; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; box-shadow: 0 4px 14px rgba(18,101,74,.14); }
.new-chat-button:hover { background: var(--accent-bright); }
.new-chat-button svg { width: 17px; height: 17px; }
.new-chat-button kbd { margin-left: auto; color: rgba(255,255,255,.62); font: 10px ui-monospace, monospace; }
.machine-status-link { height: 38px; margin: -1px 4px 10px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 620; }
.machine-status-link:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.machine-status-link svg { width: 16px; height: 16px; color: var(--accent); }
.machine-status-link i { margin-left: auto; padding: 2px 5px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font: 700 8px ui-sans-serif, sans-serif; letter-spacing: .08em; }
.sidebar-search { margin: 2px 4px 12px; height: 38px; position: relative; display: flex; align-items: center; }
.sidebar-search svg { position: absolute; left: 10px; width: 16px; color: var(--faint); }
.sidebar-search input { width: 100%; height: 100%; border: 1px solid transparent; border-radius: 9px; padding: 0 10px 0 33px; outline: none; background: rgba(255,255,255,.48); font-size: 12px; }
.sidebar-search input:focus { background: white; border-color: var(--line-strong); }
.history-heading { padding: 4px 10px 7px; display: flex; justify-content: space-between; align-items: center; color: var(--faint); text-transform: uppercase; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 2px; text-transform: none; letter-spacing: 0; font-size: 11px; }
.history-list { flex: 1; min-height: 70px; overflow-y: auto; padding: 0 2px; scrollbar-width: thin; }
.history-group-label { padding: 13px 9px 5px; color: var(--faint); font-size: 10px; }
.history-item { width: 100%; border: 0; border-radius: 10px; padding: 9px 9px; text-align: left; background: transparent; display: block; }
.history-item:hover, .history-item.active { background: rgba(255,255,255,.64); }
.history-item.active { box-shadow: inset 2px 0 var(--accent); }
.history-item strong { display: block; font-size: 12.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--faint); font-size: 10px; overflow: hidden; }
.history-item small svg { flex: 0 0 auto; width: 11px; height: 11px; }
.history-item small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { color: var(--faint); padding: 20px 12px; text-align: center; font-size: 12px; }
.usage-panel { margin: 10px 4px 8px; padding: 13px; background: rgba(255,255,255,.48); border: 1px solid rgba(255,255,255,.5); border-radius: 12px; }
.usage-title { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 650; margin-bottom: 11px; }
.plan-badge { color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 6px; font-size: 9px; text-transform: uppercase; }
.usage-row + .usage-row { margin-top: 11px; }
.usage-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.usage-track { height: 4px; overflow: hidden; background: rgba(23,24,22,.10); border-radius: 4px; }
.usage-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s; }
.sidebar-footer { min-height: 50px; padding: 8px 4px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.server-status { min-width: 0; display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgba(181,112,25,.10); }
.status-dot.ready { background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(27,128,95,.10); }
.server-status div { min-width: 0; }
.server-status strong, .server-status small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-status strong { font-size: 10.5px; font-weight: 650; }
.server-status small { max-width: 180px; color: var(--faint); font-size: 9px; margin-top: 2px; }

.main-panel { min-width: 0; height: 100%; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.topbar { height: 62px; flex: 0 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(245,245,243,.86); backdrop-filter: blur(16px); z-index: 20; }
.topbar-left, .topbar-controls { min-width: 0; display: flex; align-items: center; gap: 7px; }
.path-chip { min-width: 0; max-width: min(36vw, 420px); height: 36px; border: 0; border-radius: 9px; padding: 0 9px; background: transparent; display: flex; align-items: center; gap: 7px; }
.path-chip:hover { background: var(--surface-soft); }
.path-chip > svg { width: 16px; color: var(--muted); flex: 0 0 auto; }
.path-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.path-chip .tiny-chevron { width: 11px; transform: rotate(90deg); }
.compact-select { height: 34px; padding: 0 4px 0 9px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.6); }
.compact-select:hover { border-color: var(--line-strong); background: white; }
.compact-select select { max-width: 150px; border: 0; outline: none; background: transparent; font-size: 11px; padding: 0 2px; cursor: pointer; }
.control-label { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.permission-select svg { width: 14px; color: var(--accent); }

.empty-state { flex: 1; min-height: 0; overflow-y: auto; display: grid; place-items: center; padding: 54px 24px 190px; }
.empty-inner { width: min(650px, 100%); text-align: center; }
.empty-orbit { margin: 0 auto 24px; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; position: relative; background: var(--ink); box-shadow: 0 18px 46px rgba(23,24,22,.18); }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; inset: -10px; border: 1px solid rgba(23,24,22,.09); border-radius: 50%; }
.empty-orbit::after { inset: -22px; border-color: rgba(23,24,22,.045); }
.empty-inner h2 { margin: 13px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: clamp(29px, 4vw, 42px); font-weight: 500; letter-spacing: -.035em; }
.empty-inner > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.workspace-card { width: min(470px, 100%); margin: 31px auto 17px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; display: flex; align-items: center; gap: 11px; box-shadow: 0 7px 25px rgba(30,34,28,.045); }
.workspace-card:hover { border-color: rgba(18,101,74,.32); transform: translateY(-1px); }
.workspace-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.workspace-icon svg { width: 19px; }
.workspace-card > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-card small, .workspace-card strong { display: block; }
.workspace-card small { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.workspace-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, monospace; }
.workspace-chevron { width: 15px; color: var(--faint); }
.prompt-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.prompt-suggestions button { border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); padding: 7px 11px; font-size: 11px; }
.prompt-suggestions button:hover { background: white; color: var(--ink); }

.conversation-view { flex: 1; min-height: 0; overflow-y: auto; padding: 34px 24px 190px; scroll-behavior: smooth; }
.conversation-header, .message-list, .thinking-indicator { width: min(820px, 100%); margin-left: auto; margin-right: auto; }
.conversation-header { padding: 0 0 26px; border-bottom: 1px solid var(--line); }
.conversation-header h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.conversation-header p { margin: 6px 0 0; color: var(--faint); font: 10px ui-monospace, monospace; }
.message-list { padding: 20px 0; }
.message { margin: 17px 0; animation: message-in .22s ease both; }
@keyframes message-in { from { opacity: 0; transform: translateY(4px); } }
.message-user { display: flex; justify-content: flex-end; }
.message-user .message-body { max-width: min(78%, 620px); padding: 11px 14px; border-radius: 16px 16px 4px 16px; background: #e3e4df; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-agent { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; }
.agent-avatar { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: white; margin-top: 1px; }
.agent-avatar .brand-mark { transform: scale(.55); }
.agent-avatar .brand-mark span { border-color: white; }
.message-agent .message-body { min-width: 0; font-size: 13px; line-height: 1.72; overflow-wrap: anywhere; }
.message-body p { margin: 0 0 10px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3 { margin: 19px 0 8px; line-height: 1.3; }
.message-body h1 { font-size: 19px; }.message-body h2 { font-size: 17px; }.message-body h3 { font-size: 14px; }
.message-body ul, .message-body ol { padding-left: 20px; }
.message-body code { background: rgba(23,24,22,.07); border-radius: 4px; padding: 2px 4px; font: 11.5px ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-block { position: relative; margin: 12px 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #22241f; color: #e9ebe5; }
.code-block-header { height: 32px; padding: 0 9px 0 12px; display: flex; align-items: center; justify-content: space-between; color: #aeb2a8; border-bottom: 1px solid rgba(255,255,255,.08); font: 9px ui-monospace, monospace; }
.copy-code { width: 25px; height: 25px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; border-radius: 6px; }
.copy-code:hover { background: rgba(255,255,255,.08); }
.copy-code svg { width: 13px; }
.code-block pre { margin: 0; padding: 13px; overflow-x: auto; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.event-card { margin: 10px 0 10px 38px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.5); overflow: hidden; }
.event-card summary { min-height: 39px; padding: 8px 11px; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 11px; }
.event-card summary::-webkit-details-marker { display: none; }
.event-card summary svg { width: 15px; color: var(--muted); }
.event-card summary strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.event-status { flex: 0 0 auto; color: var(--faint); font-size: 9px; }
.event-card pre, .event-content { max-height: 300px; overflow: auto; margin: 0; padding: 11px 13px; border-top: 1px solid var(--line); background: rgba(240,240,236,.72); color: #3d403a; white-space: pre-wrap; overflow-wrap: anywhere; font: 10.5px/1.55 ui-monospace, monospace; }
.reasoning-card { border-style: dashed; background: transparent; }
.reasoning-card summary svg { color: #7c6caa; }
.file-change-list { margin: 0; padding: 10px 28px; border-top: 1px solid var(--line); color: var(--muted); font: 10.5px/1.7 ui-monospace, monospace; }
.thinking-indicator { display: flex; align-items: center; gap: 4px; padding: 0 0 10px 38px; color: var(--faint); }
.thinking-indicator span { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; animation: pulse 1.2s infinite; }
.thinking-indicator span:nth-child(2) { animation-delay: .16s; }.thinking-indicator span:nth-child(3) { animation-delay: .32s; }
.thinking-indicator em { font-size: 10px; font-style: normal; margin-left: 5px; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.composer-wrap { position: absolute; bottom: 0; left: 0; right: 0; z-index: 16; padding: 35px 22px max(13px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 28%); pointer-events: none; }
.composer { width: min(820px, 100%); margin: 0 auto; border: 1px solid var(--line-strong); border-radius: 17px; background: rgba(255,255,255,.95); box-shadow: 0 10px 36px rgba(30,34,28,.10); overflow: hidden; pointer-events: auto; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(18,101,74,.45); box-shadow: 0 12px 40px rgba(30,34,28,.11), 0 0 0 3px rgba(18,101,74,.06); }
.composer textarea { width: 100%; min-height: 54px; max-height: 180px; resize: none; border: 0; outline: none; background: transparent; padding: 15px 16px 7px; font-size: 13px; line-height: 1.5; }
.composer textarea::placeholder { color: var(--faint); }
.composer-bottom { min-height: 42px; padding: 4px 7px 7px 13px; display: flex; align-items: center; gap: 7px; }
.composer-context { min-width: 0; flex: 1; display: flex; align-items: center; gap: 6px; color: var(--faint); }
.composer-context svg { width: 13px; flex: 0 0 auto; }
.composer-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 9.5px ui-monospace, monospace; }
.send-button { width: 34px; height: 34px; border: 0; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: white; }
.send-button:hover { background: var(--accent); }
.send-button:disabled { opacity: .35; cursor: default; }
.send-button svg { width: 16px; }
.stop-button { background: #f0e2df; color: var(--danger); }
.composer-hint { width: min(820px, 100%); margin: 7px auto 0; color: var(--faint); text-align: center; font-size: 9px; pointer-events: auto; }

.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(24,26,22,.34); backdrop-filter: blur(5px); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal-card { width: min(560px, 100%); max-height: min(720px, 90vh); overflow: auto; border: 1px solid rgba(255,255,255,.76); border-radius: 20px; padding: 22px; background: #fafaf8; box-shadow: var(--shadow); animation: modal-in .2s ease; }
@keyframes modal-in { from { transform: translateY(6px) scale(.99); opacity: .6; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 5px 0 0; font: 500 23px Georgia, "Songti SC", serif; }
.path-search { height: 44px; position: relative; display: flex; align-items: center; }
.path-search svg { position: absolute; left: 12px; width: 17px; color: var(--faint); }
.path-search input { width: 100%; height: 100%; border: 1px solid var(--line-strong); border-radius: 11px; background: white; padding: 0 12px 0 38px; outline: none; font: 11px ui-monospace, monospace; }
.path-search input:focus { border-color: var(--accent); }
.breadcrumb-row { display: flex; align-items: center; gap: 6px; min-height: 36px; color: var(--faint); font: 10px ui-monospace, monospace; overflow: hidden; }
.breadcrumb-row button { border: 0; background: transparent; color: var(--accent); padding: 0; }
.breadcrumb-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-list { min-height: 170px; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: white; }
.path-item { width: 100%; height: 45px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.path-item:last-child { border-bottom: 0; }
.path-item:hover { background: var(--surface-soft); }
.path-item svg { width: 17px; color: var(--accent); }
.path-item span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, monospace; }
.path-item .workspace-chevron { color: var(--faint); width: 13px; }
.path-empty { padding: 48px 20px; color: var(--faint); text-align: center; font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.primary-button, .secondary-button { min-height: 38px; border-radius: 10px; padding: 0 14px; font-size: 12px; font-weight: 650; }
.primary-button { border: 1px solid var(--ink); color: white; background: var(--ink); }
.primary-button:hover { background: var(--accent); border-color: var(--accent); }
.secondary-button { border: 1px solid var(--line-strong); background: white; }
.secondary-button:hover { background: var(--surface-soft); }
.danger-text { color: var(--danger); }

.approval-layer { z-index: 120; }
.approval-card { width: min(590px, 100%); padding: 26px; }
.approval-icon { float: right; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #f5e9d6; color: var(--warning); }
.approval-card h2 { margin: 7px 0 8px; font: 500 24px Georgia, "Songti SC", serif; }
.approval-reason { margin: 0 52px 18px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.approval-details { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #232520; color: #ebeee7; }
.approval-detail-row { padding: 8px 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.approval-detail-row:last-child { border: 0; }
.approval-detail-row small { display: block; color: #989e93; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.approval-detail-row code { display: block; max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 10.5px/1.5 ui-monospace, monospace; }
.approval-questions { display: grid; gap: 12px; margin-top: 14px; }
.approval-question label { display: block; font-size: 11px; font-weight: 650; margin-bottom: 6px; }
.approval-question input, .approval-question select { width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 10px; background: white; font-size: 11px; }
.approval-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.approval-queue { min-height: 14px; margin: 10px 0 0; text-align: right; color: var(--faint); font-size: 9px; }

.toast-region { position: fixed; z-index: 200; top: 17px; right: 17px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 350px; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 8px 30px rgba(30,34,28,.14); font-size: 11px; line-height: 1.45; animation: toast-in .2s ease; }
.toast.error { color: var(--danger); }.toast.success { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } }

body.sidebar-collapsed .app-shell { grid-template-columns: 0 minmax(0,1fr); }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); pointer-events: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 850px) {
  :root { --sidebar-width: min(320px, 87vw); }
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); transform: translateX(-105%); box-shadow: 18px 0 55px rgba(22,24,21,.14); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(23,24,22,.30); backdrop-filter: blur(2px); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main-panel { height: 100%; }
  .topbar { height: 56px; padding: 0 10px; }
  .topbar-controls { gap: 4px; }
  .control-label, .permission-select > svg { display: none; }
  .compact-select { height: 32px; padding: 0 1px; background: transparent; }
  .compact-select select { max-width: 92px; font-size: 10px; }
  .model-select { max-width: 105px; }
  .path-chip { padding: 0 4px; max-width: 31vw; }
  .path-chip > svg:first-child, .path-chip .tiny-chevron { display: none; }
  .path-chip span { font-size: 9px; }
  .empty-state { padding: 38px 18px 185px; }
  .empty-orbit { width: 86px; height: 86px; }
  .empty-inner h2 { font-size: 30px; }
  .prompt-suggestions { display: grid; grid-template-columns: 1fr; margin: 0 auto; width: min(340px, 100%); }
  .conversation-view { padding: 24px 15px 180px; }
  .conversation-header h1 { font-size: 22px; }
  .message-user .message-body { max-width: 88%; }
  .event-card { margin-left: 0; }
  .composer-wrap { padding: 30px 10px max(8px, env(safe-area-inset-bottom)); }
  .composer-hint { font-size: 8px; }
  .modal-layer { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 86vh; border-radius: 20px 20px 0 0; padding: 20px 17px max(18px, env(safe-area-inset-bottom)); }
  .approval-card { padding: 22px 17px max(18px, env(safe-area-inset-bottom)); }
  .approval-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .approval-actions .primary-button { grid-column: 1 / -1; grid-row: 1; }
  .login-card { padding: 34px 24px; }
  .login-card h1 { font-size: 29px; }
  .toast-region { left: 10px; right: 10px; top: 10px; }
  .toast { max-width: none; }
}

@media (max-width: 520px) {
  .topbar { gap: 3px; }
  .topbar-left { gap: 0; }
  .topbar-left .icon-button { width: 32px; }
  .path-chip { max-width: 22vw; }
  .compact-select select { max-width: 79px; }
  .permission-select select { max-width: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
