/* Money-intelligence pieces (public/finance/intel-ui.js): Safe to spend,
   quick-add, the working lists, Borrowing and Betting cards, the income
   plan and the school-fees planner. Uses the blue tokens from style.css. */

/* ── Safe to spend today ─────────────────────────────────────────── */
.stsd { margin: 20px 0 0; padding: 22px 22px 18px; background: var(--accent-soft); border: 1px solid #CFE0FA; border-radius: 24px; }
.stsd-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.stsd-kicker { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 15px/1.2 var(--font-body); color: var(--accent-strong); letter-spacing: .01em; }
.stsd-kicker .ico { width: 20px; height: 20px; }
.stsd-figure { margin: 6px 0 0; }
.stsd-figure strong { font: 800 clamp(40px, 11vw, 56px)/1.05 var(--font-display); letter-spacing: -.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.stsd-sub { margin: 4px 0 0; font-size: 16px; color: var(--text-2); }
.stsd-empty { margin: 8px 0 0; font-size: 16px; color: var(--text-2); max-width: 60ch; }
.stsd .inline-form { margin-bottom: 0; }
.stsd-how { margin-top: 12px; }
.stsd-how > summary { cursor: pointer; font: 600 14.5px/1.3 var(--font-body); color: var(--accent-strong); min-height: 44px; display: flex; align-items: center; }
.streak-chip { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 6px 12px 6px 8px; font: 600 14px/1.3 var(--font-body); color: var(--text-2); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; }
.streak-chip .ico { width: 18px; height: 18px; color: var(--accent); flex: none; }

/* A worked sum: label on the left, the number on the right. */
.working { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 2px; }
.working li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 15px; color: var(--text-2); }
.working li > span { min-width: 0; }
.working li em { display: block; font-style: normal; font-size: 13.5px; color: var(--muted); }
.working li strong { flex: none; font-variant-numeric: tabular-nums; color: var(--navy); text-align: right; }
.working-total { font-weight: 700; }
.working .working-total strong { font-size: 16.5px; }

/* ── Quick-add ───────────────────────────────────────────────────── */
.quick-add { margin: 16px 0 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); }
.qa-label { display: flex; align-items: center; gap: 8px; font: 700 16px/1.2 var(--font-display); color: var(--navy); margin-bottom: 10px; }
.qa-label .ico { color: var(--accent); width: 20px; height: 20px; }
.qa-row { display: flex; gap: 8px; }
.qa-row input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; font: 500 17px/1.2 var(--font-body); color: var(--text); background: var(--panel-raised); border: 1.5px solid var(--border); border-radius: 14px; }
.qa-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.qa-row .btn { min-height: 48px; }
.qa-hint { margin-top: 8px; }
.qa-preview:empty { display: none; }
.qa-preview { margin-top: 10px; }
.qa-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; background: var(--bg); border-radius: 14px; }
.qa-kind, .qa-date { display: inline-flex; align-items: center; gap: 5px; font: 600 13.5px/1.2 var(--font-body); color: var(--muted); }
.qa-kind .ico, .qa-date .ico { width: 16px; height: 16px; }
.qa-draft.is-in .qa-kind { color: var(--take); }
.qa-amt { font: 800 19px/1.2 var(--font-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.qa-desc { font-weight: 600; color: var(--text); }
.qa-cat select { min-height: 40px; padding: 6px 10px; font: 500 14.5px var(--font-body); color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; max-width: 100%; }
.qa-msg { margin: 8px 0 0; font-size: 14.5px; color: var(--text-2); }

/* ── Borrowing and Betting cards ─────────────────────────────────── */
.mini-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.mini-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 15px; color: var(--text-2); }
.mini-list li span { flex: 1; min-width: 0; }
.mini-list li strong { font-variant-numeric: tabular-nums; color: var(--navy); }
.mini-list li em { font-style: normal; font-size: 13px; color: var(--muted); min-width: 76px; text-align: right; }
.tile .more > summary { cursor: pointer; font: 600 14.5px/1.3 var(--font-body); color: var(--accent-strong); min-height: 44px; display: flex; align-items: center; }
.rate-calc { margin-top: 6px; }
.rate-calc .field-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.month-bars { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 0; padding: 0; align-items: end; height: 118px; }
.month-bars li { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; gap: 3px; }
.mb-bar { align-self: end; justify-self: center; width: 70%; height: max(3px, var(--h)); background: var(--sky); border-radius: 6px 6px 2px 2px; }
.mb-val { font: 600 12px/1.2 var(--font-body); color: var(--text-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-lbl { font-size: 12px; color: var(--muted); }
.bet-card .bet-goal-open { align-self: flex-start; margin-top: 6px; }
.bet-goal-form { margin-top: 4px; }

/* ── Income plan (Budget / Money) ────────────────────────────────── */
.income-plan { display: grid; gap: 12px; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font: 600 16px/1.3 var(--font-body); color: var(--text); cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; background: #B9C6D8; border-radius: 999px; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 4px var(--accent-soft); }
.plan-base, .plan-total { margin: 0; font-size: 15.5px; color: var(--text-2); }
.plan-base strong, .plan-total strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.plan-method { flex-wrap: wrap; }
.plan-group { padding: 12px 0 0; border-top: 1px solid var(--border-soft); }
.plan-group-title { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; font: 700 16px/1.3 var(--font-display); color: var(--navy); }
.plan-group-title strong { font-variant-numeric: tabular-nums; }
.plan-lines { list-style: none; margin: 0; padding: 0; }
.plan-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 7px 0; font-size: 15px; color: var(--text-2); }
.pl-name { flex: 1; min-width: 0; }
.pl-name em { margin-left: 8px; font-style: normal; font-size: 13px; color: var(--muted); }
.plan-lines strong { font-variant-numeric: tabular-nums; color: var(--navy); }
.pl-short { flex-basis: 100%; font-size: 13.5px; color: var(--warn-text); }
.income-plan .plan-apply { justify-self: start; }

/* ── Goals: runway line, school-fees planner, landing runway ─────── */
.goal-runway { margin: -4px 0 0; font-weight: 600; color: var(--accent-strong); }
.goal-runway:empty { display: none; }
.sf-host { margin: 4px 0 16px; padding: 16px; background: var(--panel-raised); border: 1px solid var(--border-soft); border-radius: 18px; }
.sf-planner .tile-sub { display: flex; align-items: center; gap: 8px; margin: 0; }
.sf-planner .tile-sub .ico { color: var(--accent); }
.sf-planner .btn { justify-self: start; }
.sf-or { margin-top: 12px; }
.pg-runway { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 15px; color: var(--text-2); }
.pg-runway > .ico { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.pg-runway select { margin: 0 4px; padding: 4px 6px; font: 600 14.5px var(--font-body); color: var(--accent-strong); background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; }
.pg-runway strong { display: block; margin-top: 2px; color: var(--navy); }

@media (max-width: 480px) {
  .stsd { padding: 18px 16px 14px; border-radius: 20px; }
  .quick-add { padding: 14px; }
  .working li { font-size: 14.5px; }
}
