/* Money Radar — a dark operations console for the earning pipeline.
   Graphite base, cyan/teal signal colours, one warm warning accent.
   Effects stay limited to borders, soft glows and 150-250 ms transitions. */

:root {
  --bg: #070b12;
  --panel: rgba(15, 23, 36, 0.78);
  --panel-solid: #0e1622;
  --line: rgba(94, 234, 212, 0.14);
  --line-strong: rgba(34, 211, 238, 0.38);
  --grid: rgba(56, 189, 248, 0.06);
  --text: #e7eef9;
  --text-dim: #a9bad0;
  --muted: #7f92ab;
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  --glow-cyan: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 28px -10px rgba(34, 211, 238, 0.7);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--teal); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 10px 16px; background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- backdrop */

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.backdrop-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.85;
}

.backdrop-glow { position: absolute; width: 62vw; height: 62vw; border-radius: 50%; filter: blur(90px); opacity: 0.32; }
.glow-a { top: -28vw; left: -12vw; background: radial-gradient(circle, #0e7490 0%, transparent 62%); }
.glow-b { bottom: -34vw; right: -18vw; background: radial-gradient(circle, #1e3a8a 0%, transparent 62%); opacity: 0.3; }

/* ------------------------------------------------------------------- shell */

.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.rail {
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 14, 22, 0.92), rgba(7, 11, 18, 0.86));
  backdrop-filter: blur(10px);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 6px; }

.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; color: var(--cyan);
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.24), rgba(34, 211, 238, 0.04));
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow-cyan);
}

.brand-text strong { display: block; font-size: 13px; letter-spacing: 0.22em; color: var(--text); }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 14px 8px 6px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.nav a:hover { background: rgba(34, 211, 238, 0.07); color: var(--text); }
.nav a.active {
  color: #eafcff;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(45, 212, 191, 0.04));
  border-color: var(--line-strong);
  box-shadow: inset 2px 0 0 var(--cyan);
}

.nav-icon { width: 16px; height: 16px; display: inline-grid; place-items: center; color: currentColor; opacity: 0.9; }
.nav-icon svg { width: 16px; height: 16px; }

.nav-badge:not(:empty) {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.16); border: 1px solid var(--line-strong);
  color: var(--cyan); font-size: 11px; text-align: center;
}

.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-note { color: var(--muted); font-size: 11px; line-height: 1.45; padding: 0 4px; }

.workspace { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 16px 26px; border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.82); backdrop-filter: blur(12px);
}

.topbar-title h1 { font-size: 20px; }
.topbar-title p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-status { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.topbar-actions { display: flex; gap: 8px; }

.view { padding: 24px 26px 56px; display: grid; gap: 18px; align-content: start; }
.view:focus { outline: none; }

/* ----------------------------------------------------------------- buttons */

.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(19, 30, 45, 0.72);
  color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  text-decoration: none; white-space: nowrap;
}

.btn:hover, .button:hover { color: var(--text); border-color: var(--line-strong); background: rgba(28, 43, 63, 0.9); }

.btn-primary, .button.primary {
  color: #041318; background: linear-gradient(180deg, #67e8f9, #22d3ee);
  border-color: rgba(34, 211, 238, 0.7); font-weight: 600;
  box-shadow: 0 8px 24px -14px rgba(34, 211, 238, 0.9);
}
.btn-primary:hover, .button.primary:hover { background: linear-gradient(180deg, #a5f3fc, #38bdf8); color: #041318; }

.btn-block { width: 100%; }
.button.small, .btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.button.danger { color: #ffd7dd; border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.1); }
.button.danger:hover { background: rgba(251, 113, 133, 0.18); }
.button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.icon-button:hover { color: var(--text); border-color: var(--line); }

/* ------------------------------------------------------------ panels/cards */

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  position: relative; padding: 18px 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 29, 44, 0.86), rgba(11, 17, 27, 0.9));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  display: grid; gap: 12px; min-width: 0; align-content: start;
}

.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.05), transparent 42%);
}

.card-title {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
}

.card-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------- stats */

.kpi, .stat {
  position: relative; padding: 16px 16px 14px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 28, 43, 0.82), rgba(10, 16, 26, 0.88));
  display: grid; gap: 4px; overflow: hidden;
}

.kpi::before, .stat::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55), transparent);
  opacity: 0.7;
}

.kpi-label, .stat-label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.kpi-value, .stat-value {
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em; color: var(--text); line-height: 1.15; overflow-wrap: anywhere;
}

.kpi-hint, .stat-hint { font-size: 11px; color: var(--muted); }
.kpi.good .kpi-value { color: var(--good); text-shadow: 0 0 22px rgba(52, 211, 153, 0.35); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi.info .kpi-value { color: var(--cyan); }

/* ------------------------------------------------------------------ funnel */

.funnel { display: grid; gap: 10px; }

.funnel-row {
  display: grid; grid-template-columns: 108px minmax(0, 1fr) 56px 74px;
  align-items: center; gap: 12px; font-size: 13px;
}

.funnel-name { color: var(--text-dim); }
.funnel-count { font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.funnel-conv { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.funnel-track { position: relative; height: 10px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); overflow: hidden; }

.funnel-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.9), rgba(45, 212, 191, 0.55));
  box-shadow: 0 0 16px -4px rgba(34, 211, 238, 0.8);
  transition: width 320ms ease;
}

/* ------------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left; padding: 10px 12px; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  background: rgba(12, 19, 30, 0.9); border-bottom: 1px solid var(--line); white-space: nowrap;
}

tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.08); color: var(--text-dim); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(34, 211, 238, 0.04); }
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.title-cell { color: var(--text); font-weight: 500; }

/* ----------------------------------------------------------- badges & chips */

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28); background: rgba(148, 163, 184, 0.1);
  color: var(--text-dim); font-size: 11px; letter-spacing: 0.02em; white-space: nowrap;
}

.badge.A, .badge.good { color: #bbf7d0; border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.12); }
.badge.B { color: #bae6fd; border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.12); }
.badge.C { color: #e2e8f0; border-color: rgba(148, 163, 184, 0.35); }
.badge.high, .badge.bad { color: #fecdd3; border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.12); }
.badge.medium, .badge.warn { color: #fde68a; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.1); }
.badge.low { color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(12, 19, 30, 0.8);
  color: var(--text-dim); font-size: 11px; white-space: nowrap;
}
.chip strong { color: var(--text); font-weight: 600; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot-live { background: var(--good); box-shadow: 0 0 10px rgba(52, 211, 153, 0.8); animation: pulse 2.6s ease-in-out infinite; }
.dot-warn { background: var(--warn); box-shadow: 0 0 10px rgba(251, 191, 36, 0.7); }
.dot-bad { background: var(--bad); box-shadow: 0 0 10px rgba(251, 113, 133, 0.7); }
.dot-idle { background: var(--muted); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* -------------------------------------------------------------------- lists */

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }

.list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.1); background: rgba(13, 21, 33, 0.6);
  font-size: 13px; color: var(--text-dim);
}

.list.plain li { border: none; background: none; padding: 3px 0; }
.list li .button { margin-left: auto; }

/* -------------------------------------------------------------------- forms */

.field { display: grid; gap: 6px; }
.field-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field-hint { font-size: 11px; color: var(--muted); }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text);
  background: rgba(9, 15, 24, 0.9); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px; width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:hover, select:hover, textarea:hover { border-color: rgba(34, 211, 238, 0.3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; font-family: var(--mono); font-size: 12.5px; }
select option { background: var(--panel-solid); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .field { min-width: 150px; flex: 1 1 150px; }

.checklist { display: grid; gap: 6px; }
.checklist label { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); }
.checklist input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cyan); }

input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--cyan); flex: 0 0 auto; }
input[type="file"] { padding: 7px 10px; font-size: 12px; }

.field-inline { display: flex; align-items: center; gap: 10px; }

/* -------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(6px);
}

.modal {
  width: min(760px, 100%); max-height: 86vh; overflow: auto; border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #101a28, #0a1119);
  box-shadow: 0 40px 90px -40px #000, 0 0 0 1px rgba(34, 211, 238, 0.12);
}

.modal-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 26, 0.96); backdrop-filter: blur(8px);
}
.modal-head h2 { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.modal-body { padding: 20px; display: grid; gap: 14px; }

/* ------------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }

.toast {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(13, 21, 33, 0.96); color: var(--text); font-size: 13px;
  box-shadow: var(--shadow); animation: toast-in 180ms ease;
}

.toast-good { border-color: rgba(52, 211, 153, 0.5); }
.toast-bad { border-color: rgba(251, 113, 133, 0.55); }

@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- kanban */

.run-status {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(11, 18, 28, 0.7);
  font-size: 13px; line-height: 1.45;
}
.run-status[data-tone="good"] { border-color: rgba(45, 212, 191, 0.35); }
.run-status[data-tone="warn"] { border-color: rgba(250, 204, 21, 0.35); }
.run-status[data-tone="info"] { border-color: rgba(56, 189, 248, 0.35); }
.run-status-text { flex: 1 1 320px; min-width: 0; }
.run-status-text strong { display: block; font-size: 13px; letter-spacing: 0.01em; }
.run-status-text .muted { font-size: 12px; }

/* The exact result of the last sync, kept on screen instead of only in a toast. */
.sync-summary {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(11, 18, 28, 0.5);
  font-size: 12px; line-height: 1.5; color: var(--muted);
}
.sync-summary:not(:empty) { display: flex; }
.sync-summary[data-tone="good"] { border-color: rgba(45, 212, 191, 0.35); color: var(--text); }
.sync-summary[data-tone="warn"] { border-color: rgba(250, 204, 21, 0.35); color: var(--text); }
.sync-summary[data-tone="bad"] { border-color: rgba(248, 113, 113, 0.45); color: var(--text); }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }

/* Ten stages fit on a wide screen as two rows, so the paid columns are never off-screen. */
@media (min-width: 1500px) {
  .kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow-x: visible; }
}

.column {
  flex: 0 0 232px; border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(11, 18, 28, 0.7); padding: 10px; display: grid; gap: 8px; align-content: start;
}

.column-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 2px 4px 6px;
}

.deal-card {
  display: grid; gap: 6px; padding: 10px; border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(20, 31, 47, 0.8);
  cursor: pointer; transition: border-color 150ms ease, transform 150ms ease;
}
.deal-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.deal-card strong { font-size: 13px; color: var(--text); }

.deal-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }

/* -------------------------------------------------------------- misc blocks */

.empty {
  display: grid; gap: 10px; justify-items: start; padding: 28px; border-radius: var(--radius);
  border: 1px dashed rgba(34, 211, 238, 0.25); background: rgba(10, 17, 27, 0.6);
}
.empty h3 { font-size: 16px; color: var(--text); }
.empty p { color: var(--muted); font-size: 13px; max-width: 62ch; }

.hint-box, .warn-box, .danger-box { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5; }
.hint-box { border: 1px solid rgba(34, 211, 238, 0.22); background: rgba(34, 211, 238, 0.07); color: var(--text-dim); }
.warn-box { border: 1px solid rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); color: #fde68a; }
.danger-box { border: 1px solid rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.09); color: #fecdd3; }

.progress { height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.15); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--teal)); }

.dropzone {
  padding: 22px; border-radius: var(--radius); border: 1px dashed rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.04); text-align: center; color: var(--muted); font-size: 13px;
  transition: border-color 150ms ease, background 150ms ease;
}
.dropzone.over { border-color: var(--cyan); background: rgba(34, 211, 238, 0.1); color: var(--text); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.link { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.offscreen { position: absolute; left: -9999px; }
.divider { height: 1px; background: var(--line); border: none; margin: 4px 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; }
.section-head p { color: var(--muted); font-size: 12px; }

.hero {
  display: grid; gap: 8px; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(1200px 200px at 10% -40%, rgba(34, 211, 238, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(17, 27, 42, 0.92), rgba(9, 15, 24, 0.94));
  box-shadow: var(--shadow);
}
.hero h2 { font-size: 22px; }
.hero p { color: var(--text-dim); font-size: 13px; max-width: 78ch; }

body.compact table { font-size: 12px; }
body.compact tbody td, body.compact thead th { padding: 6px 9px; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .funnel-row { grid-template-columns: 92px minmax(0, 1fr) 48px 64px; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 14px 16px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-group { display: none; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .rail-foot { margin-top: 4px; grid-auto-flow: column; align-items: center; }
  .rail-note { display: none; }
  .topbar { position: static; flex-wrap: wrap; padding: 14px 16px; }
  .topbar-status { margin-left: 0; order: 3; width: 100%; justify-content: flex-start; }
  .view { padding: 16px 16px 40px; }
}

@media (max-width: 560px) {
  .funnel-row { grid-template-columns: 84px minmax(0, 1fr) 40px; }
  .funnel-conv { display: none; }
  .kpi-value { font-size: 22px; }
}

.button[data-busy="true"] { opacity: 0.7; cursor: progress; animation: pulse 1.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .card, .kpi, .column { border: 1px solid CanvasText; }
  .funnel-fill { background: Highlight; }
}

/* Shown only until the app boots: the file:// case has no other symptom. */
.boot-hint {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1.5;
}
