:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0f0f0f;
  --panel-2: #171717;
  --well: #000000;
  --line: #232323;
  --line-strong: #353535;
  --text: #f5f5f3;
  --muted: #8f8f8a;
  --faint: #5c5c58;
  --amber: #f2a93b;
  --amber-glow: rgba(242, 169, 59, 0.35);
  --amber-line: rgba(242, 169, 59, 0.38);
  --amber-wash: rgba(242, 169, 59, 0.08);
  --red: #e5533d;
  --green: #8cc56a;
  --blue: #6fa8dc;
  --paper: #e9dfcc;
  --ink: #1d1b18;
  --kind-client: #f2a93b;
  --kind-project: #6fa8dc;
  --kind-person: #8cc56a;
  --kind-decision: #e0789a;
  --kind-procedure: #b39ddb;
  --kind-topic: #5cbfb0;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --display: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --sidebar: 264px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(242, 169, 59, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(229, 83, 61, 0.07), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .8  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color: var(--text);
  font: 15px/1.5 var(--body);
}

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: var(--ink); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.label { font: 500 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.mono, input.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--faint); }
.lead { margin: 0; line-height: 1.55; }
.err-text { color: #ff9c8b; margin: 0; white-space: pre-wrap; }
code { font: 400 12px/1 var(--mono); color: var(--amber); background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }

/* ---------- app shell ---------- */
/* The shell is pinned to the screen: only the content scrolls, never the page itself. */
.app { position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100%); display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.appbar, .tabbar { display: none; }
.content { grid-column: 2; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 18px; }

.sidebar {
  grid-column: 1; display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow-y: auto;
  padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(10, 10, 10, 0.6);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.brand b { display: block; font: 600 26px/1 var(--display); letter-spacing: -0.03em; }
.brand small { display: block; font: 400 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.onair-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); text-decoration: none; }
.onair-card:hover { border-color: var(--line-strong); }
.onair-card b { display: block; font: 600 16px/1.1 var(--display); letter-spacing: -0.01em; }
.onair-card small { display: block; margin-top: 3px; color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onair-card .panel-ico { width: 34px; height: 34px; }
.side-nav, .side-agents { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--r-md); border: 0; background: none;
  color: var(--muted); text-decoration: none; cursor: pointer; font: 600 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.side-nav a:hover, .side-agents a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.side-nav a.active { color: var(--amber); background: var(--panel); }
.side-agents .label { padding: 0 12px 6px; }
.side-agents a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: 14px; }
.side-agents a.active { background: var(--panel); }

.onair {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); background: var(--well); white-space: nowrap;
}
.onair i { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; }
.onair.on { color: #ffd9cf; border-color: rgba(229, 83, 61, 0.6); background: linear-gradient(180deg, #4a1d15, #2c120d); box-shadow: 0 0 18px rgba(229, 83, 61, 0.35); animation: flicker 0.9s ease-out 1; }
.onair.on i { background: var(--red); box-shadow: 0 0 10px var(--red); }
.onair.wait { color: var(--amber); }
.onair.wait i { background: var(--amber); animation: blink 1s steps(2) infinite; }
.onair.err { color: var(--red); }
.onair-card .onair span { display: none; }
.onair-card .onair { padding: 6px; }
@keyframes flicker { 0%, 20%, 40% { opacity: 0.3; } 10%, 30%, 100% { opacity: 1; } }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.page-title { min-width: 0; }
.page-title h1 { margin: 0; font: 600 44px/1 var(--display); letter-spacing: -0.04em; }
.page-title h1 em { font-style: normal; color: var(--amber); }
.page-title p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.banners { display: flex; flex-direction: column; gap: 8px; }
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--amber); background: var(--panel); color: var(--muted);
}
.banner .ico { color: var(--amber); margin-top: 1px; }
.banner b { color: var(--text); }
.banner.err { border-left-color: var(--red); }
.banner.err .ico { color: var(--red); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.panel-head + .panel-body { border-top: 1px solid var(--line); }
.panel-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line); color: var(--amber); }
.panel-title { flex: 1; min-width: 0; }
.panel-title h2 { margin: 0; font: 600 19px/1.15 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.panel-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-body h3.label { margin: 6px 0 -4px; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); text-decoration: none; }
a.stat:hover { border-color: var(--line-strong); }
.stat-text { display: flex; flex-direction: column; min-width: 0; }
.stat b { font: 600 24px/1 var(--display); letter-spacing: -0.03em; }
.stat .label { margin-top: 3px; }
.stat small { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; flex: none;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.btn .ico { width: 16px; height: 16px; }
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.only-icon { width: 40px; padding: 0; }
.btn.sm { height: 34px; padding: 0 10px; font-size: 10px; }
.btn.sm.only-icon { width: 34px; padding: 0; }
.btn.primary { background: var(--amber); color: var(--ink); border-color: var(--amber); box-shadow: 0 0 20px -6px var(--amber-glow); }
.btn.primary:hover { background: #f6b955; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { border-color: var(--line); color: var(--text); }
.btn.lit { color: var(--amber); }
.btn.danger { color: #ff9c8b; border-color: rgba(229, 83, 61, 0.45); background: transparent; }
.btn.ghost.danger { border-color: transparent; color: var(--faint); }
.btn.ghost.danger:hover { color: #ff9c8b; border-color: rgba(229, 83, 61, 0.45); }
.btn.danger.armed { background: var(--red); border-color: var(--red); color: #fff; }
.btn.toggle { color: var(--faint); }
.btn.toggle.on { color: var(--green); border-color: #3f5a2f; background: rgba(140, 197, 106, 0.08); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text); text-decoration: none; flex: none; }
.icon-btn .ico { width: 22px; height: 22px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--well); color: var(--muted); font: 500 10px/1 var(--mono); letter-spacing: 0.04em;
}
.badge .ico { width: 13px; height: 13px; }
.badge.on { color: var(--green); border-color: #3f5a2f; }
.badge.err { color: #ff9c8b; border-color: #6e2b20; }
.badge.warn { color: var(--amber); border-color: var(--amber-line); }
.code-line { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 4px 4px 12px; border-radius: var(--r-md); background: #070707; border: 1px solid var(--line); }
.code-line code { flex: 1; min-width: 0; padding: 6px 0; border: 0; background: none; color: #d6d6d2; font-size: 12px; line-height: 1.5; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.code-line code::-webkit-scrollbar { display: none; }
.banner .btn { margin-left: auto; align-self: center; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font: 500 9px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.tag.agent { border-color: var(--amber-line); color: var(--amber); }
.tag.ok { border-color: #3f5a2f; color: var(--green); }
.tag.err { border-color: #6e2b20; color: #ff9c8b; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2a2a2a; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.6); }

.avatar {
  --ring: var(--amber);
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--panel-2); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring);
  font: 600 17px/1.1 var(--display); letter-spacing: -0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 30px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--ring); }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; box-shadow: 0 0 0 1.5px var(--ring); }
.avatar.add { --ring: var(--line); color: var(--muted); background: transparent; }
.avatar.add .ico { width: 14px; height: 14px; }
.avatar.drawn, .avatar.sm.drawn, .avatar.xs.drawn { background: #070707; box-shadow: none; }
.avatar-pick { display: flex; align-items: center; gap: 18px; }
.avatar-pick .avatar { width: 96px; height: 96px; }
.avatar-pick .stack-sm { gap: 8px; min-width: 0; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-actions .btn[hidden] { display: none; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; color: var(--faint); text-align: center; }
.empty .ico { width: 28px; height: 28px; stroke-width: 1.5; }
.empty p { margin: 0; }

/* ---------- loading ---------- */
.skeleton { display: block; flex: none; border-radius: var(--r-sm); background: var(--panel-2); animation: skeleton-pulse 1.8s ease-in-out infinite; }
.loading-skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; }
.sk-avatar { width: 44px; height: 44px; border-radius: 50%; }
.sk-label { width: 28%; min-width: 80px; height: 14px; }
.sk-caption { width: 60%; height: 11px; }
.sk-total { width: 72px; height: 12px; margin-left: auto; }
.sk-heat.skeleton { height: clamp(90px, 11vw, 142px); border-radius: 2px; opacity: .7; background-image: linear-gradient(var(--panel) 3px, transparent 3px), linear-gradient(90deg, var(--panel) 3px, transparent 3px); background-size: calc(100% / 53) calc(100% / 7); }
.sk-heat.loading-skeleton { gap: 8px; }
.sk-heat > .sk-caption { margin-top: 4px; }
.sk-chat { width: 100%; gap: 24px; }
.sk-message { display: flex; flex-direction: column; gap: 10px; width: 72%; max-width: 560px; }
.sk-message.owner { align-self: flex-end; width: 58%; }
.sk-bubble { width: 100%; height: 78px; border-radius: var(--r-lg); }
.sk-message.owner .sk-bubble { height: 54px; }
.sk-compose { height: 52px; border-radius: var(--r-lg); }
.side-agents .sk-row { padding: 6px 12px; gap: 10px; }
.side-agents .sk-avatar { width: 26px; height: 26px; }
.side-agents .sk-caption { display: none; }
@keyframes skeleton-pulse { 50% { background-color: var(--line); } }

/* ---------- agent cards ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.agent-card {
  --ring: var(--amber);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: #0c0c0c; border: 1px solid var(--line); border-radius: var(--r-md);
  animation: rise 0.45s ease-out both; animation-delay: var(--delay, 0ms);
}
.agent-card.off { opacity: 0.6; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.monitor { position: relative; display: block; aspect-ratio: 16 / 10; background: #070707; border-bottom: 1px solid var(--line); overflow: hidden; }
.monitor img { display: block; width: 100%; height: 100%; object-fit: cover; }
.monitor::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px); }
.monitor .dark { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--faint); font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.monitor .dark .ico { width: 26px; height: 26px; stroke-width: 1.4; }
.agent-ident { display: flex; align-items: center; gap: 12px; padding: 16px 14px 10px; text-decoration: none; }
.agent-ident b { display: block; font: 600 20px/1.05 var(--display); letter-spacing: -0.025em; }
.agent-ident small { display: block; margin-top: 3px; color: var(--muted); font: 400 11px/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--faint); }
.agent-card .badges { padding: 12px 14px 0; }
.agent-actions { display: flex; gap: 8px; padding: 12px 14px 14px; margin-top: auto; }
.agent-actions .btn:not(.only-icon) { flex: 1; }

/* ---------- rows ---------- */
.rows { display: flex; flex-direction: column; margin: -6px 0; }
.row-link, .row-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.row-item { align-items: flex-start; }
.rows > :last-child { border-bottom: 0; }
.row-link:hover { background: linear-gradient(90deg, rgba(242, 169, 59, 0.05), transparent); }
.row-title { display: flex; align-items: center; gap: 8px; font: 600 17px/1.15 var(--display); letter-spacing: -0.02em; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--faint); font: 400 11px/1.6 var(--mono); }
.row-meta b { color: var(--text); font-weight: 600; }
.row-text { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text.full { white-space: pre-wrap; word-break: break-word; }
.row-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--blue); font: 400 11px/1.4 var(--mono); }
.row-tools span { display: inline-flex; align-items: center; gap: 4px; }
.row-tools .ico { width: 12px; height: 12px; }
.row-actions { display: flex; gap: 2px; flex: none; align-items: center; }
.edit-box { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ---------- agent page ---------- */
.hero {
  --ring: var(--amber);
  display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow);
  background: linear-gradient(115deg, color-mix(in srgb, var(--ring) 16%, var(--panel)), var(--panel) 62%);
}
.hero .badge { max-width: 100%; min-width: 0; }
.hero .badge .ico { flex: none; }
.hero-model { overflow: hidden; text-overflow: ellipsis; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero h1 { margin: 0; font: 600 38px/1.05 var(--display); letter-spacing: -0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero.compact { padding: 10px 14px; gap: 14px; }
.hero.compact h1 { font-size: 28px; }
.hero.compact .hero-text { gap: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; scroll-snap-type: x proximity; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; scroll-snap-align: center;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); color: var(--muted); text-decoration: none;
  font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.tabs a .ico { width: 16px; height: 16px; }
.tabs a:hover { color: var(--text); border-color: var(--line-strong); }
.tabs a.active { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.tabs .count { font-style: normal; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.back-link { align-self: flex-start; }
.art-back { margin-bottom: -6px; }
@media (max-width: 899px) { .art-back { display: none; } }

/* ---------- forms ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.model-pick { display: grid; gap: 8px; min-width: 0; }
.brain-live { display: grid; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); border: 1px dashed var(--amber-line); background: linear-gradient(180deg, rgba(242, 169, 59, 0.08), transparent 120px); min-width: 0; }
.brain-live[hidden] { display: none; }
.brain-live-head { display: flex; align-items: center; gap: 12px; color: var(--muted); min-width: 0; }
.brain-live .subscription-spinner { border-top-color: var(--amber); flex: none; }
.brain-live-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brain-live-title { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; min-width: 0; }
.brain-live-head b { color: var(--text); font-weight: 600; }
.brain-live-head .line { font: 400 11px/1.5 var(--mono); }
.brain-live-now { font-size: 13px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brain-live-toggle { flex: none; }
.brain-live-toggle .ico { transform: rotate(90deg); transition: transform 0.15s ease; }
.brain-live-toggle[aria-expanded="true"] .ico { transform: rotate(-90deg); }
.brain-live-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; min-width: 0; }
.brain-live-cols > section { display: grid; gap: 8px; align-content: start; min-width: 0; }
.brain-live-scroll { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.brain-live-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.brain-event { display: grid; grid-template-columns: 44px 18px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.brain-event:first-child { border-top: 0; }
.brain-event .at { font: 400 10px/1.6 var(--mono); color: var(--faint); }
.brain-event .ico { color: var(--muted); display: inline-flex; transform: translateY(2px); }
.brain-event .ico svg { width: 14px; height: 14px; }
.brain-event.reasoning > :last-child { padding-left: 10px; border-left: 2px solid var(--amber); color: #cfcfca; font-style: italic; }
.brain-event.reasoning .ico, .brain-event.page .ico, .brain-event.done .ico { color: var(--amber); }
.brain-event.error .ico { color: var(--red, #e5484d); }
.brain-event.skip { color: var(--muted); }
.brain-event a { color: var(--text); text-decoration: underline; text-decoration-color: var(--amber-line); text-underline-offset: 3px; }
@media (max-width: 760px) { .brain-live-cols { grid-template-columns: minmax(0, 1fr); } .brain-live-scroll { max-height: 260px; } }
.brain-backups { display: grid; gap: 10px; min-width: 0; }
.brain-backups > .btn { justify-self: start; }
.brain-backup { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); min-width: 0; }
.brain-backup .grow { width: 100%; min-width: 0; }
.brain-backup .model-pick select, .brain-backup .model-pick input, .set-control .brain-account select { width: 100%; min-width: 0; }
.brain-backup-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 12px; color: var(--amber); }
.model-pick select:disabled { opacity: 0.45; }
.model-pick input { font-family: var(--mono); }
.field small { color: var(--faint); font-size: 12px; line-height: 1.4; }
.field-row { display: flex; align-items: center; justify-content: space-between; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md);
  outline: none; font-size: 15px; transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none; appearance: none;
}
select { padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a39580' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
textarea { height: auto; min-height: 110px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
textarea.tall { min-height: 220px; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.mono { font-family: var(--mono); font-size: 13px; }
input[type=color] { width: 64px; height: 44px; padding: 4px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > input { flex: 1; }
.paste-field { display: flex; gap: 8px; align-items: center; min-width: 0; }
.paste-field[hidden] { display: none; }
.paste-field > input { flex: 1; min-width: 0; }
.paste-field > .paste-btn { flex: none; }
.input-row > .paste-field, .vault-inline > .paste-field, .vault-value > .paste-field { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .input-row:has(> .paste-field) { flex-wrap: wrap; }
  .input-row > .paste-field { flex-basis: 100%; }
}
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); color: var(--faint); }
.search input { height: 100%; padding: 0; border: 0; background: transparent; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* A model to pick: a row that behaves like a button, and says when it cannot be used. */
.model-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: inherit; padding: 12px 2px; }
.model-row:hover:not(:disabled) { background: linear-gradient(90deg, rgba(242, 169, 59, 0.05), transparent); }
.model-row.on { background: linear-gradient(90deg, var(--amber-wash), transparent); }
.model-row:disabled { opacity: 0.45; cursor: not-allowed; }
.brain { display: grid; gap: 20px; }
.brain-harness select { width: 100%; }
.brain-side { min-width: 0; }
.brain-side.dim > .rows, .brain-side.dim > .field { opacity: 0.4; pointer-events: none; }
/* The card the local models run on, as one line above them. */
.card-strip { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.card-line > svg { color: var(--amber); }
.card-meta { color: var(--muted); font: 400 12px/1.5 var(--mono); }
/* Where the model runs: two sides of one switch, not a dropdown. */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); gap: 3px; }
.segmented button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 7px 14px; border-radius: calc(var(--r-md) - 3px); font: inherit; font-size: 13px; }
.segmented button:hover { color: var(--text); }
.segmented a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: calc(var(--r-md) - 3px); color: var(--muted); font-size: 13px; text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a.on { background: var(--amber); color: var(--ink); font-weight: 600; }
.segmented .ico { width: 15px; height: 15px; }
.segmented button.on { background: var(--amber); color: var(--ink); font-weight: 600; }
.brain-custom > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.brain-custom > summary::-webkit-details-marker { display: none; }
.brain-custom > summary::before { content: "▸ "; color: var(--faint); }
.brain-custom[open] > summary::before { content: "▾ "; }
.brain-custom > summary:hover { color: var(--text); }
.brain-custom > .stack-sm { margin-top: 10px; }
.row-link.model-row { padding: 12px 12px 12px 14px; }
.model-row .tag { height: auto; min-height: 20px; padding: 4px 6px; line-height: 1.35; white-space: normal; text-align: left; overflow-wrap: anywhere; }
/* Where Hermes runs: three lit tiles, each with its mark, rather than a squeezed toggle. */
.segmented.hermes-places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.segmented.hermes-places.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segmented.hermes-places.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.segmented.hermes-places button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 58px; padding: 8px 6px; line-height: 1.2; text-align: center; }
.segmented.hermes-places button .ico { width: 18px; height: 18px; margin: 0; vertical-align: 0; }
.segmented.hermes-places button:not(.on) .ico { color: var(--faint); }
.hermes-keys-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.hermes-key-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.hermes-key { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hermes-key:first-child { border-top: 0; }
.hermes-key:hover:not(:disabled) { background: var(--panel-2); }
.hermes-key:disabled { opacity: 0.45; cursor: not-allowed; }
.hermes-key.on { background: var(--amber-wash); }
.hermes-key-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.hermes-key.on .hermes-key-dot { border-color: var(--amber); }
.hermes-key.on .hermes-key-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.hermes-key-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hermes-key-name { font: 600 15px/1.2 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hermes-key-pending { margin: 0; }
.model-row[hidden], .model-search-none[hidden] { display: none; }
.hermes-key-meta { color: var(--faint); font: 400 11px/1.4 var(--mono); }
.hermes-key-form { margin-top: 10px; }
@media (max-width: 600px) {
  .segmented.hermes-places.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented.hermes-places.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hermes-key-add, .hermes-typed { flex-direction: column; align-items: stretch; }
  .hermes-key-add > input, .hermes-key-add > .paste-field, .hermes-typed > input { flex: none; width: 100%; }
  .hermes-key-form .row > .btn, .hermes-typed > .btn { width: 100%; justify-content: center; }
}
.notice { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.notice.warn { border-color: var(--amber-line); background: var(--amber-wash); color: var(--text); }
.notice > svg { flex: none; margin-top: 3px; color: var(--amber); }
.notice .stack-sm { gap: 8px; }
.encryption-warning { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 16px; margin-bottom: 16px; border: 1px solid var(--red); border-left: 4px solid var(--red); border-radius: var(--r-md); background: #1c0e0c; color: var(--text); overflow-wrap: anywhere; }
.encryption-warning[hidden] { display: none; }
.encryption-warning > svg { flex: none; color: var(--red); margin-top: 2px; }
.encryption-warning .grow { min-width: min(240px, 100%); flex-basis: 240px; }
.encryption-warning p { margin: 0; font-size: 13px; color: var(--text); }
.encryption-warning strong { font-size: 15px; }
.encryption-warning .btn { flex-shrink: 0; max-width: 100%; }
/* The app manifest a provider is created from: folded away, mono, never in the way. */
.manifest > summary { cursor: pointer; color: var(--muted); font: 500 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; list-style: none; }
.manifest > summary::-webkit-details-marker { display: none; }
.manifest > summary::before { content: "▸ "; color: var(--faint); }
.manifest[open] > summary::before { content: "▾ "; }
.manifest > summary:hover { color: var(--text); }
.manifest pre { max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); color: var(--muted); font: 400 11px/1.6 var(--mono); white-space: pre; }
.row.end { justify-content: flex-end; }
.row > .btn:last-child { margin-left: auto; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.steps a, .lead a { color: var(--amber); }
.telegram-setup { min-width: 0; }
.telegram-setup-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.telegram-setup-toolbar .field { flex: 1; min-width: min(100%, 180px); margin: 0; }
.telegram-setup-progress { margin: 16px 0; color: var(--muted); font: 400 11px/1.6 var(--mono); }
.telegram-setup-progress.complete { color: var(--green); }
.telegram-setup-steps { list-style: none; padding: 0; margin: 0; display: grid; }
.telegram-setup-steps > li { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.telegram-setup-number { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 500 11px/1 var(--mono); }
.telegram-setup-number .ico { width: 14px; height: 14px; }
.telegram-setup-steps .current .telegram-setup-number { color: var(--amber); border-color: var(--amber-line); background: var(--amber-wash); }
.telegram-setup-steps .verified .telegram-setup-number { color: var(--green); border-color: var(--green); }
.telegram-setup-body { flex: 1; min-width: 0; display: grid; gap: 10px; }
.telegram-setup-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.telegram-setup-title > b { font-size: 14px; line-height: 28px; }
.telegram-setup-title > small { font: 400 10px/1.5 var(--mono); color: var(--muted); }
.telegram-setup-steps .verified .telegram-setup-title > small { color: var(--green); }
.telegram-setup-body > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.telegram-setup-body .btn { min-height: 44px; height: auto; white-space: normal; font: 500 13px/1.4 var(--body); letter-spacing: 0; text-transform: none; }
.telegram-setup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.telegram-setup-actions:empty { display: none; }
.telegram-setup-actions > .stack-sm, .telegram-setup-actions > .input-row { width: 100%; }
.telegram-setup-actions > .row { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.telegram-setup-body .code-line { width: 100%; min-width: 0; }
.telegram-setup-body .code-line code { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.savebar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(5, 5, 5, 0.92); backdrop-filter: blur(10px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
}


.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; min-height: 32px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .rocker { position: relative; flex: none; width: 44px; height: 24px; border-radius: 6px; background: #070707; border: 1px solid var(--line); transition: background 0.2s; }
.switch .rocker::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 3px; background: var(--faint); transition: transform 0.2s, background 0.2s; }
.switch input:checked + .rocker { background: var(--amber-wash); border-color: var(--amber-line); }
.switch input:checked + .rocker::after { transform: translateX(20px); background: var(--amber); box-shadow: 0 0 10px var(--amber-glow); }
.switch input:focus-visible + .rocker { box-shadow: 0 0 0 3px var(--amber-glow); }
.switch-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.switch-text small { color: var(--faint); font-size: 12px; line-height: 1.35; }
.agent-security [role="status"]:empty { display: none; }
.agent-security [role="status"] { margin: 0; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--well); color: var(--muted); font: 500 12px/1 var(--mono);
}
.chip .ico { width: 13px; height: 13px; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: rgba(242, 169, 59, 0.14); border-color: var(--amber); color: var(--amber); }


/* ---------- model accounts and settings ---------- */
.subscription-picker { min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.subscription-picker[hidden], .settings-pane[hidden], .savebar[hidden] { display: none; }
.subscription-content { padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.subscription-head { display: flex; align-items: center; gap: 12px; }
.subscription-head h3 { margin: 3px 0 0; font: 600 22px/1.1 var(--display); letter-spacing: -.025em; }
.subscription-mark { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-2); color: var(--amber); box-shadow: inset 0 1px 0 #ffffff08; }
.subscription-mark .ico { width: 23px; height: 23px; }
.subscription-status { display: inline-flex; align-items: center; gap: 6px; flex: none; font: 400 11px/1.4 var(--body); color: var(--muted); }
.subscription-status i, .subscription-option-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.subscription-status.ready { color: var(--green); }
.subscription-status.ready i, .subscription-option-dot.ready { background: var(--green); }
.subscription-status.connecting { color: var(--amber); }
.subscription-status.connecting i { background: var(--amber); animation: blink 1.5s ease-in-out infinite; }
.subscription-status.error { color: #ff9c8b; }
.subscription-status.error i { background: var(--red); }
.subscription-description, .subscription-intro p, .subscription-identity p, .subscription-step-body p, .provider-key p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.subscription-intro h4 { margin: 0 0 6px; font: 500 18px/1.4 var(--display); letter-spacing: -.015em; }
.subscription-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.subscription-footer .btn, .subscription-step-body .btn, .provider-key .btn { min-height: 44px; height: auto; padding-top: 12px; padding-bottom: 12px; white-space: normal; font: 600 13px/1.4 var(--body); letter-spacing: 0; text-transform: none; }
.subscription-footer .btn.ghost { padding-left: 0; padding-right: 0; }
.subscription-source { font: 400 11px/1.4 var(--body); color: var(--muted); }
.subscription-identity { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.subscription-identity b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.subscription-identity p { margin-top: 3px; font-size: 12px; }
.subscription-connected { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #8cc56a30; border-radius: 50%; color: var(--green); background: #8cc56a08; flex: none; }
.subscription-connected .ico { width: 16px; height: 16px; }
.subscription-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.subscription-steps li { display: flex; align-items: flex-start; gap: 12px; }
.subscription-step { display: grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--amber); border: 1px solid var(--amber-line); border-radius: 50%; font: 500 11px/1 var(--mono); }
.subscription-step-body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; align-items: flex-start; }
.subscription-step-body > b { font-size: 14px; line-height: 24px; font-weight: 600; }
.subscription-step-body .field { width: 100%; }
.subscription-step-body .field .label { font: 400 12px/1.4 var(--body); text-transform: none; letter-spacing: 0; }
.subscription-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; width: 100%; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--well); }
.subscription-code strong { color: var(--amber); font: 500 clamp(20px, 3vw, 28px)/1.4 var(--mono); letter-spacing: .1em; user-select: all; overflow-wrap: anywhere; }
.subscription-code .btn { min-width: 44px; min-height: 44px; }
.subscription-wait { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.subscription-wait .ico { width: 14px; height: 14px; }
.subscription-progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.quota-accounts { min-width: 0; }
.quota-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 4px; scrollbar-width: thin; }
.subscription-usage .panel-head { padding: 10px 12px; }
.subscription-usage .panel-title h2 { font-size: 17px; }
.subscription-usage .panel-title p { font-size: 11px; }
.subscription-usage .panel-body { padding: 10px 12px; gap: 6px; }
.quota-tab { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--well); color: var(--muted); font: 500 11px var(--mono); cursor: pointer; }
.quota-tab-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 180px; }
.quota-tab-account { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 10px var(--mono); opacity: .8; }
.quota-tab .ico { width: 16px; height: 16px; }
.quota-tab[aria-selected=true] { color: var(--amber); border-color: var(--amber-line); background: var(--amber-wash); }
.quota-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.quota-account-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.quota-account-head .grow { min-width: 0; }
.quota-account-head h3 { margin: 0 0 2px; font: 600 14px var(--display); overflow-wrap: anywhere; }
.quota-account-head p { margin: 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.quota-windows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 6px; }
.quota-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 8px; margin-top: 8px; }
.quota-balance { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-sm); }
.quota-balance span { color: var(--muted); font-size: 11px; }
.quota-balance strong { font: 500 15px var(--mono); overflow-wrap: anywhere; }
.quota-balance.empty strong { color: var(--red); }
.quota-window { border: 1px solid var(--line); background: var(--well); border-radius: var(--r-sm); padding: 6px 8px; min-width: 0; }
.quota-window-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 11px; line-height: 1.2; }
.quota-window-label span { overflow-wrap: anywhere; }
.quota-window-label strong { display: inline-flex; align-items: baseline; gap: 5px; font: 500 15px var(--mono); white-space: nowrap; }
.quota-window-label strong small { font: 400 10px var(--mono); color: var(--muted); }
.quota-meter { display: block; appearance: none; width: 100%; height: 3px; margin: 4px 0; border: 0; border-radius: 2px; overflow: hidden; background: var(--panel-2); color: var(--green); }
.quota-meter::-webkit-progress-bar { background: var(--panel-2); }
.quota-meter::-webkit-progress-value { background: var(--green); }
.quota-meter::-moz-progress-bar { background: var(--green); }
.quota-window.low .quota-meter { color: var(--amber); }
.quota-window.low .quota-meter::-webkit-progress-value { background: var(--amber); }
.quota-window.low .quota-meter::-moz-progress-bar { background: var(--amber); }
.quota-window.exhausted .quota-meter { color: var(--red); }
.quota-window.exhausted .quota-meter::-webkit-progress-value { background: var(--red); }
.quota-window.exhausted .quota-meter::-moz-progress-bar { background: var(--red); }
.quota-windows.stale .quota-meter { color: var(--muted); }
.quota-windows.stale .quota-meter::-webkit-progress-value { background: var(--muted); }
.quota-windows.stale .quota-meter::-moz-progress-bar { background: var(--muted); }
.quota-window-meta, .quota-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--muted); font: 400 9px var(--mono); line-height: 1.3; }
.quota-foot { margin-top: 6px; color: var(--faint); }
.sk-quota-tab { width: 64px; height: 44px; }
.sk-quota-meter { height: 3px; margin: 4px 0; }
.sk-quotas.loading-skeleton { gap: 8px; }
.quota-status { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .quota-tab { gap: 5px; padding: 7px 10px; }
  .quota-tab-label { max-width: 150px; }
}
.subscription-spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--text); border-radius: 50%; animation: subscription-spin .8s linear infinite; }
@keyframes subscription-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .subscription-spinner { animation: none; } }
.subscription-help { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.subscription-help summary { display: flex; align-items: center; gap: 7px; min-height: 32px; cursor: pointer; list-style: none; }
.subscription-help summary::-webkit-details-marker { display: none; }
.subscription-help summary::after { content: "+"; margin-left: auto; font-family: var(--mono); }
.subscription-help[open] summary::after { content: "−"; }
.subscription-help summary .ico { width: 14px; height: 14px; }
.subscription-help p { margin: 12px 0; }
.subscription-help a { color: var(--amber); text-underline-offset: 3px; }
.subscription-help a .ico { margin-left: 5px; width: 12px; height: 12px; }
.subscription-accounts { display: flex; flex-direction: column; gap: 6px; }
.subscription-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 12px; text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--well); }
.subscription-option:hover { border-color: var(--amber-line); background: var(--panel-2); }
.subscription-option[aria-pressed=true] { border-color: var(--amber-line); }
.subscription-option b { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.subscription-option small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.subscription-option > .ico { width: 15px; height: 15px; color: var(--muted); }
.subscription-error { display: flex; gap: 8px; margin: 0; padding: 12px; border-left: 2px solid var(--red); background: #e5533d08; color: #ff9c8b; font-size: 12px; line-height: 1.6; }
.subscription-error .ico { width: 16px; height: 16px; margin-top: 2px; }
.subscription-remove { align-self: flex-start; }
.subscription-picker button:focus-visible, .subscription-picker a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.resident-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.resident-account { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.resident-account > .subscription-status { font-size: 0; }
.resident-account > .subscription-status i { width: 7px; height: 7px; }
.resident-account b { font: 500 17px/1.4 var(--display); }
.resident-email { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.resident-account small { display: block; font: 400 10px/1.4 var(--mono); color: var(--amber); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.provider-key { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.provider-key-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.provider-key h3 { margin: 0; font: 500 22px/1.3 var(--display); letter-spacing: -.02em; }
.provider-key > .btn, .provider-key .stack-sm > .btn { align-self: flex-start; }

/* Settings rows: what a setting is on the left, its control on the right; saved as it changes. */
.set-rows { display: flex; flex-direction: column; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 28px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-rows > .set-row:first-child { border-top: 0; padding-top: 2px; }
.set-rows > .set-row:last-child { padding-bottom: 2px; }
.set-row.stack { grid-template-columns: minmax(0, 1fr); }
/* A row holding only an account picker that has nothing to ask disappears with it. */
.set-row:has(> .subscription-picker[hidden]) { display: none; }
.set-text { min-width: 0; }
.set-text > b { display: flex; align-items: baseline; gap: 10px; font: 500 15px/1.35 var(--body); color: var(--text); }
.set-text small b { color: var(--text); font-weight: 600; }
.set-text small { display: block; max-width: 64ch; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.set-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.set-row.stack .set-control { display: block; }
.set-control > select { width: auto; min-width: 128px; }
.set-control .switch { min-height: 0; }
.set-control > input[type=text], .set-control > input[type=email] { width: min(300px, 100%); }
.set-row.stack .set-control > input[type=text] { width: 100%; }
.voice-pick { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.voice-pick select { width: auto; min-width: 210px; }
.avatar-pick .avatar-actions { align-self: center; }
.set-saved { font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); opacity: 0; transition: opacity 0.2s ease; }
.set-saved.on { opacity: 1; }
.inactivity-control { display: grid; justify-items: end; gap: 8px; }
input.num { width: 92px; text-align: right; font-family: var(--mono); }
.set-switches { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.set-switches > .switch { padding: 10px 14px; }
.set-switches > .switch + .switch { border-top: 1px solid var(--line); }
/* Harness versions: one row per CLI in a well, the version in mono and its state on the right. */
.harness-list { display: grid; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.harness-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.harness-row + .harness-row { border-top: 1px solid var(--line); }
.harness-row.off { opacity: 0.55; }
.harness-name { display: grid; gap: 3px; flex: 1; min-width: 0; }
.harness-name b { font: 600 15px/1.3 var(--body); }
.harness-version { font: 500 13px/1.3 var(--mono); color: var(--text); }
.harness-next { color: var(--amber); }
.harness-name small { color: var(--faint); font: 400 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.harness-name small.harness-error { color: var(--red); }
.harness-row > .badge { flex: none; }
@media (max-width: 480px) {
  .harness-row { flex-wrap: wrap; gap: 8px; }
  .harness-row > .badge { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .set-saved { transition: none; } }
@media (max-width: 600px) {
  /* A switch, a number or an hour stays next to its title; a button or a wide control goes under it. */
  .set-row { gap: 10px 16px; }
  .set-row:has(> .set-control > :is(.btn, .segmented, .input-row, .row, .stack-sm, input[type=text], .voice-pick, .owner-pick)) { grid-template-columns: minmax(0, 1fr); }
  .set-row:has(> .set-control > :is(.btn, .segmented, .input-row, .row, .stack-sm, input[type=text], .voice-pick, .owner-pick)) > .set-control { justify-content: flex-start; flex-wrap: wrap; }
  .set-control > .owner-pick { width: 100%; }
}

/* Settings: every entry in one list on the left, grouped like the desk's sections; its page on the right. */
.rail { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 24px; align-items: start; }
.rail-nav {
  display: flex; flex-direction: column; min-height: 0; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}
.rail-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* On a desktop Settings fits the screen: the title stays, the list and the page each scroll in their own column, and the margins above and below never scroll away. */
@media (min-width: 900px) {
  .mode-rail .content { overflow: hidden; }
  .mode-rail .wrap { height: 100%; padding-bottom: 28px; }
  .mode-rail .rail { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .mode-rail .rail-nav { max-height: 100%; align-self: start; }
  .mode-rail .rail-detail { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
.rail-group:first-child { padding-top: 8px; }
.rail-group { padding: 14px 12px 6px; font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.rail-group::after { content: ""; display: block; height: 1px; margin-top: 8px; background: var(--line); }
.rail-item {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 11px; width: 100%;
  padding: 6px 12px 6px 7px; border: 0; border-radius: var(--r-md); background: none; color: var(--muted);
  font: inherit; text-align: left; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.rail-item:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.rail-item.active { background: var(--panel-2); color: var(--text); }
.rail-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--well); color: var(--muted); }
.rail-mark .ico { width: 16px; height: 16px; }
.rail-item.active .rail-mark { color: var(--amber); border-color: var(--amber-line); background: var(--amber-wash); }
.rail-name { min-width: 0; }
.rail-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.3 var(--body); color: inherit; }
.rail-item.active .rail-name b { color: var(--amber); }
.rail-name small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 10.5px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--faint); }
.rail-item .led { width: 8px; height: 8px; border-radius: 50%; background: #2a2a2a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.rail-item .led.on { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.rail-item .led.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.rail-item .led.busy { background: var(--amber); animation: blink 1.5s ease-in-out infinite; }
.rail-item .led.err { background: var(--red); box-shadow: 0 0 8px rgba(229, 83, 61, 0.5); }
.rail-item .led.none { visibility: hidden; }
.rail-item .rail-go { display: none; width: 16px; height: 16px; color: var(--faint); }
.rail-page[hidden] { display: none; }
.rail-detail { min-width: 0; }
.rail-back { display: none; align-self: flex-start; }
.set-section { display: grid; gap: 10px; }
.set-section + .set-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.set-section > .label { font: 500 15px/1.35 var(--body); letter-spacing: 0; text-transform: none; color: var(--text); }
.set-section > .muted { margin: -6px 0 2px; font-size: 13px; }
.rail .provider-key { padding: 0; border: 0; background: none; }
/* The page already names the provider: its picker keeps only the account's status. */
.rail .subscription-head .subscription-mark, .rail .subscription-head > .grow { display: none; }
.rail .subscription-head:not(:has(> :not(.subscription-mark, .grow))) { display: none; }
.rail .subscription-head { justify-content: flex-end; }
.rail .resident-accounts { margin-top: 14px; }
.resident-account.link { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease; }
.resident-account.link:hover, .resident-account.link:focus-visible { border-color: var(--line-strong); outline: none; }
.accounts { display: grid; gap: 12px; }
.account-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.account + .account { border-top: 1px solid var(--line); }
.account-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 12px 12px 16px; }
.account-row .subscription-option-dot { width: 8px; height: 8px; }
.account-row .subscription-option-dot.ready { box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.account-row .subscription-option-dot.error { background: var(--red); }
.account-row .subscription-option-dot.connecting { background: var(--amber); animation: blink 1.5s ease-in-out infinite; }
.account-row .grow { min-width: 0; }
.account-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15px/1.35 var(--body); }
.account-row small { display: block; margin-top: 2px; font: 400 11px/1.45 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.account-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.account > .subscription-error { margin: 0 16px 12px; }
.account-login { display: grid; gap: 14px; padding: 4px 16px 16px; border-top: 1px dashed var(--line); background: rgba(242, 169, 59, 0.03); }
.account-login .subscription-steps { margin-top: 12px; }
.accounts-empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); font-size: 13px; }
.accounts-add { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) {
  .account-actions .btn:not(.only-icon) { width: 34px; padding: 0; }
  .account-actions .btn:not(.only-icon) span { display: none; }
}
.set-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 0 4px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.set-note .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .rail-item { transition: none; } .rail-item .led.busy { animation: none; } }
@media (max-width: 899px) {
  .rail { grid-template-columns: 1fr; gap: 16px; }
  .rail-item { padding: 10px 12px 10px 8px; }
  .rail.open .rail-nav, .rail:not(.open) .rail-detail { display: none; }
  .rail-back { display: inline-flex; }
  .rail .resident-accounts { grid-template-columns: 1fr; }
  .rail-item .rail-go { display: block; }
  .rail:not(.open) .rail-item.active { background: none; box-shadow: none; color: var(--muted); }
  .rail:not(.open) .rail-item.active .rail-name b { color: var(--text); }
  .rail:not(.open) .rail-item.active .rail-mark { color: var(--muted); border-color: var(--line); background: var(--well); }
}
.access-identity { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.access-identity > .ico { color: var(--amber); }
.access-identity b { font-size: 15px; }
.access-identity small { display: block; color: var(--muted); margin-top: 3px; }
.access-rules > p, .access-people > p { margin: -4px 0 2px; font-size: 13px; }
.access-add { display: flex; flex-wrap: wrap; gap: 8px; }
.access-add input, .access-add select { flex: 1; min-width: 120px; }
.access-add .btn { min-height: 44px; }
.access-rules ul { list-style: none; margin: 4px 0 0; padding: 0; }
.access-rule { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; }
.access-rule > .ico { color: var(--muted); width: 16px; height: 16px; }
.access-rule .grow { overflow-wrap: anywhere; }
.access-rule .btn { min-height: 44px; }
.access-progress { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.access-progress[hidden] { display: none; }
.access-invitation { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 44px; gap: 10px; }
.access-invitation .grow small { display: block; margin-top: 5px; line-height: 1.5; }
.access-invitation .ok-text { color: var(--green); }
.access-invitation .access-rule-remove { grid-column: 4; }
@media (max-width: 600px) {
  .access-add input[type=email] { flex-basis: 100%; }
  .access-add:has(input[type=email]) .btn { width: 100%; justify-content: center; }
  .access-invitation { grid-template-columns: 16px minmax(0, 1fr) 44px; align-items: start; }
  .access-invitation > .ico { margin-top: 10px; }
  .access-invitation .access-rule-remove { grid-column: 3; grid-row: 1; }
  .access-invitation .access-invite-send { grid-column: 2; justify-self: start; }
}
.access-no-rules { color: var(--faint); font-size: 12px; }
.access-note { display: flex; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.access-note .ico { width: 16px; height: 16px; margin-top: 2px; }
.access-users { border-top: 1px solid var(--line); }
.access-user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--line); }
.access-user-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); }
.access-user-email { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-top: 3px; }
.access-user small { display: block; font-size: 10px; color: var(--faint); margin-top: 6px; line-height: 1.6; }
.permissions { border-top: 1px solid var(--line); }
.permission { display: grid; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.permission-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.permission-who .grow { min-width: 0; }
.permission-who b { font-size: 15px; overflow-wrap: anywhere; }
.permission-who small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; color: var(--muted); font-size: 12px; }
.permission-who small .ico { width: 13px; height: 13px; }
.permission-who .btn { min-height: 44px; }
.permission .chips { padding-left: 48px; }
@media (max-width: 600px) { .permission .chips { padding-left: 0; } }
.access-history summary { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; min-height: 44px; font-size: 13px; }
.access-audit > div { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.access-audit b { display: block; font-weight: 500; }
.access-audit .grow > span { display: block; margin-top: 3px; color: var(--muted); }
.access-audit time { color: var(--faint); font-size: 10px; white-space: nowrap; }
@media (max-width: 600px) {
  .access-user { gap: 10px; }
  .access-user-mark { display: none; }
  .access-user .grow { flex-basis: calc(100% - 100px); }
  .access-user > .btn { min-height: 44px; margin-left: auto; }
}
@media (max-width: 1000px) {
}
@media (max-width: 600px) {
  .subscription-content { padding: 18px; gap: 18px; }
  .subscription-head { flex-wrap: wrap; }
  .subscription-status { font-size: 10px; }
  .subscription-mark { width: 38px; height: 38px; border-radius: 10px; }
  .subscription-head h3 { font-size: 20px; }
  .subscription-footer > .btn.primary { flex: 1; }
  .resident-accounts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .resident-account { padding: 14px; }
  .provider-key { padding: 18px; }
  .settings-tabs { gap: 4px; }
  .settings-tabs button { flex: none; padding: 10px 12px; }
  .settings-tabs .ico { display: none; }
}

/* ---------- routines ---------- */
.routine-panel > .panel-body { padding: 0; gap: 0; }
.routine-list { display: flex; flex-direction: column; min-width: 0; }
.routine-list > .empty { margin: 18px 20px; }
.routine { min-width: 0; border-top: 1px solid var(--line); }
.routine:first-child { border-top: 0; }
.routine-toggle { display: grid; grid-template-columns: 8px minmax(0, 1fr) 16px; align-items: start; gap: 14px; width: 100%; padding: 14px 20px; border: 0; background: none;
  color: inherit; text-align: left; font: inherit; cursor: pointer; }
.routine-toggle:hover, .routine.open .routine-toggle { background: var(--panel-2); }
.routine-toggle:focus-visible { outline: 2px solid var(--amber-line); outline-offset: -2px; }
.routine-toggle > .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); transition: transform 0.15s ease; }
.routine.open .routine-toggle > .ico { transform: rotate(90deg); color: var(--text); }
.routine-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--faint); }
.routine-dot.ok { background: var(--green); }
.routine-dot.err { background: var(--red); }
.routine-dot.agent { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); }
.routine-dot.off { background: transparent; border: 1px solid var(--faint); }
.routine-main { display: grid; gap: 4px; min-width: 0; }
.routine-name { font: 600 15px/1.3 var(--display); letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.routine.paused .routine-name { color: var(--muted); }
.routine-times { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font: 400 11px/1.5 var(--mono); min-width: 0; }
.routine-state.ok { color: var(--green); }
.routine-state.err { color: #ff9c8b; }
.routine-state.agent { color: var(--amber); }
.routine-where { flex-basis: 100%; color: var(--faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.routine.open .routine-alert { display: none; }
.routine-alert { color: #ff9c8b; font-size: 12px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow-wrap: anywhere; }
.routine-detail { display: grid; gap: 12px; padding: 4px 20px 18px 42px; background: var(--panel-2); min-width: 0; }
.routine-detail[hidden] { display: none; }
.routine-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font: 400 11px/1.5 var(--mono); }
.routine-facts dt { color: var(--faint); text-transform: uppercase; letter-spacing: 0.12em; font-size: 9px; line-height: 16px; }
.routine-facts dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.routine-facts code { color: var(--amber); }
.routine-detail .task-verification { margin: 0; }
.routine-detail .task-verification.err { color: #ff9c8b; }
.routine-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.routine-actions .btn.danger { margin-left: auto; }
.routine-block { display: grid; gap: 6px; min-width: 0; }
.routine-block > span { color: var(--faint); font: 500 9px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.routine-detail pre { margin: 0; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: var(--r-sm); background: #070707; border: 1px solid var(--line);
  font: 400 11px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: #d6d6d2; }
@media (prefers-reduced-motion: reduce) { .routine-toggle > .ico { transition: none; } }
@media (max-width: 600px) {
  .routine-panel > .panel-head .panel-title p { display: none; }
  .routine-toggle { gap: 12px; padding: 12px 14px; }
  .routine-detail { padding: 4px 14px 14px 34px; }
  .routine-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .routine-actions .btn.sm { width: 100%; justify-content: center; }
  .routine-actions .btn.danger { margin-left: 0; }
}
details.raw summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--muted);
  font: 500 10px/1.8 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}
details.raw summary::-webkit-details-marker, details.step summary::-webkit-details-marker { display: none; }
.steps-log pre, details.raw pre {
  margin: 8px 0 0; max-height: 420px; overflow: auto; padding: 10px 12px; border-radius: var(--r-sm); background: #070707; border: 1px solid var(--line);
  font: 400 11px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: #d6d6d2;
}

/* ---------- desktop ---------- */
.monitor-frame { background: #070707; border-radius: var(--r-md); padding: 10px; border: 1px solid var(--line); box-shadow: 0 0 0 6px #111111; }
.monitor-frame .screen { position: relative; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: #000; display: grid; place-items: center; }
.monitor-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.monitor-frame .off { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--faint); }
.monitor-frame .off > .ico { width: 34px; height: 34px; stroke-width: 1.4; }

/* ---------- teletype ---------- */
.panel.teletype .panel-body { padding: 0; border-top: 0; }
.feed {
  list-style: none; margin: 0; padding: 4px 16px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink); font: 400 12px/1.5 var(--mono); border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: inset 0 10px 14px -12px rgba(0, 0, 0, 0.6);
}
.feed li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px dotted rgba(43, 36, 28, 0.28); animation: drop 0.35s ease-out both; }
.feed li:last-child { border-bottom: 0; }
.feed-ico { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(43, 36, 28, 0.08); color: #6b5a44; }
.feed-ico .ico { width: 13px; height: 13px; }
.feed-text { flex: 1; min-width: 0; word-break: break-word; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 10px; letter-spacing: 0.04em; }
.feed-meta time, .feed-meta .where { opacity: 0.6; }
.feed-meta .who { font-weight: 600; }
.feed li.tool .feed-ico, .feed li.tool .what { color: #2f5f8d; }
.feed li.error .feed-ico, .feed li.error .what, .feed li.warning .feed-ico, .feed li.warning .what { color: #b13a26; }
.feed li.pass { opacity: 0.5; }
.feed .why { flex: none; color: #8a6a2c; padding: 3px; }
.feed .why .ico { width: 15px; height: 15px; }
.feed-empty { justify-content: center; padding: 24px 0 !important; opacity: 0.6; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-slot { display: flex; flex-direction: column; min-height: 0; }
.chat-log {
  display: flex; flex-direction: column; gap: 12px; min-height: 320px; max-height: 65vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.chat-log .empty { margin: auto; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: min(720px, 92%); animation: drop 0.25s ease-out both; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { --ring: var(--line-strong); min-width: 0; padding: 9px 13px 11px; border-radius: 16px 16px 16px 5px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--ring); }
.msg.mine .bubble { border-radius: 16px 16px 5px 16px; background: var(--amber-wash); border: 1px solid var(--amber-line); }
.msg .meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; color: var(--faint); font: 400 10px/1.6 var(--mono); letter-spacing: 0.04em; }
.msg .meta b { color: var(--text); font: 600 12px/1.4 var(--body); letter-spacing: 0; }
.msg .meta .why { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--amber); text-decoration: none; text-transform: uppercase; letter-spacing: 0.1em; }
.msg .meta .why .ico { width: 12px; height: 12px; }
.msg .meta .send-state { display: inline-flex; align-items: baseline; gap: 8px; color: var(--faint); }
.msg.pending .bubble { opacity: 0.72; }
.msg.failed .bubble { border-color: #6e2b20; }
.msg.failed .meta .send-state { color: #ff9c8b; }
.msg .meta .retry { padding: 0; border: 0; background: none; color: var(--amber); font: inherit; text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; text-decoration: underline 1px var(--amber-glow); text-underline-offset: 3px; }
.msg .text { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.msg .text.md { white-space: normal; gap: 6px; }
.msg .text a { color: var(--amber); text-decoration: underline 1px var(--amber-glow); text-underline-offset: 3px; overflow-wrap: anywhere; }
.msg .text a:hover, .msg .text a:focus-visible { text-decoration-color: var(--amber); }
.chat-file { display: block; margin-top: 8px; }
.chat-file img { display: block; max-width: 100%; max-height: 360px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.chat-file.audio { width: 320px; max-width: 100%; height: 36px; }
.agent-email { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; max-width: 100%; color: var(--amber); font: 400 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.agent-email .ico { flex: 0 0 15px; width: 15px; height: 15px; }
.mail-address { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.mail-address > a, .mail-address > code { color: var(--amber); font: 400 clamp(15px, 2vw, 22px)/1.5 var(--mono); overflow-wrap: anywhere; min-width: 0; }
.mail-address.previous + .mail-address.previous { margin-top: 14px; }
.mail-address.previous code { font-size: 13px; }
.mail-address-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 12px; }
.mail-at { padding-bottom: 13px; color: var(--muted); font-family: var(--mono); }
.mail-feedback:empty { display: none; }
.mail-feedback { color: var(--muted); overflow-wrap: anywhere; }
.mail-feedback[role="alert"], .mail-feedback.err-text { color: var(--red); }
.mail-account + .mail-account, .mail-add-account { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.mail-account > header, .mail-record > header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.mail-account > header .grow { flex: 1 1 160px; min-width: 120px; }
.mail-account h3 { margin: 0; font: 600 18px/1.4 var(--display); overflow-wrap: anywhere; }
.mail-account p { margin: 5px 0; }
.mail-account details, .mail-account-form { margin-top: 16px; }
.mail-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mail-checks li { padding: 16px; border-left: 1px solid var(--line); color: var(--muted); }
.mail-checks li:first-child { border-left: 0; }
.mail-checks li.current { background: var(--amber-wash); color: var(--text); }
.mail-checks li.done { color: var(--text); }
.mail-step { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 400 11px var(--mono); }
.done .mail-step { color: var(--green); border-color: var(--green); }
.current .mail-step { color: var(--amber); border-color: var(--amber); }
.mail-step .ico { width: 15px; height: 15px; }
.mail-checks b { font-size: 13px; }
.mail-checks p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.mail-dns > p { margin: 12px 0 16px; }
.mail-record { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.mail-record + .mail-record { margin-top: 10px; }
.mail-record header { justify-content: space-between; }
.mail-record header b { font: 400 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.mail-record dl { margin: 14px 0 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 14px; }
.mail-record dt { font-size: 12px; color: var(--muted); padding-top: 6px; }
.mail-record dd { display: flex; align-items: flex-start; gap: 8px; margin: 0; min-width: 0; }
.mail-record code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; font-size: 12px; }
.mail-domain-note { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mail-domain-note .ico { flex: 0 0 18px; width: 18px; height: 18px; color: var(--amber); margin-top: 3px; }
@media (max-width: 650px) {
  .mail-address-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mail-at { display: none; }
  .mail-checks { grid-template-columns: minmax(0, 1fr); }
  .mail-checks li { display: flex; gap: 12px; border-left: 0; border-top: 1px solid var(--line); padding: 14px; }
  .mail-checks li:first-child { border-top: 0; }
  .mail-step { flex: 0 0 25px; margin: 0; }
  .mail-record { padding: 12px; }
  .mail-record dl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mail-record dt { padding-top: 6px; }
  .mail-record dd { flex-wrap: wrap; }
  .mail-record code { flex-basis: 100%; }
}
.chat-file.doc { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font: 400 12px/1.4 var(--mono); }
.chat-note {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--faint); font: 400 11px/1.4 var(--mono); text-decoration: none;
}
.chat-note .ico { width: 13px; height: 13px; }
.chat-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-note b { color: var(--muted); font-weight: 500; flex: none; }
.chat-note.error, .chat-note.interrupted { color: #ff9c8b; border-color: #6e2b20; }
.chat-working { display: flex; flex-direction: column; gap: 6px; flex: none; }
.chat-working:empty { display: none; }
.working {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); text-decoration: none; color: var(--muted);
  background: linear-gradient(90deg, rgba(242, 169, 59, 0.10), transparent 70%); border: 1px dashed var(--amber-line);
}
.working .grow { display: flex; flex-direction: column; }
.working b { color: var(--text); font-weight: 600; }
.working .line { font: 400 11px/1.5 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typing { display: inline-flex; gap: 4px; flex: none; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 6px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chat-compose:focus-within { border-color: var(--amber); }
.chat-compose .chat-input { flex: 1; height: 44px; min-height: 44px; max-height: 160px; padding: 11px 10px; resize: none; border: 0; background: transparent; box-shadow: none; overflow-y: auto; }
.chat-compose .btn.send { width: 44px; height: 44px; border-radius: 12px; padding: 0; }
.chat-compose .btn.send .ico { width: 19px; height: 19px; }

/* Chat pages fill the screen like a messaging app. */
.mode-chat .content { overflow: hidden; }
.mode-chat .wrap { height: 100%; padding-bottom: 20px; }
.mode-chat .chat-slot, .mode-chat .wrap > .chat { flex: 1; }
.mode-chat .chat { flex: 1; }
.mode-chat .chat-log { flex: 1; min-height: 0; max-height: none; }

/* ---------- requests ---------- */
.requests-slot { display: flex; flex-direction: column; flex: none; }
.requests-slot:empty { display: none; }
.requests { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-lg); border: 1px solid var(--amber-line); background: linear-gradient(180deg, rgba(242, 169, 59, 0.12), rgba(242, 169, 59, 0.04)); flex: none; }
.requests-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--amber); font: 600 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.request-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); text-decoration: none; min-width: 0; }
.request-card b { display: block; font-size: 13px; }
.request-card .row-text { margin-top: 1px; font-size: 13px; }
.msg.request .bubble { border-color: var(--amber-line); border-left-color: var(--amber); background: var(--amber-wash); }
.request-tag { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 4px; color: var(--amber); font: 600 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.request-tag .ico { width: 13px; height: 13px; }
.choices-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.choices-row .btn { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.choices-row .label { margin-left: 4px; }

/* ---------- reasoning ---------- */
.steps-log { display: flex; flex-direction: column; gap: 8px; }
.step { padding: 10px 12px; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line); }
.step-head, details.step summary { display: flex; align-items: center; gap: 10px; min-width: 0; }
details.step summary { cursor: pointer; list-style: none; }
.step-ico { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.step-ico .ico { width: 14px; height: 14px; }
.step-head b, details.step summary b { font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.step .at { margin-left: auto; flex: none; color: var(--faint); font: 400 10px/1 var(--mono); }
.step .body { margin: 8px 0 0 36px; white-space: pre-wrap; word-break: break-word; }
.step.thinking { border-left: 3px solid var(--amber); }
.step.thinking .step-ico { color: var(--amber); }
.step.thinking .body { color: #cfcfca; font-style: italic; }
.step.thinking.hidden .body { color: var(--faint); }
.step.text { border-left: 3px solid var(--line-strong); }
.step.note .body { color: var(--faint); font: 400 11px/1.6 var(--mono); }
details.step.tool { border-left: 3px solid var(--blue); }
details.step.tool .step-ico, details.step.tool summary b { color: var(--blue); }
details.step summary .args { flex: 1; min-width: 0; color: var(--muted); font: 400 11px/1.6 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.step summary .ms { flex: none; color: var(--faint); font: 400 10px/1.6 var(--mono); }
details.step summary .at { margin-left: 0; }
details.step.failed { border-left-color: var(--red); }
details.step.failed summary b, details.step.failed .step-ico { color: #ff9c8b; }
details.step > .label { display: block; margin: 12px 0 0; }
.answer { padding: 12px 14px; border-radius: var(--r-md); background: var(--amber-wash); border: 1px solid var(--amber-line); white-space: pre-wrap; word-break: break-word; }
details.raw + details.raw { margin-top: 4px; }
details.raw summary { padding: 8px 0; }
details.raw summary .ico { width: 15px; height: 15px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r-md); background: var(--paper); color: var(--ink);
  font: 500 13px/1.4 var(--body); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8); animation: toast-in 0.25s ease-out both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.toast .ico { color: #3f6b2a; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast.err { background: #3a1510; color: #ffd9cf; border: 1px solid rgba(229, 83, 61, 0.6); }
.toast.err .ico { color: #ff9c8b; }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center;
  padding: calc(32px + var(--safe-top)) 20px calc(32px + var(--safe-bottom));
  background: radial-gradient(520px 380px at 50% 22%, rgba(242, 169, 59, 0.13), transparent 70%);
}
.login > p { color: var(--muted); }
.login-inner { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-icon { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0, 0, 0, 0.9), 0 0 44px -12px var(--amber-glow); }
.login h1 { margin: 8px 0 0; font: 600 56px/1 var(--display); letter-spacing: -0.04em; }
.login-sub { margin: 0; color: var(--muted); }
.login-card {
  width: 100%; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; padding: 20px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.login-field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--well); color: var(--faint); }
.login-field:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); color: var(--amber); }
.login-field input[type=password], .login-field input[type=text] { flex: 1; height: 100%; padding: 0; border: 0; background: transparent; font-size: 16px; box-shadow: none; }
.login-card .btn.primary { height: 52px; margin-top: 2px; font-size: 12px; }
.login-error { margin: 0; min-height: 18px; color: #ff9c8b; font-size: 13px; }
.login-error:empty { min-height: 0; }
.login-foot { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--faint); font: 400 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.login-foot .ico { width: 14px; height: 14px; }
.login-langs { display: flex; gap: 4px; margin-top: 4px; }
.login-langs button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; font: 500 10px/1 var(--mono); letter-spacing: 0.12em; }
.login-langs button.on { color: var(--amber); border-color: var(--amber-line); }
.choice .panel-ico { font: 600 11px/1 var(--mono); letter-spacing: 0.06em; }

/* ---------- phone: an app with a top bar and a tab bar ---------- */
@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .sidebar { display: none; }
  .content { grid-column: 1; grid-row: 2; }
  .appbar {
    grid-row: 1; display: flex; align-items: center; gap: 8px; z-index: 10;
    height: calc(56px + var(--safe-top)); padding: var(--safe-top) 10px 0 8px;
    background: rgba(5, 5, 5, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  }
  .appbar h1 { flex: 1; min-width: 0; margin: 0; font: 600 22px/1.1 var(--display); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar-brand { display: grid; place-items: center; width: 40px; height: 40px; }
  .appbar-brand img { width: 32px; height: 32px; border-radius: 8px; }
  .tabbar {
    grid-row: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 10;
    padding: 6px 6px calc(6px + var(--safe-bottom)); background: rgba(5, 5, 5, 0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 52px; border-radius: 12px; color: var(--faint); text-decoration: none; font: 600 9px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--amber); }
  .tabbar a.active .ico { filter: drop-shadow(0 0 6px var(--amber-glow)); }

  .wrap { padding: 16px 14px 24px; gap: 14px; }
  .page-title h1 { display: none; }
  .page-title p { margin: 0; font-size: 14px; }
  .page-head { align-items: center; }
  /* A commit's message is what the page is about: the app bar only says "Commit", so it stays, smaller. */
  .art-commit-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-title .thread-title.heading h1 { display: block; font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; }
  .art-commit-head .page-title h1 { display: block; margin-bottom: 10px; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
  .art-commit-head .page-actions { justify-content: flex-start; }
  .art-decide .row { flex-wrap: wrap; }
  .art-decide .row > .spacer { display: none; }
  .art-decide .row > .btn { flex: 1 1 0; justify-content: center; }
  .art-decide .row > .btn.primary { flex-basis: 100%; }
  .mode-chat .page-head { display: none; }
  .mode-chat .wrap { padding-bottom: 8px; gap: 10px; }
  .kbd-open .tabbar { display: none; }
  .kbd-open .mode-chat .wrap { padding-bottom: 6px; }

  .panel-head { padding: 14px 16px; flex-wrap: wrap; }
  .panel-actions:has(.badge, .tag) { flex-basis: 100%; justify-content: flex-start; padding-left: 48px; }
  .panel-body { padding: 16px; }
  .panel-title h2 { font-size: 19px; }
  .split, .grid2, .grid3, .choices { grid-template-columns: minmax(0, 1fr); }
  /* On a phone the list is the way to the models: only the chosen one explains itself. */
  .harness-row { padding: 10px 12px; }
  .harness-row:not(.on) .harness-hint { display: none; }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; min-width: 0; line-height: 1.25; padding-inline: 8px; white-space: normal; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .panel-ico { width: 32px; height: 32px; }
  .stat b { font-size: 22px; }
  .agent-grid { grid-template-columns: minmax(0, 1fr); }

  .hero { padding: 14px; gap: 14px; }
  .hero h1 { font-size: 32px; }
  .avatar.lg { width: 56px; height: 56px; font-size: 24px; }
  .hero .btn.toggle span { display: none; }
  .hero .btn.toggle { width: 38px; padding: 0; }
  .tabs { margin: 0 -14px; padding: 2px 14px; }

  input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea, .chat-compose .chat-input { font-size: 16px; }
  .input-row.token { flex-direction: column; align-items: stretch; }
  .input-row.token > input, .input-row.token > .paste-field { flex: none; }
  .agent-card .monitor { aspect-ratio: 16 / 8; }
  .row-item { flex-wrap: wrap; }
  .row-item > .row-actions { width: 100%; justify-content: flex-end; }
  .step .body { margin-left: 0; }
  .savebar { bottom: 8px; }
  .chat-log { padding: 12px; }
  .msg { max-width: 100%; }
  .toast { bottom: calc(80px + var(--safe-bottom)); }
}

/* Phones get a slimmer scale: smaller type, tighter bars and panels. */
@media (max-width: 899px) {
  body { font-size: 14px; }
  .appbar { height: calc(48px + var(--safe-top)); }
  .appbar h1 { font-size: 20px; font-weight: 700; }
  .appbar-brand { width: 34px; height: 34px; }
  .appbar-brand img { width: 26px; height: 26px; border-radius: 7px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn .ico { width: 20px; height: 20px; }
  .tabbar { padding: 4px 4px max(4px, calc(var(--safe-bottom) - 14px)); }
  .tabbar a { height: 44px; gap: 4px; font-size: 8.5px; letter-spacing: 0.05em; }
  .tabbar a .ico { width: 20px; height: 20px; stroke-width: 1.6; }
  .wrap { padding: 12px 12px 20px; gap: 12px; }
  .page-title p { font-size: 13px; }
  .panel { border-radius: 14px; }
  .panel-head { padding: 11px 13px; gap: 10px; }
  .panel-body { padding: 13px; gap: 12px; }
  .panel-ico { width: 30px; height: 30px; border-radius: 8px; }
  .panel-ico .ico { width: 16px; height: 16px; }
  .panel-title h2 { font-size: 17px; font-weight: 700; }
  .panel-title p { font-size: 12px; }
  .panel-actions:has(.badge, .tag) { padding-left: 40px; }
  .btn { height: 38px; padding: 0 12px; font-size: 10px; }
  .btn.only-icon { width: 38px; }
  .btn.sm { height: 32px; padding: 0 9px; }
  .btn.sm.only-icon { width: 32px; }
  .btn .ico { width: 15px; height: 15px; }
  .badge { height: 22px; padding: 0 7px; font-size: 9.5px; }
  .stat { padding: 10px; gap: 8px; border-radius: 14px; }
  .stat .panel-ico { width: 28px; height: 28px; }
  .stat b { font-size: 18px; }
  .stat .label { font-size: 9px; }
  .hero { padding: 10px 12px; gap: 10px; border-radius: 14px; }
  .hero h1 { font-size: 24px; font-weight: 700; }
  .hero .hero-text { gap: 6px; }
  .hero.compact { padding: 8px 10px; }
  .hero.compact h1 { font-size: 20px; }
  .avatar { width: 36px; height: 36px; font-size: 14px; }
  .avatar.lg { width: 44px; height: 44px; font-size: 18px; }
  .avatar.sm { width: 26px; height: 26px; font-size: 11px; }
  .tabs a { height: 32px; padding: 0 10px; gap: 6px; font-size: 9.5px; }
  .tabs a .ico { width: 14px; height: 14px; }
  .agent-ident { padding: 12px 12px 8px; }
  .agent-ident b { font-size: 18px; }
  .agent-card .badges { padding-left: 12px; padding-right: 12px; }
  .agent-actions { padding: 10px 12px 12px; }
  .row-link, .row-item { padding: 10px 2px; gap: 10px; }
  .row-title { font-size: 16px; }
  .row-meta { font-size: 10px; }
  .choice { padding: 10px 12px; }
  .choice b { font-size: 18px; }
  .chat-log { padding: 10px; gap: 10px; border-radius: 14px; }
  .msg .bubble { padding: 7px 11px 9px; }
  .msg .meta { font-size: 9.5px; }
  .msg .meta b { font-size: 12px; }
  .mode-chat .hero { display: none; }
  .mode-chat .wrap { padding-bottom: 6px; gap: 8px; }
  .mode-chat .chat-working { gap: 4px; }
  .mode-chat .working { padding: 5px 10px; gap: 8px; }
  .mode-chat .working .grow { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
  .mode-chat .working b { flex: none; font-size: 12px; }
  .mode-chat .working .line { min-width: 0; }
  .chat-compose { padding: 4px; border-radius: 14px; }
  .chat-compose .chat-input { height: 40px; min-height: 40px; padding: 9px 8px; }
  .chat-compose .btn.send { width: 40px; height: 40px; }
  .working { padding: 6px 10px; }
  .step { padding: 8px 10px; }
  .switch { min-height: 34px; }
  .switch .rocker { width: 40px; height: 22px; }
  .switch .rocker::after { width: 14px; height: 14px; }
  .switch input:checked + .rocker::after { transform: translateX(18px); }
  .switch-text { font-size: 13px; }
  .feed { font-size: 11px; padding: 2px 12px; }
  .login h1 { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- token heatmap ---------- */
/* Start at the first recorded use. Bounded squares keep short histories compact;
   longer histories scroll sideways and open on the latest week after mounting. */
.heat-wrap { display: flex; flex-direction: column; gap: 22px; }
.heat-block { display: flex; flex-direction: column; gap: 6px; }
.heat-block .empty { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 0 2px; font-size: 13px; }
.heat-block .empty .ico { width: 18px; height: 18px; }
.heat-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.heat-head b { font: 600 13px/1.2 var(--sans); letter-spacing: 0.01em; }
.heat-head .avatar { width: 22px; height: 22px; flex: 0 0 auto; }
.heat-total { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--muted); letter-spacing: 0.06em; }
.heat-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.heat-plot { display: flex; flex-direction: column; gap: 4px; width: max-content; min-width: 100%; }
.heat-months,
.heat-grid { display: grid; grid-template-columns: repeat(var(--weeks), 14px); gap: 3px; }
.heat-grid { grid-template-rows: repeat(var(--rows, 7), 14px); grid-auto-flow: column; }
.heat-month { font: 500 9px/1 var(--mono); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.heat-cell { display: block; aspect-ratio: 1; border-radius: 2px; border: 1px solid transparent; }
.heat-cell.l0 { background: #141414; }
.heat-cell.l1 { background: rgba(242, 169, 59, 0.22); }
.heat-cell.l2 { background: rgba(242, 169, 59, 0.45); }
.heat-cell.l3 { background: rgba(242, 169, 59, 0.7); }
.heat-cell.l4 { background: var(--amber); }
.heat-cell.blank { visibility: hidden; }
.heat-cell[title] { cursor: crosshair; }
.heat-cell[title]:hover { border-color: var(--text); }
.heat-readout { margin: 0; font: 400 11px/1.4 var(--mono); color: var(--muted); min-height: 1.4em; }
.heat-range { margin: 0 0 8px; font: 400 11px/1.4 var(--mono); color: var(--muted); }
/* The scale is said once, up in the panel header. */
.heat-legend { display: inline-flex; align-items: center; gap: 3px; }
.heat-legend .heat-cell { width: 10px; }
.heat-legend small { font: 500 9px/1 var(--mono); letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.heat-legend small:first-child { margin-right: 3px; }
.heat-legend small:last-child { margin-left: 3px; }

/* ---------- your account: the mark, the sidebar's foot, the phone's top right, the menu ---------- */
.user-mark {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--amber); font: 500 11px/1 var(--mono); letter-spacing: 0.04em;
}
.user-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-mark.sm { width: 26px; height: 26px; font-size: 10px; }
.user-mark.lg { width: 42px; height: 42px; font-size: 14px; }
.side-account { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.side-identity {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 10px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.side-identity:hover, .side-identity[aria-expanded="true"] { background: var(--panel); }
.side-identity b { display: block; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-identity small { display: block; color: var(--faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.side-identity .ico.up { width: 14px; height: 14px; color: var(--faint); transform: rotate(-90deg); }
.profile-btn {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--well); cursor: pointer;
}
.profile-btn:hover { border-color: var(--line-strong); }
.profile-btn[aria-expanded="true"] { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.profile-scrim { position: fixed; inset: 0; z-index: 39; }
.profile-scrim.bar { background: rgba(0, 0, 0, 0.45); }
.profile-menu {
  position: fixed; z-index: 40; width: min(300px, calc(100vw - 20px)); padding: 6px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  animation: profile-in 0.14s ease-out;
}
.profile-menu.bar { top: var(--top, calc(56px + var(--safe-top))); right: 10px; transform-origin: top right; }
.profile-menu.side { left: var(--left, 14px); bottom: var(--bottom, 76px); width: var(--width, 300px); transform-origin: bottom left; }
@keyframes profile-in { from { opacity: 0; transform: scale(0.97); } }
@media (prefers-reduced-motion: reduce) { .profile-menu { animation: none; } }
.profile-head { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.profile-head .grow { min-width: 0; }
.profile-head b { display: block; font: 600 16px/1.2 var(--display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head small { display: block; margin-top: 4px; color: var(--faint); font: 400 11px/1.2 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-item {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 10px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--muted); font: 500 14px/1 var(--body); text-align: left; cursor: pointer;
}
.profile-item .ico { width: 18px; height: 18px; }
.profile-item:hover, .profile-item:focus-visible { background: var(--panel-2); color: var(--text); outline: none; }
.profile-item.out:hover, .profile-item.out:focus-visible { color: #ff9c8b; }
.profile-body hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.profile-confirm { padding: 8px 8px 4px; }
.profile-confirm b { display: block; font: 600 17px/1.2 var(--display); letter-spacing: -0.01em; }
.profile-confirm p { margin: 6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.profile-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- instruction context ---------- */
.context-intro { margin: 0; color: var(--muted); max-width: 780px; font-size: 13px; line-height: 1.8; }
/* The sources list is drawn like the Settings list: the same items, the same lit entry. */
.context-browser { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 24px; align-items: start; }
.context-files { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -28px rgba(0, 0, 0, 0.9); }
.context-file { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; width: 100%; padding: 6px 12px 6px 7px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.context-file:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.context-file.active { background: var(--panel-2); color: var(--text); }
.context-file.active b { color: var(--amber); }
.context-file.active > .ico { color: var(--amber); border-color: var(--amber-line); background: var(--amber-wash); }
.context-file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px/1.35 var(--mono); color: var(--text); }
.context-file small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 10.5px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--faint); }
.context-file > .ico { box-sizing: border-box; width: 30px; height: 30px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--well); color: var(--muted); }
.context-file-dot { width: 8px; height: 8px; border-radius: 50%; background: #2a2a2a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); flex: none; }
.context-file-dot.applied { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.context-file-dot.detected { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.context-document { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); }
.context-document > header { display: flex; align-items: flex-start; gap: 12px; padding: 24px 24px 16px; }
.context-document h2 { margin: 0; font: 500 26px/1.3 var(--display); letter-spacing: -.03em; }
.context-path { margin: 7px 0 0; color: var(--muted); font: 400 11px/1.7 var(--mono); overflow-wrap: anywhere; }
.context-provenance { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 24px 16px; }
.context-provenance time { color: var(--faint); font-size: 11px; }
.context-explanation { margin: 0; padding: 0 24px 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.context-text { margin: 0; padding: 24px; max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--line); background: var(--well); color: #c9c9c5; font: 400 12px/1.9 var(--mono); tab-size: 2; }
.context-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.context-empty .ico { width: 28px; height: 28px; color: var(--faint); }
.context-empty p { margin: 0; }
.context-limit { display: block; padding: 12px 24px; color: var(--muted); font-size: 11px; }
@media (max-width: 900px) {
  .tabbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .context-browser { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .context-files { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: thin; }
  .context-file { width: 210px; min-width: 210px; }
  .context-document > header { padding: 18px 18px 14px; flex-wrap: wrap; }
  .context-provenance { padding: 0 18px 14px; }
  .context-explanation { padding: 0 18px 18px; }
  .context-text { padding: 18px; max-height: 65vh; font-size: 11px; }
}

.context-group { display: block; padding: 14px 12px 6px; font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.context-group:first-child { padding-top: 8px; }
.context-group::after { content: ""; display: block; height: 1px; margin-top: 8px; background: var(--line); }
.context-draft { display: flex; gap: 10px; align-items: center; padding: 14px 10px; color: var(--amber); font-size: 13px; }
.context-upload-hint { color: var(--muted); font-size: 11px; line-height: 1.6; }
.context-editor { display: flex; flex-direction: column; gap: 18px; padding: 0 24px 24px; }
.context-editor-text { min-height: 340px; resize: vertical; font: 400 13px/1.8 var(--mono); tab-size: 2; }
.context-count { margin-top: -12px; color: var(--muted); font-size: 11px; text-align: right; }
.context-editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.context-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 20px; }
.context-error { display: flex; gap: 8px; margin: 0 24px 20px; padding: 12px; border-left: 2px solid var(--red); background: #e5533d08; color: #ff9c8b; font-size: 12px; line-height: 1.6; }
.context-editor .context-error { margin: 0; }
@media (max-width: 900px) {
  .context-group { display: none; }
  .context-editor { padding: 0 18px 18px; }
  .context-editor-text { min-height: 300px; font-size: 16px; }
  .context-tools { padding: 0 18px 18px; }
  .context-tools .btn, .context-editor-actions .btn { min-height: 44px; }
}

.context-document h2 { overflow-wrap: anywhere; }

/* ---------- scheduled tasks and their history ---------- */
.task-kind-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task-kind { display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; color: var(--muted); background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.task-kind.active { color: var(--amber); border-color: var(--amber-line); background: var(--amber-wash); }
.task-kind b, .task-kind small { display: block; }
.task-kind b { font: 600 17px/1.3 var(--display); }
.task-kind small { margin-top: 4px; font-size: 11px; color: var(--muted); }
.task-kind .ico { flex: none; }
.task-tabs { margin: 0; }
.task-timing > small { color: var(--muted); line-height: 1.6; }
.task-verification { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.task-history-filters { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.task-history-filters > select { flex: 1 1 150px; width: auto; }
.task-history-search { display: flex; gap: 8px; flex: 2 1 280px; min-width: 0; }
.task-history-search input { min-width: 0; }
.task-history-count { margin: 16px 0; font: 400 11px/1.6 var(--mono); color: var(--muted); }
.task-history-list { display: flex; flex-direction: column; gap: 12px; }
.task-history-item { padding: 20px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.task-history-item > header { display: flex; gap: 12px; align-items: flex-start; }
.task-history-item h3 { margin: 0 0 6px; font: 600 21px/1.25 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.task-history-item details { margin-top: 16px; }
.task-history-item summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; color: var(--muted); font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.task-history-item details[open] summary { color: var(--text); }
.task-history-item pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 12px/1.8 var(--mono); }
.task-history-links { margin-top: 12px; }
.task-history-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 20px; font-size: 11px; }
@media (max-width: 600px) {
  .task-kind-picker { gap: 8px; }
  .task-kind { padding: 12px; gap: 8px; }
  .task-kind small { font-size: 10px; }
  .task-history-item { padding: 12px; }
  .task-history-item > header { gap: 10px; }
  .task-history-item > header > .panel-ico { display: none; }
  .task-history-item > header .grow { min-width: 0; }
  .task-history-item h3 { font-size: 16px; margin-bottom: 4px; }
  .task-history-item > header .row-meta { flex-wrap: wrap; row-gap: 2px; }
  .task-history-item > header > .tag { flex: none; }
  .task-history-item details { margin-top: 8px; }
  .task-history-list { gap: 8px; }
  .task-form .set-row:has(> .set-control > :is(select, input[type=text])) { grid-template-columns: minmax(0, 1fr); }
  .task-form .set-control > :is(select, input[type=text]) { width: 100%; }
  .task-history-search { flex-basis: 100%; }
  .task-timing input[type=datetime-local] { min-width: 0; width: 100%; }
}

@media (max-width: 600px) { .task-history-filters > select:first-child { flex-basis: 100%; } }

/* doc's checks: two groups of rows with a rocker each, the owner's own marked amber; the editor tries a rule on every harness */
.doc-group { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.doc-group + .doc-group { margin-top: 16px; }
.doc-group-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.doc-group-head h3 { margin: 0; font: 500 16px/1.3 var(--display); }
.doc-group-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.doc-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.doc-group-head + .doc-check { border-top: 0; }
.doc-check .switch { flex: 1; min-width: 0; }
.doc-check .switch-text { min-width: 0; overflow-wrap: anywhere; }
.doc-check-actions { display: flex; gap: 4px; flex: none; }
.doc-add { display: flex; margin-bottom: 16px; }
.doc-editor { padding: 18px; margin-bottom: 16px; border: 1px dashed var(--amber-line); border-radius: var(--r-md); background: var(--amber-wash); }
.doc-editor textarea { min-height: 72px; }
.doc-targets { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.doc-editor .row > .btn:last-child { margin-left: auto; }
.doc-trials { display: flex; flex-direction: column; gap: 8px; }
.doc-trials:empty { display: none; }
.doc-trial { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.doc-trial-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-trial-head small { color: var(--muted); }
.doc-trial-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.doc-trial details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.doc-trial details p { display: grid; gap: 2px; margin: 8px 0 0; font-size: 13px; overflow-wrap: anywhere; }

/* A new memory: a line at the top of the list. */
.memory-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.memory-add > input { flex: 1 1 320px; min-width: 0; }
.memory-add-options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* The agent's voice */
.voice-about { color: var(--muted); }
.voice-about a { color: var(--amber); }
.voice-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.voice-listen:has(> [hidden]:only-child) { display: none; }
.voice-preview { height: 36px; max-width: 100%; }

/* ---------- company brain ---------- */
.brain-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.brain-stats > div { min-width: 120px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.brain-stats > div.grow { flex: 1 1 260px; }
@media (max-width: 600px) {
  .brain-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .brain-stats > div { min-width: 0; padding: 12px; }
  .brain-stats > div.grow { grid-column: 1 / -1; }
  .brain-stats small { letter-spacing: 0.02em; }
}
.brain-stats b { display: block; font: 600 24px/1.1 var(--display); letter-spacing: -0.02em; }
.brain-stats small { display: block; margin-top: 4px; color: var(--muted); font: 400 11px/1.5 var(--mono); letter-spacing: 0.06em; }
.brain-search { display: grid; gap: 12px; }
.brain-list { display: grid; border-top: 1px solid var(--line); }
.brain-row { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.brain-row:hover { background: linear-gradient(90deg, var(--amber-wash), transparent); }
.brain-row b { display: block; font: 600 17px/1.2 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.brain-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.brain-row-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; }
.brain-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brain-head-meta small { color: var(--muted); font: 400 11px/1.5 var(--mono); }
.brain-page .lead { font-size: 17px; color: var(--text); margin-bottom: 14px; }
.brain-text { gap: 12px; line-height: 1.65; }
.brain-link { color: var(--amber); text-decoration: underline; text-decoration-color: var(--amber-line); font-family: var(--mono); font-size: 0.92em; }
.brain-history { list-style: none; margin: 0; padding: 0; display: grid; }
.brain-history > li { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.brain-history > li:first-child { border-top: 0; padding-top: 0; }
.brain-history .row { flex-wrap: wrap; gap: 8px; }
.brain-history p { margin: 0; color: var(--muted); }
.brain-history small { color: var(--muted); font: 400 11px/1.5 var(--mono); }
.brain-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brain-sources li { display: grid; gap: 2px; padding: 10px 12px; border-left: 2px solid var(--amber-line); background: var(--well); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.brain-source-who { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; color: var(--amber); }
.brain-sources small { color: var(--faint); font: 400 10.5px/1.4 var(--mono); }
.brain-views { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brain-views > .segmented { flex: none; }
.brain-diary-head { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.brain-diary-day { min-width: 0; }
.brain-diary-day b { display: block; font: 600 18px/1.2 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.brain-diary-day small { display: block; margin-top: 2px; color: var(--amber); font: 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; min-height: 1.4em; }
.brain-diary-pick { width: auto; flex: none; }
.brain-diary-sum { margin: 0; color: var(--muted); font-size: 13px; }
.brain-diary-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.brain-diary-row:hover { background: linear-gradient(90deg, var(--amber-wash), transparent); }
.brain-diary-row b { display: block; font: 600 16px/1.25 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.brain-diary-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.brain-diary-row .brain-diary-who { color: var(--amber); font-family: var(--mono); font-size: 12px; }
.brain-diary-time { color: var(--faint); font-size: 12px; line-height: 1.6; }
.brain-diary-agents { display: grid; gap: 10px; }
.brain-diary-agent { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); min-width: 0; }
.brain-diary-agent > .row b { font: 600 15px/1.2 var(--display); }
.brain-diary-note { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.brain-diary-note p { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.brain-diary-jumps:empty { display: none; }
@media (max-width: 560px) {
  .brain-diary-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .brain-diary-day { grid-column: 1 / -1; order: -1; }
  .brain-diary-pick { width: 100%; }
  .brain-diary-head > .btn:last-child:not(:nth-child(4)) { grid-column: 1 / -1; justify-self: start; }
  .brain-diary-row, .brain-diary-note { grid-template-columns: 40px minmax(0, 1fr); }
  .brain-diary-row > .brain-row-meta, .brain-diary-note > .badge { grid-column: 2; justify-content: flex-start; justify-self: start; }
}
.segmented button .ico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }

/* The brain map: pages as LEDs on a black well, joined by their links. */
.brain-map {
  position: relative; height: clamp(420px, calc(100dvh - 375px), 860px); overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background-color: var(--well);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1.2px); background-size: 24px 24px;
}
.brain-map-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.brain-map-svg.grabbing { cursor: grabbing; }
.brain-map .node { --kind: var(--muted); cursor: pointer; transition: opacity 0.2s ease; outline: none; }
.brain-map .kind-client { --kind: var(--kind-client); }
.brain-map .kind-project { --kind: var(--kind-project); }
.brain-map .kind-person { --kind: var(--kind-person); }
.brain-map .kind-decision { --kind: var(--kind-decision); }
.brain-map .kind-procedure { --kind: var(--kind-procedure); }
.brain-map .kind-topic { --kind: var(--kind-topic); }
.brain-map .node .disc { fill: color-mix(in srgb, var(--kind) 22%, var(--well)); stroke: var(--kind); stroke-width: 1.5; transition: stroke-width 0.15s ease; }
.brain-map .node .core { fill: var(--kind); }
.brain-map .node .ring { fill: none; stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.85; }
.brain-map .node .name { fill: var(--text); fill-opacity: 0.86; font: 500 calc(12px / var(--k, 1))/1 var(--body); text-anchor: middle; paint-order: stroke; stroke: var(--well); stroke-width: calc(4px / var(--k, 1)); stroke-linejoin: round; pointer-events: none; }
.brain-map .node:hover .disc, .brain-map .node:focus-visible .disc { stroke-width: 3; }
.brain-map .node:focus-visible .name { fill-opacity: 1; }
.brain-map .node.picked .disc { stroke-width: 3; filter: drop-shadow(0 0 8px var(--kind)); }
.brain-map .node.picked .name { fill: var(--amber); fill-opacity: 1; font-weight: 600; }
.brain-map .edge { stroke: var(--line-strong); stroke-width: 1.2; transition: opacity 0.2s ease; }
.brain-map .edge.mention { stroke: var(--line-strong); stroke-opacity: 0.6; stroke-dasharray: 4 4; }
.brain-map .edge, .brain-map .node .disc, .brain-map .node .ring { vector-effect: non-scaling-stroke; }
.brain-map-svg.focus .node:not(.on) { opacity: 0.18; }
.brain-map-svg.focus .edge:not(.on) { opacity: 0.08; }
.brain-map-svg.focus .edge.on { stroke: var(--amber); stroke-opacity: 0.9; }
.brain-map .node.dim { opacity: 0.14; }
.brain-map .edge.dim { opacity: 0.05; }
.brain-map-legend {
  position: absolute; top: 12px; left: 12px; max-width: calc(100% - 140px); display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(5, 5, 5, 0.82); backdrop-filter: blur(6px);
  font: 400 10.5px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--muted); pointer-events: none;
}
.brain-map-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.brain-map-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--kind); box-shadow: 0 0 6px color-mix(in srgb, var(--kind) 60%, transparent); }
.brain-map-legend em { font-style: normal; color: var(--faint); }
.brain-map-legend .line { width: 18px; height: 0; border-top: 1.5px solid var(--line-strong); }
.brain-map-legend .line.mention { border-top-style: dashed; }
.brain-map-legend .kind-client { --kind: var(--kind-client); }
.brain-map-legend .kind-project { --kind: var(--kind-project); }
.brain-map-legend .kind-person { --kind: var(--kind-person); }
.brain-map-legend .kind-decision { --kind: var(--kind-decision); }
.brain-map-legend .kind-procedure { --kind: var(--kind-procedure); }
.brain-map-legend .kind-topic { --kind: var(--kind-topic); }
.brain-map-tools { position: absolute; top: 12px; right: 12px; display: grid; gap: 6px; }
.brain-map-tools .btn { background: rgba(15, 15, 15, 0.9); }
.brain-map-card {
  position: absolute; left: 12px; bottom: 12px; width: min(360px, calc(100% - 24px)); display: grid; gap: 8px; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: rgba(15, 15, 15, 0.94); backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04); animation: map-card-in 0.18s ease-out;
}
.brain-map-card[hidden] { display: none; }
.brain-map-card .row { gap: 6px; flex-wrap: wrap; }
.brain-map-card b { font: 600 19px/1.2 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.brain-map-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-height: 6em; overflow: auto; }
.brain-map-card small { color: var(--faint); font: 400 10.5px/1.4 var(--mono); letter-spacing: 0.06em; }
.brain-map-card .chips { max-height: 72px; overflow: auto; }
.brain-map-card .chip { font-size: 12px; padding: 4px 10px; }
.brain-map-hint { position: absolute; right: 12px; bottom: 12px; color: var(--faint); font: 400 10.5px/1.4 var(--mono); letter-spacing: 0.04em; pointer-events: none; }
@keyframes map-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .brain-map-card { animation: none; } .brain-map .node, .brain-map .edge { transition: none; } }
@media (max-width: 899px) {
  .brain-map { height: max(360px, calc(100dvh - 330px)); border-radius: var(--r-md); }
  .brain-map-legend { max-width: calc(100% - 64px); flex-wrap: nowrap; overflow-x: auto; pointer-events: auto; scrollbar-width: none; }
  .brain-map-legend::-webkit-scrollbar { display: none; }
  .brain-map-legend .lines { display: none; }
  .brain-map-card { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .brain-map-hint { display: none; }
}
.brain-sources q { color: var(--muted); font-size: 13px; line-height: 1.55; quotes: "“" "”"; overflow-wrap: anywhere; }
.brain-change { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow); }
.brain-change.flagged { border-color: var(--amber-line); }
.brain-change header b { font: 600 19px/1.2 var(--display); letter-spacing: -0.02em; }
.brain-change header { flex-wrap: wrap; }
.brain-change-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.brain-change-toggle b { overflow-wrap: anywhere; }
.brain-change-toggle .chev { flex: none; transition: transform .15s ease; }
.brain-change-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.brain-change-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.brain-change-body { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.brain-change-body[hidden], .btn[hidden] { display: none; }
.brain-change-body > small { color: var(--muted); font: 400 11px/1.5 var(--mono); }
.brain-change-actions .btn { min-height: 44px; }
.brain-diff { display: grid; padding: 8px 0; border-radius: var(--r-sm); background: var(--well); font: 400 12.5px/1.55 var(--mono); overflow-wrap: anywhere; }
.brain-diff > div { display: grid; grid-template-columns: 18px minmax(0, 1fr); padding: 2px 12px 2px 6px; }
.brain-diff > div > span { color: var(--faint); text-align: center; }
.brain-diff .diff-same { color: var(--muted); }
.brain-diff .diff-add { color: var(--text); background: rgba(140, 197, 106, 0.1); }
.brain-diff .diff-add > span { color: var(--green); }
.brain-diff .diff-del { color: var(--faint); background: rgba(229, 83, 61, 0.08); text-decoration: line-through; text-decoration-color: rgba(229, 83, 61, 0.45); }
.brain-diff .diff-del > span { color: var(--red); text-decoration: none; }
@media (max-width: 600px) {
  .brain-row { align-items: flex-start; flex-wrap: wrap; }
  .brain-row-meta { justify-content: flex-start; }
  .brain-change { padding: 14px; }
  .brain-change-toggle { flex-basis: calc(100% - 110px); }
  .brain-change-meta { order: 3; flex-basis: 100%; padding-left: 26px; }
}

/* ---------- goals in the Reasoning tab ---------- */
/* Reasoning: one list, newest first; a goal row stands for every turn that worked toward it. */
.reasoning-list { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.reasoning-list > * { min-width: 0; }
/* A lone turn carries the same token box as a goal, so every text starts at the same line. */
.reasoning-list > .row-link { gap: 14px; }
.reasoning-total { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--well); }
.reasoning-total b { font: 600 15px/1 var(--display); color: var(--amber); letter-spacing: -0.02em; }
.reasoning-total small { font: 400 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.reasoning-totals { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.row-usage { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font: 400 11px/1.6 var(--mono); }
.row-usage:empty { display: none; }
.usage-cost { color: var(--amber); font: 400 11px/1.6 var(--mono); overflow-wrap: anywhere; }
.trace-usage { display: grid; gap: 4px; }
.trace-usage > small { color: var(--muted); font-family: var(--mono); }
.goal-row { min-width: 0; border-bottom: 1px solid var(--line); }
.goal-row > summary { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px 2px; cursor: pointer; list-style: none; }
.goal-row > summary::-webkit-details-marker { display: none; }
.goal-row > summary:hover { background: linear-gradient(90deg, var(--amber-wash), transparent); }
.goal-row > summary .grow { min-width: 0; }
.goal-row > summary .chev { flex: none; transition: transform 0.15s ease; }
.goal-row[open] > summary .chev { transform: rotate(90deg); }
.goal-row[open] > summary { background: linear-gradient(90deg, var(--amber-wash), transparent 70%); }
.goal-total { flex: none; display: grid; justify-items: center; width: 64px; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.goal-total b { font: 600 18px/1.1 var(--display); color: var(--amber); letter-spacing: -0.02em; }
.goal-total small { font: 400 9.5px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.goal-text { display: -webkit-box; margin-top: 6px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.goal-turns { min-width: 0; margin: 0 0 10px 78px; border-left: 2px solid var(--amber-line); }
.goal-turns .rows { min-width: 0; }
.goal-turns .row-link { min-width: 0; padding-left: 14px; }
@media (max-width: 600px) { .goal-turns { margin-left: 8px; } .goal-total { width: 56px; } }

/* Markdown, as agents and people write it: built as DOM, styled with the desk's tokens. */
.md { display: grid; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.md > * { margin: 0; min-width: 0; }
.md p { margin: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 6px 0 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; color: var(--text); }
.md > :first-child { margin-top: 0; }
.md h3 { font-size: 19px; }
.md h4 { font-size: 17px; }
.md h5 { font-size: 15px; }
.md h6 { font-size: 13px; color: var(--muted); }
.md ul, .md ol { margin: 0; padding-left: 22px; display: grid; gap: 3px; }
.md li > ul, .md li > ol { margin-top: 3px; }
.md li::marker { color: var(--amber); }
.md ol > li::marker { font-family: var(--mono); font-size: 0.9em; }
.md li.task { list-style: none; margin-left: -20px; }
.md li.task input { margin: 0 8px 0 0; accent-color: var(--amber); vertical-align: -2px; }
.md blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--amber-line); color: var(--muted); display: grid; gap: 6px; }
.md strong { font-weight: 700; color: var(--text); }
.md del { color: var(--muted); }
.md a { color: var(--amber); text-decoration: underline 1px var(--amber-glow); text-underline-offset: 3px; overflow-wrap: anywhere; }
.md a:hover, .md a:focus-visible { text-decoration-color: var(--amber); }
.md code { font: 0.88em/1.4 var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.md .brain-link { font-size: 0.92em; }
.md hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.md-pre { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--well); overflow: hidden; }
.md-pre-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 0 4px 0 12px; border-bottom: 1px solid var(--line); color: var(--faint); font: 400 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.md-pre-head .btn.sm.only-icon { width: 28px; height: 28px; }
.md pre { margin: 0; padding: 12px 14px; overflow-x: auto; white-space: pre; }
.md pre code { padding: 0; border: 0; background: none; font-size: 12.5px; line-height: 1.6; color: var(--text); }
.md-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.md table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 1.45; }
.md th, .md td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); color: var(--muted); font: 500 11px/1.4 var(--mono); letter-spacing: 0.06em; white-space: nowrap; }
.md tbody tr:last-child td { border-bottom: 0; }
.md td + td, .md th + th { border-left: 1px solid var(--line); }
.md th.md-right, .md td.md-right { text-align: right; font-variant-numeric: tabular-nums; }
.md th.md-center, .md td.md-center { text-align: center; }

/* An agent's Slack app following the panel: one line with its state and a button to do it now. */
.slack-app-sync { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); color: var(--muted); font-size: 13px; line-height: 1.5; }
.slack-app-sync > .ico { flex: none; width: 16px; height: 16px; color: var(--green); }
.slack-app-sync.err { border-color: rgba(229, 83, 61, 0.35); }
.slack-app-sync.err > .ico { color: var(--red); }
.slack-apps .row { flex-wrap: wrap; gap: 8px; }
.slack-apps .row input { flex: 1 1 260px; min-width: 0; }

/* ---------- artifacts: the tape library ---------- */
.nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: var(--ink); font: 600 10px/18px var(--mono); font-style: normal; letter-spacing: 0; text-align: center; box-shadow: 0 0 10px var(--amber-glow); }
.art-lamp { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); background: var(--well); white-space: nowrap; }
.art-lamp i { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; }
.art-lamp.on { color: #ffd9cf; border-color: rgba(229, 83, 61, 0.6); background: linear-gradient(180deg, #4a1d15, #2c120d); box-shadow: 0 0 18px rgba(229, 83, 61, 0.3); }
.art-lamp.on i { background: var(--red); box-shadow: 0 0 10px var(--red); }
.art-lamp.mini { padding: 3px 8px; font-size: 9px; gap: 5px; }

.art-search input { width: 100%; }
.art-groups { display: grid; gap: 22px; }
.art-group > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 4px; }
.art-group > h3 span { color: var(--faint); }
.art-list { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.art-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.art-row:first-child { border-top: 0; }
.art-row:hover { background: linear-gradient(90deg, var(--amber-wash), transparent 70%); }
.art-row .panel-ico { width: 34px; height: 34px; }
.art-row > .led { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #2a2a2a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.art-row > .led.on { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.art-row > .led.busy { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); animation: blink 1.5s ease-in-out infinite; }
.art-row > .led.err { background: var(--red); box-shadow: 0 0 8px rgba(229, 83, 61, 0.5); }
.art-row-text small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-path { font: 400 14px/1.35 var(--mono); overflow-wrap: anywhere; }
.art-path-dir { color: var(--faint); }
.art-path b { font-weight: 500; color: var(--text); }
.art-row-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; max-width: 46%; }
.art-row-meta small { color: var(--faint); font: 400 11px/1.4 var(--mono); }
.art-row .chev { width: 16px; height: 16px; color: var(--faint); }
.art-level-ico { color: var(--amber); }
.art-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 2px; min-width: 0; margin: -6px 0 -8px -6px; font: 500 12.5px/1.3 var(--mono); color: var(--muted); }
.art-crumbs a, .art-crumbs b { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--r-sm); overflow-wrap: anywhere; }
.art-crumbs a { color: var(--muted); text-decoration: none; }
.art-crumbs a:hover, .art-crumbs a:focus-visible { color: var(--amber); background: var(--amber-wash); }
.art-crumbs b { color: var(--text); font-weight: 600; }
.art-crumbs .ico { width: 14px; height: 14px; flex: none; }
.art-crumbs a .ico { color: var(--faint); }
.art-crumbs a:hover .ico { color: currentColor; }
.art-crumbs .sep { color: var(--faint); }

.art-reviews > .label { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; color: var(--amber); }
.art-reviews > .label .count { font-style: normal; padding: 1px 7px; border-radius: 999px; background: var(--amber); color: var(--ink); }
.art-review { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid transparent; background: rgba(0, 0, 0, 0.38); color: inherit; text-decoration: none; }
.art-review:hover { border-color: var(--amber-line); }
.art-review > .grow > b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-review > .grow > small { display: block; margin-top: 2px; }
.art-review .art-path { font-size: 12px; }
.art-review .faint { color: var(--faint); font: 400 11px/1.4 var(--mono); white-space: nowrap; }
.art-review .chev { width: 16px; height: 16px; color: var(--amber); }

.art-author { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font: 500 13px/1.2 var(--body); white-space: nowrap; }
.art-counts { display: inline-flex; gap: 7px; font: 500 11px/1 var(--mono); }
.art-counts i { font-style: normal; color: var(--faint); }
.art-counts .add { color: var(--green); }
.art-counts .mod { color: var(--amber); }
.art-counts .del { color: #ff9c8b; }

.art-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.art-head-meta > code { padding: 0; border: 0; background: none; color: var(--amber); font: 500 13px/1 var(--mono); }
.art-head-meta a { text-decoration: none; }
.art-lead { margin-top: -6px; color: var(--muted); max-width: 72ch; }
.art-onair { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.art-onair.on { border-color: rgba(229, 83, 61, 0.3); background: linear-gradient(90deg, rgba(229, 83, 61, 0.09), var(--panel) 60%); }
.art-onair-text b { display: block; font: 600 17px/1.2 var(--display); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-onair-text small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; color: var(--faint); font: 400 12px/1.4 var(--mono); }
.art-onair-text code { color: var(--amber); }

.art-files { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.art-tree { display: grid; align-content: start; max-height: 70vh; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.art-dir { display: flex; align-items: center; gap: 6px; padding: 10px 8px 4px; color: var(--faint); font: 400 11px/1.3 var(--mono); overflow-wrap: anywhere; }
.art-dir .ico { width: 13px; height: 13px; }
.art-file { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font: 400 12.5px/1.3 var(--mono); text-align: left; cursor: pointer; }
.art-file.nested { padding-left: 22px; }
.art-file:hover { background: var(--panel-2); color: var(--text); }
.art-file.on { background: var(--amber-wash); color: var(--amber); }
.art-file .ico { width: 14px; height: 14px; }
.art-file .grow { overflow-wrap: anywhere; }
.art-file small { flex: none; color: var(--faint); font-size: 11px; }
.art-preview { display: grid; gap: 10px; min-width: 0; }
.art-preview-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.art-preview-head b { display: block; font: 600 16px/1.2 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.art-preview-head small { display: block; margin-top: 3px; color: var(--faint); font: 400 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.art-media { display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.art-media img, .art-media video { max-width: 100%; max-height: 60vh; border-radius: var(--r-sm); }
.art-media audio { width: 100%; }
.art-media.checker { background-color: #0b0b0b; background-image: conic-gradient(#151515 25%, transparent 0 50%, #151515 0 75%, transparent 0); background-size: 16px 16px; }
.art-code { margin: 0; max-height: 70vh; overflow: auto; padding: 10px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); font: 400 12.5px/1.6 var(--mono); }
.art-code code { display: grid; padding: 0; border: 0; background: none; color: #d6d6d1; font: inherit; }
.art-line { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding-right: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.art-line i { padding-right: 14px; color: var(--faint); font-style: normal; text-align: right; user-select: none; }
.art-noview { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--faint); text-align: center; }
.art-noview p { margin: 0; }
.art-noview.row { flex-direction: row; padding: 12px 14px; text-align: left; }
.small { font-size: 13px; }

.art-takes { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
.art-takes::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: 22px; width: 2px; background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 11px); }
.art-take { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.art-take:last-child { border-bottom: 0; }
.art-take-mark { position: relative; display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
.art-take-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel); }
.art-take.published .art-take-mark::after { border-color: var(--green); }
.art-take.proposed .art-take-mark::after { border-color: var(--amber); background: var(--amber-wash); animation: blink 1.6s ease-in-out infinite; }
.art-take.conflict .art-take-mark::after, .art-take.rejected .art-take-mark::after { border-color: var(--red); }
.art-take.live .art-take-mark::after { width: 14px; height: 14px; border-color: #ff8a73; background: var(--red); box-shadow: 0 0 12px rgba(229, 83, 61, 0.7); }
.art-take.superseded { opacity: 0.55; }
.art-take.rejected .art-take-text b { color: var(--faint); text-decoration: line-through; }
.art-take-text { min-width: 0; color: inherit; text-decoration: none; }
.art-take-text .row { flex-wrap: nowrap; gap: 10px; }
.art-take-text code { flex: none; color: var(--amber); font: 500 12px/1 var(--mono); }
.art-take-text b { font: 600 15px/1.3 var(--display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-take-text:hover b { color: var(--amber); }
.art-take-text small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; color: var(--faint); font-size: 12px; }
.art-take-note { color: var(--muted); font-style: italic; }

.art-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: -6px; color: var(--faint); }
.art-byline small { font: 400 12px/1.4 var(--mono); }
.art-conflicts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.art-conflicts code, .art-head-meta code { overflow-wrap: anywhere; }
.art-conflicts code { padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); font: 400 12px/1.4 var(--mono); }
.art-review-note { display: block; margin-top: 6px; color: var(--text); font-style: italic; }
.art-decide textarea { width: 100%; }
.art-diffs { display: grid; gap: 14px; }
.art-diff { min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.art-diff-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px 8px 6px; border-bottom: 1px solid var(--line-strong); background: var(--panel-2); }
.art-diff.closed .art-diff-head { border-bottom: 0; }
.art-diff.closed .art-diff-body { display: none; }
.art-diff-toggle { display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.art-diff-toggle:hover { color: var(--text); background: var(--line); }
.art-diff-toggle .ico { width: 15px; height: 15px; transform: rotate(90deg); transition: transform 0.15s ease; }
.art-diff.closed .art-diff-toggle .ico { transform: none; }
.art-diff-head code { min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: 500 12.5px/1.35 var(--mono); overflow-wrap: anywhere; }
.art-diff.deleted .art-diff-head code { color: #ff9c8b; }
.art-diff-size { flex: none; color: var(--faint); font: 400 11px/1 var(--mono); }
.art-diff-stat { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono); }
.art-diff-stat .add { color: var(--green); }
.art-diff-stat .del { color: #ff7b66; }
.art-diff-bar { display: inline-flex; gap: 2px; margin-left: 2px; }
.art-diff-bar i { width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); }
.art-diff-bar i.add { background: var(--green); }
.art-diff-bar i.del { background: var(--red); }
.art-change-kind { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 5px; font: 600 11px/1 var(--mono); font-style: normal; }
.art-diff.added .art-change-kind { color: var(--green); border: 1px solid #3f5a2f; background: rgba(140, 197, 106, 0.1); }
.art-diff.modified .art-change-kind { color: var(--amber); border: 1px solid var(--amber-line); background: var(--amber-wash); }
.art-diff.deleted .art-change-kind { color: #ff9c8b; border: 1px solid #6e2b20; background: rgba(229, 83, 61, 0.1); }
.art-diff-body > .art-noview, .art-diff-body > .art-compare, .art-diff-body > .skeleton { margin: 12px; }
.art-diff-scroll { overflow-x: auto; }
.art-diff-table { width: 100%; min-width: max-content; border-collapse: collapse; font: 400 12px/20px var(--mono); }
.art-diff-table td { padding: 0; vertical-align: top; }
.art-diff-num { width: 1%; min-width: 44px; padding: 0 10px !important; color: var(--faint); text-align: right; white-space: nowrap; user-select: none; }
.art-diff-code { padding: 0 16px 0 0 !important; color: var(--text); white-space: pre; }
.art-diff-sign { display: inline-block; width: 22px; padding-left: 8px; color: var(--faint); user-select: none; }
.art-diff-add .art-diff-code { background: rgba(46, 160, 67, 0.15); }
.art-diff-add .art-diff-num { background: rgba(46, 160, 67, 0.28); color: #9fd28a; }
.art-diff-add .art-diff-sign { color: var(--green); }
.art-diff-del .art-diff-code { background: rgba(229, 83, 61, 0.15); }
.art-diff-del .art-diff-num { background: rgba(229, 83, 61, 0.26); color: #ff9c8b; }
.art-diff-del .art-diff-sign { color: #ff7b66; }
.art-diff-add .art-diff-word { border-radius: 3px; background: rgba(46, 160, 67, 0.42); }
.art-diff-del .art-diff-word { border-radius: 3px; background: rgba(229, 83, 61, 0.42); }
.art-diff-hunk td { background: rgba(111, 168, 220, 0.1); color: var(--blue); }
.art-diff-hunk .art-diff-code { padding: 2px 16px 2px 30px !important; color: #8fb8de; }
.art-diff-table tr:first-child td { padding-top: 0; }
.art-diff-empty, .art-diff-large { margin: 0; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.art-diff-large p { margin: 0; }
.art-backup-name { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 2px 8px 2px 6px; border: 1px solid rgba(111, 168, 220, 0.4); border-radius: 999px; background: rgba(111, 168, 220, 0.08); color: var(--blue); font: 500 11px/1.4 var(--mono); text-decoration: none; white-space: nowrap; }
.art-backup-name .ico { width: 12px; height: 12px; }
a.art-backup-name:hover { border-color: var(--blue); }
.art-backups { display: grid; margin: 0; padding: 0; list-style: none; }
.art-backup { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.art-backup:last-child { border-bottom: 0; }
.art-backup .art-take-text small > span { color: var(--faint); }
.mode-artifacts .page-title h1 { font-size: 28px; line-height: 1.12; letter-spacing: -0.025em; }
.mode-artifacts .art-commit-head .page-title h1 { max-width: 80ch; font-size: 20px; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.mode-artifacts .panel-title h2 { font-size: 16px; }
.mode-artifacts .panel-title p { font-size: 13px; }
@media (max-width: 899px) {
  .mode-artifacts .art-commit-head .page-title h1 { font-size: 17px; line-height: 1.3; }
  .art-diff-head { flex-wrap: wrap; row-gap: 4px; }
  .art-diff-head code { flex-basis: calc(100% - 70px); }
  .art-backup { flex-wrap: wrap; }
  .art-backup > .art-take-text { flex-basis: 100%; }
  .art-backup .art-take-text .row { flex-wrap: wrap; }
  .art-backup > .btn { margin-left: -8px; }
}
.art-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.art-compare figure { display: grid; gap: 6px; margin: 0; }
.art-alltree summary { color: var(--muted); cursor: pointer; }
.art-alltree ul { display: grid; gap: 2px; max-height: 50vh; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; }
.art-alltree li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.art-alltree code { padding: 0; border: 0; background: none; overflow-wrap: anywhere; }
.art-alltree small { flex: none; color: var(--faint); font-family: var(--mono); }
.art-new .row { align-items: flex-end; gap: 12px; }
.art-new .row .field { margin: 0; }

@media (max-width: 899px) {
  .tabbar a { position: relative; }
  .tabbar .nav-count { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 16px; height: 16px; margin: 0; font-size: 9px; line-height: 16px; }
  .art-files { grid-template-columns: minmax(0, 1fr); }
  .art-tree { max-height: 42vh; }
}
@media (max-width: 600px) {
  .art-row { flex-wrap: wrap; }
  .art-row-meta { order: 5; width: 100%; max-width: none; justify-content: flex-start; padding-left: 66px; }
  .art-row .chev { display: none; }
  .art-onair { flex-wrap: wrap; }
  .art-onair-text { flex-basis: 100%; order: 2; }
  .art-onair > .btn { order: 3; }
  .art-review { flex-wrap: wrap; }
  .art-review .grow { flex-basis: calc(100% - 40px); }
  .art-take { align-items: flex-start; flex-wrap: wrap; }
  .art-take > .btn { margin-left: 28px; }
  .art-take > .art-take-text { flex-basis: calc(100% - 36px); }
  .art-take-text .row { flex-wrap: wrap; row-gap: 6px; }
  .art-take-text .row > b, .art-backup .art-take-text .row > b { flex-basis: 100%; order: 3; }
  .art-take-text b { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .art-take.proposed .art-take-mark::after, .art-row > .led.busy { animation: none; }
}

/* Sharing: each link an address of its own, open only to the people it names. */
.share-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.share-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.share-row > .led { width: 8px; height: 8px; margin-top: 8px; flex: none; border-radius: 50%; background: #2a2a2a; }
.share-row > .led.on { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.share-row > .led.busy { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); animation: blink 1.5s ease-in-out infinite; }
.share-row.revoked { opacity: 0.55; }
.share-text { display: grid; gap: 8px; min-width: 0; }
.share-text .row { flex-wrap: wrap; gap: 8px; }
.share-url { color: var(--text); font: 500 14px/1.35 var(--mono); text-decoration: none; overflow-wrap: anywhere; }
a.share-url:hover { color: var(--amber); }
.share-text small { color: var(--faint); font-size: 12px; }
.share-access { display: flex; flex-wrap: wrap; gap: 6px; }
.share-access .chip { cursor: default; }
.share-access .chip .ico { width: 13px; height: 13px; }
.share-host { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--well); }
.share-host input { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; }
.share-host span { padding: 0 12px 0 2px; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.share-new .row { align-items: center; gap: 12px; }
@media (max-width: 600px) {
  .share-row { flex-wrap: wrap; }
  .share-row > .row-actions { width: 100%; padding-left: 20px; }
  .share-host span { max-width: 45%; }
}
@media (prefers-reduced-motion: reduce) { .share-row > .led.busy { animation: none; } }

/* The vault: names you can use, values nobody reads back. */
.art-switch { align-self: flex-start; }
.vault-workspace [hidden] { display: none; }
.vault-search { display: grid; gap: 8px; margin-bottom: 14px; }
.vault-search .mono { font-size: 11px; }
.vault-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.vault-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.vault-row > .panel-ico { width: 34px; height: 34px; flex: none; }
.vault-text { display: grid; gap: 6px; min-width: 0; }
.vault-text, .share-text { grid-template-columns: minmax(0, 1fr); }
.vault-text small, .share-text small, .vault-workspace .art-review > .grow > small { overflow-wrap: anywhere; }
.vault-workspace .art-review { flex-wrap: wrap; }
.vault-workspace .art-review > .grow { flex: 1 1 200px; min-width: 0; }
.vault-row > .vault-text { flex: 1 1 340px; }
.vault-row { flex-wrap: wrap; }
.vault-actions { margin-left: auto; }
.vault-name-line { min-width: 0; }
.vault-copy { display: inline; padding: 0; border: 0; background: none; text-align: left; cursor: copy; }
.vault-copy-btn.btn.sm.only-icon { width: 28px; height: 28px; margin-left: 6px; vertical-align: -6px; }
.vault-copy:hover { color: var(--amber); }
.vault-copy:focus-visible { outline: 2px solid var(--amber-line); outline-offset: 3px; border-radius: 4px; }
.vault-text .row { flex-wrap: wrap; gap: 8px; }
.vault-name { font: 500 15px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--text); overflow-wrap: anywhere; }
.vault-text small { color: var(--muted); font-size: 13px; }
.vault-text small.faint { color: var(--faint); font-size: 11.5px; }
.vault-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.vault-extra:empty { display: none; }
.vault-extra { display: grid; gap: 10px; margin-top: 6px; padding: 12px; border: 1px dashed var(--amber-line); border-radius: var(--r-md); background: var(--amber-wash); }
.vault-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vault-inline input { flex: 1; min-width: 180px; }
.vault-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--amber-line); border-radius: var(--r-md); background: var(--well); }
.vault-link code { padding: 0; border: 0; background: none; color: var(--amber); font: 400 13px/1.45 var(--mono); overflow-wrap: anywhere; }
.vault-link small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.vault-value { display: flex; gap: 8px; align-items: flex-start; }
.vault-value input, .vault-value textarea { flex: 1 1 auto; min-width: 0; }
.vault-value .btn { flex: none; }
@media (max-width: 600px) {
  .vault-row > .vault-text { flex-basis: calc(100% - 46px); }
  .vault-actions { width: 100%; justify-content: flex-start; padding-left: 46px; }
  .vault-value { flex-direction: column; align-items: stretch; }
  .vault-value input, .vault-value textarea { flex: none; width: 100%; }
  .vault-value .btn { align-self: flex-start; }
}
.share-access .chip.public { border-color: var(--amber-line); color: var(--amber); }
.share-modes { flex-wrap: wrap; }
.share-new .row .field { margin: 0; min-width: 200px; }
.share-row { flex-wrap: wrap; }
.share-edit { flex-basis: 100%; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.share-new > [hidden], .share-edit > [hidden] { display: none; }
.share-modes { align-self: flex-start; }
a.art-file { text-decoration: none; }
.art-subdir { color: var(--text); }
.art-subdir .ico { color: var(--amber); }
.art-up { color: var(--faint); }
.art-tree-empty { margin: 0; padding: 14px 8px; color: var(--faint); font: 400 12px/1.4 var(--mono); }
.art-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--r-md); background: var(--panel-2); transition: border-color .15s, background .15s; }
.art-drop-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--well); color: var(--amber); }
.art-drop-ico .ico { width: 17px; height: 17px; }
.art-drop-text { display: grid; gap: 3px; min-width: 200px; }
.art-drop-text b { font-weight: 600; font-size: 13.5px; }
.art-drop-text small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.art-drop-where { color: var(--amber); font: 400 12px/1.3 var(--mono); }
.art-drop-status { color: var(--faint); font: 400 11.5px/1.3 var(--mono); }
.art-drop.busy { opacity: .75; pointer-events: none; }
.art-drop.busy .art-drop-ico { animation: blink 1.5s ease-in-out infinite; }
.art-zone.over .art-drop { border-color: var(--amber); background: var(--amber-wash); }
.art-zone.over .art-drop-ico { box-shadow: 0 0 12px var(--amber-glow); }
.share-stats { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font: 400 12px/1.4 var(--mono); text-decoration: none; }
a.share-stats:hover { color: var(--amber); }
.share-stats .ico { width: 14px; height: 14px; color: var(--amber); }
.share-stats .faint { color: var(--faint); }
.log-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.log-tools select { width: auto; min-width: 180px; }
.log-filters { flex-wrap: wrap; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.log-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--panel-2); color: var(--muted); }
.log-ico .ico { width: 15px; height: 15px; }
.log-download .log-ico { color: var(--amber); background: var(--amber-wash); }
.log-view .log-ico, .log-open .log-ico, .log-search .log-ico { color: var(--green); }
.log-refused .log-ico { color: var(--red); }
.log-text { display: grid; gap: 3px; min-width: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.log-text small { color: var(--faint); font: 400 11.5px/1.3 var(--mono); }
.log-who { font-weight: 600; }
.log-who.visitor { font: 500 13px/1.45 var(--mono); color: var(--muted); }
.log-path { color: var(--amber); font: 400 12.5px/1.4 var(--mono); background: none; border: 0; padding: 0; }
.log-link { font: 400 12.5px/1.4 var(--mono); color: var(--text); }
.log-text q { color: var(--text); }
.log-time { flex: none; color: var(--faint); font: 400 11.5px/1.6 var(--mono); white-space: nowrap; }
@media (max-width: 600px) {
  .log-row { flex-wrap: wrap; }
  .log-time { width: 100%; padding-left: 42px; }
}
.space-box { padding: 4px 0 18px; }
.space-summary { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.space-summary b { display: block; font: 600 26px/1.1 var(--display); letter-spacing: -0.02em; }
.space-summary small { color: var(--muted); font: 400 12px/1.4 var(--mono); }
.space-meter { height: 10px; border-radius: 99px; background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.space-meter i { display: block; width: var(--fill, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--amber), #ffcf7a); box-shadow: 0 0 10px var(--amber-glow); }
.space-custom { display: flex; align-items: center; gap: 10px; }
.space-custom[hidden] { display: none; }
.space-custom input { width: 140px; }
.art-newdir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; padding-top: 10px; border-top: 1px dashed var(--line); }
.art-newdir .faint { color: var(--faint); font-size: 12px; }
.art-newdir input { flex: 1 1 200px; min-width: 0; height: 36px; }
.art-preview > *, .art-table-box, .art-editor { min-width: 0; }
.art-sheet { max-width: 100%; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); overscroll-behavior: contain; }
.art-sheet table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max(100%, var(--total)); font: 400 12.5px/1.45 var(--mono); }
.art-sheet col { width: var(--w); }
.art-sheet th, .art-sheet td { padding: 8px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.art-sheet th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--muted); font-weight: 500; }
.art-sheet th .grip { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.art-sheet th .grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--line-strong); }
.art-sheet th:hover .grip::after, .art-sheet th .grip:active::after { background: var(--amber); }
.art-sheet td.num { text-align: right; color: var(--text); }
.art-sheet tr:hover td { background: var(--amber-wash); }
.art-pdf { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
/* A web page in the preview: the page itself, or its source, one switch apart. */
.art-site-body { display: grid; min-width: 0; }
.art-modes { flex: none; }
.art-modes button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: 12.5px; }
@media (max-width: 640px) {
  /* A file's name keeps a whole line on a phone; its buttons go on the line under it. */
  .art-preview-head { flex-wrap: wrap; row-gap: 6px; }
  .art-preview-head > .grow { flex: 1 1 100%; }
  .art-preview-head > .btn { padding-inline: 8px; }
  .art-preview-head .art-modes { order: 5; width: 100%; }
  .art-modes button { flex: 1; justify-content: center; }
}
.art-preview:fullscreen, .art-preview.full { position: fixed; inset: 0; z-index: 60; overflow: auto; padding: 18px; background: var(--bg); align-content: start; }
.art-preview:fullscreen .art-pdf, .art-preview.full .art-pdf, .art-preview:fullscreen .art-sheet, .art-preview.full .art-sheet { height: calc(100vh - 110px); max-height: none; }
.art-preview:fullscreen .art-media img, .art-preview.full .art-media img, .art-preview:fullscreen .art-media video, .art-preview.full .art-media video { max-height: calc(100vh - 110px); }
.art-preview:fullscreen .art-code, .art-preview.full .art-code { max-height: calc(100vh - 110px); }
.art-md { align-content: start; max-height: 70vh; overflow: auto; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.art-preview:fullscreen .art-md, .art-preview.full .art-md { max-height: calc(100vh - 110px); }
.art-editor-split { display: grid; gap: 12px; min-width: 0; }
.art-editor-split.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.art-editor-text { width: 100%; min-height: 55vh; padding: 14px 16px; resize: vertical; font-size: 13px; line-height: 1.55; }
.art-editor-preview { max-height: none; min-height: 55vh; }
.art-editor-save { flex-wrap: wrap; gap: 8px; }
.art-editor-save input { flex: 1 1 220px; min-width: 0; height: 36px; }
.art-editor-tools { flex-wrap: wrap; gap: 6px; }
.art-sheet.editing td, .art-sheet.editing th { padding: 0; }
.art-sheet.editing .cell { display: block; width: 100%; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: 400 12.5px/1.45 var(--mono); resize: none; field-sizing: content; }
.art-sheet.editing th .cell { color: var(--muted); font-weight: 500; }
.art-sheet.editing .cell:focus { outline: none; background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-line); }
.art-sheet .row-n { width: 44px; color: var(--faint); font-size: 11px; text-align: right; padding: 8px 8px 0 0; position: relative; }
.art-sheet .row-x { display: none; position: absolute; left: 2px; top: 6px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--red); cursor: pointer; }
.art-sheet .row-x .ico { width: 12px; height: 12px; }
.art-sheet tr:hover .row-x { display: grid; place-items: center; }
@media (max-width: 899px) { .art-editor-split.two { grid-template-columns: minmax(0, 1fr); } .art-editor-preview { min-height: 0; } }
.path-picker { display: grid; gap: 10px; min-width: 0; }
.path-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--well); }
.path-root { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; color: var(--faint); font: 400 12.5px/1 var(--mono); }
.path-root .ico { width: 14px; height: 14px; }
.path-sep { color: var(--faint); font: 400 13px/1 var(--mono); }
.path-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); color: var(--text); font: 400 12.5px/1 var(--mono); cursor: pointer; }
.path-chip .ico { width: 14px; height: 14px; color: var(--amber); }
.path-chip .path-caret { width: 12px; height: 12px; color: var(--faint); transform: rotate(90deg); transition: transform .15s; }
.path-chip.open { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 169, 59, 0.2); }
.path-chip.open .path-caret { transform: rotate(-90deg); }
.path-chip.add { border-style: dashed; color: var(--muted); background: none; }
.path-chip.add .ico { color: var(--muted); }
.path-leaf { flex: 1 1 180px; min-width: 140px; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: none; }
.path-leaf:focus { border-color: var(--amber); background: #000; }
.path-menu { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--amber-line); border-radius: var(--r-md); background: var(--panel-2); }
.path-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 240px; overflow: auto; }
.path-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--well); color: var(--text); font: 400 12.5px/1.2 var(--mono); text-align: left; cursor: pointer; }
.path-option:hover, .path-option.on { border-color: var(--amber-line); background: var(--amber-wash); }
.path-option .ico { width: 14px; height: 14px; color: var(--amber); }
.path-option .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-option small { color: var(--faint); font-size: 11px; }
.path-new { display: flex; gap: 8px; align-items: center; }
.path-new input { flex: 1; min-width: 0; height: 34px; }
.path-empty { margin: 0; color: var(--faint); font: 400 12px/1.4 var(--mono); }
.path-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12.5px; }
.path-status .ico { width: 14px; height: 14px; color: var(--green); }
.path-status code { color: var(--amber); font: 400 12.5px/1.3 var(--mono); background: none; border: 0; padding: 0; }
.path-status.wrong .ico { color: var(--red); }
.path-status.wrong span { color: var(--red); }

/* An agent's GitHub App: one line per organization it is installed on, the ones waiting in amber. */
.gh-orgs { display: grid; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.gh-org { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; }
.gh-org + .gh-org { border-top: 1px solid var(--line); }
.gh-org > .ico { flex: none; width: 16px; height: 16px; color: var(--green); }
.gh-org.pending { background: var(--amber-wash); }
.gh-org.pending > .ico { color: var(--amber); }
.gh-org b { display: block; overflow-wrap: anywhere; font-weight: 500; }
.gh-org small { display: block; margin-top: 2px; color: var(--faint); font: 400 12px/1.4 var(--mono); }

.email-channel { min-width: 0; }
.email-channel select, .email-channel textarea, .email-channel input[type="text"] { width: 100%; max-width: 100%; }
.email-folders { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.email-folder { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; }
.email-folder input, .email-channel input[type="checkbox"] { accent-color: var(--amber); width: 18px; height: 18px; }
.email-totals { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.email-totals > div { display: flex; flex-direction: column; gap: 4px; padding: 0 16px; border-right: 1px solid var(--line); }
.email-totals > div:first-child { padding-left: 0; }
.email-totals > div:last-child { border: 0; }
.email-totals strong { font-family: Outfit, sans-serif; font-size: 32px; font-weight: 600; line-height: 1.1; }
.email-totals span { color: var(--muted); font-size: 13px; }
.email-ledger-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.email-ledger-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.email-ledger-main > svg { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.email-ledger-main > div { min-width: 0; overflow-wrap: anywhere; }
.email-ledger-main strong { font-weight: 600; }
.email-ledger-main p { margin: 4px 0 0; font-size: 13px; }
.email-ledger-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11px; color: var(--muted); }
.email-signature-icon { display: flex; align-items: center; gap: 16px; }
.email-signature-icon > img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: #fff; }
.email-signature-icon .stack-sm { gap: 8px; min-width: 0; }
.email-signature-icon p { margin: 0; }
.email-signature-preview img { display: block; max-width: 100%; height: auto; margin-top: 16px; }
.email-agent-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.email-agent-row > span { margin-left: auto; font-size: 13px; }
@media (max-width: 600px) {
  .email-ledger-row { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .email-ledger-meta { align-items: flex-start; margin-left: 36px; }
  .email-agent-row { flex-wrap: wrap; gap: 8px; }
  .email-agent-row > span { width: 100%; margin-left: 0; order: 2; }
  .email-agent-row > svg { margin-left: auto; }
  .email-channel .segmented { width: 100%; }
  .email-channel .segmented button { flex: 1; padding-left: 8px; padding-right: 8px; }
}
.email-channel .segmented { min-width: 0; max-width: 100%; }
.email-channel .segmented .btn { min-width: 0; }

.email-workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; min-width: 0; }
.email-workspace-nav { position: sticky; top: 0; }
.email-workspace .rail-name b, .email-workspace .rail-name small { white-space: normal; overflow-wrap: anywhere; }
.email-workspace-detail, .email-section { min-width: 0; }
.email-section[hidden], .email-section > [hidden], .email-settings-tabs ~ [hidden] { display: none; }

.connector-catalog[hidden], .connector-detail[hidden] { display: none; }
.connector-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.connector-search { position: relative; flex: 1; min-width: 220px; }
.connector-search > .ico { position: absolute; top: 13px; left: 13px; color: var(--muted); pointer-events: none; }
.connector-search input { width: 100%; min-height: 44px; padding-left: 40px; }
.connector-toolbar .segmented { flex: none; }
.connector-toolbar .segmented button { min-height: 38px; }
.connector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.connector-card { display: grid; gap: 12px; width: 100%; min-width: 0; padding: 20px; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel-2); cursor: pointer; transition: border-color .15s, background .15s; }
.connector-card:hover { border-color: var(--amber-line); background: var(--amber-wash); }
.connector-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.connector-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.connector-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--amber-line); border-radius: var(--r-md); background: var(--well); color: var(--amber); }
.connector-mark .ico { width: 24px; height: 24px; }
.connector-card-name { font: 600 24px/1.15 var(--display); letter-spacing: -.02em; }
.connector-card-description { color: var(--muted); font-size: 14px; line-height: 1.6; }
.connector-card-meta { font: 400 10px/1.5 var(--mono); color: var(--muted); }
.connector-card-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 13px; color: var(--amber); }
.connector-empty { grid-column: 1 / -1; display: grid; justify-items: start; gap: 12px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--well); }
.connector-empty > .ico { color: var(--amber); }
.connector-empty h3, .connector-empty p { margin: 0; }
.connector-empty p { color: var(--muted); }
.connector-back { align-self: flex-start; }
.connector-senders { padding-top: 18px; border-top: 1px solid var(--line); }
.connector-senders p { margin: 0; }
.connector-detail .panel-title { overflow-wrap: anywhere; }
.connector-detail .panel-head { padding: 12px 16px; }
.connector-detail .panel-body { padding: 12px 16px; gap: 10px; }
.connector-detail .panel-ico { width: 30px; height: 30px; }
.connector-detail .panel-title h2 { font-size: 17px; }
.connector-detail .set-row { padding: 12px 0; gap: 8px 20px; }
.connector-detail .stack-sm { gap: 10px; }
.connector-detail .connector-actions { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin: 0; padding: 0; }
.connector-detail .connector-actions > .btn:last-child { margin-left: 0; }
.connector-pending .connector-actions .btn { height: 34px; padding: 0 10px; font-size: 10px; }
.connector-pending .set-row { padding: 8px 0; }

.connector-connected > summary { list-style: none; }
.connector-connected > summary { cursor: pointer; }
.connector-connected > summary::-webkit-details-marker { display: none; }
.connector-connected > summary:hover { background: var(--well); border-radius: inherit; }
.connector-connected > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: inherit; }
.connector-disclosure-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 500 10px var(--mono); }
.connector-disclosure-label .ico { width: 16px; height: 16px; flex: none; }
.connector-connected[open] > summary .connector-disclosure-label .ico { transform: rotate(90deg); }
@media (max-width: 600px) {
  .connector-connected > summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "icon title title" "icon status details"; gap: 8px 10px; }
  .connector-connected > summary .panel-ico { grid-area: icon; }
  .connector-connected > summary .panel-title { grid-area: title; }
  .connector-connected > summary .panel-actions { grid-area: status; justify-content: flex-start; }
  .connector-disclosure-label { grid-area: details; }
}

.connector-detail .panel-body > p { margin: 0; }
.connector-detail .muted { color: var(--muted); }
.connector-detail [role="status"]:empty { display: none; }
.connector-detail .segmented { align-self: flex-start; }
.connector-feedback { margin: 0; }
.connector-feedback:empty { display: none; }
.connector-detail .steps a { color: var(--amber); }
.connector-detail .steps { margin: 0; }
.connector-redirect-value { display: inline; overflow-wrap: anywhere; }
.connector-redirect-value code { white-space: normal; overflow-wrap: anywhere; }
.connector-redirect-value .btn { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.connector-redirect-value .btn .ico { width: 15px; height: 15px; }
@media (max-width: 600px) {
  .connector-toolbar { align-items: stretch; }
  .connector-search { min-width: 0; flex-basis: 100%; }
  .connector-toolbar .segmented { width: 100%; }
  .connector-card { padding: 18px; }
  .connector-empty { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .connector-card { transition: none; } }
.panel-mcp .panel-body > p { margin: 0; }
.panel-mcp .muted { color: var(--muted); }
.mcp-create { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.mcp-create-fields { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; }
.mcp-key-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mcp-key-controls input { flex: 1; min-width: 160px; width: 100%; min-height: 44px; }
.mcp-key-controls .btn { min-height: 44px; }
.mcp-secret { padding: 18px; border: 1px solid var(--amber-line); border-radius: var(--r-md); background: var(--amber-wash); }
.mcp-secret[hidden], .panel-mcp [role="status"]:empty { display: none; }
.mcp-secret p { margin: 0; color: var(--muted); }
.mcp-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 0; }
.mcp-token-row + .mcp-token-row { border-top: 1px solid var(--line); }
.mcp-token-row b { font-weight: 600; overflow-wrap: anywhere; }
.mcp-token-row small { color: var(--muted); font: 400 11px/1.5 var(--mono); }
.mcp-token-row .stack-sm { gap: 6px; }
.mcp-token-row .btn { min-height: 44px; }
@media (max-width: 600px) {
  .mcp-create-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mcp-key-controls input { flex-basis: 100%; }
  .mcp-secret { padding: 14px; }
}
.email-section-back { display: none; }
.email-settings-tabs { display: flex; flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.email-settings-tabs .btn { min-width: 0; }
@media (max-width: 899px) {
  .email-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .email-workspace.open > .email-workspace-nav, .email-workspace:not(.open) > .email-workspace-detail { display: none; }
  .email-workspace-nav { position: static; }
  .email-section-back { display: inline-flex; margin-bottom: 16px; }
  .email-workspace .rail-go { display: block; }
  .email-settings-tabs { width: 100%; }
  .email-settings-tabs .btn { flex: 1 1 40%; }
}
.email-workspace .rail-item { grid-template-columns: 30px minmax(0, 1fr) 16px; }
.agent-settings-save[hidden] { display: none; }
.agent-settings-save { margin-top: 20px; }
.agent-permissions { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.agent-permission { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px; cursor: pointer; }
.agent-permission + .agent-permission { border-top: 1px solid var(--line); }
.agent-permission .grow { min-width: 0; overflow-wrap: anywhere; }
.agent-permission small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.agent-permission .switch { flex-shrink: 0; }
.agent-permission-note { color: var(--muted); }
@media (max-width: 599px) {
  .artifact-default-row { grid-template-columns: minmax(0, 1fr); }
  .artifact-default-row .set-control > select { width: 100%; }
}

@media (max-width: 480px) { .mode-email .tabs, .mode-artifacts .tabs { margin: 0 -12px; padding: 2px 12px; } }

.artifact-team-default { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 270px); gap: 16px; align-items: center; }
.artifact-team-default small, .artifact-team-identity small { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.artifact-team-default select, .artifact-team-person select { width: 100%; min-width: 0; }
.artifact-team-list { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.artifact-team-person { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(180px, 270px); gap: 12px; align-items: center; padding: 14px; }
.artifact-team-person + .artifact-team-person { border-top: 1px solid var(--line); }
.artifact-team-identity { min-width: 0; overflow-wrap: anywhere; }
.artifact-team-reviewer { color: var(--amber); }
@media (max-width: 600px) {
  .artifact-team-default { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .artifact-team-person { grid-template-columns: 36px minmax(0, 1fr); }
  .artifact-team-person select { grid-column: 1 / -1; }
}

.usage-overview { min-width: 0; }
.usage-overview > [hidden] { display: none; }
.usage-overview .panel-head { padding: 10px 12px; }
.usage-overview .panel-actions { flex-wrap: nowrap; }
.usage-toggle { min-width: 44px; min-height: 44px; flex: none; }
.usage-toggle[aria-pressed=true] { color: var(--amber); background: var(--amber-wash); }
@media (max-width: 600px) {
  .usage-overview .panel-head { gap: 8px; }
  .usage-overview .panel-actions .heat-legend { display: none; }
}

@media (max-width: 899px) { .agents-page-head { display: none; } }
@media (max-width: 600px) {
  .agent-roster .panel-head { padding: 10px 12px; gap: 8px; }
  .agent-roster .panel-actions .btn { width: 44px; padding: 0; }
  .agent-roster .panel-actions .btn span { display: none; }
}

/* ---------- character sheet ---------- */
.fader { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer; }
.fader::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: #070707; border: 1px solid var(--line);
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), var(--line) calc(5% - 1px) 5%);
}
.fader::-moz-range-track { height: 6px; border-radius: 3px; background: #070707; border: 1px solid var(--line); }
.fader::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 28px; margin-top: -12px; border-radius: 4px;
  background: linear-gradient(180deg, #ffd08a, var(--amber) 45%, #b8761b); border: 1px solid #6b4610;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.fader::-moz-range-thumb { width: 20px; height: 28px; border-radius: 4px; background: var(--amber); border: 1px solid #6b4610; }
.fader:focus-visible { outline: none; }
.fader:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--amber-glow); }
.fader:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--amber-glow); }

.character-sheet { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.character-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.character-badge-label { font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.character-badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--amber-line); background: var(--amber-wash); color: var(--amber);
  font: 500 12px/1.3 var(--mono);
}
.character-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.character-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.character-stat-head, .character-align-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.character-stat-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--muted); }
.character-stat-name b { font: 500 14px/1.25 var(--body); color: var(--text); }
.character-stat-name small { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; color: var(--faint); }
.character-stat-value, .character-align-value { color: var(--amber); font: 600 14px/1.2 var(--mono); white-space: nowrap; }
.character-align-value { font-weight: 500; font-size: 12px; }
.character-poles { display: flex; justify-content: space-between; gap: 8px; color: var(--faint); font: 400 10px/1.3 var(--mono); }
.character-align { display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.character-align-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.character-preview-box { display: flex; flex-direction: column; gap: 7px; }
.character-preview-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.character-preview-head small { color: var(--faint); font-size: 11px; }
.character-preview {
  max-height: 300px; overflow: auto; margin: 0; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--well); color: var(--muted);
  font: 400 11px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.character-legacy {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well);
}
.character-legacy p { margin: 0; color: var(--muted); font: 400 13px/1.45 var(--body); }

@media (max-width: 600px) {
  .character-stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .character-legacy { flex-direction: column; align-items: stretch; }
}

/* Thread desk: a compact card per live thread, one row per agent session; history is one row per thread. */
.thread-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.thread-card, .thread-past { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.thread-card { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 8px 12px; }
.thread-card.closed, .thread-past.closed { opacity: .72; }
.thread-card > header, .thread-past > summary { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.thread-ico { display: grid; place-items: center; width: 20px; height: 20px; color: var(--faint); }
.thread-ico .ico { width: 16px; height: 16px; }
.thread-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.thread-head p { margin: 0; }
.thread-head .thread-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { display: flex; gap: 2px; align-items: center; }
.thread-actions .btn.sm.only-icon { width: 32px; height: 32px; min-height: 32px; }
.thread-title { display: flex; gap: 4px; align-items: center; min-width: 0; }
.thread-title b, .thread-title h1 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Outfit, sans-serif; font-weight: 600; letter-spacing: -.02em; }
.thread-title b { font-size: 15px; }
.thread-title .thread-id { font-family: "DM Mono", monospace; font-weight: 500; font-size: 12px; letter-spacing: 0; color: var(--muted); }
.thread-open { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.thread-title b { display: block; }
.thread-open:hover b, .thread-open:focus-visible b { color: var(--amber); }
.thread-title .thread-rename { flex: none; width: 26px; height: 26px; min-height: 26px; opacity: .45; color: var(--muted); }
.thread-title .thread-rename .ico { width: 14px; height: 14px; }
.thread-title:hover .thread-rename, .thread-title .thread-rename:focus-visible { opacity: 1; }
.thread-title.editing { gap: 6px; }
.thread-name { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; background: var(--well); color: var(--text); border: 1px solid var(--amber-line); border-radius: var(--r-sm); font: inherit; font-family: Outfit, sans-serif; font-weight: 600; }
.thread-name:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.thread-title.editing .btn.sm.only-icon { flex: none; width: 36px; height: 36px; min-height: 36px; }
.thread-title.heading { gap: 6px; }
.thread-title.heading .thread-rename { width: 32px; height: 32px; min-height: 32px; }
.thread-idle { padding-left: 30px; }
.thread-flows { display: flex; flex-direction: column; min-width: 0; }
.thread-flow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; padding: 6px 0; border-top: 1px solid var(--line); }
.thread-card .thread-flows .thread-flow:first-child { border-top: 0; padding-top: 2px; }
.thread-flow .avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.thread-flow-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thread-flow-line { display: flex; gap: 8px; align-items: center; min-width: 0; }
.thread-flow-line b { flex: none; font-family: Outfit, sans-serif; font-weight: 600; font-size: 13px; }
.thread-flow-line .thread-meta { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-usage { flex: none; margin-left: auto; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thread-usage[hidden] { display: none; }
/* The machine's load on the live sessions: three gauges in one hardware strip, never a wrapping line. */
.thread-load {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}
.thread-load[hidden] { display: none; }
.thread-gauge { display: grid; grid-template-rows: auto auto 6px auto; gap: 6px; min-width: 0; padding: 12px 16px 11px; background: var(--panel); }
.thread-gauge-label { font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.thread-gauge-value { display: flex; align-items: baseline; gap: 4px; min-width: 0; white-space: nowrap; }
.thread-gauge-value b { font: 600 26px/1 Outfit, sans-serif; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.thread-gauge-value small { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.thread-gauge-of { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 10.5px/1.2 var(--mono); letter-spacing: 0.04em; color: var(--faint); }
.thread-meter { align-self: center; position: relative; height: 4px; border-radius: 2px; background: var(--well); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); overflow: hidden; }
.thread-meter i { position: absolute; inset: 0 auto 0 0; width: max(3px, var(--fill)); border-radius: 2px; background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); transition: width 0.4s ease; }
.thread-leds { display: flex; align-items: center; gap: 5px; height: 6px; }
.thread-leds i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(140, 197, 106, 0.55); }
/* Platform tabs over the thread list, each with its count, and the search under them at full width. */
.thread-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thread-filter[hidden] { display: none; }
.thread-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.thread-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 32px; padding: 0 6px; border: 0; border-radius: calc(var(--r-md) - 3px); background: none; color: var(--muted); cursor: pointer; font: 600 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.thread-tab span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-tab .count { flex: none; padding: 2px 5px; border-radius: 999px; background: var(--panel-2); color: var(--text); font-style: normal; font-size: 10px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.thread-tab:hover { color: var(--text); }
.thread-tab.on { background: var(--amber); color: var(--ink); }
.thread-tab.on .count { background: rgba(0, 0, 0, 0.22); color: var(--ink); }
.thread-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
input.thread-search { height: 38px; }
@media (max-width: 760px) {
  .thread-tab { gap: 4px; padding: 0 3px; letter-spacing: 0.02em; }
}
/* New thread sits below the desktop rail and at the end of the phone rail. */
.email-workspace-nav > .thread-plus { width: 100%; margin-top: 6px; }
@media (max-width: 899px) {
  .email-workspace.phone-switch { gap: 12px; }
  .email-workspace.phone-switch > .email-workspace-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-auto-columns: 40px; gap: 4px; padding: 4px; border-radius: var(--r-md); }
  .thread-index-workspace.phone-switch > .email-workspace-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .email-workspace-nav > .thread-plus { width: 40px; height: 40px; margin: 0; padding: 0; }
  .email-workspace-nav > .thread-plus span { display: none; }
  .thread-list-head { display: none; }
  .email-workspace.phone-switch > .email-workspace-detail { display: block; }
  .phone-switch .rail-group, .phone-switch .rail-name small, .phone-switch .rail-go, .phone-switch .email-section-back { display: none; }
  .phone-switch .rail-item { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; min-height: 40px; padding: 5px 10px 5px 6px; }
  .thread-index-workspace.phone-switch .rail-item { gap: 4px; padding-inline: 4px; }
  .phone-switch .rail-mark { width: 26px; height: 26px; border-radius: 7px; }
  .phone-switch .rail-mark .ico { width: 14px; height: 14px; }
  /* The app bar already carries the way back to the list. */
  .thread-back { display: none; }
}
@media (max-width: 760px) {
  .thread-gauge { gap: 5px; padding: 10px 12px 9px; }
  .thread-gauge-value b { font-size: 21px; }
  .thread-gauge-label { letter-spacing: 0.12em; }
}
.thread-reason, .thread-error { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.thread-flow.live .thread-reason { color: var(--text); }
.thread-error { color: var(--red); }
.thread-flow-actions { display: flex; gap: 2px; }
.thread-flow-actions .btn.sm.only-icon { width: 30px; height: 30px; min-height: 30px; }
.thread-past > summary { padding: 8px 10px 8px 12px; cursor: pointer; list-style: none; border-radius: var(--r-md); }
.thread-past > summary::-webkit-details-marker { display: none; }
.thread-past > summary:hover { background: rgba(255,255,255,.02); }
.thread-past > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.thread-last { margin: 2px 0 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.thread-last b { color: var(--text); font-weight: 600; }
.thread-agents { display: flex; padding-right: 4px; }
.thread-agents .avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.thread-agents .avatar + .avatar { margin-left: -6px; }
.thread-chev { width: 16px; height: 16px; margin: 0 6px; color: var(--muted); transition: transform .15s ease; }
.thread-past[open] .thread-chev { transform: rotate(90deg); }
.thread-past-body { padding: 0 12px 8px 42px; border-top: 1px solid var(--line); }
.thread-past-body .thread-flows .thread-flow:first-child { border-top: 0; }
.thread-all { display: inline-block; margin-top: 4px; color: var(--amber); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .04em; text-decoration: none; }
.thread-all:hover { text-decoration: underline; }
.thread-create { display: flex; flex-direction: column; gap: 12px; }
.thread-create input { width: 100%; min-height: 44px; }
.thread-create .field { width: 100%; margin: 0; }
.thread-picker { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.thread-kinds .chip { min-height: 30px; }
.thread-channels { display: flex; flex-direction: column; max-height: 232px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.thread-channel { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 40px; padding: 6px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.thread-channel:first-child { border-top: 0; }
.thread-channel:hover, .thread-channel:focus-visible { background: rgba(255,255,255,.03); outline: none; }
.thread-channel.on { background: var(--amber-wash); }
.thread-channel-mark { display: grid; place-items: center; color: var(--muted); }
.thread-channel-mark .ico { width: 14px; height: 14px; }
.thread-channel.on .thread-channel-mark { color: var(--amber); }
.thread-channel b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.thread-channel small { color: var(--faint); font: 400 10px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.thread-channels-none { margin: 0; }
.thread-channels[hidden], .thread-channels-none[hidden], .thread-kinds[hidden], .thread-new[hidden] { display: none; }
.thread-create-foot { display: flex; gap: 8px; justify-content: flex-end; }
.thread-plus[aria-expanded="true"] .ico { transform: rotate(45deg); }
.thread-plus .ico { transition: transform .15s ease; }
@media (max-width: 640px) {
  .thread-agents { display: none; }
  .thread-past-body { padding-left: 12px; }
}
.thread-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 0 0 14px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: .04em; }
.thread-sum b { margin-right: 6px; color: var(--text); font-family: Outfit, sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.thread-who { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.thread-who .chip { display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.panel .thread-flows > .thread-flow:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
:is(.thread-plans-panel, .thread-task-panel) [hidden] { display: none; }
.thread-plan-list { display: grid; gap: 10px; }
.thread-plan-history > .label { margin: 18px 0 8px; }
.thread-dependency-tree { padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.thread-dependency-tree > .label { margin: 0 0 10px; }
:is(.thread-dependency-roots, .thread-dependency-branch) { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
:is(.thread-dependency-roots, .thread-dependency-branch) > li { min-width: 0; }
.thread-dependency-branch { --branch-indent: clamp(9px, 2vw, 20px); margin: 6px 0 0 6px; padding-left: var(--branch-indent); border-left: 1px solid var(--line-strong); }
.thread-dependency-branch.shallow { margin-left: 0; padding-left: 5px; }
.thread-dependency-branch > li { position: relative; }
.thread-dependency-branch > li::before { content: ""; position: absolute; inset: 20px 100% auto auto; width: var(--branch-indent); border-top: 1px solid var(--line-strong); }
.thread-dependency-branch.shallow > li::before { width: 5px; }
.thread-dependency-node { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 7px 9px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--text); text-decoration: none; }
a.thread-dependency-node:hover, a.thread-dependency-node:focus-visible { border-color: var(--amber-line); color: var(--amber); }
.thread-dependency-node .thread-plan-title { flex: 1 1 110px; }
.thread-dependency-node .thread-plan-title strong { font-size: 15px; }
.thread-dependency-extra { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 9px 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.thread-dependency-extra a { color: var(--amber); }
.thread-dependency-note { display: block; color: var(--muted); }
.thread-plan { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); }
:is(.thread-plan > summary, .thread-plan-index-row) { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; cursor: pointer; list-style: none; }
.thread-plan-index-row { color: var(--text); text-decoration: none; }
.thread-plan-index-row:hover { border-color: var(--line-strong); color: var(--amber); }
.thread-plan > summary::-webkit-details-marker { display: none; }
:is(.thread-plan > summary, .thread-plan-index-row):focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: var(--r-md); }
.thread-plan[open] .thread-turn-chev { transform: rotate(90deg); }
.thread-plan-title { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.thread-plan-title strong, .thread-task-title { font-family: Outfit, sans-serif; font-size: 17px; font-weight: 600; }
.thread-plan-title small { color: var(--muted); }
.thread-plan-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font: 11px "DM Mono", monospace; }
.thread-plan-body { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.thread-plan-checklist { margin: 0; padding: 0; list-style: none; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-sm); }
.thread-plan-step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px; }
.thread-plan-step + .thread-plan-step { border-top: 1px solid var(--line); }
.thread-plan-mark { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; font: 11px "DM Mono", monospace; color: var(--muted); }
.thread-plan-mark .ico { width: 14px; height: 14px; }
.thread-plan-step.done .thread-plan-mark { border-color: var(--green); color: var(--green); }
.thread-plan-step.next, .thread-plan-step.selected { background: var(--amber-wash); }
.thread-plan-step.next .thread-plan-mark { border-color: var(--amber-line); color: var(--amber); }
.thread-plan-text, .thread-task-title { overflow-wrap: anywhere; }
.thread-plan-step .btn { min-width: 36px; min-height: 36px; }
.thread-plan-form { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 14px; background: var(--panel-2); }
.thread-plan-form textarea { resize: vertical; }
.thread-plan-actions, .thread-task-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.thread-task-links { justify-content: flex-start; }
.thread-turn-plan-links { margin-top: 8px; }
.thread-task-links .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.thread-task-meta { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; color: var(--muted); font: 11px "DM Mono", monospace; }
.thread-task-event { min-width: 0; }
@media (max-width: 600px) {
  :is(.thread-plan > summary, .thread-plan-index-row) { grid-template-columns: minmax(0, 1fr) 16px; }
  .thread-plan-progress { grid-column: 1; grid-row: 2; }
  :is(.thread-plan > summary, .thread-plan-index-row) .thread-turn-chev { grid-column: 2; grid-row: 1; }
}

.thread-turns { display: flex; flex-direction: column; gap: 10px; }
.thread-turn { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); }
.thread-turn.live { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-glow); }
.thread-turn > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px; cursor: pointer; list-style: none; }
.thread-turn > summary::-webkit-details-marker { display: none; }
.thread-turn > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: var(--r-md); }
.thread-turn-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.thread-turn-who b { font-family: Outfit, sans-serif; font-weight: 600; }
.thread-turn-who .thread-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.thread-turn .badges { display: flex; gap: 8px; align-items: center; }
.thread-turn-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease; }
.thread-turn[open] .thread-turn-chev { transform: rotate(90deg); }
.thread-turn-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.thread-turn-body > h3.label { margin: 14px 0 6px; padding: 0 2px; }
.thread-turn-body > h3.label:first-child { margin-top: 10px; }
.thread-turn-body .answer { padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.thread-turn .steps-log { gap: 6px; }
.thread-turn .step { padding: 7px 10px; }
.thread-turn .step .body { margin-top: 4px; font-size: 13px; line-height: 1.45; }
.sk-turn { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px; }
.sk-avatar { width: 28px; height: 28px; border-radius: 50%; }
.sk-thread-title { width: min(320px, 70%); height: 26px; }
.sk-thread-sum { width: 220px; height: 14px; }
.thread-turn-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; }
@media (max-width: 640px) {
  .thread-turn > summary { grid-template-columns: 28px minmax(0, 1fr) 16px; }
  .thread-turn > summary .badges { grid-column: 2; grid-row: 2; }
  .thread-turn > summary .thread-turn-chev { grid-column: 3; grid-row: 1; }
}
.thread-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .04em; }
.thread-meta a { color: var(--amber); }

.thread-flow .led { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #2a2a2a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.thread-flow .led.on { background: var(--green); box-shadow: 0 0 8px rgba(140, 197, 106, 0.55); }
.thread-flow .led.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }

.agent-knowledge .set-row[hidden] { display: none; }


/* The encrypted workspace uses the desk's own controls and section rail. */
.encrypted-space .row > select { flex: 1 1 160px; width: auto; }
.encrypted-space .encrypted-request { flex-wrap: wrap; }
.encrypted-space .encrypted-request > .grow { flex: 1 1 220px; overflow-wrap: anywhere; }
.encrypted-space .row > .btn:last-child { margin-left: 0; }
.encrypted-space .row.end > .btn:last-child { margin-left: auto; }
@media (max-width: 600px) {
  .encrypted-space .row > select { flex-basis: 100%; }
  .encrypted-space .row > .btn { flex: 1 1 auto; }
}

.encrypted-space [hidden] { display: none; }

/* Existing Settings stay compact until their details are requested. */
.settings-disclosure > summary { list-style: none; cursor: pointer; }
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary:hover { background: var(--well); border-radius: inherit; }
.settings-disclosure > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: inherit; }
.settings-disclosure-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 500 10px var(--mono); flex: none; }
.settings-disclosure-label .ico { width: 16px; height: 16px; }
.settings-disclosure[open] > summary .settings-disclosure-label .ico { transform: rotate(90deg); }
.settings-key-hint { white-space: nowrap; font: 12px var(--mono); color: var(--muted); }
.settings-disclosure > .panel-body > .panel-actions { justify-content: flex-start; }
@media (max-width: 600px) {
  .settings-disclosure > summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "icon title title" "icon status details"; gap: 8px 10px; }
  .settings-disclosure > summary .panel-ico { grid-area: icon; }
  .settings-disclosure > summary .panel-title { grid-area: title; }
  .settings-disclosure > summary .panel-actions { grid-area: status; justify-content: flex-start; flex-wrap: wrap; }
  .settings-disclosure-label { grid-area: details; }
}

.mail-domain-account-step[hidden], .mail-domain-new-account[hidden] { display: none; }

.settings-disclosure:not([open]) > summary .panel-title p { display: none; }
@media (max-width: 600px) {
  .settings-disclosure > summary:not(:has(.panel-actions)) { grid-template-areas: "icon title details"; }
}

.settings-disclosure.mail-domain-card:not([open]) > summary .panel-title p { display: block; }
@media (max-width: 600px) {
  .email-channel .email-settings-tabs { flex-wrap: wrap; }
  .email-channel .email-settings-tabs button { flex: 1 1 calc(50% - 3px); white-space: normal; }
}

.encrypted-file-preview { white-space: pre-wrap; overflow-wrap: anywhere; }
.encrypted-file-image { max-width: 100%; height: auto; }

/* Encrypted folders share the artifact controls, with a compact unlock form. */
.encrypted-credential-name { font-size: 12px; color: var(--muted); height: 34px; padding: 6px 10px; text-overflow: ellipsis; }
.encrypted-unlock-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.encrypted-unlock-field > input { flex: 1; min-width: 0; width: 0; }
.encrypted-unlock-field > .btn.only-icon { flex: 0 0 40px; width: 40px; height: 40px; margin: 0; }
.encrypted-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.encrypted-remember input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--amber); }
.encrypted-password-form { gap: 10px; }
.encrypted-passkey-actions:empty { display: none; }
.encrypted-passkey-mark { display: grid; place-items: center; padding: 8px 0; color: var(--amber); }
.encrypted-passkey-mark .ico { width: 48px; height: 48px; stroke-width: 1.4; }
.encrypted-unlock [hidden], .encrypted-enrollment [hidden] { display: none; }
@media (max-width: 600px) {
  .encrypted-enrollment-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .encrypted-enrollment-actions > .btn { width: 100%; margin: 0; }
}

.encrypted-unlock-options:not(:has(button:not([hidden]))) { display: none; }
.encrypted-passkey-only { display: flex; flex-direction: column; min-height: min(560px, calc(var(--app-h, 100dvh) - 180px)); }
.encrypted-passkey-only .panel-body { flex: 1; gap: 24px; }
.encrypted-passkey-only .encrypted-passkey-mark { flex: 1; min-height: 160px; padding: 24px 0; }
.encrypted-passkey-only .encrypted-passkey-mark .ico { width: 104px; height: 104px; stroke-width: 1.2; }
.encrypted-passkey-only .encrypted-passkey-actions { margin-top: auto; }

@media (max-width: 600px) {
  .encrypted-passkey-only { min-height: max(340px, calc(var(--app-h, 100dvh) - 280px)); }
}

.encrypted-passkey-only .encrypted-unlock-footer { margin-top: auto; gap: 12px; }
/* Encrypted folders share the plaintext folder head; the lock sits square on the title line. */
.page-head.art-enc-head { flex-wrap: nowrap; align-items: flex-start; }
.page-head.art-enc-head .page-title { min-width: 0; }
.page-head.art-enc-head .page-actions { flex: none; padding-top: 4px; }
.log-row .badge { margin-left: 8px; vertical-align: 1px; }
@media (max-width: 899px) {
  .page-head.art-enc-head { align-items: center; }
  .page-head.art-enc-head .page-actions { padding-top: 0; }
}

.encrypted-remember { align-self: flex-end; min-height: 28px; gap: 6px; font-size: 12px; color: var(--muted); }
.encrypted-remember input { width: 14px; height: 14px; }
.encrypted-unlock-options { justify-content: flex-end; }
.encrypted-unlock .encrypted-unlock-options > .btn { width: auto; flex: none; margin: 0; }

/* Agent export and import */
.transfer-group { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); }
.transfer-group > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.transfer-group > summary::-webkit-details-marker { display: none; }
.transfer-group > summary .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.transfer-group > summary small, .transfer-heading small { color: var(--muted); font-size: 13px; }
.transfer-count { font: 500 11px/1 var(--mono); letter-spacing: .08em; color: var(--amber); white-space: nowrap; }
.transfer-chevron { flex: none; width: 16px; height: 16px; color: var(--faint); transition: transform .15s ease; }
.transfer-group[open] .transfer-chevron { transform: rotate(90deg); }
.transfer-tools { display: flex; gap: 6px; padding: 0 14px 8px; }
.transfer-items { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--line); background: var(--well); border-radius: 0 0 var(--r-md) var(--r-md); }
.transfer-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.transfer-item:first-child { border-top: 0; }
.transfer-item input { flex: none; margin-top: 3px; accent-color: var(--amber); }
.transfer-item .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.transfer-line { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.transfer-meta { color: var(--muted); font: 400 11px/1.4 var(--mono); }
.transfer-none { padding: 0 14px 12px; margin: 0; }
.transfer-removed { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--amber); }
.transfer-removed > .ico { width: 13px; height: 13px; }
.transfer-removed .tag { border-color: var(--amber-line); color: var(--amber); background: var(--amber-wash); }
.set-text .transfer-removed { display: flex; margin-top: 6px; }
.transfer-needs { display: flex; flex-wrap: wrap; gap: 6px; }
.transfer-needs .tag.on { border-color: var(--amber-line); color: var(--amber); }
.transfer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.transfer-actions select { width: auto; }
.transfer-file-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: 0; background: none; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.transfer-fresh[hidden], .transfer-links[hidden] { display: none; }
.transfer-fresh { display: flex; flex-direction: column; gap: 8px; }
.transfer-fresh p { margin: 0; }
.transfer-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.transfer-link { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.transfer-link > .ico { flex: none; color: var(--amber); }
.transfer-link .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.transfer-link small { color: var(--muted); font-size: 13px; }
.transfer-routes { display: flex; flex-direction: column; padding-top: 16px; border-top: 1px solid var(--line); }
.transfer-heading { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.transfer-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.transfer-route .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.transfer-file { display: none; }
@media (max-width: 640px) {
  .transfer-route { grid-template-columns: minmax(0, 1fr); }
  .transfer-actions .spacer { display: none; }
  .transfer-actions > .btn.primary { width: 100%; }
}

.encrypted-used-folders { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.encrypted-used-folders a { color: var(--amber); font-size: 12px; overflow-wrap: anywhere; }
.encrypted-confirm { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 24px; box-shadow: 0 24px 80px #000a; }
.encrypted-confirm::backdrop { background: #000b; }
.encrypted-confirm p { margin: 16px 0; color: var(--muted); line-height: 1.6; }
.encrypted-confirm .row { justify-content: flex-end; flex-wrap: wrap; }

.encrypted-passkey-registry .encrypted-credential-row.set-row:has(> .set-control) { grid-template-columns: minmax(0, 1fr) minmax(100px, 30%); gap: 12px; }
.encrypted-credential-row .set-control { align-items: stretch; width: 100%; }
.encrypted-credential-row .set-control > select { min-width: 0; width: 100%; max-width: 100%; }
.encrypted-credential-row .set-control > .btn { width: 100%; min-height: 40px; white-space: normal; font-size: 10px; padding: 8px; }

.encrypted-folder-destination { display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.encrypted-folder-destination b { color: var(--text); }
.encrypted-confirm > select { width: 100%; min-width: 0; }

/* Agent → Skill */
.skills-workspace [hidden] { display: none; }
.skill-list { display: grid; margin: 0; padding: 0; list-style: none; }
.skill-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 12px 14px; min-width: 0; padding: 16px 2px; border-top: 1px solid var(--line); }
.skill-row.result { grid-template-columns: minmax(0, 1fr) auto; }
.skill-list > .skill-row:first-child { border-top: 0; padding-top: 4px; }
.skill-row > .panel-ico { width: 34px; height: 34px; flex: none; }
.skill-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.skill-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.skill-name { font: 500 15px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--text); overflow-wrap: anywhere; }
.skill-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.skill-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--faint); font: 400 11.5px/1.5 var(--mono); }
.skill-meta code { color: var(--muted); }
.skill-source { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 6px; min-width: 0; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.skill-source .ico { width: 14px; height: 14px; flex: none; }
a.skill-source:hover { color: var(--amber); }
.skill-source .faint { color: var(--faint); }
.skill-audits { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.skill-actions .skill-switch { gap: 8px; margin-right: 6px; min-height: 30px; }
.skill-actions .skill-switch .switch-text { font-size: 13px; color: var(--muted); min-width: 4.2em; }
.skill-row.off .skill-name, .skill-row.off .skill-desc, .skill-row.off > .panel-ico { opacity: 0.5; }
.skill-led { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.skill-led .dot { width: 7px; height: 7px; }
.skill-led.ok { color: var(--green); }
.skill-led.ok .dot { background: var(--green); box-shadow: 0 0 6px rgba(140, 197, 106, 0.55); }
.skill-led.warn { color: var(--amber); }
.skill-led.warn .dot { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.skill-led.err { color: #ff9c8b; }
.skill-led.err .dot { background: var(--red); }
.skill-search { display: flex; gap: 8px; min-width: 0; }
.skill-search input { flex: 1 1 auto; min-width: 0; }
.skill-search .btn { flex: none; }
.skill-results:not(:empty) { margin-top: 14px; display: grid; gap: 10px; }
.skill-results .skill-row:first-child { border-top: 0; }
.skill-preview { margin-top: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); max-height: 420px; overflow: auto; display: grid; gap: 12px; }
.skill-files { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-files code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--muted); font: 400 11px/1.4 var(--mono); }
.btn.busy { opacity: 0.6; cursor: progress; }
.skill-matrix-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); }
.skill-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.skill-matrix th, .skill-matrix td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.skill-matrix thead th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font: 500 10px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.skill-matrix tbody th { font: 500 13px/1.3 var(--mono); color: var(--text); }
.skill-matrix tbody th small { display: block; margin-top: 4px; color: #ff9c8b; font-size: 11px; white-space: normal; max-width: 220px; }
.skill-matrix tbody tr:last-child > * { border-bottom: 0; }
.skill-links { display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: 260px; }
.skill-links .skill-led { text-transform: none; letter-spacing: 0.02em; font-size: 11px; }
@media (max-width: 640px) {
  .skill-search { flex-wrap: wrap; }
  .skill-search .btn { flex: 1 1 auto; }
  .skill-row { grid-template-columns: 34px minmax(0, 1fr); }
  .skill-row.result { grid-template-columns: minmax(0, 1fr); }
  .skill-row > .skill-actions { grid-column: 2; justify-content: flex-start; }
  .skill-row.result > .skill-actions { grid-column: 1; }
}
