/* Rustybin console styles. Tokens first; light is the default, dark comes from
   prefers-color-scheme unless the toggle pinned a theme (data-theme). */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #dde1e7;
  --border-strong: #c5ccd6;
  --text: #14171c;
  --text-2: #4a5260;
  --text-3: #6b7380;
  --accent: #2858d6;
  --accent-hover: #1f47b3;
  --accent-soft: #e8eefc;
  --accent-text: #ffffff;
  --ok: #157f3b;
  --ok-soft: #e3f4e8;
  --warn: #8a5a00;
  --warn-soft: #fdf1d6;
  --err: #c0322d;
  --err-soft: #fbe5e4;
  --info: #1f63a8;
  --info-soft: #e2eefa;
  --violet: #6a3fc1;
  --violet-soft: #efe8fb;
  --hl: #fff6cc;
  --hl-border: #e7c84a;
  --code-bg: #f6f7f9;
  --j-key: #1f4fa3;
  --j-str: #0f7a45;
  --j-num: #a14a00;
  --j-bool: #7a3cbd;
  --j-null: #6b7380;
  --diff-add: #e3f6e8;
  --diff-del: #fbe7e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .18);
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --radius: 8px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 236px;
  --header-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1b2029;
    --surface-3: #232935;
    --border: #2c3340;
    --border-strong: #3a4352;
    --text: #e8ebf0;
    --text-2: #b4bcc8;
    --text-3: #8d96a5;
    --accent: #5b8cff;
    --accent-hover: #7aa2ff;
    --accent-soft: #1d2a48;
    --accent-text: #0b1020;
    --ok: #4cc777;
    --ok-soft: #12301f;
    --warn: #f0b84a;
    --warn-soft: #34290f;
    --err: #ff6b63;
    --err-soft: #3a1817;
    --info: #6cb2ff;
    --info-soft: #132a44;
    --violet: #b195ff;
    --violet-soft: #2a2145;
    --hl: #3a3212;
    --hl-border: #8a7424;
    --code-bg: #12161d;
    --j-key: #8db8ff;
    --j-str: #7ed6a0;
    --j-num: #f5b56e;
    --j-bool: #c9a7ff;
    --j-null: #8d96a5;
    --diff-add: #13301e;
    --diff-del: #3a1a19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1b2029;
  --surface-3: #232935;
  --border: #2c3340;
  --border-strong: #3a4352;
  --text: #e8ebf0;
  --text-2: #b4bcc8;
  --text-3: #8d96a5;
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --accent-soft: #1d2a48;
  --accent-text: #0b1020;
  --ok: #4cc777;
  --ok-soft: #12301f;
  --warn: #f0b84a;
  --warn-soft: #34290f;
  --err: #ff6b63;
  --err-soft: #3a1817;
  --info: #6cb2ff;
  --info-soft: #132a44;
  --violet: #b195ff;
  --violet-soft: #2a2145;
  --hl: #3a3212;
  --hl-border: #8a7424;
  --code-bg: #12161d;
  --j-key: #8db8ff;
  --j-str: #7ed6a0;
  --j-num: #f5b56e;
  --j-bool: #c9a7ff;
  --j-null: #8d96a5;
  --diff-add: #13301e;
  --diff-del: #3a1a19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--header-h) minmax(0, 1fr); height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 500; color: var(--text-3); font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar-meta { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.topbar-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.topbar-field input { width: 150px; }
.btn.menu-btn { display: none; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
  padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
}
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 12px 10px 4px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 520; font-size: 14px; position: relative;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-count { margin-left: auto; font-size: 11px; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 7px; font-weight: 650; min-width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.main { overflow-y: auto; min-width: 0; }
.banner { max-width: 1480px; margin: 0 auto; padding: 14px 26px 0; }
.banner:empty { display: none; }
.signed-in { max-width: 220px; }
#account-menu { flex-shrink: 0; }
#account-menu .menu-pop { min-width: 220px; }

/* ── AI assist: the bar, the drawer, apply cards, markdown ─────────── */
.assist-host { display: flex; align-items: center; min-width: 0; }
.assist-wrap { position: relative; }
.assist-form { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 10px; }
.assist-form > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.assist-wrap.off .assist-form > svg { color: var(--text-3); }
.assist-input { border: 0; background: transparent; width: 260px; height: 28px; padding: 0 4px; box-shadow: none; }
.assist-input:focus { outline: none; box-shadow: none; }
.assist-form .btn.sm.primary { height: 26px; padding: 0 8px; border-radius: 999px; }
.assist-form .btn.sm.primary svg { width: 14px; height: 14px; }
.assist-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(460px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.assist-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.assist-suggestion { text-align: left; white-space: normal; height: auto; padding: 4px 10px; }
.nav-spark { display: none; width: 12px !important; height: 12px !important; color: var(--accent); margin-left: 4px; }
.sidebar.assist-on .nav-spark { display: inline-block; }
.btn.assist-off { color: var(--text-3); border-style: dashed; }
.ask-card .card-body { padding-top: 10px; }

.assist-drawer { position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(440px, 100vw); z-index: 35; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.assist-grip { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.assist-grip:hover { background: var(--accent-soft); }
.assist-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.assist-head > svg { width: 18px; height: 18px; color: var(--accent); }
.assist-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.assist-empty { color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 30px 10px; }
.assist-empty svg { width: 28px; height: 28px; color: var(--accent); }
.assist-exchange { display: flex; flex-direction: column; gap: 8px; }
.assist-question { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; font-weight: 550; }
.assist-question svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--text-3); }
.assist-answer { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.assist-foot { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.apply-card { border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--accent-soft); }
.apply-card > .row > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.apply-title { font-weight: 600; }
.apply-result { margin-top: 8px; }
body.assist-open .main { padding-right: 0; }

.ai-progress { margin: 0; padding-left: 18px; max-height: 120px; overflow: auto; }
.ai-progress li { margin: 1px 0; }
.md { line-height: 1.5; overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; }
.md h3, .md h4, .md h5, .md h6 { margin: 10px 0 4px; font-size: 14px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 4px; border-radius: 4px; }
.md-code-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 8px; }
.md-code-bar { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 2px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.md-code { margin: 0; padding: 10px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); }
.md-code.small { font-size: 11.5px; max-height: 240px; overflow: auto; }
.md-code code { background: none; padding: 0; }
@media (max-width: 1100px) { .assist-input { width: 160px; } }
.view { padding: 22px 26px 40px; max-width: 1480px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head .grow { flex: 1; min-width: 240px; }
.view-head p { color: var(--text-2); margin: 4px 0 0; max-width: 80ch; }
.backdrop { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: var(--header-h); bottom: 0; left: 0; width: 260px; z-index: 30; transform: translateX(-105%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .backdrop { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0, 0, 0, .3); z-index: 20; }
  .btn.menu-btn { display: inline-flex; }
  .topbar-field.hide-sm { display: none; }
  .view { padding: 16px 14px 32px; }
}

/* ── Building blocks ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { flex: 1; min-width: 120px; }
.card-head .hint { color: var(--text-3); font-size: 13px; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4, .grid-sidebar { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-all; }
.right { margin-left: auto; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: 550 14px var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--err); border-color: var(--border-strong); }
.btn.danger:hover { background: var(--err-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.input, .select, .textarea {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 14px var(--font); min-width: 0; width: 100%;
}
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 13px; }
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.input.sm, .select.sm { height: 28px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span, .label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.field .hint { font-size: 12px; color: var(--text-3); text-transform: none; letter-spacing: 0; font-weight: 400; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: 550 13px var(--font); padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.seg button:hover { color: var(--text); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; font: 550 13px var(--font); color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font: 600 12px var(--font); background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.outline { background: transparent; border-color: var(--border-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: var(--warn); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 127, 59, .5); } 70% { box-shadow: 0 0 0 7px rgba(21, 127, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 127, 59, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } .spinner { animation-duration: 2s; } }

.m { display: inline-block; font: 700 11px var(--mono); padding: 2px 6px; border-radius: 4px; min-width: 52px; text-align: center; background: var(--surface-3); color: var(--text-2); }
.m-GET { background: var(--ok-soft); color: var(--ok); }
.m-POST { background: var(--info-soft); color: var(--info); }
.m-PUT, .m-PATCH { background: var(--warn-soft); color: var(--warn); }
.m-DELETE { background: var(--err-soft); color: var(--err); }
.m-ANY, .m-OPTIONS, .m-HEAD { background: var(--violet-soft); color: var(--violet); }
.st { font: 700 12px var(--mono); }
.st-2 { color: var(--ok); } .st-3 { color: var(--info); } .st-4 { color: var(--warn); } .st-5 { color: var(--err); } .st-0 { color: var(--text-3); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.k { font-family: var(--mono); color: var(--text-2); white-space: nowrap; width: 1%; }
.table td.v { font-family: var(--mono); word-break: break-all; }
.table tr.hl td { background: var(--hl); }
.table tr.hl td.k { box-shadow: inset 3px 0 0 var(--hl-border); }
.table tr.diff-add td { background: var(--diff-add); }
.table tr.diff-del td { background: var(--diff-del); }
.table tr.diff-chg td { background: var(--hl); }
.tag-gw { font: 600 10px var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-left: 6px; }

.code { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow: auto; max-height: 520px; white-space: pre-wrap; word-break: break-word; font: 13px/1.5 var(--mono); color: var(--text); }
.code.tall { max-height: 70vh; }
.code.short { max-height: 260px; }
.code .j-key { color: var(--j-key); } .code .j-str { color: var(--j-str); } .code .j-num { color: var(--j-num); }
.code .j-bool { color: var(--j-bool); } .code .j-null { color: var(--j-null); } .code .x-tag { color: var(--j-key); } .code .x-attr { color: var(--j-num); }
.code .d-add { background: var(--diff-add); display: block; } .code .d-del { background: var(--diff-del); display: block; } .code .d-ctx { display: block; }
.code-wrap { position: relative; }
.code-wrap .copy-fab { position: absolute; top: 6px; right: 6px; opacity: .85; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { padding: 14px 16px; }
.tile .label { margin-bottom: 6px; display: block; }
.tile .value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.tile .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.list { display: flex; flex-direction: column; }
.list-item { display: grid; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; background: none; border-left: 3px solid transparent; text-align: left; color: inherit; font-family: inherit; width: 100%; border-top: 0; border-right: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.list-item.compare-a { box-shadow: inset -4px 0 0 var(--info); }
.list-item.compare-b { box-shadow: inset -4px 0 0 var(--violet); }
.list-item.fresh { animation: fresh 1.4s ease-out; }
@keyframes fresh { from { background: var(--hl); } to { background: transparent; } }

.empty { padding: 36px 18px; text-align: center; color: var(--text-3); }
.empty h3 { color: var(--text-2); margin-bottom: 6px; }
.empty svg { width: 34px; height: 34px; opacity: .6; margin-bottom: 6px; }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--info-soft); color: var(--text); border: 1px solid transparent; align-items: flex-start; }
.notice.err { background: var(--err-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.ok { background: var(--ok-soft); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice .grow { flex: 1; min-width: 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14px; }
.toast.err { background: var(--err); color: #fff; }

.split { display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); min-height: 520px; }
.split > .pane { min-width: 0; }
.split > .pane + .pane { border-left: 1px solid var(--border); }
.pane-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 420px; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } .split > .pane + .pane { border-left: 0; border-top: 1px solid var(--border); } .pane-scroll { max-height: 60vh; min-height: 0; } }

.kvgrid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13px; }
.kvgrid dt { color: var(--text-3); }
.kvgrid dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.url-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.url-row:last-child { border-bottom: 0; }
.url-row code { word-break: break-all; }
@media (max-width: 700px) { .url-row { grid-template-columns: minmax(0, 1fr) auto; } .url-row .label-col { grid-column: 1 / -1; } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 360px; max-height: calc(100vh - 330px); overflow-y: auto; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.msg.tool { align-self: flex-start; background: var(--violet-soft); border: 1px dashed var(--violet); font-family: var(--mono); font-size: 13px; }
.msg.error { align-self: stretch; max-width: 100%; background: var(--err-soft); }
.msg .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-3); align-items: center; white-space: normal; }
.msg.user .meta { color: inherit; opacity: .85; }
.cursor::after { content: ""; display: inline-block; width: 7px; height: 1em; background: currentColor; margin-left: 2px; vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input .textarea { min-height: 44px; height: 44px; }

/* Timeline (A2A, MCP log) */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 8px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 24px; bottom: -8px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); margin: 5px 3px; position: relative; z-index: 1; }
.tl-dot.ok { background: var(--ok); } .tl-dot.err { background: var(--err); } .tl-dot.warn { background: var(--warn); } .tl-dot.info { background: var(--info); } .tl-dot.violet { background: var(--violet); }
.tl-body { min-width: 0; font-size: 14px; }
.tl-body .tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-time { color: var(--text-3); font: 12px var(--mono); }

.log { font: 12px/1.45 var(--mono); max-height: 420px; overflow: auto; }
.log-row { display: grid; grid-template-columns: 96px 44px minmax(0, 1fr); gap: 8px; padding: 5px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.log-row:hover { background: var(--surface-2); }
.log-row .dir-out { color: var(--info); font-weight: 700; } .log-row .dir-in { color: var(--ok); font-weight: 700; } .log-row .dir-note { color: var(--violet); font-weight: 700; }
.log-row pre { margin: 6px 0 0; grid-column: 1 / -1; }
.log-detail { grid-column: 1 / -1; cursor: auto; }
/* MCP inspector: connection, protocol, timeline. */
.mcp-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
.mcp-left, .mcp-right { min-width: 0; }
.mcp-right { position: sticky; top: 72px; }
.mcp-right .log { max-height: 56vh; }
@media (max-width: 1400px) { .mcp-layout { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); } .mcp-right { grid-column: 1 / -1; position: static; } }
@media (max-width: 900px) { .mcp-layout { grid-template-columns: minmax(0, 1fr); } }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s ease; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-2); font: 11px var(--font); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 5px 8px; border-radius: 5px; z-index: 60; box-shadow: var(--shadow-lg); }

.artifact { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); margin-top: 6px; }
.artifact img { max-width: 220px; border-radius: 4px; border: 1px solid var(--border); display: block; margin-top: 6px; }
.kbd { font: 600 11px var(--mono); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text-2); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.linkish { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.linkish:hover strong, .linkish:focus-visible strong { text-decoration: underline; }
.token-box { font: 12px/1.5 var(--mono); word-break: break-all; padding: 10px 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.token-box .t-h { color: var(--err); } .token-box .t-p { color: var(--violet); } .token-box .t-s { color: var(--info); }
.countdown { font: 700 20px var(--mono); }
details.disclosure > summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; padding: 4px 0; }
details.disclosure > summary svg { width: 15px; height: 15px; vertical-align: -3px; }
.dialog-like { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
@media (max-width: 960px) { .hide-sm { display: none !important; } }
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 12px var(--font); display: grid; place-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.filters .select { width: auto; }
@media (max-width: 640px) { .topbar-meta { display: none; } .brand small { display: none; } }
.traffic-row { grid-template-columns: 76px 62px minmax(0, 1fr) 40px 64px; }
@media (max-width: 640px) {
  .filters { flex: 1 1 100%; }
  .filters > * { flex: 1 1 100%; width: auto !important; }
  .traffic-row { grid-template-columns: 62px minmax(0, 1fr) 40px; }
  .traffic-row .col-time, .traffic-row .col-lat { display: none; }
  .view-head .row { flex-wrap: wrap; }
}

/* Sign-in screen (RUSTYBIN_CONTROL_AUTH = token | jwt) */
.signin { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.signin-card { width: min(520px, 100%); }
.signin h1 { font-size: 20px; }
.signin .row > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.signin a.btn { align-self: flex-start; }
.console-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .backlink span { max-width: 120px !important; } }

/* ── Mock APIs ─────────────────────────────────────────────────────── */
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-3); cursor: pointer; padding: 0; flex: none; transition: background .15s ease; }
.switch .switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .switch, .switch .switch-knob { transition: none; } }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.err-text { color: var(--err); }
.warn-text { color: var(--warn, var(--status-warning)); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain > legend { padding: 0; margin-bottom: 6px; }
.issue-list { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.issue-list code { word-break: break-all; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.lock { display: inline-flex; color: var(--violet); }
.lock svg, .check-icon svg { width: 15px; height: 15px; }
.check-icon { display: inline-flex; }
.check-icon.ok { color: var(--ok); } .check-icon.warn { color: var(--warn); } .check-icon.err { color: var(--err); }
textarea.invalid, .input.invalid { border-color: var(--err); outline-color: var(--err); }

/* Drop zone (list empty state, wizard) */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 26px 18px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone.hero { padding: 44px 18px; margin-bottom: 14px; gap: 12px; }
.dropzone .hero-title { font-size: 18px; }

/* Wizard */
dialog.wizard { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); display: none; flex-direction: column; }
dialog.wizard[open] { display: flex; }
.wizard-head { padding: 14px 18px 0; }
.wizard-steps { list-style: none; margin: 0; padding: 12px 18px; display: flex; gap: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wizard-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.wizard-steps li[aria-current="step"] { color: var(--accent); }
.wizard-steps li[aria-current="step"] .step-n { background: var(--accent); color: var(--accent-text); }
.wizard-steps li.done .step-n { background: var(--ok-soft); color: var(--ok); }
.wizard-steps .step-n svg { width: 13px; height: 13px; }
.wizard-body { padding: 16px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.wizard-foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.wizard-ops { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px 8px; }
.op-line { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; min-width: 0; }
.op-line .mono { flex: 0 1 auto; max-width: 50%; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }

/* Mock list */
.mock-filters { flex: 1 1 420px; justify-content: flex-end; }
.mock-filters .input { width: auto; flex: 1 1 200px; max-width: 280px; }
.mock-list { display: flex; flex-direction: column; margin: -14px -16px 10px; }
.mock-row { display: grid; grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1.4fr) 130px 110px 120px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mock-row:hover { background: var(--surface-2); }
.mock-row:last-child { border-bottom: 0; }
.mr-link { font-weight: 650; font-size: 14px; color: var(--text); }
.mr-name, .mr-title { min-width: 0; }
.mr-name code { min-width: 0; }
.mr-state { justify-self: end; }
@media (max-width: 900px) {
  .mock-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "sw name state" "sw title title" "sw sec hits"; row-gap: 4px; }
  .mr-switch { grid-area: sw; align-self: start; padding-top: 2px; }
  .mr-name { grid-area: name; } .mr-title { grid-area: title; } .mr-sec { grid-area: sec; } .mr-hits { grid-area: hits; justify-self: end; text-align: right; } .mr-state { grid-area: state; }
  .mr-hits > div { display: inline; margin-left: 6px; }
}

/* Mock detail */
.mock-head h1 { font-size: 22px; word-break: break-all; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.back-link svg { width: 14px; height: 14px; }
.url-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 6px 6px 12px; max-width: 760px; }
.url-bar code { font-size: 14px; }
.mock-actions { align-self: flex-end; }
.mock-banners:not(:empty) { margin-bottom: 14px; }
.mock-banners > div:empty { display: none; }
.mock-tabs > .tabs { margin-bottom: 14px; padding: 0; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; }
.menu-pop > button, .menu-pop > a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; background: none; color: var(--text); font: 500 14px var(--font); border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.menu-pop > button:hover, .menu-pop > a:hover { background: var(--surface-3); text-decoration: none; }
.menu-pop > .danger { color: var(--err); }
.menu-pop svg { width: 16px; height: 16px; }
.ops-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ops-list { position: sticky; top: 0; }
.ops-list .pane-scroll { max-height: calc(100vh - 260px); min-height: 0; }
.op-row { grid-template-columns: 62px minmax(0, 1fr) auto; }
@media (max-width: 1100px) { .ops-layout { grid-template-columns: minmax(0, 1fr); } .ops-list { position: static; } .ops-list .pane-scroll { max-height: 340px; } }
.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: 13px var(--font); color: var(--text-2); }
.st-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.save-bar { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-lg); }
.rule { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.rule-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rule-line .select, .rule-line .input { width: auto; flex: 0 1 auto; min-width: 90px; }
.rule-line .input { flex: 1 1 120px; }
.rule-kw { font: 600 12px var(--mono); color: var(--violet); text-transform: uppercase; min-width: 52px; }
.try-base { word-break: break-all; }
.mock-strip { gap: 6px; }
.scheme { padding: 8px 0; border-bottom: 1px solid var(--border); }
.scheme:last-of-type { border-bottom: 0; }
.scheme .row > svg { width: 15px; height: 15px; color: var(--violet); }
.use-line { gap: 8px; margin-top: 4px; }
.use-line code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }
.sec-grid { align-items: start; }
.mt-row { grid-template-columns: 38px 58px minmax(0, 1fr) 34px auto 18px 60px; }
@media (max-width: 640px) { .mt-row { grid-template-columns: 58px minmax(0, 1fr) 34px 18px; } .mt-row > :first-child, .mt-row .mt-outcome, .mt-row .mt-time { display: none; } }
.report-op { border-bottom: 1px solid var(--border); }
.report-op > summary { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; min-width: 0; }
.report-op > summary::-webkit-details-marker { display: none; }
.rev-list { margin: -14px -16px; }
.rev-row { grid-template-columns: 50px minmax(0, 1fr) auto; cursor: default; }
.rev-row:hover { background: none; }

/* Schema-driven body editor */
.se { display: flex; flex-direction: column; gap: 8px; }
.se-obj { display: flex; flex-direction: column; gap: 8px; }
.se-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.se-field .hint, .se-group > .hint { font-size: 12px; color: var(--text-3); }
.se-head { display: block; }
.se-label { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); flex-wrap: wrap; }
.se-req { color: var(--err); font-weight: 700; }
.se-type { font: 500 11px var(--mono); color: var(--text-3); background: var(--surface-3); border-radius: 4px; padding: 0 5px; }
.se-group { border: 1px solid var(--border); border-left: 3px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 6px 10px 8px; background: var(--surface); }
.se-group > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 0; min-height: 28px; }
.se-group[open] > summary { margin-bottom: 6px; }
.se-group.se-absent { border-style: dashed; background: transparent; }
.se-body { display: flex; flex-direction: column; gap: 8px; }
.se-arr { display: flex; flex-direction: column; gap: 6px; }
.se-item { display: flex; gap: 8px; align-items: flex-start; }
.se-idx { font-size: 11px; color: var(--text-3); min-width: 18px; padding-top: 6px; text-align: right; }
.se-item-actions { display: flex; gap: 2px; }
.se-map { border-top: 1px dashed var(--border); padding-top: 6px; }
.se-const { padding: 4px 0; }
.se-msg { color: var(--err); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.se-msg > div { display: flex; gap: 4px; align-items: center; }
.se-msg svg { width: 13px; height: 13px; flex: none; }
.has-issue > .input, .has-issue > .select, .has-issue > .row .input, .se-field.has-issue .input, .se-field.has-issue .select { border-color: var(--err); }
.se-group.has-issue, .se-item.has-issue { border-left-color: var(--err); }
.badge svg { width: 12px; height: 12px; flex: none; }
.field > .seg, .row > .seg { align-self: flex-start; }
.use-line code { min-width: 0; }
.row.nowrap > code.break, .row.nowrap > .grow > code.break { white-space: normal; }
/* Mock APIs, round 2: bulk actions, rule preview, drag, dialogs, data */
.bulk-bar { margin: -6px -16px 12px; padding: 0 16px 10px; border-bottom: 1px solid var(--border); min-height: 38px; }
.bulk-bar.active { background: var(--accent-soft); padding-top: 8px; margin-top: -14px; }
.bulk-bar .check input { margin: 0; }
.mock-list.selectable .mock-row { grid-template-columns: 74px minmax(0, 2fr) minmax(0, 1.4fr) 130px 130px 120px; }
.mr-switch { display: flex; align-items: center; gap: 10px; }
.mr-switch input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
@media (max-width: 900px) { .mock-list.selectable .mock-row { grid-template-columns: 74px minmax(0, 1fr) auto; } }
dialog.small-dialog { width: min(520px, calc(100vw - 24px)); }
/* Self-service: the visitor's visit and the "your / instance mocks" groups. */
.visit-bar { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 13px; }
.visit-bar svg { width: 16px; height: 16px; }
.mock-group { margin: 14px 0 6px; }
.mock-group:first-child { margin-top: 0; }
.rule.dragging { opacity: .5; }
.rule.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.rule-grip { display: inline-flex; cursor: grab; color: var(--text-3); touch-action: none; }
.rule-grip svg { width: 16px; height: 16px; }
.rule-result:empty, .cond-seen:empty { display: none; }
.cond-seen-v { display: inline-flex; align-items: center; gap: 3px; font: 12px var(--mono); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
.cond-seen-v.ok { color: var(--ok); background: var(--ok-soft); }
.cond-seen-v.no { color: var(--text-2); background: var(--surface-3); }
.cond-seen-v svg { width: 12px; height: 12px; flex: none; }
.rule-preview { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.op-hits { color: var(--text-2); }
.data-col > summary { gap: 8px; }

/* Management: a rail of tabs down the left (horizontal on phones) */
.rail-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.rail button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-2); font: 550 14px var(--font); cursor: pointer; text-align: left; }
.rail button svg { width: 18px; height: 18px; flex: none; }
.rail button:hover { background: var(--surface-3); color: var(--text); }
.rail button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.rail-panel { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.inline-icon { display: inline-flex; align-items: center; gap: 4px; }
.inline-icon svg { width: 14px; height: 14px; flex: none; }
.secret-status { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.secret-status .badge svg { width: 12px; height: 12px; }
@media (max-width: 860px) {
  .rail-layout { grid-template-columns: minmax(0, 1fr); }
  .rail { flex-direction: row; overflow-x: auto; position: static; }
  .rail button { white-space: nowrap; }
}
dialog.wizard.wide { width: min(1120px, calc(100vw - 24px)); }
.conflict-section { border-top: 1px solid var(--border); padding-top: 10px; }
.conflict-col .code { max-height: 280px; }
