:root {
  --bg: #0C1433;
  --surface: #131C45;
  --surface-2: #1A2556;
  --surface-3: #212E66;
  --line: #2A3670;
  --line-soft: #202B5E;
  --text: #E9EDFF;
  --muted: #9AA4D6;
  --faint: #6B76AE;
  --iris: #8C9BFF;
  --iris-strong: #6F80F7;
  --mint: #3BE3B0;
  --amber: #F0B252;
  --coral: #FF7184;
  /* chart series — validated for the dark surface */
  --s-pace: #7584F0;
  --s-plan: #17A47F;
  --s-target: #C07F2A;
  --s-actual: #C9D0F5;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.error { color: var(--coral); margin: 0; font-size: 14px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; margin: 0; }

/* ---------- Shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(19, 28, 69, .85), rgba(12, 20, 51, .85));
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark {
  display: block; width: 36px; height: 36px; border-radius: 10px; flex: none; object-fit: cover; background: #0E1120;
  box-shadow: 0 0 0 1px rgba(143, 155, 255, .28), 0 6px 22px -8px rgba(143, 155, 255, .55);
}
.brand-mark.big { width: 56px; height: 56px; border-radius: 15px; margin-bottom: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-weight: 600; font-size: 15px; }
.brand-text span { color: var(--muted); font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--iris); }
.nav a.active svg { color: var(--iris); }
.nav-group { position: relative; }
.nav-group > a { padding-right: 40px; }
.nav-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.nav-toggle:hover { background: var(--surface-3); color: var(--text); }
.nav-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-sub[hidden] { display: none; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 21px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav .nav-sub a { padding: 7px 10px; font-size: 13.5px; font-weight: 500; border-radius: 8px; color: var(--muted); }
.nav .nav-sub a:hover { color: var(--text); }
.nav .nav-sub a.on { color: var(--text); font-weight: 600; background: rgba(143, 155, 255, .12); }
.badge {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 12px; text-align: center;
  background: rgba(240, 178, 82, .16); color: var(--amber); font-weight: 700;
}
.palette-hint {
  margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px;
  background: transparent; border: 1px dashed var(--line); color: var(--faint); font: inherit; font-size: 13px; cursor: pointer;
}
.palette-hint span { margin-right: auto; }
kbd { font-family: var(--body); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.topbar h1 { font-size: 26px; }
.topbar p { margin: 4px 0 0; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.sync-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted);
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.sync-pill.ok .dot { background: var(--mint); }
.sync-pill.busy .dot { background: var(--iris); }
.sync-pill.warn .dot { background: var(--amber); }
.sync-pill.err .dot { background: var(--coral); }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #3A4890; }
.btn.primary { background: var(--iris-strong); border-color: var(--iris-strong); color: #fff; }
.btn.primary:hover { background: #7D8DFB; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--coral); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field small { font-weight: 500; color: var(--faint); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-weight: 500;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px rgba(140, 155, 255, .18); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field input { min-width: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(26, 37, 86, .72), rgba(19, 28, 69, .72));
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 20px; min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 18px; }

/* ---------- Command: goal hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0;
  border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden;
}
.hero-main { padding: 28px 32px; display: flex; flex-direction: column; min-width: 0; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.hero-figure { font-family: var(--display); font-size: clamp(36px, 4.4vw, 52px); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; margin: 18px 0 6px; }
.hero-sub { font-size: 14px; color: var(--muted); }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-eta { margin: auto 0 0; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 14px; line-height: 1.6; color: var(--muted); }
.hero-main .track { margin-bottom: 22px; }
.hero-eta strong { color: var(--text); font-weight: 600; }

.verdict { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.verdict svg { width: 14px; height: 14px; stroke-width: 2; }
.verdict.good { color: var(--mint); background: rgba(59, 227, 176, .1); }
.verdict.warn { color: var(--amber); background: rgba(240, 178, 82, .1); }
.verdict.bad { color: var(--coral); background: rgba(255, 113, 132, .1); }
.verdict.neutral { color: var(--muted); background: var(--surface-3); }

.track { margin-top: 24px; }
.track-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); }
.track-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--iris-strong); }
.track-marker { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--amber); border-radius: 1px; }
.track-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.track-legend .tick { display: inline-block; width: 2px; height: 10px; background: var(--amber); border-radius: 1px; margin-right: 7px; vertical-align: -1px; }

.hero-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-left: 1px solid var(--line-soft); }
.stat { background: var(--surface); padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat dt { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stat dd { margin: 4px 0 0; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12.5px; color: var(--faint); }
.delta { font-weight: 600; }
.delta.up { color: var(--mint); }
.delta.down { color: var(--coral); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(19, 28, 69, .7); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi strong { display: block; font-family: var(--display); font-weight: 600; font-size: 23px; letter-spacing: -0.02em; margin: 8px 0 2px; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--faint); }

.cols-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--s-target) 0 4px, transparent 4px 7px) !important; }

/* leaderboard */
.leader { display: flex; flex-direction: column; gap: 12px; }
.leader-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--bg); background: var(--iris); }
.leader-name { font-weight: 600; font-size: 14px; }
.leader-bar { height: 5px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.leader-bar b { display: block; height: 100%; border-radius: 99px; background: var(--iris-strong); }
.leader-val { text-align: right; font-weight: 700; font-size: 14px; }
.leader-val small { display: block; color: var(--faint); font-weight: 500; font-size: 12px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 11px 12px; background: rgba(12, 20, 51, .6); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(33, 46, 102, .35); }
td.num, th.num { text-align: right; white-space: nowrap; }
td select, td input { padding: 6px 30px 6px 9px; font-size: 13.5px; min-width: 140px; }
td input { padding-right: 9px; }
td input[type="checkbox"], th input[type="checkbox"] { min-width: 0; width: 16px; padding: 0; vertical-align: middle; }
td label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.amount { font-weight: 700; }
.sub { display: block; font-size: 12px; color: var(--faint); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); text-transform: capitalize; }
.tag.manual { background: rgba(240, 178, 82, .12); color: var(--amber); }
.tag.refund { background: rgba(255, 113, 132, .12); color: var(--coral); }
.unassigned select { border-color: rgba(240, 178, 82, .55); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: rgba(111, 128, 247, .14); border: 1px solid rgba(140, 155, 255, .35); font-size: 14px; }
.bulkbar select { width: auto; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--iris-strong); padding: 0; }

/* ---------- Closers ---------- */
.closer-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.closer-row { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) 210px; align-items: center; gap: 24px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.closer-row:last-child { border-bottom: 0; }
.closer-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.closer-person .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; flex: none; }
.closer-id { min-width: 0; }
.closer-id h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.closer-id p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.closer-target { margin-top: 8px; font-size: 12px; color: var(--faint); }
.closer-target .leader-bar { margin: 0 0 4px; width: 140px; }
.closer-stats { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.closer-stats div { padding: 0 16px; border-left: 1px solid var(--line-soft); min-width: 0; }
.closer-stats div:first-child { border-left: 0; padding-left: 0; }
.closer-stats dt { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.closer-stats dd { margin: 4px 0 0; font-size: 17px; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.closer-stats .owed dd { color: var(--amber); }
.closer-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.inactive { opacity: .55; }

/* ---------- Forecast ---------- */
.forecast-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.levers { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.lever-group h3 { font-size: 13px; color: var(--muted); font-family: var(--body); font-weight: 700; margin-bottom: 10px; }
.lever { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lever-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 600; }
.lever-top output { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--text); }
.lever small { color: var(--faint); font-size: 12px; }
input[type="range"] { -webkit-appearance: none; appearance: none; padding: 0; height: 6px; border: 0; border-radius: 99px; background: linear-gradient(90deg, var(--iris-strong) var(--p, 0%), var(--surface-3) var(--p, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--iris-strong); cursor: pointer; box-shadow: 0 0 0 4px rgba(111, 128, 247, .2); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--iris-strong); cursor: pointer; }
.result-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.result { padding: 18px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(19, 28, 69, .78); }
.result.plan { border-color: rgba(23, 164, 127, .55); background: linear-gradient(180deg, rgba(23, 164, 127, .12), rgba(19, 28, 69, .78)); }
.result span { font-size: 13px; color: var(--muted); font-weight: 600; }
.result strong { display: block; font-family: var(--display); font-weight: 600; font-size: 22px; margin: 8px 0 4px; letter-spacing: -0.02em; }
.result p { margin: 0; font-size: 13px; color: var(--muted); }
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.move { padding: 16px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(12, 20, 51, .5); display: flex; flex-direction: column; gap: 6px; }
.move-rank { font-size: 12px; color: var(--faint); font-weight: 700; }
.move h3 { font-size: 14px; font-family: var(--body); font-weight: 700; }
.move strong { font-family: var(--display); font-weight: 600; font-size: 18px; }
.move p { margin: 0; font-size: 13px; color: var(--muted); }
.move button { align-self: flex-start; margin-top: 6px; }
.need-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.need { padding: 14px; border-radius: 12px; background: rgba(12, 20, 51, .5); border: 1px solid var(--line-soft); }
.need span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.need strong { display: block; font-size: 18px; font-family: var(--display); font-weight: 600; margin-top: 5px; }
.need em { font-style: normal; font-size: 12px; color: var(--faint); }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps code, .code { background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); font-size: 13px; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.status-line.ok { background: rgba(59, 227, 176, .08); color: var(--mint); border: 1px solid rgba(59, 227, 176, .3); }
.status-line.off { background: rgba(240, 178, 82, .08); color: var(--amber); border: 1px solid rgba(240, 178, 82, .3); }

/* ---------- Modal / palette / toasts ---------- */
.modal, .palette { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 10, 30, .7); }
.modal-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.modal-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-card h2 { font-size: 18px; }
.palette { place-items: start center; padding-top: 14vh; }
.palette-card { position: relative; width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.palette-card input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; background: transparent; }
.palette-card input:focus { box-shadow: none; }
.palette-card ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.palette-card li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.palette-card li small { color: var(--faint); }
.palette-card li.on { background: var(--surface-3); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); max-width: 360px; }
.toast.err { border-color: rgba(255, 113, 132, .5); }
.toast.ok { border-color: rgba(59, 227, 176, .45); }

.lock { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.lock-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 30px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.lock-card h1 { font-size: 22px; }
.lock-card p { margin: 0; }



/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tabs button.on { background: var(--surface-3); color: var(--text); }
.home-tabs { display: none; }
.home-tabs a { flex: 1; text-align: center; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 8px 4px; border-radius: 9px; }
.home-tabs a.on { background: var(--surface-3); color: var(--text); }
.tabs .count { min-width: 20px; padding: 0 6px; border-radius: 99px; font-size: 11.5px; line-height: 18px; text-align: center; background: rgba(240, 178, 82, .16); color: var(--amber); }

/* ---------- Team payouts ---------- */
.sig-badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.sig-badge.good { background: rgba(59, 227, 176, .12); color: var(--mint); }
.sig-badge.warn { background: rgba(240, 178, 82, .12); color: var(--amber); }
.row-actions { display: inline-flex; align-items: center; gap: 2px; }
.row-actions .btn { margin-right: 4px; }
.work-cell { max-width: 280px; min-width: 160px; }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.voucher-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft); margin-bottom: 16px; }
.voucher-summary span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.voucher-summary strong { display: block; font-size: 16px; margin-top: 2px; }
.voucher-summary em { display: block; font-style: normal; font-size: 12.5px; color: var(--faint); }
.voucher-summary p { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--muted); }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sign-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sign-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.sign-head .faint { font-size: 12px; }
.pad { position: relative; height: 170px; border-radius: 12px; background: #fff; border: 1px dashed #9AA4D6; overflow: hidden; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.pad-hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 12.5px; color: #8A93BD; pointer-events: none; }
.pad::before { content: ""; position: absolute; left: 16px; right: 16px; bottom: 38px; border-bottom: 1px solid #E1E5F5; pointer-events: none; }
.pad.inked .pad-hint { display: none; }
.pad-tools { display: flex; justify-content: flex-end; margin-top: -4px; }
.sig-done { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 12px; background: #fff; color: #11183A; }
.sig-done img { max-width: 100%; height: 90px; object-fit: contain; }
.sig-done span { font-size: 13px; font-weight: 600; border-top: 1px solid #E1E5F5; padding-top: 6px; align-self: stretch; }
.sign-block .btn.ghost { align-self: flex-start; }
.modal-card:has(.sign-grid) { width: min(760px, 100%); }

/* ---------- Revenue dashboard ---------- */
.widgets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.widget { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }
.w-s { grid-column: span 1; }
.w-m { grid-column: span 2; }
.w-l { grid-column: span 4; }
.widget-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.widget-head h2 { font-size: 14px; }
.w-s .widget-head h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.widget-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.widget-tools { display: flex; gap: 2px; margin: -6px -8px 0 0; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.widgets.editing .widget { border-style: dashed; border-color: var(--line); }
.w-figure { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.w-figure.neg { color: var(--coral); }
.widget-body em { display: block; font-style: normal; font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.w-legend { margin: -4px 0 10px; }
.w-empty { padding: 20px 0; text-align: center; font-size: 13.5px; color: var(--faint); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.hbar-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-top b { font-weight: 600; white-space: nowrap; }
.hbar-track { height: 6px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; background: var(--iris-strong); }
.hbar small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.mini-table { width: 100%; font-size: 13.5px; }
.mini-table th { background: transparent; padding: 6px 0; }
.mini-table td { padding: 8px 0; }
.mini-table td.num, .mini-table th.num { padding-left: 12px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.activity li:last-child { border-bottom: 0; }
.activity b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity small { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity div { min-width: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; }
.act-dot.in { background: var(--mint); }
.act-dot.out { background: var(--amber); }
.activity strong { font-size: 13.5px; white-space: nowrap; }
.activity strong.in { color: var(--mint); }
.activity strong.out { color: var(--text); }
.add-widgets .panel-head { margin-bottom: 10px; }
.widget-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--iris); }
.chip svg { width: 14px; height: 14px; }


/* ---------- Signing link (in app) ---------- */
.link-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.link-panel strong { font-size: 14px; }
.link-panel p { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 52ch; }
.link-panel.has-link { flex-direction: column; align-items: stretch; }
.link-row { display: flex; gap: 8px; }
.link-row input { font-size: 13px; color: var(--muted); }
.link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.wa { color: #4ADE80; }
.btn.small.danger { margin-left: auto; }

/* ---------- Public sign page ---------- */
.sign-page { min-height: 100vh; }
.sign-wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.sign-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.sign-head-top { display: flex; align-items: center; gap: 12px; }
.sign-head-top strong { display: block; font-size: 16px; }
.sign-head-top .brand-mark { width: 40px; height: 40px; }
.sign-head-top div span { display: block; font-size: 13px; color: var(--muted); }
.sign-amount { padding: 16px 18px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line-soft); }
.sign-amount span { font-size: 13px; color: var(--muted); }
.sign-amount strong { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 2px; }
.sign-amount em { font-style: normal; font-size: 13px; color: var(--faint); }
.sign-details { margin: 0; display: flex; flex-direction: column; }
.sign-details div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sign-details div:last-child { border-bottom: 0; }
.sign-details dt { font-size: 13px; color: var(--muted); }
.sign-details dd { margin: 0; font-size: 14px; }
.sign-form { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 18px; }
.sign-form h2 { font-size: 16px; }
.confirm { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.confirm input { margin-top: 1px; flex: none; width: 20px; height: 20px; }
.confirm b { color: var(--text); }
.fine { margin: 0; font-size: 12.5px; text-align: center; }
.sign-msg h1, .sign-success h1 { font-size: 20px; }
.sign-msg p { margin: 0; }
.sign-success { display: flex; gap: 14px; align-items: center; }
.sign-success p { margin: 2px 0 0; font-size: 14px; }
.tick { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(59, 227, 176, .12); color: var(--mint); flex: none; }
.tick svg { width: 22px; height: 22px; stroke-width: 2.4; }
.sign-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sign-actions .btn { flex: 1; }
@media (max-width: 480px) {
  .sign-card { padding: 18px; border-radius: 16px; }
  .sign-details div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Goals & countdowns ---------- */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.goal-grid.full { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.goal-card {
  --g: var(--iris);
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 20px; min-width: 0; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--line-soft);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--g) 14%, transparent), transparent 60%), var(--surface);
}
.goal-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--g); opacity: .85; }
.goal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.goal-title { display: flex; gap: 10px; min-width: 0; }
.goal-title h3 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.goal-head .verdict { flex: none; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--g); flex: none; margin-top: 6px; box-shadow: 0 0 12px color-mix(in srgb, var(--g) 60%, transparent); }
.goal-body { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 92px; height: 92px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fg { stroke: var(--g); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring b { position: relative; font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.ring small { position: relative; display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.goal-cd { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.goal-cd-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cd-off { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--faint); font-size: 13px; }
.cd-off b { color: var(--muted); font-weight: 600; }

.cd { display: flex; gap: 8px; flex-wrap: wrap; }
.cd.blocks .cd-unit {
  display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 8px 6px; border-radius: 12px;
  background: rgba(12, 20, 51, .75); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.cd.blocks b { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cd.blocks small { font-size: 10.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.cd.inline { gap: 6px; align-items: baseline; }
.cd.inline .cd-unit { display: inline-flex; align-items: baseline; gap: 1px; }
.cd.inline b { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.cd.inline small { font-size: 12px; color: var(--muted); font-weight: 600; }
.cd.urgent b { color: var(--amber); }
.cd.blocks.urgent .cd-unit { border-color: rgba(240, 178, 82, .5); }
.cd.over b { color: var(--coral); }

.goal-track { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); }
.goal-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--g) 65%, transparent), var(--g)); }
.goal-mark { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--amber); border-radius: 1px; }
.goal-stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.goal-stats div { min-width: 0; }
.goal-stats dt { font-size: 11.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.goal-stats dd { margin: 2px 0 0; font-family: var(--display); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-eta { margin: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.goal-eta strong { color: var(--text); }
.goal-chart { height: 200px; }
.goal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.goal-cta {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg);
  border: 1px dashed var(--line); color: var(--muted); text-decoration: none; font-size: 14px;
}
.goal-cta:hover { border-color: var(--iris); color: var(--text); }
.goal-cta svg { color: var(--iris); }
.goal-cta b { color: var(--text); }
.note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--amber); background: rgba(240, 178, 82, .08); border: 1px solid rgba(240, 178, 82, .3); }
.kpi.accent { border-color: rgba(59, 227, 176, .35); background: linear-gradient(180deg, rgba(59, 227, 176, .08), rgba(19, 28, 69, .7)); }

/* top-bar countdown chip */
.cd-chip {
  --g: var(--iris);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--g) 45%, var(--line)); background: color-mix(in srgb, var(--g) 10%, var(--surface));
  font-size: 13px; max-width: 100%;
}
.cd-chip .swatch { margin: 0; width: 8px; height: 8px; border-radius: 50%; }
.cd-chip-name { color: var(--muted); font-weight: 600; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-chip .cd.inline b { font-size: 13.5px; }
.cd-chip .cd.inline small { font-size: 11px; }

/* settings: goal list + switches */
.settings-grid .span-all { grid-column: 1 / -1; }
.goal-list { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.goal-row { --g: var(--iris); display: grid; grid-template-columns: 10px minmax(180px, 1.3fr) minmax(140px, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(12, 20, 51, .35); }
.goal-row:last-child { border-bottom: 0; }
.goal-row .swatch { margin: 0; }
.goal-row-main { min-width: 0; display: flex; flex-direction: column; }
.goal-row-main b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-row-main small { font-size: 12.5px; color: var(--muted); }
.goal-row-main small.faint { color: var(--faint); }
.goal-row-progress small { display: block; font-size: 12px; color: var(--faint); margin-top: 5px; }
.goal-row-progress .leader-bar { margin: 0; }
.goal-row-toggles { display: flex; gap: 14px; flex-wrap: wrap; }
.switch-mini { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--iris-strong); border-color: var(--iris-strong); }
.switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--iris); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-row b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.switch-row small { display: block; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.switch-list { display: flex; flex-direction: column; gap: 12px; }

.money-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; }
.cur-tag { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--mint); background: rgba(59, 227, 176, .12); vertical-align: 1px; }

/* goal modal */
.modal-card:has(#goalForm) { width: min(620px, 100%); }
.deadline-row { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.quick-dates .chip { padding: 5px 10px; font-size: 12.5px; }
.cd-settings { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; background: rgba(12, 20, 51, .35); min-width: 0; }
.cd-settings legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.unit-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; }
.chip-check input:checked + span { border-color: var(--iris); background: rgba(111, 128, 247, .18); color: var(--text); }
.chip-check input:checked + span::before { content: "✓"; color: var(--iris); }
.chip-check input:focus-visible + span { outline: 2px solid var(--iris); outline-offset: 2px; }
.seg + input[type="hidden"] { display: none; }
.cd-settings .seg { align-self: flex-start; }
.cd-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line); font-size: 12px; }
.cd-preview.off { opacity: .7; }
.swatches { display: flex; gap: 10px; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches i { display: block; width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.swatches input:checked + i { border-color: #fff; }
.swatches input:focus-visible + i { outline: 2px solid var(--iris); outline-offset: 2px; }

/* daily heatmap */
.heatmap { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.hm-months { display: grid; grid-template-columns: repeat(var(--w), minmax(12px, 1fr)); gap: 4px; margin-left: 34px; font-size: 11px; color: var(--faint); }
.hm-body { display: flex; gap: 6px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; width: 28px; font-size: 10.5px; color: var(--faint); }
.hm-days span { line-height: 1; align-self: center; }
.hm-grid { flex: 1; display: grid; grid-template-rows: repeat(7, minmax(12px, 1fr)); grid-template-columns: repeat(var(--w), minmax(12px, 1fr)); grid-auto-flow: column; gap: 4px; min-width: calc(var(--w) * 16px); }
.hm-cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); min-width: 10px; }
.hm-cell.l1 { background: rgba(59, 227, 176, .25); }
.hm-cell.l2 { background: rgba(59, 227, 176, .45); }
.hm-cell.l3 { background: rgba(59, 227, 176, .7); }
.hm-cell.l4 { background: var(--mint); }
.hm-cell.future { background: transparent; }
.hm-cell.today { outline: 1.5px solid var(--text); outline-offset: 1px; }
.hm-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--faint); }
.hm-scale { display: inline-flex; align-items: center; gap: 4px; }
.hm-scale .hm-cell { width: 11px; min-width: 11px; }

.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { .ring .ring-fg { transition: none; } }

/* ---------- Home tools ---------- */
.home-tools { display: flex; justify-content: flex-end; margin-bottom: -6px; }
.cols-2.one { grid-template-columns: minmax(0, 1fr); }
.home-groups { display: grid; gap: 14px; }

/* ---------- Total balance ---------- */
.bal-card {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: linear-gradient(135deg, #1B2760 0%, var(--surface) 60%);
}
.bal-card.solo { grid-template-columns: minmax(0, 1fr); }
.bal-main { padding: 22px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.bal-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bal-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(140, 155, 255, .14); font-size: 13.5px; font-weight: 600; }
.bal-chip svg { width: 16px; height: 16px; color: var(--iris); }
.bal-select { width: auto; min-width: 136px; padding: 7px 30px 7px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; background-color: var(--bg); cursor: pointer; }
.bal-range { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 380px; }
.bal-figure { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.bal-figure strong { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.bal-figure strong.neg { color: var(--coral); }
.bal-trend { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(140, 155, 255, .12); color: var(--muted); }
.bal-trend svg { width: 14px; height: 14px; }
.bal-trend.up { color: var(--mint); background: rgba(59, 227, 176, .12); }
.bal-trend.down { color: var(--coral); background: rgba(255, 113, 132, .12); }
.bal-tiles { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 4px; }
.bal-tile { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(12, 20, 51, .5); border: 1px solid var(--line-soft); min-width: 0; }
.bal-tile > div { min-width: 0; }
.bal-tile span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bal-tile strong { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.bal-tile em, .bal-next-cell em { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--faint); margin-top: 2px; }
.bal-tile em span, .bal-next-cell em span { display: inline; font-size: inherit; font-weight: 500; color: var(--faint); }
.bal-tile small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
/* ---------- Team members ---------- */
.nav-group[hidden], .nav a[hidden], .nav-toggle[hidden] { display: none; }
.member-list { display: grid; gap: 10px; }
.member-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface-2); }
.member-row.paused { opacity: .65; }
.member-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.member-main small { color: var(--muted); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.access-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.access-list { display: grid; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.access-row:first-child { border-top: 0; }
.access-row b { display: block; color: var(--text); font-size: 14px; font-weight: 600; }
.access-row small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.access-seg { flex: none; display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.access-seg label { position: relative; cursor: pointer; }
.access-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.access-seg span { display: block; min-width: 42px; padding: 5px 9px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; }
.access-seg input:checked + span { background: var(--surface-3); color: var(--text); }
.access-seg input:focus-visible + span { outline: 2px solid var(--iris); outline-offset: 1px; }
.member-code { padding: 14px; border-radius: 12px; border: 1px dashed var(--iris); background: var(--bg); text-align: center; }
.member-code code { font-size: 19px; font-weight: 600; letter-spacing: .03em; color: var(--text); user-select: all; overflow-wrap: anywhere; }

/* What a person can't change is taken off the screen; the server refuses it anyway. */
.member :is([data-action="customize-home"], [data-action="add-fin-widget"], [data-action="rev-edit"], [data-edit-fin]),
.ro-payments :is(#syncBtn, #syncPill, #addPaymentBtn, [data-action="bulk-assign"], [data-action="bulk-paid"], [data-action="bulk-clear"], [data-action="select-page"], [data-select], [data-delete-manual]),
.ro-payouts :is([data-action="add-payout"], [data-edit-payout], [data-delete-payout], [data-sign-payout]),
.ro-expenses :is([data-action="add-expense"], [data-edit-expense], [data-delete-expense]),
.ro-pipeline :is(button[data-add-deal], button[data-edit-deal]),
.ro-closers :is([data-action="add-closer"], [data-edit-closer], [data-delete-closer]),
.ro-goals :is([data-action="add-goal"], [data-edit-goal], [data-goal-quick], [data-delete-goal]) { display: none !important; }
.ro-payments :is([data-assign], [data-client], [data-paid]) { pointer-events: none; opacity: .6; }
.ro-pipeline .pipe-card { cursor: default; }

/* ---------- Pipeline ---------- */
.pipe-stats { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.pipe-stat { display: flex; align-items: center; gap: 12px; }
.pipe-stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--iris); }
.pipe-stat-icon svg, .pipe-add svg, .pipe-more svg, .pipe-outcome span svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pipe-stat strong { display: block; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.2; }
.pipe-stat small { color: var(--muted); font-size: 12.5px; }
.pipe-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.pipe-tools input { flex: 0 1 220px; min-width: 150px; }
.pipe-people { display: flex; flex-wrap: wrap; gap: 6px; }
.pipe-people button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pipe-people button:first-child { padding-left: 11px; }
.pipe-people button.on { background: var(--surface-3); border-color: var(--iris); color: var(--text); }
.pipe-people .avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; }
.pipe-tools-end { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.pipe-board { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)) 118px; gap: 12px; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.pipe-proposal { --deal: 124, 158, 66; }
.pipe-negotiation { --deal: 176, 96, 72; }
.pipe-closing { --deal: 110, 130, 168; }
.pipe-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .025); transition: border-color .12s, background .12s; }
.pipe-col header { display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: 4px 8px; padding: 2px 2px 0 4px; }
.pipe-col h3 { margin: 0; font-size: 14px; font-weight: 600; }
.pipe-col header p { grid-column: 2 / -1; margin: 0; color: var(--muted); font-size: 12.5px; }
.pipe-dot { width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--deal)); box-shadow: 0 0 0 3px rgba(var(--deal), .25); }
.pipe-count { padding: 0 7px; border-radius: 99px; font-size: 11.5px; line-height: 18px; background: var(--surface-3); color: var(--muted); }
.pipe-add { justify-self: end; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.pipe-add:hover { background: var(--surface-3); color: var(--text); }
.pipe-list { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 110px; }
.pipe-hint { margin: 0; padding: 18px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--faint); font-size: 13px; text-align: center; }
.pipe-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(var(--deal), .55); background: linear-gradient(155deg, rgba(var(--deal), .46), rgba(var(--deal), .24)); cursor: grab; transition: transform .12s, box-shadow .12s; }
.pipe-card:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .8); }
.pipe-card:active { cursor: grabbing; }
.pipe-dragging { opacity: .45; }
.pipe-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: rgba(255, 255, 255, .78); font-size: 12px; }
.pipe-more { display: grid; place-items: center; width: 26px; height: 26px; margin: -3px -5px -3px 0; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #fff; cursor: pointer; }
.pipe-more:hover { background: rgba(255, 255, 255, .14); }
.pipe-card strong { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.pipe-title { color: rgba(255, 255, 255, .78); font-size: 12.5px; overflow-wrap: anywhere; }
.pipe-note { margin: 5px 0 0; color: rgba(255, 255, 255, .85); font-size: 12.5px; }
.pipe-note b, .pipe-paid b { color: #fff; font-weight: 600; }
.pipe-paid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 6px; }
.pipe-paid i { display: block; height: 5px; margin-bottom: 4px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.pipe-paid i b { display: block; height: 100%; border-radius: 99px; background: var(--mint); }
.pipe-paid p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 12.5px; }
.pipe-paid .pipe-late { color: #FFC2B5; font-weight: 600; }
.pipe-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-top: 6px; }
.pipe-card-foot b { font-size: 15px; font-weight: 600; }
.pipe-side { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; min-height: 280px; }
.pipe-outcome { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 12px 8px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .025); color: var(--text); font: inherit; cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.pipe-outcome:hover { background: var(--surface-2); }
.pipe-outcome span { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; background: var(--surface-3); color: var(--muted); }
.pipe-outcome.won span { background: rgba(59, 227, 176, .16); color: var(--mint); }
.pipe-outcome b { font-size: 14px; font-weight: 600; }
.pipe-outcome small { color: var(--muted); font-size: 12px; }
.pipe-over { border-color: var(--iris); background: rgba(140, 155, 255, .1); }
.pipe-form-hint { margin: -4px 0 0; font-size: 13px; }
.form-grid [hidden] { display: none; }
.exp-table td:first-child { white-space: nowrap; }
@media (max-width: 760px) {
  .exp-table .exp-via { display: none; }
  .exp-table th, .exp-table td { padding-left: 8px; padding-right: 8px; }
}
.bal-add { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--iris); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bal-add:hover { color: var(--text); }
.bal-add svg { width: 13px; height: 13px; }
.bal-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); }
.bal-icon svg { width: 16px; height: 16px; }
.bal-icon.in { color: var(--mint); }
.bal-icon.out { color: var(--amber); }
.bal-next { padding: 22px 24px; border-left: 1px solid var(--line-soft); background: rgba(12, 20, 51, .35); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bal-next-head b { display: block; font-size: 14px; font-weight: 600; }
.bal-next-head small { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.bal-next-cells { display: grid; gap: 12px; }
.bal-next-cell { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.bal-next-cell:last-child { border-bottom: 0; padding-bottom: 0; }
.bal-next-cell > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.bal-next-cell strong { font-family: var(--display); font-size: 17px; font-weight: 600; }
.bal-next-cell em { margin: 0; text-align: right; }
.bal-tile em.up, .bal-next-cell em.up { color: var(--mint); }
.bal-tile em.down, .bal-next-cell em.down { color: var(--coral); }

/* ---------- Deadline card ---------- */
.goal-body { flex-wrap: wrap; }
.dl-card {
  position: relative; flex: 1 1 250px; min-width: 0; padding: 16px 18px; border-radius: 16px; color: #fff; overflow: hidden;
  background:
    radial-gradient(70% 110% at 100% 0, color-mix(in srgb, var(--g, #8C9BFF) 55%, transparent) 0, transparent 70%),
    linear-gradient(140deg, #2B4DF0 0%, #1733BE 48%, #0A1763 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.dl-card.urgent { background: radial-gradient(70% 110% at 100% 0, rgba(255, 194, 122, .5) 0, transparent 70%), linear-gradient(140deg, #E8703A 0%, #B8341F 55%, #5C1420 100%); }
.dl-card.over { background: linear-gradient(140deg, #3A4375, #1A2149); }
.dl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.dl-chip svg { width: 14px; height: 14px; }
.dl-side { font-size: 12.5px; color: rgba(255, 255, 255, .85); font-weight: 500; }
.dl-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin-top: 12px; padding-right: 40px; font-family: var(--display); }
.dl-figure > b { font-size: clamp(34px, 3.4vw, 42px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; }
.dl-figure > span[data-ul] { font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; }
.dl-rest { display: inline-flex; gap: 8px; margin-left: 4px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.dl-rest i { font-style: normal; }
.dl-rest b { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.dl-sub { margin: 4px 0 0; padding-right: 40px; font-size: 13px; color: rgba(255, 255, 255, .85); }
.dl-go { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer; text-decoration: none; }
.dl-go:hover { background: rgba(255, 255, 255, .3); }
.dl-go svg { width: 16px; height: 16px; }
.cd-preview .dl-card { width: 100%; flex: none; }

/* ---------- Sales report ---------- */
.sr { display: flex; flex-direction: column; gap: 16px; }
.sr-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.sr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sr-stat { min-width: 0; }
.sr-stat > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sr-stat-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 2px 0; }
.sr-stat-row strong { font-family: var(--display); font-size: clamp(20px, 2.1vw, 26px); font-weight: 600; letter-spacing: -0.02em; }
.sr-delta { padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.sr-delta.up { color: var(--mint); background: rgba(59, 227, 176, .14); }
.sr-delta.down { color: var(--coral); background: rgba(255, 113, 132, .14); }
.sr-stat small { display: block; font-size: 12px; color: var(--faint); }
.sr-stat small b { color: var(--muted); font-weight: 600; }
.sr-flow { position: relative; height: 340px; margin: 0 -2px; }
.sr-svg { position: absolute; left: 0; right: 0; top: 50px; width: 100%; height: 240px; stroke: none; -webkit-mask-image: linear-gradient(90deg, #000 86%, rgba(0, 0, 0, .25) 100%); mask-image: linear-gradient(90deg, #000 86%, rgba(0, 0, 0, .25) 100%); }
.sr-svg path { transition: fill .2s; }
.sr-station { position: absolute; top: 0; bottom: 0; width: 0; }
.sr-line { position: absolute; top: 44px; bottom: 44px; left: -.5px; width: 1px; background: rgba(233, 237, 255, .35); }
.sr-bubble { position: absolute; left: 0; transform: translateX(-50%); min-width: 62px; padding: 5px 10px; border-radius: 10px; text-align: center; white-space: nowrap; background: #0F1738; border: 1px solid var(--line); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7); }
.sr-bubble.top { top: 0; }
.sr-bubble.bottom { bottom: 0; }
.sr-bubble b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.sr-bubble small { display: block; font-size: 11px; line-height: 1.2; color: var(--faint); max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.sr-table th { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; }
.sr-table tr { position: relative; }
.sr-table tr.on td { background: var(--surface-2); }
.sr-table tbody tr:hover td { background: rgba(26, 37, 86, .6); }
.sr-table td button { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.sr-table td button::after { content: ""; position: absolute; inset: 0; }
.sr-table td button i { flex: none; width: 9px; height: 9px; border-radius: 50%; }

/* ---------- Page widgets ---------- */
.fw-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-bottom: 18px; }
.fw-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 40px 16px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.ring.fw-ring { width: 72px; height: 72px; }
.ring.fw-ring b { font-size: 15px; }
.fw-text { min-width: 0; }
.fw-text h3 { font-size: 17px; line-height: 1.3; letter-spacing: -0.015em; }
.fw-text p { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.fw-edit { position: absolute; top: 8px; right: 8px; }
.fw-edit svg { width: 15px; height: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bal-card { grid-template-columns: minmax(0, 1fr); }
  .bal-next { border-left: 0; border-top: 1px solid var(--line-soft); }
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-l { grid-column: span 2; }
  .closer-row { grid-template-columns: 1fr 210px; }
  .closer-stats { grid-column: 1 / -1; grid-row: 2; }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { border-left: 0; border-top: 1px solid var(--line-soft); }
  .cols-2 { grid-template-columns: 1fr; }
  .forecast-grid { grid-template-columns: 1fr; }
  .levers { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; overflow: visible; z-index: 20; flex-direction: row;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-soft);
  }
  .brand, .palette-hint, .nav-sub, .nav-toggle { display: none; }
  .nav-group { display: contents; }
  .nav-group > a { padding-right: 4px; }
  .home-tabs { display: flex; }
  .member-row { grid-template-columns: auto minmax(0, 1fr); }
  .member-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .access-row { flex-wrap: wrap; }
  .pipe-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .pipe-stat-icon { display: none; }
  .pipe-stat strong { font-size: 18px; }
  .pipe-stat small { font-size: 12px; line-height: 1.3; display: block; }
  .pipe-board { grid-template-columns: repeat(3, 78vw) 118px; scroll-snap-type: x proximity; }
  .pipe-col { scroll-snap-align: start; }
  .pipe-tools input { flex: 1 1 100%; }
  .pipe-tools-end { margin-left: 0; width: 100%; }
  .pipe-tools-end .btn.primary { flex: 1 1 100%; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 8px; }
  .nav a.active { box-shadow: inset 0 2px 0 var(--iris); }
  .badge { position: absolute; top: 0; right: 2px; margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
  .main { padding: 18px 16px 96px; }
  .topbar h1 { font-size: 21px; }
  .topbar-actions .btn span { display: none; }
  .hero-main { padding: 22px 20px; }
  .stat { padding: 16px 18px; }
  .stat dd { font-size: 19px; }
  .result-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .goal-grid { grid-template-columns: 1fr; }
  .goal-card { padding: 16px; }
  .goal-body { gap: 14px; }
  .ring { width: 78px; height: 78px; }
  .ring b { font-size: 16px; }
  .cd.blocks { gap: 6px; }
  .cd.blocks .cd-unit { min-width: 0; flex: 1; padding: 6px 4px 5px; }
  .cd.blocks b { font-size: 21px; }
  .goal-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .goal-row { grid-template-columns: 10px 1fr auto; gap: 10px 12px; }
  .goal-row-progress, .goal-row-toggles { grid-column: 2 / -1; }
  .deadline-row { grid-template-columns: 1fr 120px; }
  .cd-chip-name { display: none; }
  .topbar-actions { width: 100%; }
  .nav a { padding: 6px 4px; }
  .toolbar .grow { flex-basis: 100%; }
  .toolbar .btn.primary { flex-basis: 100%; }
  .payout-table thead { display: none; }
  .payout-table, .payout-table tbody { display: block; }
  .payout-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "p a" "w w" "v d" "s x"; gap: 6px 12px; padding: 14px; border-bottom: 1px solid var(--line-soft); }
  .payout-table tr:last-child { border-bottom: 0; }
  .payout-table td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; }
  .payout-table .c-p { grid-area: p; } .payout-table .c-a { grid-area: a; font-size: 16px; }
  .payout-table .c-w { grid-area: w; color: var(--muted); font-size: 13.5px; }
  .payout-table .c-v { grid-area: v; font-size: 13px; } .payout-table .c-d { grid-area: d; text-align: right; font-size: 13px; }
  .payout-table .c-d .sub { display: inline; margin-left: 4px; }
  .payout-table .c-s { grid-area: s; align-self: center; } .payout-table .c-x { grid-area: x; justify-self: end; }
  .payout-table .c-a { text-align: right; }

  .widgets { gap: 10px; }
  .widget { padding: 14px; }
  .w-figure { font-size: 20px; }
  .sign-grid { grid-template-columns: 1fr; }
  .voucher-summary { grid-template-columns: 1fr; }
  .tabs { display: flex; }
  .tabs button { flex: 1; justify-content: center; }
  .closer-row { padding: 16px; gap: 14px; grid-template-columns: 1fr; }
  .closer-stats { grid-row: auto; }
  .closer-actions { justify-content: flex-start; }
  .closer-actions .icon-btn { margin-left: auto; }
  .closer-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .closer-stats div:nth-child(4) { border-left: 0; padding-left: 0; }
  .closer-stats div { padding: 0 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 19px; }
  .bal-main, .bal-next { padding: 16px; }
  .bal-next-cell { grid-template-columns: 68px minmax(0, 1fr); }
  .bal-next-cell em { grid-column: 2; text-align: left; }
  .sr-stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sr-flow { height: 280px; }
  .sr-svg { height: 180px; }
  .sr-bubble { min-width: 0; padding: 4px 7px; }
  .sr-bubble b { font-size: 12px; }
  .sr-bubble small { max-width: 72px; font-size: 10px; }
  .fw-strip { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
