/* NUWA AGENT — application styles.
 * Two-color system: Deep Midnight Navy (dominant) + Electric Violet (accent).
 * The selected token network adds a secondary accent (--net) used only on token surfaces.
 */
:root {
  --bg: #0B0E1C;
  --bg-2: #0E1224;
  --surface: #101426;
  --surface-2: #151A31;
  --surface-3: #1B2140;
  --border: rgba(160, 170, 220, .09);
  --border-2: rgba(160, 170, 220, .16);
  --text: #ECEEFA;
  --text-2: #B9BDD6;
  --muted: #858BAA;
  --dim: #5A6183;
  --accent: #8B6CFF;
  --accent-2: #B6A2FF;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(139, 108, 255, .12);
  --accent-line: rgba(139, 108, 255, .35);
  --glow: 0 0 0 1px rgba(139, 108, 255, .28), 0 8px 32px -8px rgba(139, 108, 255, .45);
  --success: #3DD68C;
  --warn: #F5B94A;
  --danger: #FF6B7A;
  --info: #5EB3FF;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -16px rgba(0, 0, 0, .6);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  --header: 58px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --net: #3C7BFF;
  --net2: #3C7BFF;
  --net-ink: #fff;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F4F5FB;
  --bg-2: #EEF0F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FD;
  --surface-3: #EEF0F9;
  --border: rgba(16, 20, 38, .08);
  --border-2: rgba(16, 20, 38, .14);
  --text: #101426;
  --text-2: #2E3452;
  --muted: #646B8C;
  --dim: #9097B3;
  --accent: #6E4DF5;
  --accent-2: #6E4DF5;
  --accent-soft: rgba(110, 77, 245, .09);
  --accent-line: rgba(110, 77, 245, .3);
  --glow: 0 0 0 1px rgba(110, 77, 245, .25), 0 8px 24px -10px rgba(110, 77, 245, .35);
  --shadow: 0 1px 2px rgba(16, 20, 38, .04), 0 8px 24px -18px rgba(16, 20, 38, .25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 108, 255, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(139, 108, 255, .05), transparent 60%);
}
[data-theme="light"] body::before { opacity: .5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
svg { flex-shrink: 0; }
::selection { background: var(--accent); color: #fff; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
.app.collapsed { --sidebar: 68px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 30; overflow: hidden;
}
.sb-top { display: flex; align-items: center; gap: 8px; height: var(--header); padding: 0 14px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; }
.brand-word { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand-word b { font-weight: 800; letter-spacing: .14em; font-size: 14px; }
.brand-word span { font-weight: 500; letter-spacing: .24em; font-size: 10.5px; color: var(--accent-2); }
.sb-collapse { margin-left: auto; }
.sb-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sb-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 12px 10px 6px; white-space: nowrap; }
.nav-link {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--muted); font-weight: 500; white-space: nowrap; position: relative; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--text); }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-link.active svg { color: var(--accent-2); }
.nav-link .count { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.nav-link .live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(61, 214, 140, .18); animation: pulse 1.6s infinite; }
.sb-bottom { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.profile:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, #8B6CFF, #4C3BB8); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent-line); flex-shrink: 0; }
.profile-meta { min-width: 0; line-height: 1.25; }
.profile-meta b { display: block; font-size: 13px; white-space: nowrap; }
.profile-meta span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.app.collapsed .brand-word, .app.collapsed .sb-label, .app.collapsed .nav-link span, .app.collapsed .nav-link .count,
.app.collapsed .profile-meta, .app.collapsed .token-card { display: none; }
.app.collapsed .sb-top { padding: 0 10px; justify-content: center; flex-direction: column; height: auto; padding-block: 10px; gap: 6px; }
.app.collapsed .sb-collapse { margin: 0; transform: rotate(180deg); }
.app.collapsed .nav-link { justify-content: center; padding: 0; }
.app.collapsed .nav-link .live { position: absolute; top: 6px; right: 10px; }

/* Token card (network themed) */
.token-card {
  border: 1px solid color-mix(in srgb, var(--net) 30%, var(--border)); border-radius: 10px; padding: 10px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--net) 10%, transparent), transparent 70%);
}
.tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tc-head img { width: 18px; height: 18px; }
.tc-head b { font-size: 12.5px; }
.tc-head .sym { color: var(--net); font-weight: 700; font-size: 12px; }
[data-theme="light"] .tc-head .sym { color: color-mix(in srgb, var(--net) 70%, #000); }
.tc-head .tc-net { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.ca-full {
  display: flex; align-items: flex-start; gap: 6px; font-family: var(--mono); font-size: 10.5px; line-height: 1.45; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border); padding: 6px 7px; border-radius: 7px; word-break: break-all; text-align: left; width: 100%;
}
.ca-full .ca-txt { flex: 1; }
.ca-full svg { color: var(--muted); margin-top: 1px; }
.ca-full:hover svg { color: var(--net); }
.ca-full.ca-none { color: var(--muted); font-family: var(--font); font-size: 11.5px; cursor: default; }
.tc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tc-links:empty { display: none; }
.tc-links a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); flex: 1 1 auto; }
.tc-links a:hover { border-color: var(--net); color: var(--text); }
body[data-network="solana"] .token-card { border-image: linear-gradient(135deg, var(--net2), var(--net)) 1; border-radius: 0; }
body[data-network="bsc"] .token-card { background: linear-gradient(160deg, rgba(240, 185, 11, .12), transparent 70%); }
body[data-network="robinhood"] .tc-head .sym { text-shadow: 0 0 12px rgba(204, 255, 0, .5); }
body[data-network="base"] .token-card { border-radius: 6px; }
body[data-network="ethereum"] .token-card { background: linear-gradient(160deg, rgba(142, 162, 255, .12), rgba(98, 104, 143, .04) 70%); }
body[data-network="arbitrum"] .token-card { border-left: 3px solid var(--net); }

.main { min-width: 0; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 20; height: var(--header); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { color: var(--dim); }
.hd-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
.search-box { display: flex; align-items: center; gap: 8px; width: 280px; height: 34px; padding: 0 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { flex: 1; border: 0; background: none; outline: 0; min-width: 0; color: var(--text); }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-2); color: var(--muted); }
.net-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 7px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--net) 40%, var(--border)); background: color-mix(in srgb, var(--net) 8%, transparent); font-size: 12px; font-weight: 500; white-space: nowrap; }
.net-chip img { width: 16px; height: 16px; }
.sim-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--warn); background: rgba(245, 185, 74, .1); border: 1px solid rgba(245, 185, 74, .25); white-space: nowrap; }
.icon-btn { position: relative; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.content { padding: 28px 28px 64px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-in { animation: fadeUp .25s ease both; }

/* Dropdown */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .55); padding: 6px; z-index: 60; animation: pop .14s ease both; }
.dropdown.left { left: 0; right: auto; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none; text-align: left; color: var(--text-2); font-size: 13px; }
.dd-item:hover, .dd-item.hl { background: var(--surface-2); color: var(--text); }
.dd-item.danger { color: var(--danger); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dd-head { padding: 8px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); display: flex; justify-content: space-between; align-items: center; }
.dd-head button { border: 0; background: none; color: var(--accent-2); font-size: 11px; text-transform: none; letter-spacing: 0; }
.dd-empty { padding: 16px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 8px; }
.notif:hover { background: var(--surface-2); }
.notif .ni { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex-shrink: 0; }
.notif b { font-size: 13px; font-weight: 500; display: block; }
.notif span { font-size: 12px; color: var(--muted); }
.notif.unread b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.search-results { width: 380px; max-height: 420px; overflow: auto; }
.sr-type { font-size: 10.5px; color: var(--dim); margin-left: auto; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.ph-l { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-2); margin-bottom: 8px; }
.ph h1 { font-size: 26px; line-height: 1.2; }
.ph .sub { color: var(--muted); margin-top: 6px; max-width: 720px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-with-art { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 22px 24px; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 55%); position: relative; overflow: hidden; }
.ph-with-art .ph { margin: 0; }
.ph-with-art .art { width: 220px; height: 120px; opacity: .95; }
.ph-with-art .art svg { width: 100%; height: 100%; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 20px -6px rgba(139, 108, 255, .6); }
.btn.primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 26px -6px rgba(139, 108, 255, .8); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 122, .3); background: rgba(255, 107, 122, .06); }
.btn.danger:hover { background: rgba(255, 107, 122, .12); }
.btn.success { color: var(--success); border-color: rgba(61, 214, 140, .3); background: rgba(61, 214, 140, .07); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-group { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.btn-group button { border: 0; background: none; height: 32px; padding: 0 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.btn-group button.on { background: var(--surface-3); color: var(--text); }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card.pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-h h3 svg { color: var(--accent-2); }
.card-h .meta { color: var(--muted); font-size: 12px; }
.card-h .r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-b { padding: 18px; }
.card-b.tight { padding: 8px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.split.r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.accent { color: var(--accent-2); }
.ok { color: var(--success); }
.warn-c { color: var(--warn); }
.bad { color: var(--danger); }

/* Stats */
.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.stat .lbl svg { color: var(--accent-2); }
.stat .val { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .val small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.stat .delta { font-size: 12px; margin-top: 2px; color: var(--muted); }
.stat .delta b { color: var(--success); font-weight: 600; }
.stat .spark { position: absolute; right: 12px; bottom: 12px; width: 84px; height: 30px; opacity: .9; }

/* Badges & pills */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.badge.violet { color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.green { color: var(--success); border-color: rgba(61, 214, 140, .3); background: rgba(61, 214, 140, .08); }
.badge.amber { color: var(--warn); border-color: rgba(245, 185, 74, .3); background: rgba(245, 185, 74, .08); }
.badge.red { color: var(--danger); border-color: rgba(255, 107, 122, .3); background: rgba(255, 107, 122, .08); }
.badge.blue { color: var(--info); border-color: rgba(94, 179, 255, .3); background: rgba(94, 179, 255, .08); }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live .d { animation: pulse 1.4s infinite; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); }

/* Progress */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s ease; position: relative; }
.progress.live > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 1.4s infinite; }
.progress.green > i { background: var(--success); }
.progress.amber > i { background: var(--warn); }
.progress.lg { height: 10px; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.t .lnk { font-weight: 500; }
table.t .lnk:hover { color: var(--accent-2); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .flabel { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); display: none; }
.field.invalid .err { display: block; }
.field.invalid .input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 122, .12); }
.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); outline: 0; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23858BAA' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent-line); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.choice b { display: block; font-size: 13px; font-weight: 600; }
.choice span { font-size: 12px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.choice:has(input:checked) .ci { background: var(--accent); color: #fff; }
.switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { left: 18px; background: #fff; }
.src-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.src-row:last-child { border-bottom: 0; }
.src-row .si { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex-shrink: 0; }
.src-row b { font-size: 13.5px; font-weight: 600; }
.src-row p { font-size: 12.5px; color: var(--muted); }
.range { -webkit-appearance: none; appearance: none; width: 120px; height: 4px; border-radius: 99px; background: var(--surface-3); outline: 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: pointer; }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: pointer; }

/* Stepper */
.stepper { display: flex; gap: 0; margin-bottom: 20px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); position: relative; }
.step:first-child { border-radius: 10px 0 0 10px; }
.step:last-child { border-radius: 0 10px 10px 0; }
.step + .step { border-left: 0; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--border-2); flex-shrink: 0; }
.step b { display: block; font-size: 13px; color: var(--text-2); }
.step span { font-size: 11.5px; }
.step.on { background: var(--accent-soft); color: var(--text); }
.step.on .n { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 16px var(--accent); }
.step.done .n { background: rgba(61, 214, 140, .15); border-color: rgba(61, 214, 140, .4); color: var(--success); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: none; height: 40px; padding: 0 14px; color: var(--muted); font-weight: 500; position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tab .tag { height: 18px; font-size: 10.5px; }

/* Expandable */
.exp { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.exp + .exp { margin-top: 10px; }
.exp-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; color: var(--text); }
.exp-h:hover { background: var(--surface-2); }
.exp-h .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.exp.open > .exp-h .chev { transform: rotate(180deg); }
.exp-b { display: none; padding: 0 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.exp.open > .exp-b { display: block; animation: fadeUp .2s ease; }
.exp-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12px; flex-shrink: 0; }

/* Lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.li:last-child { border-bottom: 0; }
a.li:hover { background: var(--surface-2); }
.li .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-2); flex-shrink: 0; font-weight: 700; font-size: 12px; }
.li b { font-weight: 550; font-size: 13.5px; display: block; }
.li .s { font-size: 12px; color: var(--muted); }
.bul { margin: 0; padding-left: 18px; color: var(--text-2); }
.bul li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); min-width: 0; }

/* Agents */
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agent { display: flex; flex-direction: column; }
.agent-h { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 12px; }
.agent-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--accent-line); flex-shrink: 0; position: relative; }
.agent.running .agent-ic::after { content: ""; position: absolute; inset: -4px; border-radius: 13px; border: 1px solid var(--accent); opacity: .6; animation: ping 1.6s infinite; }
.agent-h b { font-size: 14px; display: block; }
.agent-h .s { font-size: 12px; color: var(--muted); }
.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.agent-stats div { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.agent-stats span { display: block; font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.agent-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.agent-find { padding: 0 16px 12px; font-size: 12.5px; color: var(--text-2); flex: 1; }
.agent-find li { margin: 3px 0; }
.agent-f { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; }
.file-st { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.log { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; max-height: 360px; overflow: auto; padding: 12px 14px; }
.log div { display: flex; gap: 10px; }
.log time { color: var(--dim); flex-shrink: 0; }
.log .who { color: var(--accent-2); flex-shrink: 0; }
.log .ok { color: var(--success); }
.log .wr { color: var(--warn); }

/* Banner */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(245, 185, 74, .28); background: rgba(245, 185, 74, .07); color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.banner svg { color: var(--warn); margin-top: 1px; }
.banner.info { border-color: var(--accent-line); background: var(--accent-soft); }
.banner.info svg { color: var(--accent-2); }
.banner.ok { border-color: rgba(61, 214, 140, .3); background: rgba(61, 214, 140, .07); }
.banner.ok svg { color: var(--success); }
.banner.bad { border-color: rgba(255, 107, 122, .3); background: rgba(255, 107, 122, .07); }
.banner.bad svg { color: var(--danger); }
.banner b { color: var(--text); }

/* Framework cards */
.fw-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); position: relative; }
.fw-card:hover { border-color: var(--border-2); }
.fw-card h4 { font-size: 14.5px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.fw-card p { color: var(--text-2); font-size: 13px; }
.fw-sec { margin-top: 12px; }
.fw-sec .flabel { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 6px; }
.ev { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.ev .src { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.editable { outline: 0; border-radius: 6px; transition: background .15s, box-shadow .15s; }
.editable[contenteditable="true"] { background: var(--bg-2); box-shadow: 0 0 0 1px var(--accent-line); padding: 2px 6px; margin: -2px -6px; }
.heur { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: start; }
.heur .if { font-family: var(--mono); font-size: 11px; color: var(--accent-2); padding: 3px 7px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft); }
.dna-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.meter .progress { flex: 1; }
.values-rank { counter-reset: v; }
.values-rank li { list-style: none; display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.values-rank li::before { counter-increment: v; content: counter(v); width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.tension { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px; border: 1px dashed var(--border-2); border-radius: 10px; margin-top: 8px; font-size: 13px; }
.tension .vs { font-size: 10.5px; font-weight: 700; color: var(--warn); letter-spacing: .1em; }
.diagram { width: 100%; max-width: 760px; height: auto; display: block; margin: 0 auto; }
.diagram text { font-family: var(--font); }

/* Editor */
.editor { display: grid; grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); min-height: 640px; }
.editor > div { min-width: 0; }
.ed-side { border-right: 1px solid var(--border); background: var(--bg-2); overflow: auto; max-height: 760px; }
.ed-pane { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.ed-pane:last-child { border-right: 0; }
.ed-bar { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.ed-bar b { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.ed-text { flex: 1; width: 100%; min-height: 600px; max-height: 760px; border: 0; outline: 0; resize: none; background: transparent; padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text); tab-size: 2; }
.ed-prev { flex: 1; overflow: auto; max-height: 760px; padding: 18px 22px; }
.tree { font-family: var(--mono); font-size: 12px; padding: 8px; }
.tree-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; color: var(--text-2); cursor: pointer; white-space: nowrap; border: 0; background: none; width: 100%; text-align: left; }
.tree-item:hover { background: var(--surface-2); }
.tree-item.on { background: var(--accent-soft); color: var(--text); }
.tree-item svg { color: var(--muted); }
.tree-item.dir svg { color: var(--accent-2); }
.tree-item .st { margin-left: auto; font-size: 10px; color: var(--dim); }
.ed-sec { padding: 10px 12px; border-top: 1px solid var(--border); }
.ed-sec .flabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 6px; }
.ed-sec a, .ed-sec button.lk { display: block; padding: 4px 6px; font-size: 12px; color: var(--text-2); border-radius: 5px; border: 0; background: none; text-align: left; width: 100%; }
.ed-sec a:hover, .ed-sec button.lk:hover { background: var(--surface-2); color: var(--text); }
.tree-pre { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text-2); margin: 0; white-space: pre; overflow-x: auto; }
.tree-pre .d { color: var(--accent-2); }

/* Markdown */
.md { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.md h1 { font-size: 22px; color: var(--text); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 17px; color: var(--text); margin: 24px 0 10px; }
.md h3 { font-size: 14.5px; color: var(--text); margin: 18px 0 8px; }
.md h4 { font-size: 13.5px; color: var(--text); margin: 14px 0 6px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 20px; margin: 8px 0; }
.md li { margin: 3px 0; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--accent-2); }
.md pre { white-space: pre-wrap; word-break: break-word; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: var(--text-2); }
.md blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; color: var(--text); }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--border-2); padding: 6px 10px; text-align: left; }
.md th { background: var(--surface-2); color: var(--text); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md strong { color: var(--text); }
.md a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }

/* Skill library */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-box { width: 320px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.skill-card { display: flex; flex-direction: column; padding: 0; transition: border-color .15s, transform .15s, box-shadow .15s; }
.skill-card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--glow); }
.sc-top { display: flex; gap: 12px; padding: 16px 16px 10px; align-items: flex-start; }
.monogram { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--m1, #8B6CFF), var(--m2, #3E2E9C)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.sc-top h3 { font-size: 14.5px; }
.sc-top .s { font-size: 12px; color: var(--muted); }
.sc-desc { padding: 0 16px; color: var(--text-2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.sc-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; }
.sc-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); margin-top: auto; font-size: 12px; color: var(--muted); }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.score i { width: 8px; height: 8px; border-radius: 50%; }

/* Validation */
.vt { display: flex; flex-direction: column; }
.qa { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--bg-2); }
.qa + .qa { margin-top: 10px; }
.qa .q { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; display: flex; gap: 10px; }
.qa .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa .col { padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.qa .col .flabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 4px; }
.crit { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.crit:last-child { border-bottom: 0; }
.crit .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.crit .ck.pass { background: rgba(61, 214, 140, .15); color: var(--success); }
.crit .ck.fail { background: rgba(245, 185, 74, .15); color: var(--warn); }
.crit .v { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.verdict { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 12px; border: 1px solid rgba(61, 214, 140, .3); background: linear-gradient(120deg, rgba(61, 214, 140, .1), transparent 60%); }
.verdict.needs { border-color: rgba(245, 185, 74, .3); background: linear-gradient(120deg, rgba(245, 185, 74, .1), transparent 60%); }
.verdict h2 { font-size: 20px; }
.hl-text mark { background: rgba(255, 107, 122, .18); color: var(--text); border-radius: 3px; padding: 0 2px; }
.hl-text mark.good { background: rgba(61, 214, 140, .16); }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 16, .62); backdrop-filter: blur(6px); animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 15.5px; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6); font-size: 13px; animation: slideIn .2s ease; min-width: 240px; }
.toast svg { color: var(--success); }
.toast.warn svg { color: var(--warn); }
.toast.err svg { color: var(--danger); }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; }
.empty svg.ill { width: 180px; height: 120px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); max-width: 380px; }

/* Charts */
.chart { width: 100%; height: 220px; display: block; }
.chart text { font-family: var(--font); font-size: 10.5px; fill: var(--dim); }
.chart .grid-l { stroke: var(--border); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; pointer-events: none; z-index: 300; padding: 8px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border-2); font-size: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pipe { padding: 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); position: relative; }
.pipe b { font-size: 22px; font-variant-numeric: tabular-nums; display: block; }
.pipe span { font-size: 11.5px; color: var(--muted); }
.pipe .bar { height: 3px; border-radius: 3px; background: var(--accent); margin-top: 10px; opacity: .8; }
.pipe:not(:last-child)::after { content: ""; position: absolute; right: -8px; top: 50%; width: 8px; height: 1px; background: var(--accent-line); }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa-btn { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); text-align: left; transition: border-color .15s, background .15s; }
.qa-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.qa-btn .qi { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; flex-shrink: 0; box-shadow: 0 6px 16px -6px var(--accent); }
.qa-btn b { font-size: 13px; display: block; }
.qa-btn span { font-size: 11.5px; color: var(--muted); }

/* Settings */
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow b { font-size: 13.5px; font-weight: 550; display: block; }
.set-row .grow span { font-size: 12px; color: var(--muted); }
.net-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.net-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.net-opt img { width: 22px; height: 22px; }
.net-opt.on { border-color: var(--net); box-shadow: 0 0 0 1px var(--net); background: color-mix(in srgb, var(--net) 8%, var(--bg-2)); }
.net-opt b { font-size: 13px; }
.net-opt span { font-size: 11px; color: var(--muted); display: block; }

/* Animations */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes dash { to { stroke-dashoffset: -24; } }
.flow { stroke-dasharray: 4 4; animation: dash 1.2s linear infinite; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor { grid-template-columns: 220px minmax(0, 1fr); }
  .editor .ed-prev-pane { grid-column: 1 / -1; border-top: 1px solid var(--border); }
}
@media (max-width: 1080px) {
  .split, .split.r { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { width: 200px; }
  .ph-with-art .art { width: 160px; height: 90px; }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; --sidebar: 268px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 268px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 24px 0 48px -12px rgba(0, 0, 0, .6); background: var(--surface); }
  .app.mobile-open .sidebar { transform: none; }
  .app.collapsed .brand-word, .app.collapsed .sb-label, .app.collapsed .nav-link span, .app.collapsed .profile-meta, .app.collapsed .token-card { display: revert; }
  .sb-collapse { display: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(5, 7, 16, .5); }
  .menu-btn { display: inline-grid; }
  .header { padding: 0 14px; }
  .content { padding: 20px 14px 56px; }
  .search { display: none; }
  .search.mobile-on { display: block; position: absolute; left: 10px; right: 10px; top: 10px; }
  .search.mobile-on .search-box { width: 100%; }
  .search.mobile-on .search-results { width: 100%; }
  .hide-m { display: none !important; }
  .agents, .g2, .g3 { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipe::after { display: none; }
  .qa-grid { grid-template-columns: 1fr; }
  .stepper { flex-direction: column; }
  .step:first-child { border-radius: 10px 10px 0 0; }
  .step:last-child { border-radius: 0 0 10px 10px; }
  .step + .step { border-left: 1px solid var(--border); border-top: 0; }
  .editor { grid-template-columns: 1fr; }
  .ed-side { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .ed-pane { border-right: 0; }
  .ed-text { min-height: 380px; }
  .ph-with-art { grid-template-columns: 1fr; }
  .ph-with-art .art { display: none; }
  .ph h1 { font-size: 22px; }
  .qa .cols { grid-template-columns: 1fr; }
  .net-grid { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 110px 1fr; }
  .toolbar .search-box { width: 100%; }
}
@media (min-width: 861px) { .mobile-only { display: none !important; } }
@media (max-width: 520px) {
  .g4, .g5 { grid-template-columns: 1fr 1fr; }
  .stat .val { font-size: 22px; }
  .stat .spark { display: none; }
  .net-chip span { display: none; }
  .sim-badge span { display: none; }
}

/* SVG illustration system: shared stroke width, rounded joins, brand colors */
.ill { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ill .a { stroke: var(--accent); }
.ill .a2 { stroke: var(--accent-2); }
.ill .l { stroke: var(--border-2); }
.ill .t { stroke: var(--muted); }
.ill .fa { fill: var(--accent); stroke: none; }
.ill .fa2 { fill: var(--accent-2); stroke: none; }
.ill .fs { fill: var(--surface-2); }
.ill .fb { fill: var(--bg-2); }
.ill .fw { fill: var(--text); stroke: none; }
.ill .fsoft { fill: var(--accent-soft); }
.ill .ok { stroke: var(--success); }
.ill .fok { fill: var(--success); stroke: none; }
.ill .glow { filter: drop-shadow(0 0 6px rgba(139, 108, 255, .7)); }
