/* MLG HQ dashboard
   Brand: cobalt, navy, sky, paper, ink, acid (acid only for primary actions and "needs you").
   Type:  Archivo (display, variable width), Geist (text), Geist Mono (numbers and small labels).
   Shape: --r-card for panels, --r-field for inputs, pills for anything you press. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"); }

:root {
  color-scheme: light;
  --cobalt: #1c39ff;
  --navy: #0b1a8f;
  --sky: #bcc8ff;
  --paper: #f3f3ee;
  --ink: #0b0c11;
  --acid: #d5ff3f;
  --acid-ink: #0b0c11;

  --bg: var(--paper);
  --surface: #fcfcf9;
  --surface-2: #f6f6f1;
  --surface-3: #ebebe4;
  --text: var(--ink);
  --text-2: #3f414b;
  --muted: #676973;
  --line: rgba(11, 12, 17, 0.085);
  --line-2: rgba(11, 12, 17, 0.15);
  --link: #1c39ff;
  --focus: #1c39ff;
  --shadow: 0 1px 0 rgba(11, 12, 17, 0.04), 0 1px 3px rgba(11, 12, 17, 0.04);
  --shadow-pop: 0 18px 48px -12px rgba(11, 26, 143, 0.28), 0 2px 6px rgba(11, 12, 17, 0.08);

  --good: #11743a; --good-bg: #e2f2e4; --good-dot: #18a34a;
  --warn: #8a5300; --warn-bg: #fbefd6; --warn-dot: #f0a419;
  --bad: #b8262a; --bad-bg: #fbe4e2; --bad-dot: #d93b3b;
  --violet: #4b33b8; --violet-bg: #ebe7fb;
  --blue: #1530d6; --blue-bg: #e4e8ff;
  --skyc: #26338a; --sky-bg: #eef1ff;

  /* charts (validated: positive/other replies pass CVD and contrast relief via legend + table) */
  --viz-s1: #8b8e9a;
  --viz-pos: #1c39ff;
  --viz-other: #93a3ff;
  --viz-grid: #e6e6de;
  --viz-base: #c8c8be;
  --viz-track: #e3e7ff;

  --side: #0b1a8f;
  --side-2: #13238f;
  --side-text: #dfe4ff;
  --side-muted: #9aa6ef;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-text: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-card: 14px;
  --r-field: 9px;
  --r-sm: 6px;
  --gut: 32px;
  --side-w: 232px;
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d13;
    --surface: #14151d;
    --surface-2: #191b24;
    --surface-3: #22242f;
    --text: #ecece6;
    --text-2: #c4c5ce;
    --muted: #9497a3;
    --line: rgba(255, 255, 255, 0.075);
    --line-2: rgba(255, 255, 255, 0.14);
    --link: #93a3ff;
    --focus: #93a3ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, 0.6);
    --good: #5fd38a; --good-bg: rgba(24, 163, 74, 0.16);
    --warn: #f6c35b; --warn-bg: rgba(240, 164, 25, 0.15);
    --bad: #ff8a80; --bad-bg: rgba(217, 59, 59, 0.17);
    --violet: #b9a8ff; --violet-bg: rgba(124, 99, 240, 0.18);
    --blue: #a9b6ff; --blue-bg: rgba(28, 57, 255, 0.22);
    --skyc: #c9d1ff; --sky-bg: rgba(188, 200, 255, 0.12);
    --viz-s1: #6e7180;
    --viz-pos: #3b55ff;
    --viz-other: #8a96e8;
    --viz-grid: #23252f;
    --viz-base: #363846;
    --viz-track: #20264d;
    --side: #080f52;
    --side-2: #0f1866;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--f-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01";
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--acid); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tone-good { color: var(--good); }
.tone-bad { color: var(--bad); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--acid); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.skip:focus { top: 12px; }

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

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); color: var(--side-text); padding: 18px 12px 14px;
  z-index: 20;
}
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 22px; }
.side .side__toggle { display: none; color: var(--side-text); }
.side .side__toggle:hover { background: rgba(255, 255, 255, 0.1); }
.side .side__toggle:focus-visible { outline-color: var(--acid); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--cobalt); color: var(--acid); font: 800 18px/1 var(--f-display); font-stretch: 80%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.brand__mark--lg { width: 48px; height: 48px; border-radius: 14px; font-size: 28px; }
.brand__name { font: 600 16px/1 var(--f-display); font-stretch: 112%; letter-spacing: 0.01em; }
.brand__name b { font-weight: 800; color: var(--acid); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; }
.nav__link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: var(--side-text); font-weight: 500; font-size: 14px; text-decoration: none;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav__link i { font-size: 17px; color: var(--side-muted); transition: color 0.15s; }
.nav__link:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: #fff; }
.nav__link.is-active { background: rgba(255, 255, 255, 0.11); color: #fff; }
.nav__link.is-active i { color: var(--acid); }
.nav__link:focus-visible { outline-color: var(--acid); }
.nav__badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--acid); color: var(--ink); font: 600 11.5px/20px var(--f-mono); text-align: center;
}
.nav__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.nav__logout { color: var(--side-muted); }
.send-pill {
  display: flex; align-items: center; gap: 8px; margin: 0 10px; font: 500 12px/1 var(--f-mono); color: var(--side-text);
}
.send-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good-dot); box-shadow: 0 0 0 3px rgba(24, 163, 74, 0.25); }
.send-pill.is-off::before { background: var(--bad-dot); box-shadow: 0 0 0 3px rgba(217, 59, 59, 0.25); }

.main { min-width: 0; padding: 30px var(--gut) 64px; outline: none; }
.main.is-loading .view { opacity: 0.55; transition: opacity 0.2s; }
.main.is-loading::before {
  content: ""; position: fixed; top: 0; left: var(--side-w); right: 0; height: 2px; z-index: 30;
  background: linear-gradient(90deg, transparent, var(--cobalt), transparent); background-size: 40% 100%;
  background-repeat: no-repeat; animation: load 1s linear infinite;
}
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.view { max-width: 1280px; margin: 0 auto; }

/* ---------- page head ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title {
  margin: 0; font: 760 32px/1.02 var(--f-display); font-stretch: 84%; letter-spacing: -0.012em; color: var(--text);
  text-wrap: balance;
}
.page-sub { margin: 6px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 30px 0 12px; font: 650 15px/1.3 var(--f-text); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.notice { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-field); background: var(--warn-bg); color: var(--warn); margin: 0 0 16px; }
.notice--soft { background: var(--sky-bg); color: var(--skyc); }
.foot-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.lead { margin: 0 0 12px; color: var(--text-2); }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font: 600 11.5px/1 var(--f-mono);
}
.count--acid { background: var(--acid); color: var(--ink); }

/* ---------- cards and grids ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 18px 20px 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: 16px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 14px; min-height: 28px; }
.card__title { display: flex; align-items: center; gap: 8px; margin: 0; font: 650 14.5px/1.3 var(--f-text); letter-spacing: -0.005em; }
.card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 550; font-size: 13px; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid--main { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .card + .card { margin-top: 0; }
.grid--cols { align-items: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--top { align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  font-weight: 550; font-size: 13.5px; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-2); border-color: rgba(11, 12, 17, 0.26); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 15px; }
.btn--sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn--sm i { font-size: 13px; }
.btn--icon { width: 34px; padding: 0; }
.btn--sm.btn--icon { width: 28px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--primary { background: var(--acid); color: var(--acid-ink); border-color: transparent; font-weight: 650; }
.btn--primary:hover { background: #c8f52a; border-color: transparent; }
.btn--danger { background: var(--bad-dot); color: #fff; border-color: transparent; }
.btn--danger:hover { background: #c22f2f; border-color: transparent; }
.btn--danger-ghost { color: var(--bad); border-color: transparent; background: var(--bad-bg); }
.btn--danger-ghost:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn--onDark { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.btn--onDark:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.36); }
.btn--block { width: 100%; }

/* segmented links */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 999px; flex-wrap: wrap; }
.seg__opt { padding: 5px 12px; border-radius: 999px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.seg__opt:hover { text-decoration: none; color: var(--text); }
.seg__opt.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11, 12, 17, 0.12); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: -1px; border: 0; background: none;
  color: var(--muted); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-on { color: var(--text); border-bottom-color: var(--cobalt); }
.tab .count { margin-left: 2px; }

/* ---------- form controls ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field--row { flex-direction: row; align-items: center; gap: 10px; }
.field--row .field__label { white-space: nowrap; }
.field--grow { flex: 1 1 200px; }
.field--wide { grid-column: 1 / -1; }
.field__label { font: 500 12px/1.3 var(--f-text); color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
.req { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--acid); color: var(--ink); font: 600 10.5px/1.6 var(--f-mono); }
.input, .select {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--r-field);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.input:hover, .select:hover { border-color: rgba(11, 12, 17, 0.28); }
.input:focus, .select:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(28, 57, 255, 0.16); }
.input[aria-invalid="true"], .input[aria-invalid=""] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23676973' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input--sm, .select--sm { height: 32px; font-size: 13px; }
.input--num { width: 92px; font-family: var(--f-mono); font-size: 12.5px; text-align: right; padding: 0 8px; }

.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__ui { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background 0.2s; }
.toggle__ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease); }
.toggle input:checked + .toggle__ui { background: var(--cobalt); border-color: var(--cobalt); }
.toggle input:checked + .toggle__ui::after { transform: translateX(14px); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--focus); outline-offset: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--bool { gap: 6px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.savebar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  margin-top: 16px; padding: 10px 12px 10px 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line-2); backdrop-filter: blur(10px); box-shadow: var(--shadow-pop);
}
.savebar #resetRates { margin-right: auto; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick__d input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.daypick__d span {
  display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); font-weight: 550; font-size: 12.5px; color: var(--text-2); background: var(--surface);
}
.daypick__d input:checked + span { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.daypick__d input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- chips and tags ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px;
  font: 550 12px/1 var(--f-text); white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.chip--neutral { background: var(--surface-3); color: var(--text-2); }
.chip--muted { background: var(--surface-3); color: var(--muted); }
.chip--sky { background: var(--sky-bg); color: var(--skyc); }
.chip--blue { background: var(--blue-bg); color: var(--blue); }
.chip--navy { background: var(--navy); color: #fff; }
.chip--acid { background: var(--acid); color: var(--ink); }
.chip--good { background: var(--good-bg); color: var(--good); }
.chip--won { background: var(--good-dot); color: #fff; }
.chip--violet { background: var(--violet-bg); color: var(--violet); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--bad { background: var(--bad-bg); color: var(--bad); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag--acid { background: var(--acid); border-color: transparent; color: var(--ink); font-weight: 600; }
.tag--mono { font-family: var(--f-mono); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot--good { background: var(--good-dot); }
.dot--bad { background: var(--bad-dot); }
.dot--pulse { box-shadow: 0 0 0 0 rgba(24, 163, 74, 0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24, 163, 74, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(24, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 163, 74, 0); } }
.needs-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1.5px var(--ink); vertical-align: middle; }

/* ---------- overview ---------- */

.strip {
  display: flex; flex-wrap: wrap; align-items: stretch; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden;
}
.strip__item { display: flex; align-items: center; gap: 11px; padding: 13px 18px; flex: 1 1 auto; border-right: 1px solid var(--line); min-width: 0; }
.strip__item:last-child { border-right: 0; }
.strip__item > i { font-size: 18px; color: var(--muted); }
.strip__item--mb { flex: 2 1 300px; }
.strip__mb { flex: 1; min-width: 0; }
.strip__k { font: 500 11.5px/1.3 var(--f-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip__v { font-weight: 600; font-size: 14px; white-space: nowrap; }
.strip__v .muted { font-weight: 400; }
.strip__meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.strip__meta > span { font: 500 11px var(--f-mono); color: var(--muted); white-space: nowrap; }
.meter { flex: 1; height: 4px; border-radius: 999px; background: var(--viz-track); overflow: hidden; max-width: 160px; min-width: 60px; }
.meter span { display: block; height: 100%; background: var(--cobalt); border-radius: inherit; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 15px 16px 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi__label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.kpi__value { margin-top: 8px; font: 620 27px/1.1 var(--f-text); letter-spacing: -0.02em; }
.kpi__sub { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.kpi--warn { border-color: color-mix(in srgb, var(--warn-dot) 60%, transparent); background: color-mix(in srgb, var(--warn-bg) 55%, var(--surface)); }
.kpi__flag { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font: 600 11px/1 var(--f-mono); }
.delta { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.delta b { font: 600 11.5px/1 var(--f-mono); }
.delta i { font-size: 12px; }
.delta--good i, .delta--good b { color: var(--good); }
.delta--bad i, .delta--bad b { color: var(--bad); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 10px; color: var(--text-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw--s1 { background: var(--viz-s1); }
.sw--pos { background: var(--viz-pos); }
.sw--other { background: var(--viz-other); }

.viz { position: relative; min-height: 290px; }
.viz svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--muted); font: 500 10.5px var(--f-mono); font-variant-numeric: tabular-nums; }
.viz-panel { fill: var(--text-2); font: 550 11.5px var(--f-text); }
.viz-s1 { fill: var(--viz-s1); }
.viz-pos { fill: var(--viz-pos); }
.viz-other { fill: var(--viz-other); }
.viz-col { transition: opacity 0.12s; }
.viz-col.is-dim { opacity: 0.32; }
.viz-hit { fill: transparent; cursor: crosshair; outline: none; }
.viz-hit:focus-visible { fill: rgba(28, 57, 255, 0.06); stroke: var(--focus); stroke-width: 1.5; }
.viz-tip {
  position: absolute; z-index: 4; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 10px;
  background: var(--ink); color: #f3f3ee; font-size: 12px; line-height: 1.55; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(4px); transition: opacity 0.1s, transform 0.1s;
}
.viz-tip.is-on { opacity: 1; transform: none; }
.viz-tip__date { font: 500 11px var(--f-mono); color: #a9abb5; margin-bottom: 3px; }
.viz-tip__row { display: flex; align-items: center; gap: 7px; }
.viz-tip__row b { font: 600 12.5px var(--f-mono); min-width: 22px; }
.viz-tip__row.muted { color: #a9abb5; margin-top: 3px; }
.viz-tip__row.muted b { min-width: 0; font-size: 11.5px; }
.key { width: 12px; height: 2.5px; border-radius: 2px; flex: none; }
.key--s1 { background: #b4b7c2; }
.key--pos { background: #6d82ff; }
.key--other { background: var(--sky); }

.card--hot { border-color: color-mix(in srgb, var(--acid) 70%, var(--line)); box-shadow: inset 0 3px 0 var(--acid), var(--shadow); }
.hot { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hot li + li { border-top: 1px solid var(--line); }
.hot__item { display: grid; gap: 4px; padding: 11px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); }
.hot__item:hover { background: var(--surface-2); text-decoration: none; }
.hot__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hot__top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot__sum { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.hot__time { color: var(--muted); font: 500 11.5px var(--f-mono); }

.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.funnel__row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 48px 48px; align-items: center; gap: 10px; }
.funnel__name { color: var(--text-2); font-weight: 500; font-size: 13px; }
.funnel__bar { height: 18px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.funnel__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--viz-other); }
.funnel__fill--late { background: var(--viz-pos); }
.funnel__num { font: 600 13px var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.funnel__rate { font: 500 11.5px var(--f-mono); color: var(--muted); text-align: right; }

.cap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 200px; }
.cap__day { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; outline: none; border-radius: 8px; }
.cap__area { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-height: 0; padding-bottom: 0; }
.cap__day:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cap__val { font: 600 12.5px var(--f-mono); text-align: center; line-height: 1.25; }
.cap__val span { color: var(--muted); font-weight: 500; }
.cap__track { position: relative; width: min(30px, 100%); min-height: 4px; max-height: calc(100% - 22px); background: var(--viz-track); border-radius: 4px 4px 0 0; flex: none; display: flex; align-items: flex-end; overflow: hidden; }
.cap__fill { width: 100%; background: var(--cobalt); border-radius: 4px 4px 0 0; }
.cap__day.is-off .cap__val { color: var(--muted); font-weight: 500; }
.cap__day.is-over .cap__fill { background: var(--warn-dot); }
.cap__over { display: block; font: 600 10.5px var(--f-mono); color: var(--warn); }
.cap__lbl { flex: none; color: var(--muted); font: 500 11.5px var(--f-mono); border-top: 1px solid var(--viz-base); width: 100%; text-align: center; padding-top: 6px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed__item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.feed__item:first-child { border-top: 0; padding-top: 2px; }
.feed__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.feed__icon--reply, .feed__icon--booked { background: var(--acid); color: var(--ink); }
.feed__icon--bounce, .feed__icon--error { background: var(--bad-bg); color: var(--bad); }
.feed__icon--inquiry { background: var(--navy); color: #fff; }
.feed__icon--click, .feed__icon--concept_view { background: var(--blue-bg); color: var(--blue); }
.feed__body { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.feed__body a { color: var(--text); font-weight: 600; }
.feed__time { color: var(--muted); font: 500 11.5px var(--f-mono); white-space: nowrap; }
.feed--tight .feed__item { padding: 6px 0; }
.link-strong { color: var(--text); font-weight: 600; }

.run__meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 500 12px var(--f-mono); }
.run__title { margin: 8px 0 8px; font: 700 19px/1.2 var(--f-display); font-stretch: 90%; letter-spacing: -0.005em; }
.prose { color: var(--text-2); font-size: 13.5px; }
.prose p { margin: 0 0 8px; }
.prose ul { margin: 0 0 8px; padding-left: 18px; }
.prose li { margin: 3px 0; }
.prose li::marker { color: var(--cobalt); }

/* ---------- needs you ---------- */

.ncards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.ncard {
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: inset 4px 0 0 var(--acid), var(--shadow); transition: opacity 0.2s, transform 0.2s;
}
.ncard--inquiry { box-shadow: inset 4px 0 0 var(--navy), var(--shadow); }
.ncard.is-leaving { opacity: 0; transform: scale(0.98); }
.ncard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ncard__kicker { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ncard__title { margin: 6px 0 2px; font: 700 20px/1.15 var(--f-display); font-stretch: 88%; }
.ncard__from { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.ncard__time { color: var(--muted); font: 500 11.5px var(--f-mono); white-space: nowrap; }
.ncard__summary { display: flex; gap: 9px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--sky-bg); color: var(--text); font-weight: 500; line-height: 1.45; }
.ncard__summary i { color: var(--cobalt); margin-top: 2px; }
.ncard__msg { margin: 0; color: var(--text-2); }
.ncard__body summary { cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.mail-body { white-space: pre-wrap; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.ncard__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* ---------- tables ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters--inline { margin-bottom: 16px; gap: 16px; }
.filter .select { width: auto; max-width: 190px; }
.filter--sort { margin-left: auto; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 33px; }
.filters .toggle { padding: 0 6px; font-size: 13px; }

.table-host { transition: opacity 0.15s; }
.is-busy { opacity: 0.55; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; margin: 0 -20px; background: transparent; }
.card .table-wrap .table th:first-child, .card .table-wrap .table td:first-child { padding-left: 20px; }
.card .table-wrap .table th:last-child, .card .table-wrap .table td:last-child { padding-right: 20px; }
.table-wrap--short { max-height: 280px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted);
  font: 500 11.5px/1.2 var(--f-mono); white-space: nowrap; border-bottom: 1px solid var(--line-2);
}
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table--dense th, .table--dense td { padding: 7px 10px; }
.table__group th { background: var(--surface-2); color: var(--text-2); font: 600 12px var(--f-text); padding-top: 8px; padding-bottom: 8px; }
.row-link { cursor: pointer; transition: background 0.1s; }
.row-link:hover, .row-link:focus-visible { background: var(--surface-2); outline: none; }
.row-link:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--cobalt); }
.cell-title { display: block; color: var(--text); font-weight: 600; }
a.cell-title:hover { color: var(--link); }
.cell-main { display: block; }
.cell-sub a, a.cell-sub { color: var(--link); }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; font-family: var(--f-text); font-weight: 400; overflow-wrap: anywhere; }
.cell-subject { max-width: 380px; }
.cell-msg { max-width: 340px; }
.cell-msg summary { cursor: pointer; color: var(--text-2); }
.cell-msg p { margin: 8px 0 0; }
.cell-err { color: var(--bad); font-size: 12.5px; max-width: 280px; }
.actions { text-align: right; white-space: nowrap; }
.fit { display: inline-flex; align-items: center; gap: 8px; }
.fit__bar { width: 44px; height: 4px; border-radius: 999px; background: var(--viz-track); overflow: hidden; }
.fit__bar span { display: block; height: 100%; background: var(--cobalt); }
.fit__n { min-width: 20px; text-align: right; }
.ratebar { display: inline-flex; align-items: center; gap: 10px; min-width: 140px; width: 100%; }
.ratebar__track { flex: 1; height: 8px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.ratebar__fill { display: block; height: 100%; background: var(--cobalt); border-radius: 0 4px 4px 0; }
.ratebar__val { font: 600 12px var(--f-mono); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pager__info { color: var(--text-2); font-size: 13px; }

.empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty > i { font-size: 26px; color: var(--muted); margin-bottom: 4px; }
.empty__title { margin: 0; color: var(--text); font-weight: 600; }
.empty__hint { margin: 0; font-size: 13px; max-width: 46ch; }

/* ---------- prospect detail ---------- */

.p-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; margin-bottom: 22px; }
.p-head__main { min-width: 0; flex: 1 1 420px; }
.p-head__chips { display: flex; gap: 8px; margin-bottom: 10px; }
.p-head .page-title { font-size: 38px; }
.p-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; color: var(--text-2); }
.p-meta li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.p-meta i { color: var(--muted); }
.p-stats { display: flex; gap: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.p-stats > div { padding: 12px 18px; border-right: 1px solid var(--line); }
.p-stats > div:last-child { border-right: 0; }
.p-stats dt { color: var(--muted); font: 500 11.5px var(--f-mono); }
.p-stats dd { margin: 4px 0 0; font-weight: 600; white-space: nowrap; }
.p-stats__big { font: 700 22px/1 var(--f-display) !important; font-stretch: 90%; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.p-col { min-width: 0; }
.p-col--side { position: sticky; top: 16px; }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.step { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 0 0 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--line-2); border-radius: 2px; }
.step:last-child::before { display: none; }
.step__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); font: 600 12.5px var(--f-mono); color: var(--text-2); }
.step--sent .step__n { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.step--scheduled .step__n { background: var(--sky-bg); color: var(--cobalt); border-color: var(--sky); }
.step--failed .step__n { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.step--cancelled .step__n { color: var(--muted); text-decoration: line-through; }
.step__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.step__subj { font-weight: 600; overflow-wrap: anywhere; }
.step--cancelled .step__subj { color: var(--muted); }
.step__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.step__meta span { display: inline-flex; align-items: center; gap: 4px; }
.step__err { margin-top: 6px; color: var(--bad); font-size: 12.5px; }
.step__act { display: flex; gap: 4px; align-items: flex-start; padding-top: 2px; }

.audit-head { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.score { display: flex; align-items: baseline; gap: 2px; padding: 8px 14px; border-radius: 12px; background: var(--surface-2); }
.score b { font: 750 34px/1 var(--f-display); font-stretch: 85%; }
.score span { color: var(--muted); font: 500 12px var(--f-mono); }
.score--bad b { color: var(--bad); }
.score--warn b { color: var(--warn); }
.score--good b { color: var(--good); }
.kv { margin: 0; display: grid; gap: 10px; }
.kv > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.kv--inline { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.kv--inline > div { display: block; }
.kv--inline dt { font: 500 11.5px var(--f-mono); }
.kv--inline dd { font-weight: 600; margin-top: 2px; }
.kv--small dd { font-size: 13px; }
.issues { list-style: none; margin: 0; padding: 0; }
.issue { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.issue__label { font-weight: 600; }
.issue__note { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.sev { justify-self: start; height: 22px; padding: 0 8px; border-radius: 999px; font: 600 11px/22px var(--f-mono); }
.sev--high { background: var(--bad-bg); color: var(--bad); }
.sev--medium { background: var(--warn-bg); color: var(--warn); }
.sev--low { background: var(--surface-3); color: var(--text-2); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 9px 0 9px 18px; border-top: 1px solid var(--line); position: relative; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 6px; height: 6px; border-radius: 2px; background: var(--cobalt); }
.src { margin-left: 4px; font: 500 11.5px var(--f-mono); padding: 1px 6px; border-radius: 6px; background: var(--blue-bg); color: var(--blue); white-space: nowrap; }
.src:hover { text-decoration: none; background: var(--sky); }
.save-state { margin: 0; min-height: 18px; color: var(--good); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.mini-inbox { display: grid; gap: 10px; }
.mini-mail { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.mini-mail summary { cursor: pointer; list-style: none; display: grid; gap: 6px; }
.mini-mail summary::-webkit-details-marker { display: none; }
.mini-mail__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.mini-mail__top .tag { margin-left: auto; }
.mini-mail__sum { font-size: 13px; font-weight: 500; }
.mini-mail .mail-body { background: var(--surface); }
.mini-mail__act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- insights ---------- */

.exps { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.exp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.exp__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exp__title { margin: 0; font: 650 15px/1.3 var(--f-text); }
.exp__hyp { margin: 6px 0 12px; color: var(--text-2); font-size: 13px; }
.exp .table-wrap { margin: 0 -20px; border: 0; box-shadow: none; border-radius: 0; background: transparent; }
.exp .table th:first-child, .exp .table td:first-child { padding-left: 20px; }
.exp .table th:last-child, .exp .table td:last-child { padding-right: 20px; }
.exp__result { display: flex; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--good-bg); color: var(--good); font-weight: 500; font-size: 13px; }
.exp__result i { margin-top: 3px; }
.log { list-style: none; margin: 0; padding: 0; }
.log__item { padding: 14px 0; border-top: 1px solid var(--line); }
.log__item:first-child { border-top: 0; padding-top: 0; }
.log__meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 500 11.5px var(--f-mono); }
.log__title { margin: 8px 0 6px; font: 650 15px/1.35 var(--f-text); }
.log__item .chips { margin-top: 8px; }
.batches { list-style: none; margin: 0; padding: 0; }
.batch { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.batch:first-child { border-top: 0; padding-top: 0; }
.batch__top { display: flex; justify-content: space-between; gap: 10px; }
.batch__notes { margin: 0; color: var(--text-2); font-size: 13px; }

/* ---------- settings ---------- */

.kill {
  display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap;
  padding: 22px 26px; border-radius: var(--r-card); margin-bottom: 16px; color: #fff;
  background: var(--navy);
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(28, 57, 255, 0.9), transparent 60%);
}
.kill.is-off { background: #2b1416; background-image: radial-gradient(120% 140% at 100% 0%, rgba(217, 59, 59, 0.5), transparent 60%); }
.kill__title { margin: 0 0 6px; font: 780 28px/1 var(--f-display); font-stretch: 84%; display: flex; align-items: center; gap: 12px; }
.kill__title::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--good-dot); box-shadow: 0 0 0 4px rgba(24, 163, 74, 0.3); }
.kill.is-off .kill__title::before { background: var(--bad-dot); box-shadow: 0 0 0 4px rgba(217, 59, 59, 0.3); }
.kill__text { flex: 1 1 380px; }
.kill__text p { margin: 0; color: rgba(255, 255, 255, 0.82); max-width: 62ch; }
.kill__btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9); background: transparent; color: #fff; font: 700 16px/1 var(--f-text);
  transition: background 0.15s, color 0.15s;
}
.kill__btn:hover { background: #fff; color: var(--navy); }
.kill.is-off .kill__btn { background: var(--acid); border-color: var(--acid); color: var(--ink); }
.kill.is-off .kill__btn:hover { background: #c8f52a; }
.kill__btn:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
.mboxes { display: grid; gap: 12px; }
.mbox { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.mbox--off { border-style: dashed; }
.mbox > p { margin: 0 0 10px; }
.mbox__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mbox__email { display: flex; align-items: center; gap: 8px; font-weight: 650; overflow-wrap: anywhere; }
.mbox__state { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 13px; }
.mbox__err { display: flex; gap: 6px; margin: 6px 0 0; color: var(--bad); font-size: 12.5px; }
.mbox__fields { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 12px 18px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mbox__stat b { font: 600 15px var(--f-mono); }
.mbox__stat .field__label { display: block; margin-bottom: 6px; }
.settings-form { margin-top: 16px; }
.settings-form .card + .card { margin-top: 16px; }
.sup { list-style: none; margin: 16px 0 0; padding: 0; }
.sup__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.sup__val { display: flex; align-items: center; gap: 7px; font-weight: 550; min-width: 0; }
.sup__val span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup__val i { color: var(--muted); }
.sup__reason { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- pricing ---------- */

.calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.calc__in { min-width: 0; display: grid; gap: 16px; }
.pstep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px 20px; box-shadow: var(--shadow); min-width: 0; }
.pstep__title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 650 15px/1.3 var(--f-text); }
.pstep__n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color: var(--paper); font: 600 12px var(--f-mono); }
.pstep__opts { margin: 16px 0 10px; }
.pgroup { margin: 0; padding: 0; border: 0; min-width: 0; }
.pgroup + .pgroup { margin-top: 16px; }
.pgroup__title { margin: 0 0 8px; padding: 0; font: 500 11.5px var(--f-mono); color: var(--muted); }
.ptypes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ptype { position: relative; display: block; cursor: pointer; }
.ptype input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ptype__body {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ptype:hover .ptype__body { border-color: rgba(28, 57, 255, 0.45); }
.ptype input:checked + .ptype__body { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt), 0 6px 18px -8px rgba(28, 57, 255, 0.4); background: color-mix(in srgb, var(--sky-bg) 60%, var(--surface)); }
.ptype input:focus-visible + .ptype__body { outline: 2px solid var(--focus); outline-offset: 2px; }
.ptype__name { font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.ptype__desc { color: var(--text-2); font-size: 12.5px; line-height: 1.45; flex: 1; }
.ptype__meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font: 500 11.5px var(--f-mono); color: var(--text-2); padding-top: 8px; border-top: 1px solid var(--line); }
.ptype input:checked + .ptype__body .ptype__meta { color: var(--cobalt); }
.pmods-wrap { columns: 2 320px; column-gap: 24px; }
.pmods-wrap .pgroup { break-inside: avoid; margin: 0 0 16px; }
.pmods { list-style: none; margin: 0; padding: 0; }
.pmod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: 9px; }
.pmod:hover { background: var(--surface-2); }
.pmod.is-on { background: var(--sky-bg); }
.pmod__check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.pmod__check input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--cobalt); flex: none; }
.pmod__price { font: 500 11.5px var(--f-mono); color: var(--text-2); white-space: nowrap; text-align: right; }
.pmod.is-on .pmod__name { font-weight: 600; }
.stepper { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 2px; margin: 4px 0 2px 24px; justify-self: start; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.stepper__b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--text-2); }
.stepper__b:hover { background: var(--surface-3); }
.stepper__n { width: 36px; height: 26px; border: 0; background: transparent; text-align: center; font: 600 13px var(--f-mono); -moz-appearance: textfield; appearance: textfield; }
.stepper__n::-webkit-inner-spin-button, .stepper__n::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pmults { display: grid; gap: 14px; }
.pmult { margin: 0; padding: 0; border: 0; min-width: 0; }
.pmult__title { padding: 0; margin: 0 0 7px; font: 600 13px var(--f-text); }
.segctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 13px; }
.segctl__opt { position: relative; cursor: pointer; }
.segctl__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segctl__opt > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 100%; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; color: var(--text-2); transition: background 0.15s; }
.segctl__opt:hover > span { background: color-mix(in srgb, var(--surface) 50%, transparent); }
.segctl__opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(11, 12, 17, 0.14); font-weight: 600; }
.segctl__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.segctl__name { line-height: 1.3; }
.segctl__f { font: 500 11px var(--f-mono); color: var(--muted); white-space: nowrap; }
.segctl__opt input:checked + span .segctl__f { color: var(--cobalt); }

.calc__sum { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 18px; scrollbar-width: thin; scrollbar-color: rgba(188, 200, 255, 0.4) transparent; }
.sum {
  position: relative; overflow: hidden; padding: 22px 22px 20px; border-radius: 18px; color: #fff;
  background: var(--navy);
  background-image: radial-gradient(90% 60% at 100% 0%, rgba(28, 57, 255, 0.95), transparent 70%), radial-gradient(70% 50% at 0% 100%, rgba(28, 57, 255, 0.35), transparent 70%);
  box-shadow: var(--shadow-pop);
}
.sum__label { font: 500 12px var(--f-mono); color: var(--sky); }
.sum__rec { margin: 6px 0 14px; font: 860 60px/0.92 var(--f-display); font-stretch: 74%; letter-spacing: -0.02em; font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.sum__range { padding: 0 2px; }
.sum__track { position: relative; display: block; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(188, 200, 255, 0.3), rgba(188, 200, 255, 0.75)); }
.sum__pin { position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; transform: translateY(-50%); border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px var(--navy); transition: left 0.3s var(--ease); }
.sum__lh { display: flex; justify-content: space-between; margin: 10px 0 0; }
.sum__lh div:last-child { text-align: right; }
.sum__lh dt { font: 500 11.5px var(--f-mono); color: var(--sky); }
.sum__lh dd { margin: 2px 0 0; font: 600 16px var(--f-mono); font-variant-numeric: tabular-nums; }
.sum__facts { margin: 18px 0 0; display: grid; gap: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.sum__facts > div { display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.sum__facts dt { display: flex; align-items: center; gap: 6px; color: var(--sky); font-size: 12.5px; }
.sum__facts dd { margin: 0; font-weight: 600; font-size: 13.5px; }
.sum__per { color: var(--sky); font-weight: 400; }
.sum__actions { display: grid; gap: 8px; margin-top: 16px; }
.sum__actions .btn { height: 40px; font-size: 14px; }
.sum__break { margin-top: 16px; }
.sum__break summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #fff; }
.breakdown { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.breakdown th { font-weight: 400; text-align: left; padding: 6px 8px 6px 0; color: rgba(255, 255, 255, 0.85); vertical-align: top; }
.breakdown th .muted { color: var(--sky); }
.breakdown td { text-align: right; padding: 6px 0; font-family: var(--f-mono); font-size: 11.5px; white-space: nowrap; vertical-align: top; }
.breakdown tr { border-bottom: 1px dashed rgba(255, 255, 255, 0.12); }
.breakdown__sub th, .breakdown__sub td { font-weight: 650; color: #fff; }
.sum__note { margin: 10px 0 0; font-size: 12px; color: var(--sky); }
.sum__tips { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); }
.sum__tipsTitle { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--acid); }
.sum__tips ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: rgba(255, 255, 255, 0.86); }
.sum__tips li { margin: 4px 0; }
.sum :focus-visible { outline-color: var(--acid); }

.quotes { list-style: none; margin: 0; padding: 0; }
.quote { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.quote:first-child { border-top: 0; padding-top: 0; }
.quote__main, .quote__amt { display: grid; gap: 2px; min-width: 0; }
.quote__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote__amt { text-align: right; font: 600 14px var(--f-mono); }
.quote__amt .small { font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; }
.quote__act { display: flex; gap: 4px; }

.ratebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.hourly { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; padding-top: 0; }
.plain-list span { color: var(--text-2); }
.table--edit td, .table--edit th { padding-top: 8px; padding-bottom: 8px; }
.pair { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pair__sep { color: var(--muted); font-size: 12px; }

/* ---------- dialog, toasts, login ---------- */

.dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-2); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
.dialog--wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(11, 12, 17, 0.45); backdrop-filter: blur(3px); }
.dialog[open] { display: flex; flex-direction: column; animation: pop 0.18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.dialog__title { margin: 0; font: 650 15px/1.3 var(--f-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog__body { padding: 18px 20px; overflow: auto; }
.dialog--wide .dialog__body { padding: 0; background: #f6f6f3; }
.dialog__msg { margin: 0; color: var(--text-2); }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.preview-frame { display: block; width: 100%; height: min(70vh, 720px); border: 0; background: #fff; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: min(420px, calc(100vw - 40px)); padding: 11px 16px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-pop);
  animation: toastIn 0.22s var(--ease); transition: opacity 0.3s, transform 0.3s; pointer-events: auto;
}
.toast i { color: var(--acid); font-size: 16px; }
.toast--error { background: #3a0f12; }
.toast--error i { color: #ff8a80; }
.toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.login {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px;
  background: var(--navy);
  background-image: radial-gradient(70% 60% at 85% 10%, rgba(28, 57, 255, 0.95), transparent 70%), radial-gradient(60% 50% at 10% 100%, rgba(28, 57, 255, 0.45), transparent 70%);
}
.login__card {
  width: min(380px, 100%); display: grid; gap: 16px; padding: 30px 28px; border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
.login__title { margin: 6px 0 0; font: 820 40px/0.95 var(--f-display); font-stretch: 78%; letter-spacing: -0.015em; }
.login__sub { margin: -8px 0 4px; color: var(--muted); }
.login__err { margin: -4px 0 0; color: var(--bad); font-size: 13px; }
.login .btn { height: 42px; }

.is-mock .brand__name::after {
  content: "mock"; margin-left: 8px; padding: 2px 6px; border-radius: 6px; vertical-align: 2px;
  background: rgba(213, 255, 63, 0.16); color: var(--acid); font: 500 10px var(--f-mono); letter-spacing: 0;
}

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

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc { grid-template-columns: minmax(0, 1fr) 340px; }
  .sum__rec { font-size: 52px; }
}
.summini { display: none; }
@media (max-width: 1100px) {
  .hide-lg { display: none; }
  .grid--cols .col { display: contents; }
  .grid--cols .card--hot { order: -1; }
  .summini {
    position: fixed; left: 50%; bottom: 14px; z-index: 40; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
    padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--navy); color: #fff; box-shadow: var(--shadow-pop);
  }
  .summini b { font: 800 20px/1 var(--f-display); font-stretch: 80%; }
  .summini__k { font: 500 11px var(--f-mono); color: var(--sky); }
  .summini__r { font: 500 11.5px var(--f-mono); color: var(--sky); }
  .summini i { color: var(--acid); }
  .summini:focus-visible { outline: 3px solid var(--acid); outline-offset: 2px; }
  .summini.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
  .summini { transition: opacity 0.2s, transform 0.2s; }
  .calc { padding-bottom: 56px; }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
  .p-grid { grid-template-columns: minmax(0, 1fr); }
  .p-col--side { position: static; }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc__sum { position: static; order: -1; max-height: none; overflow: visible; }
  .ncards, .exps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --gut: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; padding: 10px 12px; }
  .side__top { padding: 0 4px; }
  .side .side__toggle { display: inline-flex; }
  .nav { display: none; padding: 12px 0 6px; }
  .side.is-open .nav { display: flex; max-height: calc(100vh - 60px); overflow-y: auto; }
  .side.is-open { box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4); }
  .main { padding-top: 20px; }
  .main.is-loading::before { left: 0; }
  .hide-md { display: none; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .strip__item { flex: 1 1 45%; border-bottom: 1px solid var(--line); }
  .mbox__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mbox__fields .toggle { grid-column: 1 / -1; }
  .filter--sort { margin-left: 0; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .hide-sm { display: none; }
  .page-title { font-size: 28px; }
  .p-head .page-title { font-size: 30px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi__value { font-size: 23px; }
  .kpi__flag { display: none; }
  .delta { font-size: 11px; flex-wrap: wrap; }
  .card { padding: 16px 16px 18px; }
  .card .table-wrap { margin: 0 -16px; }
  .card .table-wrap .table th:first-child, .card .table-wrap .table td:first-child { padding-left: 16px; }
  .card .table-wrap .table th:last-child, .card .table-wrap .table td:last-child { padding-right: 16px; }
  .strip__item { flex: 1 1 100%; border-right: 0; padding: 11px 14px; }
  .funnel__row { grid-template-columns: 74px minmax(0, 1fr) 40px 42px; gap: 8px; }
  .cap { gap: 6px; }
  .search { max-width: none; flex-basis: 100%; }
  .filter { flex: 1 1 45%; }
  .filter .select { max-width: none; width: 100%; }
  .filters .toggle { flex: 1 1 auto; }
  .p-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
  .table th, .table td { padding: 9px 10px; }
  .ncard { padding: 16px; }
  .ncard__actions .btn { flex: 1 1 auto; }
  .p-stats { width: 100%; flex-wrap: wrap; }
  .p-stats > div { flex: 1 1 45%; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .issue { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .step { grid-template-columns: 30px minmax(0, 1fr); }
  .step__act { grid-column: 2; }
  .kv > div { grid-template-columns: 100px minmax(0, 1fr); }
  .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .mbox__fields { grid-template-columns: minmax(0, 1fr); }
  .sup__row { grid-template-columns: minmax(0, 1fr) auto; }
  .sup__reason, .sup__date { display: none; }
  .kill { padding: 20px; }
  .kill__btn { width: 100%; justify-content: center; }
  .savebar { border-radius: 16px; flex-wrap: wrap; }
  .pmods-wrap { columns: 1; }
  .ptypes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ptype input:not(:checked) + .ptype__body .ptype__desc { display: none; }
  .ptype__body { padding: 11px 13px; }
  .segctl { grid-template-columns: minmax(0, 1fr); }
  .summini__k { display: none; }
  .sum__rec { font-size: 48px; }
  .quote { grid-template-columns: minmax(0, 1fr) auto; }
  .quote__act { grid-column: 1 / -1; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .exp .table-wrap { margin: 0 -16px; }
  .ratebar { min-width: 110px; }
  .pager { flex-wrap: wrap; }
}

@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) {
  .chip::before, .dot, .sw { forced-color-adjust: none; }
}
