/* =========================================================
   Park Front Capital — design system.

   Paper, not a dashboard. Deep navy ink on near-white, with
   one institutional blue for actions and copper for the things
   that are set aside rather than spent.

   Two reasons it's light. First, legibility: this is a ledger,
   and numbers on paper is the oldest solved problem in
   bookkeeping. Second, the people using it are outdoors —
   a dark theme on a phone in direct sun is unreadable.

   Colour is reserved for meaning:
     green  = collected      copper/amber = owed or reserved
     red    = spent          navy         = act on this
   ========================================================= */

:root {
  /* surfaces */
  --paper:     #F6F8FC;
  --surface:   #FFFFFF;
  --surface-2: #F1F4FA;
  --surface-3: #E7ECF5;
  --line:      #DCE3EF;
  --line-soft: #EAEFF7;
  --line-firm: #C4CFE0;

  /* ink */
  --ink:   #0E1A2E;
  --ink-2: #2E3F5A;
  --muted: #5A6B85;
  /* Tertiary text still has to clear 4.5:1, and it sits on tinted
     surfaces as often as on white, so it's tuned against the darkest
     of them. #8494AC looked right and measured 3.08 — the old build
     was "hard to see" because tone was picked by eye, not by ratio. */
  --faint: #5C6E89;

  /* brand */
  --navy:      #1E4FA8;
  --navy-deep: #16346B;
  --navy-lift: #2C63C4;
  --navy-soft: #E9EFFA;
  --navy-line: #C3D3EE;

  /* Two coppers. The bright one is for fills, bars and badge
     backgrounds, where contrast against white is irrelevant. The ink
     one is for TYPE, which has to clear 4.5:1 — including on top of
     copper-soft. Using the fill colour for text is what put "Owed"
     at 3.87:1. */
  --copper:      #B4652A;
  --copper-ink:  #8A4A17;
  --copper-soft: #FBF0E5;
  --copper-line: #EBD3B8;

  /* semantics */
  --in:        #12784A;
  --in-soft:   #E6F4EC;
  --in-line:   #BFE0CD;
  --amber:     #A65D00;
  --amber-soft:#FDF2E3;
  --amber-line:#EFD7B4;
  --out:       #B3261E;
  --out-soft:  #FCECEA;
  --out-line:  #F0C9C5;
  --steel:     #5C7091;

  /* geometry */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --side: 236px;

  --shadow-sm: 0 1px 2px rgba(14,26,46,.07);
  --shadow:    0 1px 3px rgba(14,26,46,.07), 0 6px 16px rgba(14,26,46,.05);
  --shadow-lg: 0 18px 48px rgba(14,26,46,.16);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100dvh; }

h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
b, strong { font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: .88em; color: var(--ink-2); }

.muted { color: var(--muted); }
.neg   { color: var(--out); }
.tone-in    { color: var(--in); }
.tone-amber { color: var(--amber); }
.tone-out   { color: var(--out); }
.tone-blue  { color: var(--navy); }
.spacer { flex: 1; }

/* ---------------------------------------------------------
   Shell
--------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 2px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(160deg, var(--navy-lift), var(--navy-deep));
  box-shadow: 0 2px 6px rgba(30,79,168,.32);
}
.brand__mark svg { width: 19px; height: 19px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__text b { font-size: 13.5px; letter-spacing: .1em; color: var(--ink); }
.brand__text i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .28em;
  color: var(--copper-ink);
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background .14s, color .14s;
}
.nav a svg { width: 17px; height: 17px; color: var(--faint); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a:hover svg { color: var(--muted); }
.nav a.is-on {
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-weight: 600;
}
.nav a.is-on svg { color: var(--navy); }

.side__foot { display: flex; flex-direction: column; gap: 10px; }
.safebox {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: var(--r);
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
}
.safebox span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-deep); opacity: .8; }
.safebox b { font-size: 20px; letter-spacing: -.02em; color: var(--navy-deep); }
.phase { font-size: 11px; color: var(--faint); padding-left: 2px; }

/* ---- main ---- */
.main { min-width: 0; padding: 0 0 96px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 26px 15px;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar__title { font-size: 21px; color: var(--ink); }
.topbar__sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.topbar__stats { display: flex; gap: 22px; align-items: center; }
.mini { display: flex; flex-direction: column; align-items: flex-end; }
.mini span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.mini b { font-size: 16px; color: var(--ink); }
.mini--tag { justify-content: center; }
.mini--tag span {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.view { padding: 22px 26px 40px; max-width: 1180px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------------------------------------------------------
   Cards
--------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card__title { font-size: 17px; color: var(--ink); }
.card__title--sm {
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.card__title--sm svg { width: 15px; height: 15px; color: var(--navy); }
.card__hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.footnote { text-align: center; font-size: 12px; color: var(--faint); padding: 8px 0 0; }

.card--intake {
  border-color: var(--navy-line);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------
   Intake
--------------------------------------------------------- */
.intake { margin-top: 16px; }
.intake__text {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 14px 15px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.intake__text:focus {
  background: var(--surface);
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,79,168,.14);
}
.intake__text::placeholder { color: var(--faint); }

.intake__tools { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.mic {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-firm);
  color: var(--ink-2);
  font-size: 14px;
  transition: border-color .15s, background .15s, color .15s;
}
.mic svg { width: 17px; height: 17px; }
.mic:hover:not(:disabled) { border-color: var(--navy); color: var(--navy-deep); background: var(--navy-soft); }
.mic:disabled { opacity: .5; cursor: not-allowed; }
.mic.is-live {
  background: var(--out-soft);
  border-color: var(--out);
  color: var(--out);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179,38,30,.26); }
  50%      { box-shadow: 0 0 0 8px rgba(179,38,30,0); }
}

.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.examples__label {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
  width: 100%;
}
.example {
  text-align: left;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line-firm);
  color: var(--muted);
  font-size: 12.5px;
  transition: border-color .15s, color .15s, background .15s;
}
.example:hover { border-color: var(--navy); border-style: solid; color: var(--navy-deep); background: var(--navy-soft); }

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-firm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .14s, border-color .14s, transform .08s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(30,79,168,.3);
}
.btn--primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.btn--danger { color: var(--out); border-color: var(--out-line); background: var(--out-soft); }
.btn--danger:hover { background: #F8DEDB; border-color: var(--out); }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }

.iconbtn {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--faint);
}
.iconbtn svg { width: 14px; height: 14px; }
.iconbtn:hover { color: var(--out); background: var(--out-soft); }

/* ---- segmented control ---- */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg--wide { display: flex; }
.seg--wide .seg__opt { flex: 1; justify-content: center; }
.seg__opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  transition: background .14s, color .14s;
}
.seg__opt svg { width: 15px; height: 15px; }
.seg__opt:hover { color: var(--ink); }
.seg__opt.is-on {
  background: var(--surface);
  color: var(--navy-deep);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------
   Review card
--------------------------------------------------------- */
.card--review { border-color: var(--navy-line); box-shadow: var(--shadow); }
.review__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.review__raw {
  margin: 14px 0;
  padding: 11px 14px;
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13.5px;
  font-style: italic;
}
.review__foot { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.review__foot .btn--primary { margin-left: auto; }

.parsed {
  padding: 14px;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.parsed__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.parsed__guess { margin: 10px 0 0; font-size: 12px; color: var(--amber); display: flex; align-items: center; gap: 6px; }
.parsed__guess svg { width: 13px; height: 13px; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-firm);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,79,168,.14); }
.input::placeholder { color: var(--faint); }
select.input {
  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, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* ---------------------------------------------------------
   Stats
--------------------------------------------------------- */
.stats { display: grid; gap: 14px; }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stats--4 { grid-template-columns: repeat(4, 1fr); }

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat__label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-size: 23px; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 12px; color: var(--faint); }
.stat--in    .stat__value { color: var(--in); }
.stat--out   .stat__value { color: var(--out); }
.stat--amber .stat__value { color: var(--amber); }
.stat--blue {
  background: var(--navy-soft);
  border-color: var(--navy-line);
}
.stat--blue .stat__label { color: var(--navy-deep); opacity: .75; }
.stat--blue .stat__value { color: var(--navy-deep); }
.stat--big .stat__value { font-size: 27px; }

/* ---------------------------------------------------------
   Bars
--------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.bar__label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.bar__head b { font-variant-numeric: tabular-nums; }
.bar__ico { display: inline-flex; color: var(--faint); }
.bar__ico svg { width: 15px; height: 15px; }
.bar__track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 999px; transition: width .35s cubic-bezier(.2,.7,.3,1); }
.bar__fill--blue  { background: var(--navy); }
.bar__fill--in    { background: var(--in); }
.bar__fill--out   { background: var(--out); }
.bar__fill--amber { background: var(--copper); }
.bar__fill--steel { background: var(--steel); }

/* ---------------------------------------------------------
   Ledger rows
--------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.rows--tight { gap: 0; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: 0; }

/* The row is the button. Give it the affordances of one. */
.row--tap {
  cursor: pointer;
  border-radius: var(--r-sm);
  padding-left: 8px;
  padding-right: 8px;
  margin: 0 -4px;
  transition: background .12s;
}
.row--tap:hover { background: var(--surface-2); }
.row--tap:hover .row__act { color: var(--navy); }
.row--tap:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
  background: var(--surface-2);
}
.row__ico {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.row__ico svg { width: 15px; height: 15px; }
.row__ico--in    { color: var(--in);     background: var(--in-soft);     border-color: var(--in-line); }
.row__ico--out   { color: var(--out);    background: var(--out-soft);    border-color: var(--out-line); }
.row__ico--amber { color: var(--copper-ink); background: var(--copper-soft); border-color: var(--copper-line); }

.row__body { flex: 1; min-width: 0; }
.row__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row__who { color: var(--ink); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__amt { font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__amt--in { color: var(--in); }
.row__amt--out { color: var(--out); }
.row__amt--amber { color: var(--copper-ink); }
.row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.row__meta i { font-style: normal; color: var(--line-firm); }
.row__src { text-transform: capitalize; color: var(--steel); }
.row__act {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent; border: 0; color: var(--faint);
}
.row__act svg { width: 15px; height: 15px; }
.row__act:hover { color: var(--navy); background: var(--navy-soft); }

.miniRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.miniRow:last-child { border-bottom: 0; }
.miniRow > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); min-width: 0; }
.miniRow > span svg { width: 15px; height: 15px; color: var(--faint); }
.miniRow i { font-style: normal; font-size: 12px; color: var(--faint); }
.miniRow b { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------
   Jobs
--------------------------------------------------------- */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.job {
  padding: 15px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.job__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.job__name { display: block; color: var(--ink); font-size: 15px; }
.job__client { font-size: 12.5px; color: var(--muted); }
.job__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.job__grid div { display: flex; flex-direction: column; gap: 2px; }
.job__grid span { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.job__grid b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.job__owed {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 13px; padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--copper-soft);
  border: 1px solid var(--copper-line);
  font-size: 13px;
  color: #7A4318;
}
.job__toggle {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 0;
  background: none; border: 0;
  color: var(--muted); font-size: 12.5px;
}
.job__toggle svg { width: 14px; height: 14px; transition: transform .18s; }
.job__toggle.is-open svg { transform: rotate(90deg); }
.job__toggle:hover { color: var(--navy); }
.job__entries { margin-top: 6px; border-top: 1px solid var(--line); }

.assign { border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
.assign .row { border-bottom: 0; }
.assign__pick { display: flex; align-items: center; gap: 9px; padding: 0 4px 6px 46px; }
.assign__pick svg { width: 15px; height: 15px; color: var(--faint); flex: 0 0 auto; }
.assign__pick .input { padding: 7px 10px; font-size: 13px; }

/* ---------------------------------------------------------
   Cushion — copper, because this money is set aside, not spent
--------------------------------------------------------- */
.card--cushion { border-color: var(--copper-line); box-shadow: var(--shadow); }
.cushion__head { display: flex; gap: 14px; align-items: flex-start; }
.cushion__badge {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(160deg, #C9793C, var(--copper));
  box-shadow: 0 2px 6px rgba(180,101,42,.3);
}
.cushion__badge svg { width: 20px; height: 20px; }

.cushion__balance {
  display: flex; flex-direction: column; gap: 2px;
  margin: 20px 0 18px;
  padding: 18px 20px;
  border-radius: var(--r);
  background: var(--copper-soft);
  border: 1px solid var(--copper-line);
}
.cushion__balance span { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #8A5222; }
.cushion__balance b { font-size: 40px; letter-spacing: -.03em; color: #6E3F16; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cushion__balance small { font-size: 12.5px; color: var(--copper-ink); }

.rate { margin-bottom: 18px; }
.rate__row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.rate__row b { color: var(--ink); font-size: 16px; }
.range {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--copper), var(--copper-line));
  outline: none;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--copper);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.range::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--copper);
  cursor: pointer;
}

.disclaimer {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 18px 0 0; padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.disclaimer svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; }

.payform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 14px; }

/* ---------------------------------------------------------
   Advisor — signals, readiness, bench
--------------------------------------------------------- */
.sigs { display: flex; flex-direction: column; gap: 12px; }

.sig {
  padding: 15px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-firm);
}
.sig--act   { border-left-color: var(--out);    background: var(--out-soft); }
.sig--watch { border-left-color: var(--copper); background: var(--copper-soft); }
.sig--info  { border-left-color: var(--navy);   background: var(--navy-soft); }

.sig__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sig__ask { font-size: 12px; color: var(--muted); }
.sig__ask b { color: var(--ink); }
.sig__title { margin: 10px 0 0; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.sig__body { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

.sig__maths {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.sig__mathsLabel {
  display: block;
  font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.sig__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 3px 0;
}
.sig__row span { color: var(--muted); }
.sig__row b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---- readiness ---- */
.readyBar { margin: 4px 0 18px; }
.readyBar__head { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.readyBar__head b { color: var(--ink); font-size: 15px; }

.readies { display: flex; flex-direction: column; gap: 10px; }

.ready {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 13px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background .15s, border-color .15s;
}
.ready--done { background: var(--in-soft); border-color: var(--in-line); }
.ready--doing { background: var(--copper-soft); border-color: var(--copper-line); }
.ready--na { opacity: .6; }

.ready__main { flex: 1 1 260px; min-width: 0; }
.ready__top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.ready__top b { font-size: 14.5px; color: var(--ink); }
.ready__asks { font-size: 11px; color: var(--muted); }
.ready__main p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.ready__states { display: flex; gap: 3px; flex-wrap: wrap; }
.ready__state {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line-firm);
  color: var(--muted);
  transition: background .14s, color .14s, border-color .14s;
}
.ready__state:hover { border-color: var(--navy); color: var(--navy-deep); }
.ready__state.is-on {
  background: var(--navy); border-color: var(--navy);
  color: #fff; font-weight: 600;
}

/* ---- bench ---- */
.benches { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bench {
  padding: 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.bench__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bench__head b { font-size: 14.5px; color: var(--ink); }
.bench__firm { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bench__note { margin: 8px 0 10px; font-size: 13px; color: var(--ink-2); }
.bench__disclose {
  margin: 10px 0 0; padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}

@media (max-width: 620px) {
  .ready__states { width: 100%; }
  .ready__state { flex: 1; text-align: center; }
}

/* ---------------------------------------------------------
   Pills, chips, table
--------------------------------------------------------- */
.pill, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.pill--in,    .chip--in    { color: var(--in);     background: var(--in-soft);     border-color: var(--in-line); }
.pill--amber, .chip--amber { color: var(--copper-ink); background: var(--copper-soft); border-color: var(--copper-line); }
.pill--out,   .chip--out   { color: var(--out);    background: var(--out-soft);    border-color: var(--out-line); }
.pill--muted, .chip--muted { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 0 10px 9px;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line-firm);
}
.table td { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------
   Modal + toast
--------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; }
.modal.is-on { display: block; }
.modal__scrim { position: absolute; inset: 0; background: rgba(14,26,46,.4); backdrop-filter: blur(2px); }
.modal__panel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.toasts { position: fixed; left: 50%; bottom: 90px; z-index: 80; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toasts.is-on { opacity: 1; transform: translate(-50%, -8px); }
/* Only an actionable toast accepts taps; a plain one must never
   intercept a press aimed at the row underneath it. */
.toasts.is-interactive { pointer-events: auto; }
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
}
.toast--ok   { background: var(--in); }
.toast--warn { background: var(--copper); }

.toast--action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 9px 9px 18px;
}
.toast__btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: background .14s;
}
.toast__btn:hover { background: rgba(255,255,255,.26); }
.toast__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------
   Sign-in gate
--------------------------------------------------------- */
.gate {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 18px;
  background:
    radial-gradient(900px 420px at 50% -10%, var(--navy-soft), transparent 70%),
    var(--paper);
}
.gate__panel {
  width: min(420px, 100%);
  padding: 30px 28px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.gate__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.gate__title { font-size: 24px; color: var(--ink); line-height: 1.2; }
.gate__sub { margin: 8px 0 22px; font-size: 14px; color: var(--muted); }
.gate__note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 18px; padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  font-size: 12.5px; color: var(--navy-deep);
}
.gate__note svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; color: var(--navy); }
.gate__form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.gate__error { margin: 0 0 14px; font-size: 13px; color: var(--out); }

.gate__or {
  position: relative;
  text-align: center;
  margin: 18px 0;
  color: var(--faint);
  font-size: 12px;
}
.gate__or::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--line);
}
.gate__or span { position: relative; padding: 0 12px; background: var(--surface); }

.gate__local {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px dashed var(--line-firm);
  color: var(--ink-2);
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.gate__local small { font-size: 12px; color: var(--muted); }
.gate__local:hover { border-color: var(--navy); background: var(--surface-2); }

.gate__sent { text-align: center; }
.gate__tick {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: var(--in);
  background: var(--in-soft);
  border: 1px solid var(--in-line);
}
.gate__tick svg { width: 22px; height: 22px; }

.gate__lang { display: flex; gap: 4px; justify-content: center; margin-top: 22px; }
.gate__foot { font-size: 11.5px; color: var(--faint); }

/* ---------------------------------------------------------
   Storage-eviction warning
--------------------------------------------------------- */
.risk {
  display: flex;
  gap: 13px;
  margin: 18px 26px 0;
  padding: 15px 17px;
  border-radius: var(--r);
  background: var(--copper-soft);
  border: 1px solid var(--copper-line);
}
.risk__ico {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  color: #fff;
  background: var(--copper);
}
.risk__ico svg { width: 17px; height: 17px; }
.risk__body b { display: block; color: #6E3F16; font-size: 14.5px; }
.risk__body p { margin: 4px 0 0; font-size: 13px; color: #7A4318; }
.risk__acts { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

/* ---------------------------------------------------------
   Telegram link code — read off a screen, typed on a phone
--------------------------------------------------------- */
.linkcode {
  margin: 10px 0;
  padding: 16px;
  text-align: center;
  border-radius: var(--r);
  background: var(--navy-soft);
  border: 1px dashed var(--navy-line);
  color: var(--navy-deep);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .22em;
  text-indent: .22em;   /* balance the trailing letter-space */
  user-select: all;
}

/* ---------------------------------------------------------
   Sync pill
--------------------------------------------------------- */
.pill--sync { justify-content: center; width: 100%; padding: 6px 10px; }
.pill--sync svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------
   Bottom tabs (mobile only)
--------------------------------------------------------- */
.tabs { display: none; }

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 1080px) {
  .stats--4 { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding-bottom: 92px; }
  .topbar { padding: 15px 16px 12px; }
  .topbar__title { font-size: 19px; }
  .topbar__stats { gap: 16px; width: 100%; justify-content: space-between; }
  .mini { align-items: flex-start; }
  .mini b { font-size: 15px; }
  .view { padding: 16px 16px 32px; }
  .risk { margin: 14px 16px 0; }
  .card { padding: 16px; border-radius: var(--r); }
  .stats--3, .stats--4 { grid-template-columns: repeat(2, 1fr); }
  .jobs { grid-template-columns: 1fr; }
  .payform { grid-template-columns: 1fr; }
  .cushion__balance b { font-size: 34px; }
  .review__foot .btn { flex: 1; justify-content: center; }

  .tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: grid;
    /* Derived from the route count, not hardcoded — adding a screen
       shouldn't silently overflow the tab bar. */
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }
  .tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 1px;
    min-width: 0;
    border-radius: var(--r-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    text-align: center;
  }
  .tabs a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tabs a svg { width: 19px; height: 19px; }
  .tabs a.is-on { color: var(--navy-deep); background: var(--navy-soft); font-weight: 600; }
}

@media (max-width: 420px) {
  .stats--3, .stats--4 { grid-template-columns: 1fr 1fr; }
  .job__grid { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
