/* Relay Pilot Rot Analytics — dashboard theme (layered on Bootstrap 5.3) */

:root {
  --navy-950: #070d1a;
  --navy-900: #0b1426;
  --navy-800: #111d36;
  --navy-700: #1a2a4a;
  --navy-500: #3a4d74;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #5b6b82;
  --accent: #0891b2;
  --accent-strong: #0e7490;
  --accent-soft: #e0f6fa;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #a16207;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --neutral-soft: #eef2f7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 72px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-accent="blue"]   { --accent: #2563eb; --accent-strong: #1d4ed8; --accent-soft: #e6efff; }
[data-accent="indigo"] { --accent: #4f46e5; --accent-strong: #4338ca; --accent-soft: #ecebff; }
[data-accent="teal"]   { --accent: #0d9488; --accent-strong: #0f766e; --accent-soft: #dcf5f2; }

[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); }
a:hover { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .82em; }
.text-muted, .muted { color: var(--muted) !important; }
.small-caps { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; font-weight: 600; color: var(--muted); }

/* Bootstrap accent overrides */
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong);
  --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent-strong); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong);
}
.btn { border-radius: var(--radius-sm); font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; }
.btn-sm { font-size: .8rem; }
.btn-icon { padding: .3rem .45rem; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: #d5dde8; font-size: .875rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 25%, transparent);
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-label { font-weight: 500; margin-bottom: .3rem; }
.form-text { color: var(--muted); }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { color: var(--accent-strong); }
.nav-pills .nav-link.active { background: var(--accent-soft); }
.dropdown-menu { border-radius: var(--radius-sm); border-color: var(--border); box-shadow: var(--shadow); font-size: .875rem; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 24px; height: 24px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #c7d2e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .2s ease, transform .2s ease; z-index: 1040; overflow-y: auto; overflow-x: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.15rem 1rem; color: #fff; text-decoration: none; }
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #38bdf8); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; }
.nav-section { padding: .9rem 1.2rem .35rem; font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; color: #6b7c99; white-space: nowrap; }
.side-nav { list-style: none; margin: 0; padding: 0 .6rem; }
.side-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; margin: 1px 0; color: #b8c4d8;
  text-decoration: none; border-radius: 8px; font-weight: 500; white-space: nowrap; position: relative;
}
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.side-nav a.active::before { content: ""; position: absolute; left: -.6rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-nav .count { margin-left: auto; background: var(--danger); color: #fff; font-size: .68rem; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 1rem 1.2rem; font-size: .72rem; color: #5f7090; white-space: nowrap; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-name, body.sidebar-collapsed .nav-section, body.sidebar-collapsed .side-nav .label,
body.sidebar-collapsed .sidebar-footer, body.sidebar-collapsed .side-nav .count { display: none; }
body.sidebar-collapsed .side-nav a { justify-content: center; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: .5rem; padding-right: .5rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1030; backdrop-filter: saturate(1.4) blur(8px);
}
.topbar-title { font-weight: 600; font-size: .95rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: .45rem; border-radius: 8px; display: inline-flex; position: relative; }
.icon-btn:hover { background: var(--neutral-soft); color: var(--text); }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .8rem; }
.content { padding: 1.5rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.maintenance-banner { background: var(--warning-soft); color: var(--warning); padding: .5rem 1.5rem; font-weight: 500; border-bottom: 1px solid #fde68a; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); width: var(--sidebar-w) !important; }
  body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(7, 13, 26, .45); z-index: 1035; }
  body.sidebar-collapsed .brand-name, body.sidebar-collapsed .nav-section, body.sidebar-collapsed .side-nav .label, body.sidebar-collapsed .sidebar-footer { display: revert; }
  body.sidebar-collapsed .side-nav a { justify-content: flex-start; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-header .subtitle { color: var(--muted); margin: .25rem 0 0; max-width: 760px; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb-lite { font-size: .8rem; color: var(--muted); margin-bottom: .35rem; }
.breadcrumb-lite a { color: var(--muted); text-decoration: none; }
.breadcrumb-lite a:hover { color: var(--accent-strong); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .9rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: .78rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.kpi .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin-top: .25rem; line-height: 1.15; }
.kpi .meta { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.kpi .kpi-icon { position: absolute; right: .9rem; top: .9rem; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.kpi.tone-success .kpi-icon { background: var(--success-soft); color: var(--success); }
.kpi.tone-warning .kpi-icon { background: var(--warning-soft); color: var(--warning); }
.kpi.tone-danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi a.stretched-link { color: inherit; }

.health-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--neutral-soft); }
.health-bar span { display: block; height: 100%; }
.seg-healthy { background: #22c55e; } .seg-degraded { background: #f59e0b; } .seg-unavailable { background: #ef4444; }
.seg-unknown { background: #94a3b8; } .seg-suspended { background: #334155; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-secondary { background: var(--neutral-soft); color: #475569; }
.pill-dark { background: #1e293b; color: #f1f5f9; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 5px; background: var(--neutral-soft); color: #475569; font-size: .72rem; margin: 0 .2rem .2rem 0; }

/* ---------- Tables ---------- */
.table-card { overflow: hidden; }
.table { margin: 0; font-size: .85rem; --bs-table-hover-bg: #f6f9fc; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table thead th .sort-link { color: inherit; text-decoration: none; }
.table thead th .sort-link:hover { color: var(--accent-strong); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { font-weight: 600; color: var(--text); text-decoration: none; }
.table .cell-sub { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .col-check { width: 36px; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
tr.row-muted td { opacity: .62; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; }
.filters .search { min-width: 220px; }
@media (max-width: 575.98px) { .filters .form-control, .filters .form-select, .filters .search { width: 100%; min-width: 0; } }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem 1rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.pagination { margin: 0; }
.page-link { color: var(--accent-strong); font-size: .8rem; }
.active > .page-link { background: var(--accent); border-color: var(--accent); }
.bulk-bar { display: none; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: .82rem; }
.bulk-bar.show { display: flex; }

/* ---------- Empty / skeleton ---------- */
.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--muted); }
.empty-state .empty-icon { width: 54px; height: 54px; margin: 0 auto .8rem; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.empty-state h3 { font-size: 1rem; color: var(--text); font-weight: 600; margin-bottom: .35rem; }
.skeleton { position: relative; overflow: hidden; background: #edf1f6; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
.chart-box { position: relative; min-height: 260px; }
.chart-box.sm { min-height: 200px; }
.chart-box > .skeleton { position: absolute; inset: 0; }
.chart-error { display: grid; place-items: center; min-height: 200px; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- Charts (charts.js) ---------- */
.rc-chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.rc-chart text { fill: var(--muted); font-size: 11px; }
.rc-grid { stroke: #e8edf3; stroke-width: 1; }
.rc-axis { stroke: #cbd5e1; }
.rc-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .76rem; color: var(--muted); margin-top: .4rem; }
.rc-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--c); }
.rc-tooltip { position: absolute; pointer-events: none; background: var(--navy-900); color: #fff; font-size: .75rem; padding: .45rem .6rem; border-radius: 7px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.rc-tooltip.show { opacity: 1; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; font-size: .8rem; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar .track { grid-column: 1 / -1; height: 7px; background: var(--neutral-soft); border-radius: 99px; overflow: hidden; margin-bottom: .45rem; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 99px; width: 0; transition: width .5s ease; }

/* ---------- Misc ---------- */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.stat-list li:last-child { border-bottom: 0; }
.stat-list .k { color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .feed-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--neutral-soft); color: var(--muted); }
.feed .feed-icon.critical { background: var(--danger-soft); color: var(--danger); }
.feed .feed-icon.warning { background: var(--warning-soft); color: var(--warning); }
.feed .feed-icon.info { background: var(--info-soft); color: var(--info); }
.feed .title { font-weight: 600; font-size: .84rem; }
.feed .meta { font-size: .75rem; color: var(--muted); }
.copy-field { display: flex; gap: .4rem; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .35rem .35rem .7rem; }
.copy-field code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: .82rem; }
.callout { border-radius: var(--radius-sm); padding: .8rem 1rem; border: 1px solid var(--border); background: var(--surface-2); font-size: .85rem; }
.callout-info { background: var(--info-soft); border-color: #bfdbfe; color: #1e3a8a; }
.callout-warning { background: var(--warning-soft); border-color: #fde68a; color: #78350f; }
.callout-danger { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.callout-success { background: var(--success-soft); border-color: #bbf7d0; color: #14532d; }
.strategy-option { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; cursor: pointer; height: 100%; display: block; transition: border-color .15s, background .15s; }
.strategy-option:hover { border-color: var(--accent); }
.strategy-option input { margin-right: .5rem; }
.strategy-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.strategy-option .desc { display: block; color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .75rem; }
.condition-row { display: grid; grid-template-columns: 1.2fr .8fr 2fr auto; gap: .5rem; margin-bottom: .5rem; }
@media (max-width: 767.98px) { .condition-row { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .55rem 0 .55rem 1.1rem; border-left: 2px solid var(--border); position: relative; font-size: .83rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .9rem; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .when { color: var(--muted); font-size: .74rem; }
.toast-container { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.app-toast { display: flex; gap: .6rem; align-items: flex-start; background: var(--navy-900); color: #e2e8f0; padding: .75rem .9rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(7, 13, 26, .3); font-size: .85rem; animation: toast-in .2s ease; border-left: 4px solid var(--accent); }
.app-toast.success { border-left-color: #22c55e; } .app-toast.error { border-left-color: #ef4444; } .app-toast.warning { border-left-color: #f59e0b; } .app-toast.info { border-left-color: #3b82f6; }
.app-toast .close { margin-left: auto; background: none; border: 0; color: #94a3b8; padding: 0 .2rem; font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.modal-content { border-radius: var(--radius); border: 0; box-shadow: 0 20px 60px rgba(7, 13, 26, .25); }
.dist-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) repeat(3, minmax(70px, 1fr)); gap: .5rem; align-items: center; font-size: .82rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.dist-bar { height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; margin-top: 3px; }
.dist-bar > span { display: block; height: 100%; width: 0; }
.dist-bar.c > span { background: #94a3b8; } .dist-bar.e > span { background: var(--accent); } .dist-bar.a > span { background: #22c55e; }
.w-progress { width: 0; }

/* ---------- Auth / public pages ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 10% -10%, #15335f 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #0c4a6e 0%, transparent 55%), var(--navy-950); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); padding: 2rem; }
.auth-card.wide { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; font-weight: 700; font-size: 1.05rem; }
.auth-card h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: .35rem; }
.steps { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.steps span { font-size: .75rem; padding: .2rem .6rem; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); font-weight: 600; }
.steps span.on { background: var(--accent-soft); color: var(--accent-strong); }
.public-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 1.5rem; }
.public-card { max-width: 480px; text-align: center; background: var(--surface); border-radius: 16px; padding: 2.25rem 2rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.public-card .code { font-size: .8rem; color: var(--muted); letter-spacing: .08em; }
pre.json { background: var(--navy-900); color: #e2e8f0; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .75rem; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.help-toc a { display: block; padding: .3rem 0; color: var(--muted); text-decoration: none; }
.help-toc a:hover { color: var(--accent-strong); }
.help-content h2 { font-size: 1.1rem; font-weight: 700; margin-top: 1.75rem; scroll-margin-top: 80px; }
.help-content h2:first-child { margin-top: 0; }
.help-content h3 { font-size: .95rem; font-weight: 600; margin-top: 1rem; }
.help-content p, .help-content li { color: #334155; line-height: 1.6; }
.sk-row { height: 96px; }
.sk-line { height: 18px; }

/* Licensing */
.sha-cell { max-width: 9rem; }
.license-banner { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.25rem; font-size: .85rem; border-bottom: 1px solid var(--border); }
.license-banner.warn { background: var(--warning-soft); color: #78350f; }
.license-banner.bad { background: var(--danger-soft); color: #7f1d1d; }
.license-banner a { color: inherit; font-weight: 600; }
.strategy-option.is-locked { opacity: .55; cursor: not-allowed; }

/* Relay Pilot logo (sidebar): full logo + caption; the R mark alone when the sidebar is collapsed */
.sidebar-brand { flex-direction: column; align-items: flex-start; gap: .3rem; }
.sidebar-brand .brand-logo { display: block; height: 32px; width: auto; max-width: 100%; }
.sidebar-brand .brand-logo-mark { display: none; height: 30px; width: auto; }
.sidebar-brand .brand-name { font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); padding-left: 2px; }
.sidebar-brand .brand-name .brand-sub { display: inline; margin: 0; font-size: inherit; color: inherit; letter-spacing: inherit; }
body.sidebar-collapsed .sidebar-brand { align-items: center; }
body.sidebar-collapsed .sidebar-brand .brand-logo { display: none; }
body.sidebar-collapsed .sidebar-brand .brand-logo-mark { display: block; }
@media (max-width: 991.98px) {
  body.sidebar-collapsed .sidebar-brand { align-items: flex-start; }
  body.sidebar-collapsed .sidebar-brand .brand-logo { display: block; }
  body.sidebar-collapsed .sidebar-brand .brand-logo-mark { display: none; }
}
.auth-brand img { height: 40px; width: auto; }
