:root {
  --bg: #04070d;
  --bg-2: #08111d;
  --panel: rgba(13, 25, 42, 0.78);
  --panel-solid: #0c1726;
  --line: rgba(90, 200, 255, 0.16);
  --line-strong: rgba(90, 200, 255, 0.38);
  --accent: #46d3ff;
  --accent-2: #1f8fff;
  --glow: rgba(70, 211, 255, 0.45);
  --text: #e4f2ff;
  --muted: #86a1ba;
  --ok: #3ee6a0;
  --warn: #ffbd59;
  --danger: #ff5d6e;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(31, 143, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(70, 211, 255, 0.07), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before { /* faint HUD grid */
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(70, 211, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 211, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  pointer-events: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app {
  position: relative;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 920px; margin: 0 auto;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(4, 7, 13, 0.9), rgba(4, 7, 13, 0.6));
  backdrop-filter: blur(10px);
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { margin: 0; font-size: 17px; letter-spacing: 0.32em; font-weight: 600; }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px currentColor; flex: none; }
.status.ok .dot { background: var(--ok); }
.status.bad .dot { background: var(--danger); }
.actions { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted);
  transition: color .2s, background .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); background: rgba(70, 211, 255, 0.08); border-color: var(--line); }
.icon-btn.off { color: rgba(134, 161, 186, 0.5); }

/* mini reactor in the header mirrors Jarvis's state */
.mini-reactor {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); display: grid; place-items: center;
  box-shadow: 0 0 12px var(--glow), inset 0 0 8px var(--glow);
}
.mini-reactor span { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--accent) 60%); box-shadow: 0 0 10px var(--accent); animation: breathe 3.5s ease-in-out infinite; }
body[data-state="listening"] .mini-reactor span { animation: pulse .7s ease-in-out infinite; background: radial-gradient(circle, #fff, #ff8a7a 60%); box-shadow: 0 0 12px #ff6b6b; }
body[data-state="thinking"] .mini-reactor { border-style: dashed; animation: spin 1.4s linear infinite; }
body[data-state="speaking"] .mini-reactor span { animation: pulse .45s ease-in-out infinite; }

/* ---------- chat ---------- */
.chat {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.welcome { margin: auto; text-align: center; padding: 20px 8px 30px; max-width: 520px; }
.welcome h2 { font-weight: 500; font-size: 26px; margin: 26px 0 6px; letter-spacing: 0.02em; }
.welcome p { color: var(--muted); margin: 0 0 22px; }
.suggestions { display: flex; flex-direction: column; gap: 8px; }
.suggestions button {
  padding: 12px 14px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: border-color .2s, transform .1s;
}
.suggestions button:hover { border-color: var(--line-strong); }
.suggestions button:active { transform: scale(0.99); }

/* big arc reactor */
.reactor { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.reactor .ring { position: absolute; border-radius: 50%; inset: 0; }
.reactor .r1 { border: 2px solid var(--line-strong); box-shadow: 0 0 30px rgba(70, 211, 255, 0.25), inset 0 0 30px rgba(70, 211, 255, 0.15); }
.reactor .r2 { inset: 16px; border: 3px dashed rgba(70, 211, 255, 0.55); animation: spin 18s linear infinite; }
.reactor .r3 { inset: 34px; border: 2px solid rgba(70, 211, 255, 0.5); border-left-color: transparent; border-right-color: transparent; animation: spin 6s linear infinite reverse; }
.reactor .core {
  position: absolute; inset: 52px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #bff1ff 25%, var(--accent) 55%, rgba(31, 143, 255, 0.2) 75%, transparent 76%);
  box-shadow: 0 0 40px var(--accent), 0 0 80px rgba(70, 211, 255, 0.4);
  animation: breathe 3.5s ease-in-out infinite;
}
body[data-state="listening"] .reactor .core { animation: pulse .7s ease-in-out infinite; }
body[data-state="thinking"] .reactor .r2 { animation-duration: 2s; }
body[data-state="thinking"] .reactor .r3 { animation-duration: 1s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .85; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.08); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------- messages ---------- */
.msg { display: flex; flex-direction: column; max-width: 86%; animation: fadeUp .25s ease-out; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.jarvis { align-self: flex-start; }
.msg .who { font-size: 11px; letter-spacing: .22em; color: var(--accent); margin: 0 0 5px 2px; opacity: .85; }
.bubble {
  padding: 11px 15px; border-radius: var(--radius); line-height: 1.55; font-size: 15.5px;
  overflow-wrap: anywhere;
}
.msg.user .bubble {
  background: linear-gradient(135deg, rgba(31, 143, 255, 0.32), rgba(70, 211, 255, 0.18));
  border: 1px solid rgba(70, 211, 255, 0.3); border-bottom-right-radius: 5px; white-space: pre-wrap;
}
.user-controls { display: flex; justify-content: flex-end; margin-top: 4px; }
.edit-message-btn { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.edit-message-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.msg.jarvis .bubble {
  background: var(--panel); border: 1px solid var(--line); border-top-left-radius: 5px;
  box-shadow: inset 3px 0 0 rgba(70, 211, 255, 0.55);
  min-width: 64px;
}
.bubble > :first-child { margin-top: 0; }
.bubble > :last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 .65em; }
.bubble ul, .bubble ol { margin: .2em 0 .7em; padding-left: 1.3em; }
.bubble li { margin: .2em 0; }
.bubble h3, .bubble h4, .bubble h5, .bubble h6 { margin: .8em 0 .4em; font-size: 1em; color: var(--accent); }
.bubble a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(70, 211, 255, 0.35); }
.bubble a:hover { border-bottom-color: var(--accent); }
.bubble code { font-family: var(--mono); font-size: .88em; background: rgba(70, 211, 255, 0.1); padding: .1em .35em; border-radius: 5px; }
.bubble pre { position: relative; background: #02050a; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; margin: .5em 0 .8em; }
.bubble pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; white-space: pre; }
.reply-controls { display: flex; margin-top: 6px; }
.replay-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted);
}
.replay-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.replay-btn svg { width: 17px; height: 17px; }
.copy-btn { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted); }
.error-text { color: var(--danger); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.typing-label { color: var(--muted); font-size: 13px; margin-left: 8px; }

/* tool activity chips */
.chips { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 12.5px; color: var(--muted); padding: 5px 10px 5px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(4, 7, 13, 0.5);
}
.chip svg { width: 15px; height: 15px; }
.chip .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.chip.ok svg { color: var(--ok); }
.chip.fail { color: var(--danger); border-color: rgba(255, 93, 110, 0.3); }

/* approval card */
.confirm {
  margin-top: 10px; border: 1px solid rgba(255, 189, 89, 0.45); border-radius: 12px;
  background: rgba(255, 189, 89, 0.06); padding: 12px;
}
.confirm .title { display: flex; align-items: center; gap: 8px; color: var(--warn); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.confirm .title svg { width: 18px; height: 18px; }
.confirm .what { margin: 8px 0; }
.confirm details { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.confirm pre { white-space: pre-wrap; font-size: 12px; }
.confirm .buttons { display: flex; gap: 8px; }
.confirm .buttons button { flex: 1; padding: 10px; border-radius: 10px; font-weight: 600; border: 1px solid; }
.confirm .approve { background: rgba(62, 230, 160, 0.14); border-color: rgba(62, 230, 160, 0.5); color: var(--ok); }
.confirm .deny { background: rgba(255, 93, 110, 0.1); border-color: rgba(255, 93, 110, 0.45); color: var(--danger); }
.confirm.done .buttons { display: none; }
.confirm .outcome { font-size: 13px; color: var(--muted); }

/* ---------- composer ---------- */
.composer {
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(4, 7, 13, 0.95), rgba(4, 7, 13, 0.7));
  backdrop-filter: blur(10px);
}
.voice-hint { font-size: 13px; color: var(--muted); padding: 0 6px 8px; min-height: 1em; }
.voice-hint b { color: var(--text); font-weight: 500; }
#form { display: flex; align-items: flex-end; gap: 8px; }
#input {
  flex: 1; resize: none; max-height: 140px; min-height: 48px;
  padding: 12px 14px; border-radius: 14px; font-size: 16px; line-height: 1.4;
  background: var(--panel); border: 1px solid var(--line); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(70, 211, 255, 0.08); }
.mic, .send, .attach {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); transition: transform .1s, background .2s, box-shadow .2s;
}
.attach { width: 40px; height: 40px; color: var(--muted); background: var(--panel); align-self: center; }
.attach:hover { color: var(--accent); border-color: var(--accent); }
.attach svg { width: 19px; height: 19px; }
.attachment-preview { display: block; max-width: min(320px, 70vw); max-height: 260px; object-fit: contain; margin-top: 8px; border-radius: 8px; }
.mic { background: radial-gradient(circle at 50% 35%, rgba(70, 211, 255, 0.28), rgba(31, 143, 255, 0.12)); color: var(--accent); box-shadow: 0 0 18px rgba(70, 211, 255, 0.2); }
.mic:active, .send:active { transform: scale(0.94); }
.mic.listening { background: radial-gradient(circle, rgba(255, 93, 110, 0.45), rgba(255, 93, 110, 0.15)); color: #fff; border-color: rgba(255, 93, 110, 0.7); animation: micPulse 1.2s ease-out infinite; }
.mic.unsupported { opacity: .45; }
@keyframes micPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 93, 110, 0.5); } 100% { box-shadow: 0 0 0 16px rgba(255, 93, 110, 0); } }
.send { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #04121d; border: none; }
.send svg { stroke-width: 2.4; }
.send.stop { background: rgba(255, 93, 110, 0.18); color: var(--danger); border: 1px solid rgba(255, 93, 110, 0.5); }

/* ---------- dialogs ---------- */
.panel-dialog {
  width: min(440px, calc(100vw - 28px)); padding: 0; border-radius: 18px;
  border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(70, 211, 255, 0.1);
}
.panel-dialog::backdrop { background: rgba(2, 4, 8, 0.7); backdrop-filter: blur(3px); }
.panel-dialog form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel-dialog h3 { margin: 0; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; font-size: 15px; color: var(--accent); }
.row { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.row.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); }
.row.check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.row select, .row input[type="text"], #password {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); outline: none; font-size: 16px;
}
.row input[type="range"] { accent-color: var(--accent); }
.info { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; line-height: 1.6; }
.info b { color: var(--text); font-weight: 500; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
.error { color: var(--danger); margin: 0; font-size: 13px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.conversation-list { display: flex; flex-direction: column; gap: 8px; max-height: min(60vh, 480px); overflow-y: auto; }
.conversation-row { display: flex; gap: 8px; align-items: center; }
.conversation-open { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); color: var(--text); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-rename { flex: none; padding: 8px 10px; }
.conversation-rename-input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg-2); color: var(--text); }
.conversation-save, .conversation-cancel { flex: none; padding: 8px 10px; }
.primary, .ghost { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-strong); }
.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #04121d; border: none; font-weight: 600; }
.ghost { background: transparent; color: var(--text); }

@media (max-width: 560px) {
  .msg { max-width: 94%; }
  .brand h1 { font-size: 15px; letter-spacing: .26em; }
  .actions { flex: none; gap: 1px; }
  .actions .icon-btn { width: 34px; height: 36px; }
  .brand { gap: 7px; }
  .mini-reactor { width: 26px; height: 26px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .welcome h2 { font-size: 22px; }
  .reactor { width: 124px; height: 124px; }
  .reactor .core { inset: 42px; }
  .reactor .r2 { inset: 13px; }
  .reactor .r3 { inset: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- call mode ---------- */
.call-btn { color: var(--accent); }
.call-cta {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 auto 22px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(31, 143, 255, 0.35), rgba(70, 211, 255, 0.2));
  color: var(--text); font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 0 24px rgba(70, 211, 255, 0.25);
}
.call-cta svg { color: var(--accent); }
.call-cta:active { transform: scale(0.98); }

.call {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 600px at 50% 40%, rgba(31, 143, 255, 0.16), transparent 65%),
    var(--bg);
  animation: fadeUp .25s ease-out;
}
.call-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; letter-spacing: .25em; }
.call-timer { letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.orb { flex: 1; width: 100%; max-width: 560px; min-height: 220px; cursor: pointer; }
.call-status { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin: 4px 0 10px; min-height: 1.4em; }
.call[data-state="thinking"] .call-status { color: #ffc857; }
.call[data-state="muted"] .call-status { color: var(--muted); }
.captions { width: 100%; max-width: 620px; min-height: 78px; text-align: center; font-size: 15.5px; line-height: 1.45; }
.cap-you { color: var(--muted); margin-bottom: 6px; }
.cap-you:not(:empty)::before { content: "You: "; color: rgba(134, 161, 186, 0.7); }
.cap-jarvis { color: var(--text); }
.call-confirm { width: 100%; max-width: 460px; margin: 6px 0; border: 1px solid rgba(255, 189, 89, 0.45); border-radius: 12px; background: rgba(255, 189, 89, 0.06); padding: 12px; text-align: center; }
.call-confirm .buttons { display: flex; gap: 8px; margin-top: 10px; }
.call-confirm button { flex: 1; padding: 10px; border-radius: 10px; font-weight: 600; border: 1px solid; }
.call-confirm .approve { background: rgba(62, 230, 160, 0.14); border-color: rgba(62, 230, 160, 0.5); color: var(--ok); }
.call-confirm .deny { background: rgba(255, 93, 110, 0.1); border-color: rgba(255, 93, 110, 0.45); color: var(--danger); }
.call-actions { display: flex; gap: 28px; margin-top: 14px; }
.call.minimized {
  inset: auto 12px calc(84px + env(safe-area-inset-bottom)); z-index: 3;
  flex-direction: row; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--panel-solid); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); animation: none;
}
.call.minimized .orb, .call.minimized .captions, .call.minimized .call-confirm { display: none; }
.call.minimized .call-top { width: auto; flex: 1; font-size: 11px; }
.call.minimized .call-status { margin: 0; min-height: 0; font-size: 10px; letter-spacing: .08em; }
.call.minimized .call-actions { margin: 0; gap: 8px; }
.call.minimized .round { width: 42px; height: 42px; }
.call.minimized .round span { display: none; }
.round {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); position: relative;
}
.round svg { width: 24px; height: 24px; }
.round span { position: absolute; bottom: -22px; font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }
.round.end { background: #e5394d; border-color: #ff6b7b; color: #fff; }
.round.end svg { fill: currentColor; stroke: none; }
.round.on { background: rgba(255, 93, 110, 0.18); border-color: rgba(255, 93, 110, 0.6); color: var(--danger); }
.msg.user .bubble .via-voice { opacity: .6; margin-right: 6px; vertical-align: -3px; width: 15px; height: 15px; }

/* ---------- security & recognition ---------- */
.wide-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.wide-btn svg { width: 18px; height: 18px; color: var(--accent); }
#security { width: min(520px, calc(100vw - 20px)); max-height: calc(100dvh - 30px); }
.sec-block { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sec-block h4 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.sec-status { font-size: 13.5px; color: var(--muted); }
.sec-status.ok { color: var(--ok); }
.phrase { font-size: 15px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: rgba(70, 211, 255, 0.07); border-left: 3px solid var(--accent); }
.phrase:empty { display: none; }
.sec-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-buttons button { padding: 9px 14px; }
.sec-result { font-size: 13.5px; min-height: 1em; }
.sec-result.good { color: var(--ok); }
.sec-result.bad { color: var(--danger); }
.ghost.danger { color: var(--danger); border-color: rgba(255, 93, 110, 0.45); }
#faceVideo { width: 100%; max-height: 260px; border-radius: 12px; background: #000; transform: scaleX(-1); object-fit: cover; }
.panel-dialog button:disabled, .panel-dialog input:disabled { opacity: .45; cursor: not-allowed; }
.small { font-size: 12.5px; }
.status .seen { color: var(--ok); margin-left: 4px; }
.tool-image { display: block; margin: 4px 0 8px; }
.tool-image img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); }
.folder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.folder-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(70, 211, 255, 0.05); overflow-wrap: anywhere; }
.folder-list li .tag { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.folder-list li button { border: none; background: none; color: var(--danger); font-size: 16px; padding: 0 4px; }
.folder-add { display: flex; gap: 8px; }
.folder-add input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 15px; }
#permissions { width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 30px); }
.perm-list { display: flex; flex-direction: column; gap: 4px; }
.perm-list h4 { margin: 10px 0 2px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; }
.perm-row:nth-child(odd) { background: rgba(70, 211, 255, 0.04); }
.perm-row select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 13px; }
.perm-row select.allowed { color: var(--ok); } .perm-row select.ask_first { color: var(--warn); } .perm-row select.not_allowed { color: var(--danger); }
.perm-history { font-size: 12.5px; color: var(--muted); }
.perm-history ul { margin: 6px 0 0; padding-left: 18px; }
.chip.blocked { color: var(--danger); border-color: rgba(255, 93, 110, 0.4); }
.dash-links { font-size: 13.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.dash-links a { color: var(--accent); }
.notify-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.notify-row small { display: block; font-size: 12px; }

/* Brains dialog */
.brain-roles { display: flex; flex-direction: column; gap: 10px; }
.brain-row { padding: 8px 10px; border-radius: 10px; background: rgba(70, 211, 255, 0.04); display: flex; flex-direction: column; gap: 4px; }
.brain-input { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 13px; }
.brain-test { display: flex; align-items: center; gap: 8px; }
.small-btn { padding: 4px 10px; font-size: 12.5px; }
.brain-h { margin: 12px 0 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
