:root {
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
--fs-xs: 0.75rem;
--fs-sm: 0.8125rem;
--fs-md: 0.9375rem;
--fs-lg: 1.0625rem;
--fs-xl: 1.25rem;
--lh: 1.55;
--sp-1: 4px;
--sp-2: 8px;
--sp-3: 12px;
--sp-4: 16px;
--sp-5: 24px;
--sp-6: 32px;
--r-sm: 6px;
--r-md: 10px;
--r-lg: 14px;
--r-pill: 999px;
--nav-w: 288px;
--side-w: 380px;
--content-w: 780px;
--touch: 44px;
--topbar-h: 52px;
--bg: #f6f6f3;
--surface: #ffffff;
--surface-2: #efefeb;
--surface-3: #e6e6e1;
--border: #dedfd9;
--border-strong: #c9cac3;
--text: #1c1d1b;
--text-2: #565853;
--text-3: #686a64;
--accent: #2d6a58;
--accent-hover: #245647;
--accent-text: #ffffff;
--accent-soft: #e2eee8;
--danger: #b42318;
--danger-soft: #fdecea;
--warn: #8a5300;
--warn-soft: #fff3d6;
--ok: #2b7a3d;
--ok-soft: #e5f3e8;
--info: #285d9a;
--info-soft: #e7eff9;
--user-bubble: #e9ece6;
--code-bg: #f3f3ef;
--code-text: #1f2a24;
--diff-add: #e3f3e6;
--diff-del: #fbe8e6;
--focus: #2d6a58;
--scrim: rgba(20, 22, 20, 0.38);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 24px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.18);
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #121413;
--surface: #191b1a;
--surface-2: #212423;
--surface-3: #2a2e2c;
--border: #2d3130;
--border-strong: #3d4240;
--text: #e7e8e5;
--text-2: #a8aca6;
--text-3: #8a8f89;
--accent: #6cc79a;
--accent-hover: #86d6ad;
--accent-text: #0b1a12;
--accent-soft: #1c3228;
--danger: #ff8f84;
--danger-soft: #3a1e1b;
--warn: #f0c068;
--warn-soft: #33290f;
--ok: #7fd394;
--ok-soft: #1a3020;
--info: #8ab8ec;
--info-soft: #182637;
--user-bubble: #242826;
--code-bg: #151716;
--code-text: #dfe6e1;
--diff-add: #173022;
--diff-del: #3a1c1a;
--focus: #86d6ad;
--scrim: rgba(0, 0, 0, 0.55);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--bg: #121413;
--surface: #191b1a;
--surface-2: #212423;
--surface-3: #2a2e2c;
--border: #2d3130;
--border-strong: #3d4240;
--text: #e7e8e5;
--text-2: #a8aca6;
--text-3: #8a8f89;
--accent: #6cc79a;
--accent-hover: #86d6ad;
--accent-text: #0b1a12;
--accent-soft: #1c3228;
--danger: #ff8f84;
--danger-soft: #3a1e1b;
--warn: #f0c068;
--warn-soft: #33290f;
--ok: #7fd394;
--ok-soft: #1a3020;
--info: #8ab8ec;
--info-soft: #182637;
--user-bubble: #242826;
--code-bg: #151716;
--code-text: #dfe6e1;
--diff-add: #173022;
--diff-del: #3a1c1a;
--focus: #86d6ad;
--scrim: rgba(0, 0, 0, 0.55);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
height: 100%;
}
body {
margin: 0;
height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font);
font-size: var(--fs-md);
line-height: var(--lh);
-webkit-font-smoothing: antialiased;
overflow: hidden;
overscroll-behavior: none;
}
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
body { font-size: 1rem; }
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
code, pre, kbd, samp { font-family: var(--mono); font-size: 0.9em; }
a { color: var(--accent); text-underline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-4) 0; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
width: 20px;
height: 20px;
flex: none;
fill: none;
stroke: currentColor;
stroke-width: 1.75;
stroke-linecap: round;
stroke-linejoin: round;
pointer-events: none;
}
.ic-sm { width: 16px; height: 16px; }
button, input, select, textarea {
font: inherit;
color: inherit;
}
button { cursor: pointer; }
button:disabled { cursor: default; }
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--sp-2);
min-height: 36px;
padding: 0 var(--sp-3);
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--surface);
color: var(--text);
font-size: var(--fs-sm);
font-weight: 500;
white-space: nowrap;
max-width: 100%;
transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn > span { min-width: 0; white-space: normal; overflow-wrap: break-word; text-align: center; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.95); background: var(--danger); }
.btn-stop { border-color: var(--border-strong); color: var(--danger); }
.btn-block { width: 100%; min-height: var(--touch); font-size: var(--fs-md); }
.btn-sm { min-height: 30px; padding: 0 var(--sp-2); font-size: var(--fs-xs); border-radius: var(--r-sm); }
.icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
flex: none;
border: 0;
border-radius: var(--r-md);
background: transparent;
color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-expanded="true"] { color: var(--accent); }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], textarea, select.input {
width: 100%;
min-height: 40px;
padding: var(--sp-2) var(--sp-3);
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--surface);
color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; }
.field { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.field label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.hint { font-size: var(--fs-xs); color: var(--text-3); }
.switch { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 0; cursor: pointer; }
.switch input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.switch b { display: block; font-weight: 600; }
.switch small { display: block; color: var(--text-3); font-size: var(--fs-xs); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }
.topbar, .nav-head, .nav-foot, .chat-row, .btn, .icon-btn, .chip, .tabs, .composer-bar, .activity-head,
.toasts, .jump, .veil-mark, .boot, .msg-actions {
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
}
svg, img.icon { -webkit-user-drag: none; }
.sr-only {
position: absolute !important;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden; clip: rect(0 0 0 0);
white-space: nowrap; border: 0;
}
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: var(--sp-2); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
display: inline-flex; align-items: center; gap: 4px;
padding: 1px 8px;
border-radius: var(--r-pill);
background: var(--surface-2);
color: var(--text-2);
font-size: var(--fs-xs);
font-weight: 500;
line-height: 1.6;
white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.spinner {
display: inline-block;
width: 14px; height: 14px;
flex: none;
border: 2px solid var(--border-strong);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot-ok { background: var(--ok); }
.dot-busy { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
.boot {
position: fixed; inset: 0;
display: grid; place-content: center; justify-items: center; gap: var(--sp-3);
padding: var(--sp-5);
background: var(--bg);
color: var(--text-2);
text-align: center;
z-index: 50;
}
.boot-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.boot-late { max-width: 34em; font-size: var(--fs-sm); color: var(--text-3); opacity: 0; animation: appear 0.3s 8s forwards; }
@keyframes appear { to { opacity: 1; } }
body.ready .boot { display: none; }
.menu {
position: fixed;
min-width: 200px;
padding: 4px;
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--surface);
box-shadow: var(--shadow-lg);
z-index: 60;
}
.menu-item {
display: flex; align-items: center; gap: var(--sp-2);
width: 100%; min-height: 40px;
padding: 0 var(--sp-3);
border: 0; border-radius: var(--r-sm);
background: transparent; color: var(--text);
font-size: var(--fs-sm); text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.chat-title[role="button"] { cursor: pointer; border-radius: var(--r-sm); }
.chat-title[role="button"]:hover { color: var(--accent); }

.app {
position: fixed;
top: 0; left: 0; right: 0;
height: var(--app-h, 100dvh);
transform: translateY(var(--vv-top, 0px));
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr);
grid-template-areas: "top" "main";
background: var(--bg);
}
.skip {
position: absolute; left: var(--sp-2); top: var(--sp-2); z-index: 60;
padding: var(--sp-2) var(--sp-3);
background: var(--accent); color: var(--accent-text);
border-radius: var(--r-md);
transform: translateY(calc(-100% - 2 * var(--sp-2) - env(safe-area-inset-top)));
}
.skip:focus { transform: none; }
.topbar {
grid-area: top;
position: sticky;
top: 0;
display: flex;
align-items: center;
gap: var(--sp-1);
min-height: var(--topbar-h);
padding: env(safe-area-inset-top) max(var(--sp-2), env(safe-area-inset-right)) 0 max(var(--sp-2), env(safe-area-inset-left));
border-bottom: 1px solid var(--border);
background: var(--bg);
z-index: 5;
}
.topbar-title { flex: 1 1 auto; min-width: 0; padding: 0 var(--sp-1); }
.chat-title {
font-size: var(--fs-md);
font-weight: 600;
line-height: 1.3;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
transform: none; filter: none; opacity: 1;
}
.run-line {
display: flex; align-items: center; gap: 6px;
min-height: 1.3em;
font-size: var(--fs-xs);
color: var(--text-3);
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.run-line:empty { display: none; }
.run-line .dot { width: 7px; height: 7px; }
.conn {
display: inline-flex; align-items: center; gap: 6px;
padding: 2px 8px;
border-radius: var(--r-pill);
font-size: var(--fs-xs);
color: var(--text-3);
white-space: nowrap;
}
.conn:empty { display: none; }
.conn.off { background: var(--warn-soft); color: var(--warn); }
.conn.bad { background: var(--danger-soft); color: var(--danger); }
.nav {
position: fixed;
top: 0; bottom: 0; left: 0;
width: min(86vw, var(--nav-w));
display: flex;
flex-direction: column;
padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
background: var(--surface);
border-right: 1px solid var(--border);
transform: translateX(-102%);
transition: transform 0.2s ease;
z-index: 30;
visibility: hidden;
}
.app.nav-open .nav { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
.nav-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); min-height: var(--topbar-h); }
.brand { flex: 1; display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.new-chat { margin: 0 var(--sp-3) var(--sp-2); min-height: 40px; justify-content: flex-start; }
.search { position: relative; margin: 0 var(--sp-3) var(--sp-2); }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; }
.search input { padding-left: 36px; min-height: 38px; background: var(--surface-2); border-color: transparent; }
.chat-list { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--sp-2) var(--sp-2); }
.chat-row {
display: block;
width: 100%;
min-height: var(--touch);
padding: var(--sp-2) var(--sp-3);
border: 0;
border-radius: var(--r-md);
background: transparent;
text-align: left;
}
.chat-row:hover { background: var(--surface-2); }
.chat-row[aria-current="true"] { background: var(--accent-soft); }
.chat-row-title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; }
.chat-row-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-meta { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; white-space: nowrap; }
.chat-row-meta .state-busy { color: var(--accent); }
.chat-row-meta .state-warn { color: var(--warn); }
.chat-group { padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.chat-hit { padding: var(--sp-2) var(--sp-3); }
.chat-hit .snip { font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-hit mark { background: var(--warn-soft); color: inherit; border-radius: 2px; }
.list-note { padding: var(--sp-4) var(--sp-3); font-size: var(--fs-sm); color: var(--text-3); }
.nav-foot { border-top: 1px solid var(--border); padding: var(--sp-2); display: grid; gap: 2px; }
.nav-item {
display: flex; align-items: center; gap: var(--sp-3);
width: 100%; min-height: 40px;
padding: 0 var(--sp-3);
border: 0; border-radius: var(--r-md);
background: transparent; color: var(--text-2);
font-size: var(--fs-sm);
text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.sync-state { display: flex; align-items: center; gap: 6px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); color: var(--text-3); }
.sync-state:empty { display: none; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
.main {
grid-area: main;
position: relative;
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
}
.banners { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.banner {
display: flex; align-items: center; gap: var(--sp-3);
padding: var(--sp-2) var(--sp-4);
font-size: var(--fs-sm);
background: var(--info-soft); color: var(--info);
}
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--danger-soft); color: var(--danger); }
.banner .grow { color: var(--text); }
.banner .btn { min-height: 30px; }
.kb-open .banner { padding-top: 4px; padding-bottom: 4px; }
.kb-open .banner .grow { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.short.kb-open .banners { display: none; }
.short .topbar { min-height: 40px; }
.short .run-line {
position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scroller {
position: relative;
flex: 1 1 auto;
overflow-y: auto;
overflow-x: hidden;
overscroll-behavior: contain;
overflow-anchor: none;
touch-action: pan-y pinch-zoom;
scroll-padding-bottom: 64px;
}
.log {
width: 100%;
max-width: calc(var(--content-w) + 2 * var(--sp-4));
margin: 0 auto;
padding: var(--sp-4) max(var(--sp-4), env(safe-area-inset-right)) var(--sp-6) max(var(--sp-4), env(safe-area-inset-left));
}
.jump {
display: inline-flex; align-items: center; gap: 6px; flex: none;
height: 38px; min-height: 38px;
padding: 0 var(--sp-3) 0 10px;
border: 1px solid var(--border-strong);
border-radius: var(--r-pill);
background: var(--surface);
color: var(--text);
font-size: var(--fs-sm);
font-weight: 500;
}
.jump[hidden] { display: none; }
.jump .ic { width: 18px; height: 18px; flex: none; }
.jump-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.jump.has-new .jump-dot { display: inline-block; }
.jump.has-new { border-color: var(--accent); }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
.jump { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; position: relative; }
.jump .jump-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jump .jump-dot { position: absolute; top: 4px; right: 4px; }
}
.side {
position: fixed;
top: 0; bottom: 0; right: 0;
width: min(100vw, var(--side-w));
display: flex;
flex-direction: column;
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0;
background: var(--surface);
border-left: 1px solid var(--border);
transform: translateX(102%);
transition: transform 0.2s ease;
visibility: hidden;
z-index: 30;
}
.app.side-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
.side-head { display: flex; align-items: center; gap: var(--sp-1); padding: var(--sp-2); border-bottom: 1px solid var(--border); min-height: var(--topbar-h); }
.tabs { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
min-height: 36px;
padding: 0 var(--sp-3);
border: 0; border-radius: var(--r-md);
background: transparent; color: var(--text-2);
font-size: var(--fs-sm); font-weight: 500;
white-space: nowrap;
}
.tab:hover { background: var(--surface-2); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tab .count { margin-left: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.pane { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4); }
@media (min-width: 900px) {
.app {
grid-template-columns: var(--nav-w) minmax(0, 1fr);
grid-template-areas: "nav top" "nav main";
}
.nav {
position: static;
grid-area: nav;
width: auto;
transform: none;
visibility: visible;
box-shadow: none;
transition: none;
}
.app.nav-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
.app.nav-collapsed .nav { display: none; }
.app.nav-open .nav { box-shadow: none; }
#navClose .ic { transform: none; }
}
@media (min-width: 1240px) {
.app.side-open {
grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--side-w);
grid-template-areas: "nav top side" "nav main side";
}
.app.side-open.nav-collapsed {
grid-template-columns: minmax(0, 1fr) var(--side-w);
grid-template-areas: "top side" "main side";
}
.app.side-open .side {
position: static;
grid-area: side;
width: auto;
box-shadow: none;
transition: none;
}
}
dialog { color: var(--text); }
dialog::backdrop { background: var(--scrim); }
.sheet {
width: min(640px, 100vw);
max-width: 100vw;
max-height: min(88dvh, 900px);
margin: auto;
padding: 0;
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--surface);
box-shadow: var(--shadow-lg);
overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet-wide { width: min(980px, 100vw); }
.sheet-head {
display: flex; align-items: center; gap: var(--sp-2);
padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
border-bottom: 1px solid var(--border);
}
.sheet-head h2 { flex: 1; font-size: var(--fs-lg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.sheet-foot { display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
.sheet, .sheet-wide {
width: 100vw;
max-height: calc(var(--app-h, 100dvh) - max(8px, env(safe-area-inset-top)));
margin: 0;
inset: auto 0 auto 0;
top: calc(var(--vv-top, 0px) + var(--app-h, 100dvh));
transform: translateY(-100%);
border-radius: var(--r-lg) var(--r-lg) 0 0;
border-bottom: 0;
padding-bottom: env(safe-area-inset-bottom);
}
.kb-open .sheet, .kb-open .sheet-wide { padding-bottom: 0; }
.sheet-body { padding: var(--sp-4); }
.sheet-head { padding-left: var(--sp-4); }
}
.confirm {
inset: auto 0;
top: calc(var(--vv-top, 0px) + var(--app-h, 100dvh) / 2);
transform: translateY(-50%);
margin: 0 auto;
width: min(440px, calc(100vw - 2 * var(--sp-4)));
max-height: calc(var(--app-h, 100dvh) - 2 * var(--sp-4));
overflow-y: auto;
padding: var(--sp-5);
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--surface);
box-shadow: var(--shadow-lg);
}
.confirm h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.confirm p { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--sp-3); white-space: pre-line; }
.confirm .row { justify-content: flex-end; margin-top: var(--sp-4); }
.veil {
position: fixed; top: 0; left: 0; right: 0;
height: var(--app-h, 100dvh);
transform: translateY(var(--vv-top, 0px));
display: grid; place-items: center;
padding: var(--sp-4);
background: var(--bg);
z-index: 40;
overflow-y: auto;
}
.veil-card {
width: min(380px, 100%);
padding: var(--sp-6) var(--sp-5) var(--sp-5);
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--surface);
box-shadow: var(--shadow);
}
.veil-mark {
display: grid; place-items: center;
width: 44px; height: 44px; margin-bottom: var(--sp-3);
border-radius: 50%;
background: var(--accent-soft); color: var(--accent);
}
.veil-card h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
.veil-card .btn + .btn { margin-top: var(--sp-2); }
.veil-msg { min-height: 1.5em; margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.veil-msg.bad { color: var(--danger); }
.toasts {
position: fixed;
left: 50%; transform: translate(-50%, -100%);
top: calc(var(--vv-top, 0px) + var(--app-h, 100dvh) - var(--sp-4) - env(safe-area-inset-bottom));
display: grid; gap: var(--sp-2);
width: min(520px, calc(100vw - 2 * var(--sp-4)));
z-index: 70;
pointer-events: none;
}
.kb-open .toasts { top: calc(var(--vv-top, 0px) + var(--app-h, 100dvh) - var(--sp-2)); }
.toast {
display: flex; align-items: center; gap: var(--sp-3);
padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
border-radius: var(--r-md);
background: var(--text);
color: var(--bg);
font-size: var(--fs-sm);
box-shadow: var(--shadow-lg);
pointer-events: auto;
}
.toast .grow { min-width: 0; }
.toast .btn { min-height: 30px; background: transparent; border-color: currentColor; color: inherit; }
.toast.bad { background: var(--danger); color: #fff; }
.toast .close { color: inherit; opacity: 0.8; width: 32px; height: 32px; }

.log > * + * { margin-top: var(--sp-3); }
.log > .msg-user { margin-top: var(--sp-5); }
.log > .msg-user:first-child, .log > .sys-line + .msg-user { margin-top: var(--sp-2); }
.log > .activity + .activity { margin-top: var(--sp-2); }
.log > .msg-agent + .activity, .log > .activity + .msg-agent, .log > .notice + .activity, .log > .activity + .notice { margin-top: 10px; }
.log > .activity.thought + .msg-agent, .log > .activity.diag-only + .msg-agent { margin-top: 2px; }
.log > .live-tail { margin-top: var(--sp-3); }
.empty-state { padding: 12vh var(--sp-2) var(--sp-5); text-align: center; color: var(--text-2); }
.empty-state h2 { font-size: var(--fs-xl); color: var(--text); margin-bottom: var(--sp-2); }
.empty-state p { font-size: var(--fs-sm); max-width: 32em; margin: 0 auto; }
.empty-state code { font-size: var(--fs-xs); color: var(--text-3); word-break: break-all; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-5); }
.suggestion {
min-height: 40px; padding: var(--sp-1) var(--sp-3);
border: 1px solid var(--border); border-radius: var(--r-pill);
background: var(--surface); color: var(--text-2);
font-size: var(--fs-sm); text-align: left;
}
.suggestion:hover { border-color: var(--border-strong); color: var(--text); }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; }
.bubble {
max-width: min(85%, 620px);
padding: var(--sp-2) var(--sp-3);
border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg);
background: var(--user-bubble);
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.msg-user.steer .bubble { border: 1px dashed var(--border-strong); }
.msg-meta {
display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end;
margin-top: 4px;
font-size: var(--fs-xs); color: var(--text-3);
}
.msg-meta .state-bad { color: var(--danger); }
.msg-meta .state-warn { color: var(--warn); }
.msg-agent { min-width: 0; }
.msg-update .prose { color: var(--text); }
.interim-head { margin-bottom: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.msg-agent.interim .prose {
max-height: 7.5em; overflow: hidden;
-webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.msg-agent.interim.expanded .prose { max-height: none; -webkit-mask-image: none; mask-image: none; }
.msg-agent .show-more { margin-top: 2px; }
.md-plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-fallback { min-width: 0; padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--border); border-radius: var(--r-md); }
.msg-fallback.from-user { margin-left: auto; width: fit-content; max-width: 85%; }
.fallback-note { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--text-3); }
.msg-actions { display: flex; gap: 2px; margin-top: 2px; }
.msg-user .msg-actions { justify-content: flex-end; }
.msg-actions .icon-btn { width: 36px; height: 36px; color: var(--text-3); }
.msg-actions .icon-btn:hover { color: var(--text); }
.msg-actions .icon-btn .ic { width: 16px; height: 16px; }
.sys-line { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.sys-line::before, .sys-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.gap-line { color: var(--warn); }
.found { animation: found 2.4s ease-out; border-radius: var(--r-md); }
@keyframes found { 0%, 40% { box-shadow: 0 0 0 3px var(--warn); } 100% { box-shadow: 0 0 0 3px transparent; } }
.prose { overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.7em; }
.prose h3 { font-size: var(--fs-lg); margin-top: 1.1em; }
.prose h4 { font-size: var(--fs-md); margin-top: 1em; }
.prose h5 { font-size: var(--fs-sm); margin-top: 1em; color: var(--text-2); }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: 0.25em; }
.prose li > ul, .prose li > ol { margin-top: 0.25em; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose li.task .box { display: inline-block; width: 1.1em; color: var(--text-3); }
.prose li.task.done .box { color: var(--ok); }
.prose blockquote { margin: 0; padding: 0 var(--sp-3); border-left: 3px solid var(--border-strong); color: var(--text-2); white-space: pre-wrap; }
.prose code.inline { padding: 0.1em 0.35em; border-radius: 4px; background: var(--code-bg); color: var(--code-text); font-size: 0.86em; overflow-wrap: anywhere; }
.prose a { overflow-wrap: anywhere; }
.prose del { color: var(--text-3); }
.code {
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--code-bg);
overflow: hidden;
}
.code-bar {
display: flex; align-items: center; justify-content: space-between;
padding: 2px 4px 2px var(--sp-3);
border-bottom: 1px solid var(--border);
font-size: var(--fs-xs); color: var(--text-3);
}
.code-tools { display: inline-flex; gap: 2px; }
.code-bar .btn { min-height: 30px; border: 0; background: transparent; color: var(--text-3); }
.code-bar .btn:hover { color: var(--text); background: var(--surface-2); }
.code-bar .code-wrap[aria-pressed="true"] { color: var(--accent); }
.code pre {
margin: 0;
padding: var(--sp-3);
overflow-x: auto;
overscroll-behavior-x: contain;
touch-action: pan-x pan-y pinch-zoom;
color: var(--code-text);
font-size: 0.84rem;
line-height: 1.5;
tab-size: 4;
}
.code.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; touch-action: pan-x pan-y pinch-zoom; border: 1px solid var(--border); border-radius: var(--r-md); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.table-wrap th, .table-wrap td { padding: 6px var(--sp-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
overflow-wrap: normal; word-break: normal; }
.table-wrap td { min-width: 4ch; }
.table-wrap .prose-cell { min-width: 12em; }
.table-wrap .token-cell { min-width: 14em; }
.table-wrap .token-cell a, .table-wrap .token-cell code.inline { overflow-wrap: anywhere; }
.table-wrap .md-seg { white-space: nowrap; }
.table-wrap code.inline { overflow-wrap: normal; word-break: normal; }
.table-wrap th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap .al-r { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap .al-c { text-align: center; }
.activity {
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--surface);
min-width: 0;
}
.activity-head {
display: flex; align-items: center; gap: var(--sp-2);
width: 100%;
min-height: 42px;
padding: 6px var(--sp-2) 6px var(--sp-3);
border: 0; border-radius: var(--r-md);
background: transparent;
color: var(--text-2);
font-size: var(--fs-sm);
text-align: left;
}
.activity-head:hover { background: var(--surface-2); }
.activity-head .state { display: inline-flex; flex: none; }
.activity-head .state-ic { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.activity-head .sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-head .sum b { color: var(--text); font-weight: 500; }
.activity-head .badges { display: inline-flex; flex: none; gap: 4px; }
.activity-head .meta { flex: none; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.activity-head .meta:empty { display: none; }
.activity-head .chev { flex: none; width: 18px; height: 18px; transition: transform 0.15s; color: var(--text-3); }
.activity-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.activity-head .who-chips { display: inline-flex; flex: none; gap: 3px; }
.activity-head .who-chips:empty { display: none; }
.activity.live { border-color: var(--accent); }
.activity.bad { box-shadow: inset 3px 0 0 var(--danger); }
.activity.bad .activity-head .state-ic { color: var(--danger); }
.activity.stopped { box-shadow: inset 3px 0 0 var(--warn); }
.activity.stopped .activity-head .state-ic { color: var(--warn); }
.activity.thought, .activity.diag-only { border-color: transparent; background: transparent; }
.activity.thought .activity-head, .activity.diag-only .activity-head { min-height: 34px; padding-left: 2px; color: var(--text-3); }
.activity.thought .activity-head .sum b, .activity.diag-only .activity-head .sum b { color: var(--text-3); font-weight: 400; }
.activity.thought.open, .activity.diag-only.open { border-color: var(--border); background: var(--surface); }
.activity-body { border-top: 1px solid var(--border); padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.act-steps { display: grid; gap: 6px; min-width: 0; }
.who {
display: inline-flex; align-items: center;
padding: 0 6px;
border-radius: var(--r-pill);
background: var(--surface-2);
color: var(--text-2);
font-size: 0.6875rem; font-weight: 600; line-height: 1.6;
text-transform: lowercase;
white-space: nowrap;
}
.who-reviewer { background: var(--info-soft); color: var(--info); }
.who-helper { background: var(--warn-soft); color: var(--warn); }
.act-row { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); min-width: 0; }
.act-row .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--text-3); flex: none; }
.act-row .txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.act-row.warn .txt, .act-row.warn .ic { color: var(--warn); }
.act-row.bad .txt, .act-row.bad .ic { color: var(--danger); }
.act-row.ok .ic { color: var(--ok); }
.act-fold { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); min-width: 0; }
.act-fold > summary {
display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2);
min-height: 36px; padding: 4px var(--sp-2);
list-style: none; cursor: pointer;
font-size: var(--fs-sm);
min-width: 0;
}
.act-fold > summary::-webkit-details-marker { display: none; }
.act-fold > summary > .ic { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.act-fold > summary .name { font-family: var(--mono); font-size: 0.8rem; color: var(--text); flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.act-fold > summary .st { margin-left: auto; }
.act-fold > summary .label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: var(--fs-xs); }
.act-fold > summary .st {
display: inline-flex; align-items: center; gap: 4px; flex: none;
font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.act-fold > summary .st.slow, .act-fold > summary .st.warn { color: var(--warn); }
.act-fold > summary .st.stalled, .act-fold > summary .st.bad { color: var(--danger); font-weight: 600; }
.act-fold[open] > summary { border-bottom: 1px solid var(--border); }
.act-fold.running { border-color: var(--accent); }
.act-fold.o-failed, .act-fold.o-noresult { border-color: var(--danger); }
.act-fold.o-refused, .act-fold.o-held, .act-fold.o-interrupted { border-color: var(--warn); }
.act-fold.o-not_run, .act-fold.o-stale { border-style: dashed; }
.act-fold.think > summary .name, .act-fold.draft > summary .name { font-family: var(--font); font-size: var(--fs-sm); color: var(--text-2); }
.spinner-sm { width: 11px; height: 11px; border-width: 1.5px; }
.fold-label { padding: var(--sp-2) var(--sp-3) 0; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.act-fold pre {
margin: 0;
padding: var(--sp-2) var(--sp-3);
font-size: 0.78rem;
line-height: 1.45;
white-space: pre-wrap;
overflow-wrap: anywhere;
color: var(--code-text);
}
.act-fold .args { color: var(--text-3); max-height: 16em; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.act-fold .fold-prose { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.act-fold .out.empty { display: none; }
.act-fold .out.clamped:not(.expanded) .out-pre {
max-height: 15em; overflow: hidden;
-webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.out-bar { display: flex; flex-wrap: wrap; gap: var(--sp-1); padding: 0 var(--sp-2) var(--sp-2); }
.review { border-left: 3px solid var(--info); padding: 2px 0 2px var(--sp-3); font-size: var(--fs-sm); }
.review.ok { border-color: var(--ok); }
.review.changes { border-color: var(--warn); }
.review ul { margin: 4px 0 0; padding-left: 1.2em; color: var(--text-2); }
.act-diag { margin-top: var(--sp-2); border-top: 1px dashed var(--border); }
.activity.diag-only .act-diag, .act-steps:empty + .act-diag { margin-top: 0; border-top: 0; }
.act-diag > summary {
display: flex; align-items: center; gap: var(--sp-2);
min-height: 36px; padding: 4px 0;
list-style: none; cursor: pointer;
font-size: var(--fs-xs); color: var(--text-3);
}
.act-diag > summary::-webkit-details-marker { display: none; }
.act-diag > summary .ic { width: 15px; height: 15px; }
.act-diag > summary .label { padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); }
.diag-list { list-style: none; margin: 0; padding: 0 0 var(--sp-1); display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--text-2); }
.diag-list li { display: flex; gap: var(--sp-2); min-width: 0; }
.diag-at { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.diag-txt { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.notice {
display: flex; align-items: flex-start; gap: var(--sp-2);
padding: 2px var(--sp-1);
font-size: var(--fs-sm); color: var(--text-2);
}
.notice > .ic, .notice > summary > .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--info); flex: none; }
.notice-body { display: flex; flex-direction: column; min-width: 0; }
.notice-text { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.notice-detail { font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }
.notice.warn { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--warn-soft); color: var(--text); }
.notice.warn > .ic, .notice.warn > summary > .ic { color: var(--warn); }
.notice.warn .notice-text { font-weight: 500; }
.notice.bad { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--danger); border-radius: var(--r-md); background: var(--danger-soft); color: var(--text); }
.notice.bad > .ic { color: var(--danger); }
.notice-resource { display: block; padding: 0; }
.notice-resource > summary {
display: flex; align-items: center; gap: var(--sp-2);
min-height: 40px; padding: 4px var(--sp-3);
list-style: none; cursor: pointer;
}
.notice-resource > summary::-webkit-details-marker { display: none; }
.notice-resource > summary .notice-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-resource > summary .ic { margin-top: 0; }
.notice-resource[open] > summary .notice-text { white-space: normal; }
.notice-more { padding: 0 var(--sp-3) var(--sp-2) calc(var(--sp-3) + 26px); font-size: var(--fs-xs); color: var(--text-2); }
.notice-more p + p { margin-top: 4px; }
.notice-meta { color: var(--text-3); }
.advisory { border-left: 3px solid var(--info); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.advisory.risk { border-color: var(--warn); }
.advisory.critical { border-color: var(--danger); color: var(--text); }
.advisory b { display: block; font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.verdict-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.verdict-line.warn { color: var(--warn); }
.corrections { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); min-width: 0; max-width: 100%; }
.corrections > summary {
display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; cursor: pointer;
padding: 2px var(--sp-2); border-radius: var(--r-pill); background: var(--surface-2); list-style: none;
}
.corrections > summary::-webkit-details-marker { display: none; }
.corrections > summary .ic-sm { flex: none; }
.corrections-label { min-width: 0; overflow-wrap: anywhere; }
.corrections[open] > summary { margin-bottom: var(--sp-1); }
.correction { margin-top: var(--sp-1); padding-left: var(--sp-2); border-left: 2px solid var(--border); overflow-wrap: anywhere; min-width: 0; }
.correction-was { text-decoration: line-through; text-decoration-color: var(--text-3); }
.correction-now { color: var(--text-2); }
.corrections-first { margin-top: var(--sp-2); min-width: 0; }
.corrections-first > summary { cursor: pointer; color: var(--text-2); }
.corrections-first .fold-prose { margin-top: var(--sp-1); padding-left: var(--sp-2); border-left: 2px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.corrections-diag { margin-top: var(--sp-2); color: var(--text-3); overflow-wrap: anywhere; }
.live-tail { min-width: 0; }
.live-text { margin-bottom: var(--sp-2); color: var(--text); }
.live-text > :last-child::after {
content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: text-bottom;
background: var(--accent); animation: pulse 1s steps(2) infinite;
}
.live-status {
display: flex; align-items: center; gap: var(--sp-2);
min-height: 32px;
font-size: var(--fs-sm); color: var(--text-2);
-webkit-user-select: none; user-select: none;
}
.live-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-time { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.live-tail.tone-wait .live-status { color: var(--warn); font-weight: 500; }
.live-tail.tone-off .live-status { color: var(--danger); }
.card {
padding: var(--sp-3) var(--sp-4);
border: 1px solid var(--border);
border-radius: var(--r-md);
background: var(--surface);
}
.card-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.card-body { font-size: var(--fs-sm); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-q { font-size: var(--fs-md); color: var(--text); margin-bottom: var(--sp-3); white-space: pre-wrap; }
.card .opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.card .opts .btn { min-height: 40px; }
.card .free { display: flex; gap: var(--sp-2); }
.card .free input { min-height: 40px; }
.card .done-line { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.card-ask { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.card-approval { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.card-approval .card-title { color: var(--warn); }
.card-pause { border-color: var(--warn); background: var(--warn-soft); }
.card-pause .card-title { color: var(--warn); }
.card-error { border-color: var(--danger); background: var(--danger-soft); }
.card-error .card-title { color: var(--danger); }
.card-error .card-body { color: var(--text); }
.card.settled { border-color: var(--border); background: var(--surface); box-shadow: none; opacity: 0.9; }
.card.settled .card-title { color: var(--text-2); }
.card .row { margin-top: var(--sp-3); }
.card-question { min-width: 0; overflow-wrap: anywhere; }
.card-question .card-q { overflow-wrap: anywhere; }
.card-q { overflow-wrap: anywhere; }
.q-title { flex-wrap: wrap; row-gap: var(--sp-1); }
.q-title .grow { min-width: 8em; }
.card-question .badge { margin-left: auto; white-space: normal; text-align: right; max-width: 100%; }
.q-lead { margin-bottom: var(--sp-2); }
.q-why, .q-task { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-1); overflow-wrap: anywhere; }
.q-progress { margin-bottom: var(--sp-2); }
.q-progress-text { font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; letter-spacing: .02em; }
.q-steps { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; margin: var(--sp-1) 0 0; padding: 0; }
.q-step {
min-width: 2.75rem; min-height: 2.75rem; padding: 0 var(--sp-2);
border: 1px solid var(--border-strong); border-radius: var(--r-pill);
background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.q-step.done { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.q-step.current { border-width: 2px; border-color: var(--accent); color: var(--text); font-weight: 600; }
.q-step-review { padding: 0 var(--sp-3); }
.q-item { border: 0; padding: 0; margin: 0 0 var(--sp-3); min-width: 0; max-width: 100%; }
.q-item legend { display: block; width: 100%; max-width: 100%; padding: 0; margin-bottom: var(--sp-1); white-space: normal; }
.q-item legend:focus { outline: none; }
.q-item legend:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.q-num { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); letter-spacing: .02em; margin-bottom: 2px; }
.q-qtext { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-kind { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: var(--sp-2); }
.q-hint { font-size: var(--fs-xs); color: var(--text-3); margin: calc(-1 * var(--sp-1)) 0 var(--sp-2); }
.q-options { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-2); min-width: 0; }
.q-option {
display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2);
min-height: var(--touch); padding: var(--sp-2) var(--sp-3); min-width: 0;
border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.q-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.q-option input { width: 1.375rem; height: 1.375rem; margin: 0.1em 0 0; flex: none; accent-color: var(--accent); }
.q-option-n { flex: none; min-width: 1.4em; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 1.5; }
.q-option-text { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; white-space: pre-wrap; }
.q-rec { font-size: var(--fs-xs); font-weight: 600; color: var(--ok); border: 1px solid var(--ok); border-radius: var(--r-pill); padding: 1px 8px; }
.q-rec-why { flex-basis: 100%; font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }
.q-text { width: 100%; max-width: 100%; box-sizing: border-box; min-height: var(--touch); font: inherit; font-size: max(16px, 1rem); resize: vertical; }
.q-beside { margin: 0 0 var(--sp-2); padding: var(--sp-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.q-actions {
display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
margin-top: var(--sp-2); min-width: 0;
}
.q-actions .btn { min-height: var(--touch); min-width: 0; max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
.q-actions .q-go, .q-actions .q-send, .q-actions .q-next { flex: 1 1 8em; }
.q-actions .q-back { flex: 0 1 auto; }
.q-problem { flex-basis: 100%; color: var(--danger); font-size: var(--fs-sm); }
.q-problem:empty { display: none; }
.q-answers { margin: 0 0 var(--sp-2); padding-left: var(--sp-4); overflow-wrap: anywhere; font-size: var(--fs-md); }
.q-answers .q-answer { margin-bottom: var(--sp-2); }
.q-summary { list-style: none; padding-left: 0; }
.q-summary .card-q { margin-bottom: 2px; }
.q-answer-q { font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.q-answer-a { overflow-wrap: anywhere; white-space: pre-wrap; }
.q-change { margin-top: 2px; }
.q-resurfaced { border-style: dashed; }
@media (pointer: coarse) {
.activity-head { min-height: 44px; }
.act-fold > summary, .act-diag > summary { min-height: 40px; }
.msg-actions .icon-btn { width: 40px; height: 40px; }
.code-bar .btn, .out-bar .btn, .msg-agent .show-more { min-height: 36px; }
}
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
.bubble { max-width: 88%; }
.activity-head .who-chips { display: none; }
.activity-head { padding-left: var(--sp-2); gap: 6px; }
.activity-body { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.card { padding: var(--sp-3); }
.code pre { font-size: 0.8rem; }
}
@media (max-width: 360px) {
.activity-head .meta { display: none; }
}

.composer-wrap {
flex: none;
padding: 0 max(var(--sp-3), env(safe-area-inset-right)) max(var(--sp-3), env(safe-area-inset-bottom)) max(var(--sp-3), env(safe-area-inset-left));
background: linear-gradient(to bottom, transparent, var(--bg) 18px);
}
.composer-wrap > * { max-width: var(--content-w); margin-left: auto; margin-right: auto; }
.waiting {
display: flex; align-items: center; gap: var(--sp-2);
margin-bottom: var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border: 1px solid var(--accent);
border-radius: var(--r-md);
background: var(--accent-soft);
font-size: var(--fs-sm);
}
.waiting .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer {
position: relative;
border: 1px solid var(--border-strong);
border-radius: var(--r-lg);
background: var(--surface);
box-shadow: var(--shadow);
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
display: block;
width: 100%;
min-height: 48px;
max-height: calc(var(--app-h, 100dvh) * 0.35);
padding: var(--sp-3) var(--sp-4) var(--sp-1);
border: 0;
border-radius: var(--r-lg) var(--r-lg) 0 0;
background: transparent;
resize: none;
line-height: 1.5;
outline: none;
}
.composer textarea:focus-visible { outline: none; }
.composer-bar {
display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2);
padding: var(--sp-1) var(--sp-2) var(--sp-2);
min-width: 0;
}
.pickers { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pickers::-webkit-scrollbar { display: none; }
.composer-bar .pickers { display: none; }
.pick-row { display: contents; }
.pick-head, .pick-desc, .pick-vpn, .pick-foot { display: none; }
.pick-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.composer-bar .options-btn { display: inline-flex; flex: 0 1 auto; min-width: 0; padding: 0 10px; cursor: pointer; max-width: 24em; }
.composer-bar .options-btn::after { display: none; }
.options-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-bar .vpn-btn { flex: none; padding: 0 10px; cursor: pointer; }
.composer-bar .vpn-btn::after { display: none; }
.chip.vpn-btn.vpn-on, .chip.vpn-btn.vpn-on:hover, .chip.vpn-btn.vpn-on:focus-within { border-color: var(--accent); color: var(--accent); }
.chip.vpn-btn.vpn-ok, .chip.vpn-btn.vpn-ok:hover, .chip.vpn-btn.vpn-ok:focus-within { border-color: var(--ok); color: var(--ok); }
.chip.vpn-btn.vpn-bad, .chip.vpn-btn.vpn-bad:hover, .chip.vpn-btn.vpn-bad:focus-within { border-color: var(--danger); color: var(--danger); }
.vpn-btn.vpn-wait { border-style: dashed; }
.composer-bar { align-items: center; }
.composer-bar .composer-actions { margin-left: auto; }
.composer.options-open .pickers {
display: flex; flex-direction: column; gap: var(--sp-2);
position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
max-width: 560px;
max-height: calc(var(--app-h, 100dvh) - var(--composer-h, 120px) - var(--topbar-h, 52px) - 16px);
overflow-y: auto; overscroll-behavior: contain;
padding: var(--sp-3);
border: 1px solid var(--border-strong); border-radius: var(--r-lg);
background: var(--surface); box-shadow: var(--shadow-lg);
z-index: 6;
}
.composer.options-open .pick-row { display: block; }
.composer.options-open .pick-head { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.composer.options-open .pick-desc { display: block; margin: 4px 4px 0; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.45; }
.composer.options-open .pick-vpn { display: block; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.composer.options-open .pick-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding-top: var(--sp-1); }
.composer.options-open .pickers .chip { width: 100%; height: 44px; font-size: var(--fs-sm); }
.composer.options-open .pickers .chip select { flex: 1 1 auto; max-width: none; width: 100%; height: 42px; font-size: 16px; }
.composer.options-open .pick-name { position: static; width: auto; height: auto; clip: auto; flex: none; min-width: 6.5em; color: var(--text-2); }
.vpn-state { font-size: var(--fs-sm); font-weight: 600; }
.vpn-state.bad { color: var(--danger); }
.vpn-state.ok { color: var(--ok); }
.vpn-cover { margin: 6px 4px 0; font-size: var(--fs-xs); color: var(--text-2); }
.vpn-cover summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.vpn-cover ul { margin: 4px 0 0 1.1em; padding: 0; }
.pick-foot-note { font-size: var(--fs-xs); color: var(--text-3); }
.pick-foot-note.bad { color: var(--danger); }
.team-line {
display: block; width: 100%; margin: 0 0 var(--sp-1); padding: 4px var(--sp-2);
border: 0; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text-2);
font-size: var(--fs-xs); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.team-line[hidden] { display: none; }
.chip {
position: relative;
display: inline-flex; align-items: center; gap: 4px;
flex: none;
height: 32px;
padding: 0 4px 0 8px;
border: 1px solid var(--border);
border-radius: var(--r-pill);
background: var(--surface);
color: var(--text-2);
font-size: var(--fs-xs);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip:focus-within { border-color: var(--accent); }
.chip .ic { width: 15px; height: 15px; }
.chip select {
max-width: 13em;
height: 30px;
padding: 0 18px 0 0;
border: 0;
background: transparent;
color: inherit;
font-size: var(--fs-xs);
-webkit-appearance: none;
appearance: none;
cursor: pointer;
outline: none;
}
.chip::after {
content: "";
position: absolute; right: 9px; top: 50%;
width: 5px; height: 5px;
border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
transform: translateY(-70%) rotate(45deg);
pointer-events: none;
opacity: 0.6;
}
.chip.ro { border-color: var(--info); color: var(--info); }
.chip.trusted { border-color: var(--warn); color: var(--warn); }
.chip.saving { opacity: 0.6; }
.chip.failed { border-color: var(--danger); color: var(--danger); }
.composer-actions { display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.draft-state { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.draft-state.bad { color: var(--danger); }
.btn-send { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.btn-send .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.composer-actions .btn-stop, .composer-actions .btn-quiet { min-height: 34px; }
.short .composer textarea { min-height: 40px; padding-top: 8px; padding-bottom: 2px; }
.short .composer-bar { padding-top: 2px; padding-bottom: 4px; }
.short .composer-wrap { padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.kb-open .composer-wrap { padding-bottom: var(--sp-2); }
.short.kb-open .composer-wrap { padding-bottom: 4px; }
.composer-note {
min-height: 0; padding: 4px var(--sp-2) 0; font-size: var(--fs-xs); color: var(--text-3); text-align: center;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.composer-note.full { display: block; -webkit-line-clamp: unset; overflow: visible; }
.composer-note:empty { padding: 0; }
.composer-note.warn { color: var(--warn); }
.composer-note.bad { color: var(--danger); }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
.composer textarea { padding: var(--sp-3) var(--sp-3) var(--sp-1); }
.draft-state { max-width: 6.5em; }
.composer-bar .options-btn { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 190px); height: 38px; }
.composer-bar .vpn-btn { height: 38px; padding: 0 8px; }
.composer-bar { align-items: center; }
.composer-bar .pickers { display: none; }
.composer-bar .composer-actions { margin-left: auto; }
.composer.options-open .pickers { max-width: none; }
.composer-actions .btn span { display: none; }
.composer-actions .btn-stop, .composer-actions .btn-quiet { width: 40px; min-height: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-send { width: 40px; height: 40px; min-height: 40px; }
.composer-bar .options-btn, .composer-bar .vpn-btn { height: 40px; }
.short .composer { display: flex; align-items: flex-end; }
.short .composer textarea { flex: 1 1 auto; min-width: 0; max-height: calc(var(--app-h, 100dvh) * 0.3); border-radius: var(--r-lg) 0 0 var(--r-lg); padding-bottom: 8px; }
.short .composer-bar { flex: none; padding: 4px 6px 4px 0; }
.short .composer-bar .options-btn, .short .composer-bar .vpn-btn { width: 38px; padding: 0; justify-content: center; }
.short .composer-bar .options-btn span, .short .composer-bar .vpn-btn span,
.short .draft-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.section + .section { margin-top: var(--sp-5); }
.section-title {
display: flex; align-items: center; gap: var(--sp-2);
margin-bottom: var(--sp-2);
font-size: var(--fs-xs); font-weight: 600;
color: var(--text-3);
text-transform: uppercase; letter-spacing: 0.05em;
}
.section-title .grow { min-width: 0; }
.section p.lead { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-3); }
.empty-note { font-size: var(--fs-sm); color: var(--text-3); }
.err-note { font-size: var(--fs-sm); color: var(--danger); }
.kv { display: grid; grid-template-columns: minmax(6.5em, max-content) minmax(0, 1fr); gap: 4px var(--sp-3); font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.controls { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.status-card {
display: flex; align-items: center; gap: var(--sp-3);
padding: var(--sp-3);
border: 1px solid var(--border); border-radius: var(--r-md);
background: var(--bg);
margin-bottom: var(--sp-3);
}
.status-card .grow b { display: block; font-size: var(--fs-md); }
.status-card .grow span { font-size: var(--fs-xs); color: var(--text-3); }
.req-list, .file-list, .member-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.req { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-sm); }
.req .mark { flex: none; width: 1.3em; text-align: center; color: var(--text-3); }
.req.done .mark { color: var(--ok); }
.req.blocked .mark { color: var(--danger); }
.req.dropped { color: var(--text-3); text-decoration: line-through; }
.req .note { display: block; padding: 0; font-size: var(--fs-xs); color: var(--text-3); }
.plain-list li { font-size: var(--fs-xs); color: var(--text-2); font-family: var(--mono); overflow-wrap: anywhere; }
.member {
padding: var(--sp-3);
border: 1px solid var(--border); border-radius: var(--r-md);
background: var(--bg);
}
.member-head { display: flex; align-items: center; gap: var(--sp-2); }
.member-head b { font-size: var(--fs-md); }
.member-head .grow { min-width: 0; }
.member .assign { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.member .summary { margin-top: 4px; font-size: var(--fs-sm); color: var(--text); }
.member .facts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.member .live { margin-top: 6px; padding: var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-2); white-space: pre-wrap; max-height: 7em; overflow: hidden; }
.member .live:empty { display: none; }
.file {
display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border: 1px solid var(--border); border-radius: var(--r-md);
background: var(--bg);
}
.file .ic { grid-row: span 2; margin-top: 2px; color: var(--text-3); }
.file .name { font-weight: 500; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.file .where { font-size: var(--fs-xs); color: var(--text-3); overflow-wrap: anywhere; }
.file .acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.file.missing .name { color: var(--text-3); text-decoration: line-through; }
.case-k { margin-top: var(--sp-3); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.case-k.warn { color: var(--warn); }
.case-v { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.case-list { margin: 2px 0 0; padding-left: 1.1em; font-size: var(--fs-sm); color: var(--text-2); }
.case-list li { overflow-wrap: anywhere; }
.case-list li + li { margin-top: 2px; }
.mem-row { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.mem-row:last-child { border-bottom: 0; }
.mem-row.inactive .mem-text { color: var(--text-3); }
.mem-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.mem-text { font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.mem-note { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.mem-acts { display: flex; gap: 4px; margin-top: var(--sp-2); }
.mem-edit textarea { min-height: 80px; margin-top: var(--sp-2); }
.settings-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.settings-group { padding: var(--sp-4) 0; border-top: 1px solid var(--border); }
.settings-group:first-of-type { border-top: 0; padding-top: 0; }
.settings-group > h3 { font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.settings-group > p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-3); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); align-items: start; }
.settings-grid .field { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.seg button { min-height: 36px; padding: 0 var(--sp-3); border: 0; background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.save-row { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.save-row .status { font-size: var(--fs-xs); color: var(--text-3); }
.save-row .status.ok { color: var(--ok); }
.save-row .status.bad { color: var(--danger); }
.meter { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.table-mini { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table-mini th, .table-mini td { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.table-mini th { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.table-mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
.warn-box { padding: var(--sp-3); border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.preview-pre {
margin: 0;
padding: var(--sp-3);
border: 1px solid var(--border); border-radius: var(--r-md);
background: var(--code-bg); color: var(--code-text);
font-size: 0.8rem; line-height: 1.5;
overflow: auto;
white-space: pre;
max-height: 70dvh;
}
.preview-img { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: var(--r-md); background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.diff .add { background: var(--diff-add); display: block; }
.diff .del { background: var(--diff-del); display: block; }
.diff .hunk { color: var(--info); display: block; }
.preview-note { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-3); }

