:root {
  --bg: #f4f5fa; --panel: #ffffff; --panel2: #f8f9fc; --line: #e2e5ee; --text: #121528; --muted: #636a87;
  --a1: #6d4bff; --a2: #0e8fb0; --ok: #0f9f68; --warn: #b45f00; --bad: #e11d48; --chip: #eef0f7;
  --shadow: 0 10px 40px -12px rgba(20, 24, 60, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #06070c; --panel: #0e111b; --panel2: #121626; --line: #1d2232; --text: #e8ebf7; --muted: #8890b0; --a1: #8b72ff; --a2: #22d3ee; --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --chip: #161a28; --shadow: 0 10px 50px -10px rgba(0, 0, 0, .7); }
}
:root[data-theme="dark"] { --bg: #06070c; --panel: #0e111b; --panel2: #121626; --line: #1d2232; --text: #e8ebf7; --muted: #8890b0; --a1: #8b72ff; --a2: #22d3ee; --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --chip: #161a28; --shadow: 0 10px 50px -10px rgba(0, 0, 0, .7); }
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; color: var(--text); font: 14px/1.5 Inter, system-ui, sans-serif;
  background: radial-gradient(60% 40% at 15% -5%, color-mix(in srgb, var(--a1) 14%, transparent), transparent 70%),
    radial-gradient(50% 35% at 95% 0%, color-mix(in srgb, var(--a2) 10%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed; }
code, kbd, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; }
kbd { border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 4px; padding: 0 4px; font-size: 11px; opacity: .85; }
a { color: var(--a2); }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h3.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: inherit; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tabs a i { font-style: normal; opacity: .7; }
.tabs a:hover { color: var(--text); background: var(--chip); }
.tabs a.on { color: var(--text); background: var(--chip); box-shadow: inset 0 -2px 0 var(--a1); }
.count { font-size: 11px; font-weight: 600; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; color: var(--muted); }
.count:empty { display: none; }
.bar-r { display: flex; gap: 8px; align-items: center; }
.pill { padding: 3px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); font-size: 12px; white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.bad { color: var(--bad); }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 14px; flex: none; }
.icon-btn:hover { border-color: var(--a2); }
.kill { border: 1px solid var(--bad); color: var(--bad); background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.kill:hover { background: var(--bad); color: #fff; }
.banner { padding: 10px 16px; font-weight: 500; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; }
.banner.bad { background: var(--bad); color: #fff; }
.banner.warn { background: color-mix(in srgb, var(--warn) 18%, var(--panel)); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.banner button { background: #fff; color: var(--bad); border: 0; border-radius: 8px; padding: 5px 12px; font-weight: 700; cursor: pointer; }
@media (max-width: 1100px) { .tabs a { padding: 7px 9px; } .tabs a i { display: none; } }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 8px; } .tabs { order: 3; flex-basis: 100%; } .brand { flex: 1; }
  .kill { padding: 6px 9px; }
}

/* ---------------------------------------------------------------- layout */
main { max-width: 1440px; margin: 0 auto; padding: 16px; }
.view { display: grid; gap: 16px; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.view-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-h p { margin: 0; max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card h2 { font-size: 15px; margin: 0; }
.link { font-size: 12.5px; text-decoration: none; }
.stack { display: grid; gap: 14px; }

/* ---------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; position: relative; overflow: hidden; }
.tile b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile b small { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile span { color: var(--muted); font-size: 12px; }
.tile .d { position: absolute; top: 10px; right: 12px; font-size: 11.5px; font-weight: 600; }
.tile.ok b { color: var(--ok); } .tile.bad b { color: var(--bad); } .tile.warn b { color: var(--warn); } .tile.acc b { color: var(--a1); }
.up { color: var(--ok); } .down { color: var(--bad); } .flat { color: var(--muted); }

/* ---------------------------------------------------------------- chart */
.chart svg { width: 100%; height: 180px; display: block; }
.chart .ax { fill: var(--muted); font: 10.5px Inter, sans-serif; }
.chart .grid { stroke: var(--line); }
.chart rect.b-ok { fill: var(--ok); } .chart rect.b-err { fill: var(--bad); } .chart rect.b-den { fill: var(--warn); }
.chart rect.hit { fill: transparent; } .chart g.col:hover rect.hit { fill: color-mix(in srgb, var(--a2) 10%, transparent); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.k-ok { background: var(--ok); } .k-err { background: var(--bad); } .k-den { background: var(--warn); }

/* ---------------------------------------------------------------- health */
.hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hbar { display: flex; gap: 1px; height: 18px; align-items: stretch; grid-column: 1 / 4; }
.hbar i { flex: 1; border-radius: 1px; background: var(--ok); opacity: .8; min-width: 1px; }
.hbar i.x { background: var(--bad); opacity: 1; } .hbar i.n { background: var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .dot.off { background: var(--bad); } .dot.pause { background: var(--warn); }
.inflight .it { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--a2); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 3D stage */
.stage { padding: 14px; }
.flow-wrap { position: relative; height: 400px; border-radius: 14px; overflow: hidden; background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--a1) 10%, transparent), transparent 70%); }
#flow3d { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#flow3d:active { cursor: grabbing; }
.flow-hud { position: absolute; left: 12px; top: 10px; font: 12px "JetBrains Mono", monospace; color: var(--muted); pointer-events: none; }
.flow-legend { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); pointer-events: none; }
.flow-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; box-shadow: 0 0 8px currentColor; }
.stage.no-webgl .flow-wrap::after { content: "WebGL yo'q"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.stage.collapsed .flow-wrap { display: none; }
.stage.collapsed .card-h { margin-bottom: 0; }
@media (max-width: 640px) { .flow-wrap { height: 300px; } }

/* ---------------------------------------------------------------- feed */
.feed { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.feed li:hover { background: var(--chip); }
.feed li.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--a2) 22%, transparent); } }
.feed .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .args { grid-column: 2 / 4; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.feed .empty { cursor: default; display: block; color: var(--muted); }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--chip); white-space: nowrap; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.chip.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.chip.acc { color: var(--a1); background: color-mix(in srgb, var(--a1) 13%, transparent); }
.chip.adm { color: var(--a2); background: color-mix(in srgb, var(--a2) 13%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--chip); }
.tbl tr.sel td { background: color-mix(in srgb, var(--a1) 10%, transparent); }
.tbl tr.new td { animation: flash 1.2s ease-out; }
.tbl .ell { max-width: 0; width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.audit td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.audit thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.bar-mini { display: inline-block; height: 6px; border-radius: 3px; background: var(--a2); vertical-align: middle; margin-right: 6px; opacity: .7; }
.more { text-align: center; padding-top: 10px; }
.summary { font-size: 12.5px; color: var(--muted); margin: 10px 2px 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.summary b { color: var(--text); }

/* ---------------------------------------------------------------- filters / forms */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 6px; flex: 1 1 260px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.search span { color: var(--muted); }
.search input { border: 0; background: transparent; padding: 8px 0; flex: 1; min-width: 0; color: var(--text); font: inherit; outline: none; }
.search:focus-within { border-color: var(--a2); }
select, input, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; min-width: 0; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--a2); }
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: "JetBrains Mono", monospace; font-size: 13px; min-height: 140px; line-height: 1.5; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--muted); user-select: none; }
.switch input { display: none; }
.switch i { width: 30px; height: 17px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(13px); }
button.s { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; white-space: nowrap; font-family: inherit; }
button.s:hover { border-color: var(--a2); }
button.s.danger:hover { border-color: var(--bad); color: var(--bad); }
button.s:disabled { opacity: .5; cursor: default; }
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; color: #fff; background: linear-gradient(90deg, var(--a1), var(--a2)); cursor: pointer; font-family: inherit; font-size: 14px; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.fld { display: grid; gap: 4px; margin-bottom: 12px; }
.fld > span { font-size: 12.5px; font-weight: 600; }
.fld > small { color: var(--muted); font-size: 12px; }
.fld input, .fld select { width: 100%; }
input[type="checkbox"] { width: auto !important; padding: 0; margin: 0; accent-color: var(--a1); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- agents / connectors */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.ag-h { display: flex; align-items: center; gap: 10px; }
.ag-h h3 { margin: 0; font-size: 16px; }
.ag-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.ag-stats div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.ag-stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.ag-stats span { font-size: 11.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .4s; }
.meter i.w { background: var(--warn); } .meter i.x { background: var(--bad); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tool-list { display: grid; gap: 6px; margin-top: 10px; }
.tool-list details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel2); }
.tool-list summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; }
.tool-list summary::-webkit-details-marker { display: none; }
.tool-list summary b { font-family: "JetBrains Mono", monospace; font-size: 13px; }
.tool-list p { margin: 8px 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.params { font-size: 12.5px; display: grid; gap: 2px; }
.params code { color: var(--a1); }
.err-box { margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); overflow-wrap: anywhere; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }

/* ---------------------------------------------------------------- mask */
.mask { display: grid; gap: 2px; }
.mask label { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mask small { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }

/* ---------------------------------------------------------------- playground */
.pg { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pg { grid-template-columns: 1fr; } }
.pg-actions { display: flex; justify-content: flex-end; }
.meta-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }

/* ---------------------------------------------------------------- result renderer */
.result { min-width: 0; }
.result h4 { margin: 14px 0 6px; font-size: 14px; } .result h4:first-child { margin-top: 0; }
.result pre { margin: 0 0 10px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 60vh; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.55 "JetBrains Mono", monospace; }
.result .rtbl { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.result table { border-collapse: collapse; font: 12.5px "JetBrains Mono", monospace; width: max-content; min-width: 100%; }
.result th { position: sticky; top: 0; background: var(--panel2); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.result td { padding: 5px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.result tr:hover td { background: var(--chip); }
.result td.null { color: var(--muted); font-style: italic; } .result td.n { text-align: right; }
.result table.vert td { white-space: pre-wrap; overflow-wrap: anywhere; max-width: none; }
.result table.vert td:first-child { color: var(--muted); width: 1%; white-space: nowrap; }
.result table.vert tr.hit td { background: color-mix(in srgb, var(--a1) 8%, transparent); }
.result .foot { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.result .tb { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: 12px; color: var(--muted); }
mark.m { background: color-mix(in srgb, var(--a1) 20%, transparent); color: var(--a1); border-radius: 3px; padding: 0 2px; }
.dl-add { color: var(--ok); } .dl-del { color: var(--bad); } .dl-hdr { color: var(--a2); font-weight: 600; }
.sql .k { color: var(--a1); font-weight: 600; } .sql .s { color: var(--ok); } .sql .n { color: var(--warn); } .sql .c { color: var(--muted); font-style: italic; }
.json .k { color: var(--a2); } .json .s { color: var(--ok); } .json .n { color: var(--warn); } .json .b { color: var(--a1); }

/* ---------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 15, .45); z-index: 40; animation: fade .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; gap: 8px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.d-title { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px; }
.d-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.d-meta div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.d-meta span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.d-meta b { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.d-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; align-items: flex-end; }
.d-tabs button[data-dtab] { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.d-tabs button[data-dtab].on { color: var(--text); border-bottom-color: var(--a1); }
.d-tabs .grow { flex: 1; }
.d-tabs .tools { display: flex; gap: 6px; padding-bottom: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .d-tabs .tools { flex-basis: 100%; order: 3; padding-top: 6px; } .drawer-b { padding: 12px; } }
.alert { padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.alert.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.alert.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }

/* ---------------------------------------------------------------- modal / toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 6, 15, .5); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal .lead { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.checks { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.checks label { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; cursor: pointer; }
.checks label.grp { font-weight: 600; margin-top: 4px; }
.checks label.sub { padding-left: 22px; }
.secret { display: flex; gap: 6px; align-items: stretch; margin-bottom: 10px; }
.secret code { flex: 1; display: block; background: var(--bg); border: 1px dashed var(--a2); padding: 8px 10px; border-radius: 9px; overflow-wrap: anywhere; }
.snip-tabs { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.snip-tabs button.on { border-color: var(--a1); color: var(--a1); }
.snip { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 "JetBrains Mono", monospace; margin: 0; }
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 80; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13.5px; animation: slide .2s; }
.toast.bad { border-left-color: var(--bad); }

.cm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.cm-row .pat { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cm-row .btns { display: flex; gap: 4px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 7px 12px; cursor: pointer; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.seg input { display: none; }
.seg label:has(input:checked) { background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a1); font-weight: 600; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.preview { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
.preview pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 "JetBrains Mono", monospace; }
.preview .st { font-size: 12.5px; }
