/* NanoClaw Control Center — themes. Each user picks one (Default, Light, Dark, Cyber, Hell) or follows
   the system; app.js sets html[data-theme] to the resolved theme. */
:root, html[data-theme="default"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --surface-3: #e4eaee;
  --border: #dde3e8;
  --text: #15183a;
  --text-2: #4c5570;
  --text-3: #8790a6;
  --accent: #0e9f8d;
  --accent-strong: #0a7f71;
  --accent-ink: #ffffff;
  --accent-soft: #dcf5f1;
  --navy: #1b1d4b;
  --user-bubble: #1b1d4b;
  --user-ink: #f3f6fb;
  --ok: #1f9d55;
  --ok-soft: #dff5e8;
  --warn: #c27c0e;
  --warn-soft: #fdf0d7;
  --bad: #d13b3b;
  --bad-soft: #fde3e3;
  --info-soft: #e3ecfd;
  --code-bg: #eef2f6;
  --shadow-sm: 0 1px 2px rgba(21, 24, 58, .06);
  --shadow: 0 1px 2px rgba(21, 24, 58, .05), 0 8px 28px rgba(21, 24, 58, .07);
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0f1120;
  --surface: #171a2e;
  --surface-2: #1e2238;
  --surface-3: #272c46;
  --border: #2b304c;
  --text: #e8ebf6;
  --text-2: #aab1c9;
  --text-3: #747c99;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-ink: #062a26;
  --accent-soft: #0f3b38;
  --navy: #272c46;
  --user-bubble: #2dd4bf;
  --user-ink: #062a26;
  --ok: #4ade80;
  --ok-soft: #12321f;
  --warn: #fbbf24;
  --warn-soft: #3a2c0c;
  --bad: #f87171;
  --bad-soft: #3d1717;
  --info-soft: #1b2748;
  --code-bg: #1d2136;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceef2;
  --border: #e3e6eb;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e6eefe;
  --navy: #1f2937;
  --user-bubble: #2563eb;
  --user-ink: #ffffff;
  --ok: #16a34a;
  --ok-soft: #e3f7ea;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --bad: #dc2626;
  --bad-soft: #fde8e8;
  --info-soft: #e8f0fe;
  --code-bg: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .06);
  color-scheme: light;
}
html[data-theme="cyber"] {
  --bg: #05060f;
  --surface: #0b0e1f;
  --surface-2: #11152b;
  --surface-3: #1a1f3d;
  --border: #23305e;
  --text: #d8f6ff;
  --text-2: #8fb8d6;
  --text-3: #5a7396;
  --accent: #00f0ff;
  --accent-strong: #7cf9ff;
  --accent-ink: #00141a;
  --accent-soft: #062c3a;
  --navy: #ff2bd6;
  --user-bubble: #ff2bd6;
  --user-ink: #1a0016;
  --ok: #39ff88;
  --ok-soft: #08301c;
  --warn: #ffe600;
  --warn-soft: #2f2a05;
  --bad: #ff3864;
  --bad-soft: #3a0a18;
  --info-soft: #101a40;
  --code-bg: #0e1330;
  --shadow-sm: 0 0 0 1px rgba(0, 240, 255, .08);
  --shadow: 0 0 0 1px rgba(0, 240, 255, .12), 0 0 24px rgba(0, 240, 255, .10);
  --radius: 6px;
  --font: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
html[data-theme="hell"] {
  --bg: #0c0303;
  --surface: #170707;
  --surface-2: #210b0a;
  --surface-3: #2e100d;
  --border: #4a1610;
  --text: #ffe9dc;
  --text-2: #e0a68c;
  --text-3: #9a5f4c;
  --accent: #ff4d1a;
  --accent-strong: #ff8a3d;
  --accent-ink: #1a0400;
  --accent-soft: #3d1007;
  --navy: #8b0000;
  --user-bubble: #b3120a;
  --user-ink: #fff1e8;
  --ok: #f5b800;
  --ok-soft: #352605;
  --warn: #ff9f1c;
  --warn-soft: #3a2006;
  --bad: #ff2d2d;
  --bad-soft: #450808;
  --info-soft: #2a0f14;
  --code-bg: #1d0807;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 28px rgba(255, 45, 0, .12);
  color-scheme: dark;
}
/* No script yet (or none at all): follow the system. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0f1120; --surface: #171a2e; --surface-2: #1e2238; --surface-3: #272c46; --border: #2b304c;
    --text: #e8ebf6; --text-2: #aab1c9; --text-3: #747c99;
    --accent: #2dd4bf; --accent-strong: #5eead4; --accent-ink: #062a26; --accent-soft: #0f3b38;
    --navy: #272c46; --user-bubble: #2dd4bf; --user-ink: #062a26;
    --ok: #4ade80; --ok-soft: #12321f; --warn: #fbbf24; --warn-soft: #3a2c0c; --bad: #f87171; --bad-soft: #3d1717;
    --info-soft: #1b2748; --code-bg: #1d2136;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, kbd, pre { font-family: var(--mono); }

/* ---- shell ------------------------------------------------------------ */
.shell { display: flex; height: 100dvh; }
.sidebar {
  width: 248px; flex: none; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand img { border-radius: 50%; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--text-3); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav a span { flex: 1; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.badge.muted { background: var(--surface-3); color: var(--text-2); }
.badge.warn { background: var(--warn); color: #1b1300; }
.sidebar-foot { padding-top: 12px; border-top: 1px solid var(--border); }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.status-pill .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.status-pill[data-state="online"] .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-pill[data-state="paused"] .dot { background: var(--warn); }
.status-pill[data-state="offline"] .dot, .status-pill[data-state="unreachable"] .dot { background: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.mobilebar { display: none; }
.view { flex: 1; min-height: 0; overflow-y: auto; }
.banner { margin: 12px 24px 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.banner[data-tone="bad"] { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ---- page scaffolding ---------------------------------------------------- */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 30px; }
.section > h2 { font-size: 15px; margin: 0 0 4px; letter-spacing: -.005em; }
.section > .sub { margin: 0 0 14px; color: var(--text-3); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: background .12s, border-color .12s, transform .12s, opacity .12s; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag .dot { width: 7px; height: 7px; background: currentColor; }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty-state .big { font-size: 34px; }
.empty-state h3 { margin: 8px 0 4px; color: var(--text); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

input[type="text"], input[type="password"], input[type="datetime-local"], input[type="time"], select, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--text-3); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- overview ---------------------------------------------------------- */
.hero { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 65%); }
.hero img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); }
.hero h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 0; color: var(--text-2); }
.hero .actions { margin-left: auto; }
.svc { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.svc .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; flex: none; }
.svc h3 { margin: 0; font-size: 14px; }
.svc p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.svc .state { margin-top: 8px; }
.stat { padding: 16px 18px; }
.stat .num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { color: var(--text-3); font-size: 12.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.quick .btn { padding: 10px 14px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .ev-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 14px; }
.timeline .ev-ico.error { background: var(--bad-soft); }
.timeline .ev-ico.warn { background: var(--warn-soft); }
.timeline .ev-body { flex: 1; min-width: 0; }
.timeline .ev-title { font-weight: 600; font-size: 13.5px; }
.timeline .ev-meta { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .ev-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.day-head { margin: 18px 0 4px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

/* ---- connections --------------------------------------------------------- */
.conn { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.conn-top { display: flex; align-items: center; gap: 12px; }
.conn-emoji { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: var(--surface-2); flex: none; }
.conn h3 { margin: 0; font-size: 14.5px; }
.conn .desc { margin: 0; font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.6em; }
.conn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.conn.connected { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.filter-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row input { max-width: 320px; }

/* ---- tasks ------------------------------------------------------------- */
.task { padding: 16px 18px; display: grid; gap: 10px; }
.task-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 160px; }
.task-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.task-meta b { color: var(--text); font-weight: 600; }
.task-prompt { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; white-space: pre-wrap; }
.task-log { margin: 0; padding: 10px 12px; background: var(--code-bg); border-radius: 10px; font-size: 12px; max-height: 200px; overflow: auto; white-space: pre-wrap; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- history ----------------------------------------------------------- */
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; min-height: 480px; }
.list { overflow: auto; max-height: calc(100dvh - 230px); }
.list-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item.active { background: var(--accent-soft); }
.list-item .t { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12px; color: var(--text-3); }
.list-item > div { min-width: 0; flex: 1; }
.transcript { padding: 18px; overflow: auto; max-height: calc(100dvh - 230px); }

/* ---- chat -------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head h1 { margin: 0; font-size: 16px; }
.chat-head p { margin: 0; font-size: 12.5px; color: var(--text-3); }
.chat-scroll { flex: 1; overflow-y: auto; }
.chat-col { width: min(780px, 100%); margin: 0 auto; padding: 22px 16px 10px; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.daysep { align-self: center; font-size: 12px; color: var(--text-3); margin: 8px 0 0; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg.me { justify-content: flex-end; }
.avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; margin-top: 2px; }
.msg .body { min-width: 0; max-width: min(640px, 86%); display: flex; flex-direction: column; }
.msg.me .body { align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.msg.agent .bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 6px; box-shadow: var(--shadow-sm); }
.msg.me .bubble { background: var(--user-bubble); color: var(--user-ink); border-top-right-radius: 6px; white-space: pre-wrap; }
.msg.me.pending .bubble { opacity: .65; }
.msg.me.failed .bubble { outline: 2px solid var(--bad); outline-offset: 1px; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 0 4px; font-size: 11.5px; color: var(--text-3); min-height: 18px; }
.meta button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-3); font-size: 11.5px; text-decoration: underline; text-underline-offset: 2px; }
.meta button:hover { color: var(--text); }
.meta .error { color: var(--bad); }
.msg.agent .copy { opacity: 0; transition: opacity .15s; }
.msg.agent:hover .copy, .msg.agent .copy:focus-visible { opacity: 1; }
.empty-chat { text-align: center; padding: 10vh 8px 20px; }
.empty-chat img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.empty-chat h2 { margin: 14px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.empty-chat p { color: var(--text-2); margin: 0 auto 20px; max-width: 460px; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; text-align: left; }
.suggestions button { padding: 12px 14px; border-radius: 14px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; line-height: 1.4; transition: border-color .15s, color .15s, transform .15s; }
.suggestions button:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.thinking { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.thinking-body { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 16px; border-top-left-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
.composer-wrap { padding: 10px 16px 14px; }
.composer { width: min(780px, 100%); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 8px 0; max-height: 40vh; line-height: 1.5; }
.composer textarea::placeholder { color: var(--text-3); }
.send-btn { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn.stop { background: var(--bad); color: #fff; }
.hint-line { width: min(780px, 100%); margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--text-3); }
.hint-line kbd, .hint-line code { font-size: 11px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); }

/* markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .6em; }
.md ul, .md ol { margin: .2em 0 .7em; padding-left: 1.3em; }
.md li { margin: .15em 0; }
.md h3, .md h4, .md h5 { margin: .8em 0 .35em; line-height: 1.3; }
.md h3 { font-size: 1.1em; } .md h4 { font-size: 1.02em; } .md h5 { font-size: .95em; color: var(--text-2); }
.md blockquote { margin: .4em 0 .7em; padding-left: 12px; border-left: 3px solid var(--border); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: .8em 0; }
.md code { font-size: .88em; background: var(--code-bg); padding: .1em .4em; border-radius: 6px; }
.md pre { margin: .5em 0 .8em; padding: 12px 14px; border-radius: 12px; background: var(--code-bg); overflow-x: auto; line-height: 1.45; }
.md pre code { background: none; padding: 0; font-size: 12.5px; }
.msg.me .md code { background: color-mix(in srgb, var(--user-ink) 15%, transparent); }

/* ---- claude code -------------------------------------------------------- */
.cc { display: grid; grid-template-columns: 280px 1fr; height: 100%; }
.cc-side { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.cc-side-head { padding: 16px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.cc-side-head h1 { margin: 0; font-size: 17px; }
.cc-runs { overflow-y: auto; flex: 1; }
.cc-main { display: flex; flex-direction: column; min-height: 0; }
.cc-scroll { flex: 1; overflow-y: auto; }
.cc-col { width: min(860px, 100%); margin: 0 auto; padding: 22px 18px 12px; display: grid; gap: 12px; }
.cc-prompt { justify-self: end; max-width: 85%; background: var(--user-bubble); color: var(--user-ink); padding: 10px 14px; border-radius: 16px; border-top-right-radius: 6px; white-space: pre-wrap; }
.cc-text { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; border-top-left-radius: 6px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.tool { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.tool summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; }
.tool summary::-webkit-details-marker { display: none; }
.tool summary .tname { font-weight: 600; }
.tool summary .tdetail { color: var(--text-2); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tool .tstate { margin-left: auto; }
.tool pre { margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--code-bg); font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.tool.err summary { color: var(--bad); }
.perm { border: 1.5px solid var(--warn); background: var(--warn-soft); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.perm h4 { margin: 0; font-size: 14px; }
.perm pre { margin: 0; padding: 10px 12px; background: var(--surface); border-radius: 10px; font-size: 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.result-line { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 12.5px; color: var(--text-3); padding: 4px; }
.cc-compose { padding: 10px 16px 14px; border-top: 1px solid var(--border); background: var(--bg); }
.cc-compose .composer { width: min(860px, 100%); }
.cc-opts { width: min(860px, 100%); margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.cc-welcome { text-align: center; padding: 6vh 10px 10px; }
.cc-welcome .big { font-size: 40px; }
.cc-welcome h2 { margin: 6px 0; font-size: 22px; }
.cc-welcome p { color: var(--text-2); max-width: 520px; margin: 0 auto 18px; }

/* ---- agent ------------------------------------------------------------- */
textarea.editor { width: 100%; min-height: 260px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; outline: none; }
textarea.editor:focus { border-color: var(--accent); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

/* ---- logs -------------------------------------------------------------- */
.logbox { background: #0d1020; color: #d8dcf0; border-radius: 14px; padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.55; height: calc(100dvh - 240px); min-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.logbox .l-warn { color: #fbbf24; }
.logbox .l-error { color: #f87171; }
.logbox .l-dim { color: #7c84a6; }
.logbox mark { background: #2dd4bf; color: #062a26; border-radius: 3px; }

/* ---- toasts & modal ---------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; animation: pop .2s ease-out; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); color: #04210f; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal::backdrop { background: rgba(10, 12, 30, .45); backdrop-filter: blur(2px); }
.modal .m-body { padding: 22px; display: grid; gap: 14px; }
.modal h3 { margin: 0; font-size: 17px; }
.modal p { margin: 0; color: var(--text-2); }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal pre { margin: 0; max-height: 50vh; overflow: auto; background: var(--code-bg); padding: 12px; border-radius: 10px; font-size: 12.5px; white-space: pre-wrap; }

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

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .mobilebar img { border-radius: 7px; }
  .page { padding: 20px 16px 40px; }
  .split, .cc { grid-template-columns: 1fr; }
  .cc-side { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .hero { flex-wrap: wrap; }
  .hero .actions { margin-left: 0; }
}
.cc-target { width: min(860px, 100%); margin: 0 auto 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.cc-target b { color: var(--text); font-weight: 600; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* layout: reply indicator */

/* ---- Claude Code management (v2) ---------------------------------------- */
.cc-side-head input { padding: 7px 11px; font-size: 13px; }
.cc-side-foot { padding: 10px 12px; border-top: 1px solid var(--border); }
.run-item { position: relative; }
.run-item .run-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; flex: none; }
.run-item:hover .run-actions, .run-item:focus-within .run-actions, .run-item.active .run-actions { opacity: 1; }
.icon-btn.tiny { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.tiny svg { width: 15px; height: 15px; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.cc-head-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.cc-head h2 { margin: 0; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.cc-opts select.mini { width: auto; padding: 6px 28px 6px 10px; font-size: 12.5px; border-radius: 9px; }
.cc-prompt-wrap { justify-self: end; max-width: 85%; display: grid; justify-items: end; gap: 4px; }
.cc-prompt-wrap .cc-prompt { max-width: 100%; justify-self: end; }
.cc-prompt.md { white-space: normal; }
.cc-prompt.md a { color: inherit; }
.cc-prompt-meta { font-size: 11.5px; color: var(--text-3); }
.cc-text-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.copy-btn { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; opacity: 0; transition: opacity .15s; }
.cc-text:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.msg.me .bubble.md { white-space: normal; }
.msg.me .bubble.md a { color: inherit; }

/* markdown v2: code blocks, tables, task lists, nested lists */
.md .code { margin: .5em 0 .8em; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--code-bg); }
.md .code-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 12px; font-size: 11.5px; color: var(--text-3); border-bottom: 1px solid var(--border); font-family: var(--mono); }
.md .code-copy { border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 11.5px; }
.md .code-copy:hover { color: var(--text); }
.md .code pre { margin: 0; border-radius: 0; background: transparent; }
.md .md-table { overflow-x: auto; margin: .5em 0 .8em; }
.md table { border-collapse: collapse; font-size: .93em; min-width: 50%; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md .al-center { text-align: center; }
.md .al-right { text-align: right; }
.md .task { font-size: 1.05em; margin-right: 2px; }
.md .task.done { color: var(--ok); }
.md li > ul, .md li > ol { margin: .25em 0 .35em; }
.editor-preview { min-height: 260px; }

/* ---- layout fixes: let the conversation column shrink instead of overflowing ---- */
.cc { grid-template-columns: 280px minmax(0, 1fr); }
.cc-main, .cc-scroll, .cc-col, .cc-compose { min-width: 0; }
.cc-head-main > .row { flex-wrap: nowrap; min-width: 0; }
.cc-head h2 { min-width: 0; flex: 1; max-width: none; }
.cc-head .actions { flex-wrap: nowrap; }
.cc-target { flex-wrap: nowrap; min-width: 0; }
.cc-target b { min-width: 0; flex: 1; }
.cc-target .btn { flex: none; }
.cc-opts { gap: 6px; }
.cc-opts select.mini { max-width: 180px; }
.cc-opts .seg button { padding: 5px 10px; font-size: 12.5px; }
.cc-text, .tool, .perm { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1250px) {
  .cc { grid-template-columns: 230px minmax(0, 1fr); }
  .cc-head .btn span { display: none; }            /* icon-only header buttons when narrow */
  .cc-head .btn { padding: 6px 9px; }
}
@media (max-width: 900px) { .cc { grid-template-columns: minmax(0, 1fr); } }

/* ---- sign-in & security --------------------------------------------------- */
.login-body { display: grid; place-items: center; min-height: 100dvh; padding: 20px;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg) 60%); }
.login-card { width: min(440px, 100%); padding: 32px 28px; text-align: center; display: grid; gap: 10px; box-shadow: var(--shadow); }
.login-card img { margin: 0 auto 4px; border-radius: 16px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 8px; }
.login-card form { display: grid; gap: 14px; text-align: left; }
.key-row { display: flex; gap: 6px; }
.key-row input { font-family: var(--mono); letter-spacing: .03em; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.login-error { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.login-go { padding: 11px; font-size: 14.5px; }
.login-help { text-align: left; font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.login-help summary { cursor: pointer; }
.login-help code { font-size: 11.5px; background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
.signout { margin-top: 8px; width: 100%; justify-content: flex-start; color: var(--text-2); }
.sec-summary { display: flex; gap: 16px; align-items: center; }
.sec-summary .big { font-size: 34px; }
.sec-summary h2 { margin: 0; font-size: 18px; }
.sec-summary p { margin: 2px 0 0; }
.sec-summary.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.sec-summary.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); background: var(--warn-soft); }
.sec-check { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.sec-check.bad { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.sec-ico { font-size: 18px; flex: none; }
.sec-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.key-reveal { padding: 14px; border-radius: 12px; background: var(--code-bg); font-size: 15px; letter-spacing: .04em; text-align: center; user-select: all; overflow-wrap: anywhere; }

.key-row input { flex: 1; min-width: 0; }

.webhook-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.webhook-card > div { flex: 1; min-width: 240px; }
.webhook-url { font-family: var(--mono); font-size: 13px; background: var(--code-bg); padding: 6px 10px; border-radius: 8px; overflow-wrap: anywhere; }

/* ---- tasks: pause state, run feedback, editor ---- */
.task.paused { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.paused-note { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--text); }
.run-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: var(--surface-2); }
.run-status.running { background: var(--info-soft); }
.run-status.ok { background: var(--ok-soft); }
.run-status.bad { background: var(--bad-soft); }
.run-status.warn { background: var(--warn-soft); }
.run-status .small { color: var(--text-2); margin-top: 2px; }
.task-advanced { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.task-advanced summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.task-advanced p { margin: 8px 0; }
.modal { width: min(640px, calc(100% - 32px)); }
.modal .m-body { max-height: 75vh; overflow-y: auto; }

/* ---- Chat conversations ---------------------------------------------------- */
.chat-shell { display: grid; grid-template-columns: 260px 1fr; height: 100%; min-height: 0; }
.chat-shell > .chat { min-width: 0; min-height: 0; }
.chat-convs { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-convs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
.chat-convs-list { overflow-y: auto; flex: 1; }
.conv-item .t { display: flex; align-items: center; }
.chat-convs-foot { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-3); text-decoration: none; }
.chat-convs-foot:hover { color: var(--text); }
.chat-convs-toggle { display: none; }
.old-conv { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 24px; background: var(--warn-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.old-conv[hidden] { display: none; }
@media (max-width: 900px) {
  .chat-shell { grid-template-columns: 1fr; position: relative; }
  .chat-convs { position: absolute; inset: 0 auto 0 0; width: min(300px, 85vw); z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .chat-shell.convs-open .chat-convs { transform: none; }
  .chat-convs-toggle { display: inline-flex; }
  .chat-head { padding: 12px 16px; }
  .old-conv { padding: 10px 16px; }
}
.composer-wrap[hidden], .chat-convs-list [hidden] { display: none; }

/* ---- Parallel chat conversations -------------------------------------------- */
.chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.conv-item { position: relative; }
.conv-item .t { display: flex; align-items: center; gap: 6px; }
.conv-item .conv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv-item .s { display: flex; align-items: center; gap: 6px; }
.conv-item .s.working { color: var(--accent); font-weight: 600; }
.conv-item.unread .conv-title { font-weight: 700; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.spinner.tiny { width: 11px; height: 11px; border-width: 2px; }
.conv-item .run-actions { display: none; gap: 2px; }
.conv-item:hover .run-actions, .conv-item:focus-within .run-actions { display: flex; }
.conv-item.active .run-actions { display: flex; }
.chat-head > .row { flex: 1; min-width: 0; }
.chat-head > .actions { flex: none; flex-wrap: nowrap; }
@media (max-width: 600px) {
  .chat-head > .actions .btn { font-size: 0; gap: 0; padding: 7px 9px; }
  .chat-head > .actions .btn span { display: inline-flex; font-size: 14px; }
  .chat-head p { display: none; }
  .chat-head img { display: none; }
}

/* ---- Agent folders ------------------------------------------------------------ */
.folder { display: grid; gap: 8px; }
.folder-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.folder-path { font-weight: 600; overflow-wrap: anywhere; }
.folder-status { font-size: 13px; padding: 7px 10px; border-radius: 9px; }
.folder-status.ok { background: var(--ok-soft, var(--surface-2)); }
.folder-status.warn { background: var(--warn-soft); }
.folder-status.bad { background: var(--bad-soft, var(--warn-soft)); }
.root-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
.root-row .mono { overflow-wrap: anywhere; }
.restart-note { align-items: center; flex-wrap: wrap; gap: 10px; border-color: var(--warn); }

/* ---- Team ------------------------------------------------------------------- */
.team-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto auto auto; align-items: center; gap: 14px; }
.team-card.waiting { border-color: var(--warn); }
.team-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.team-set { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.team-set select.mini, .team-row select.mini, .kv-table select.mini { width: auto; max-width: 260px; padding: 6px 28px 6px 10px; font-size: 12.5px; border-radius: 9px; }
.team-set input.mini { width: 220px; padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.team-set.check { cursor: pointer; }
.team-name .btn { margin-left: 8px; }
.section-title { font-size: 15px; margin: 10px 0 0; }
.team-name { font-weight: 600; display: flex; align-items: center; }
.team-role { display: flex; align-items: center; gap: 8px; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th { text-align: left; padding: 6px 12px 6px 0; white-space: nowrap; vertical-align: top; }
.kv-table td { padding: 6px 0; color: var(--text-2); }
@media (max-width: 760px) { .team-row { grid-template-columns: 1fr; } }
.team-role select { min-width: 150px; }

/* ---- wrap long content in chats: no horizontal scrolling ---- */
.chat-scroll, .cc-scroll { overflow-x: hidden; }
.cc-col { grid-template-columns: minmax(0, 1fr); }
.cc-col > *, .chat-col > *, .msg .body, .bubble, .cc-text, .cc-prompt, .cc-prompt-wrap { min-width: 0; max-width: 100%; }
.bubble, .cc-text, .cc-prompt, .md, .md * { overflow-wrap: anywhere; word-break: break-word; }
.md pre, .md .code pre, .tool pre { white-space: pre-wrap; overflow-x: hidden; }
.md .md-table { overflow-x: visible; }
.md table { width: 100%; min-width: 0; table-layout: auto; }
.md img, .md video, .md iframe { max-width: 100%; height: auto; }

/* Chat file attachments */
.composer-files { width: min(780px, 100%); margin: 0 auto 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.composer-files[hidden] { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.85em; }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-btn { flex: none; align-self: flex-end; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-2, inherit); cursor: pointer; margin-left: -8px; }
.attach-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.attach-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer-wrap.dropping .composer { border-color: var(--accent); border-style: dashed; }
.composer.dropping { border-color: var(--accent); border-style: dashed; }
.cc-compose .composer-files { width: min(860px, 100%); }

/* ---- theme picker + theme flourishes -------------------------------------- */
.theme-pick { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 12.5px; color: var(--text-3); }
.theme-pick select { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; }
html[data-theme="cyber"] body {
  background-image: linear-gradient(rgba(0, 240, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px;
}
html[data-theme="cyber"] .btn.primary, html[data-theme="cyber"] .badge { box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent); }
html[data-theme="cyber"] .nav a.active { box-shadow: inset 2px 0 0 var(--accent), 0 0 14px rgba(0, 240, 255, .15); }
html[data-theme="cyber"] .brand-name, html[data-theme="cyber"] .page-head h1 { color: var(--accent); text-shadow: 0 0 10px rgba(0, 240, 255, .6), 2px 0 0 rgba(255, 43, 214, .5); letter-spacing: .02em; }
html[data-theme="hell"] body { background-image: radial-gradient(ellipse at 50% 120%, rgba(255, 60, 0, .22), transparent 60%); background-attachment: fixed; }
html[data-theme="hell"] .btn.primary { background: linear-gradient(180deg, #ff8a3d, #ff4d1a 55%, #c41a00); border-color: #c41a00; box-shadow: 0 0 14px rgba(255, 77, 26, .45); }
html[data-theme="hell"] .brand-name, html[data-theme="hell"] .page-head h1 { color: #ff6a2b; text-shadow: 0 0 12px rgba(255, 60, 0, .55); }
html[data-theme="hell"] .nav a.active { box-shadow: inset 2px 0 0 var(--accent); }

/* Claude Code: usage, context, slash commands, plugins */
.cc-tools { gap: 6px; flex-wrap: wrap; }
.usage-pill.warn { color: var(--warn); } .usage-pill.bad { color: var(--bad); }
.meter { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--border) 70%, transparent); overflow: hidden; min-width: 80px; flex: 1; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--ok); }
.meter.warn > span { background: var(--warn); } .meter.bad > span { background: var(--bad); }
.ctx-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; max-width: 560px; }
.ctx-line .meter { max-width: 160px; }
.usage-box { min-width: min(440px, 80vw); } .usage-row { display: grid; gap: 4px; }
.cmd-anchor { position: relative; width: min(780px, 100%); margin: 0 auto; }
.cmd-menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; max-height: 300px; overflow-y: auto; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.cmd-item .small { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item.active, .cmd-item:hover { background: var(--accent-soft); }
.cmd-help { display: grid; max-height: 60vh; overflow-y: auto; min-width: min(520px, 80vw); }
.cmd-help .list-item { text-align: left; background: none; border: 0; width: 100%; cursor: pointer; color: inherit; }
.plugin-box { min-width: min(620px, 85vw); max-height: 65vh; overflow-y: auto; }
.plugin-list { display: grid; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.plugin-list .list-item { justify-content: space-between; }
.plugin-box h4 { margin: 8px 0 0; }
.cc-compose .cmd-anchor { width: min(860px, 100%); }
.cmd-anchor .composer, .cc-compose .cmd-anchor .composer { width: 100%; }

/* Artifacts page */
.artifacts-filters { margin-bottom: 16px; }
.artifact-title { font-size: 15px; }
.artifact-purpose { margin: 6px 0 8px; color: var(--text-2); white-space: pre-wrap; }
