/* docs/SUBSCRIPTION-SPEC.md 10.5: styles for the ledger track's pages and partials (templates/subs/).
   Owner: ledger track. Loaded after app.css on every page; use the tokens app.css defines.
   No inline styles anywhere (the content security policy), so every look lives here. */

/* ---------- Worth a look: the link and the "Handled it?" form ---------- */
.ledger-link { margin: 0 0 var(--space-4); font-size: 14px; font-weight: 600; line-height: 20px; }
.ledger-link a { display: inline-flex; align-items: center; min-height: 44px; }

.disclosure-happened > summary { justify-content: center; width: 100%; padding: 8px 14px; border: 1px solid var(--navy-mid); border-radius: var(--radius-sm); color: var(--navy); }
.disclosure-happened > summary:hover { background: var(--tint-soft); text-decoration: none; }
.disclosure-happened[open] > summary { border-color: var(--line-strong); color: var(--muted); }
.disclosure-happened .btn { width: 100%; margin-top: 12px; }

/* ---------- the choices and the amount (all three forms) ---------- */
.ledger-form { margin: 0; }
.ledger-form .ledger-choices { margin-top: 8px; }
.ledger-form .ledger-amount { margin-top: 12px; }
.ledger-form .ledger-amount input { width: 100%; max-width: 14rem; }
.ledger-form .ledger-amount .small { margin: 6px 0 0; }

/* Where the browser can tell, the amount shows only for the two choices that carry one;
   everywhere else it simply stays visible (a choice with no amount ignores it). */
@supports selector(:has(*)) {
  .ledger-form .ledger-amount { display: none; }
  .ledger-form:has(input[name="outcome"][value="billed"]:checked) .ledger-amount,
  .ledger-form:has(input[name="outcome"][value="collected"]:checked) .ledger-amount { display: block; }
}

/* ---------- "Looks taken care of" ---------- */
.ledger-suggestions { margin: 0 0 var(--space-5); }
.ledger-suggestions > h2 { margin-bottom: var(--space-3); }
.ledger-suggestion { margin-bottom: var(--space-3); padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--navy-mid); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.ledger-suggestion-text { margin: 0 0 4px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 24px; }
.ledger-suggestion .ledger-dismiss { margin: 8px 0 0; }
.ledger-suggestion .btn { width: 100%; margin-top: 12px; }
.ledger-suggestion .ledger-dismiss .btn { margin-top: 0; }

/* ---------- the Follow-up page ---------- */
.ledger-headline { margin-bottom: var(--space-5); border-left: 4px solid var(--good-mark); }
.ledger-total { margin: 0 0 8px; color: var(--ink); font-size: 18px; line-height: 28px; }
.ledger-big { display: block; margin-top: 4px; color: var(--navy-deep); font-size: 36px; font-weight: 600; line-height: 40px; letter-spacing: -0.01em; }
.ledger-lines { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 8px; padding: 0; list-style: none; color: var(--body); font-size: 18px; font-weight: 600; line-height: 26px; }
.ledger-section { margin-bottom: var(--space-5); }
.ledger-section > h2 { margin-bottom: var(--space-3); }
.ledger-chart { margin: 0 0 var(--space-3); }
.ledger-day { white-space: nowrap; }
.ledger-struck { text-decoration: line-through; }
.ledger-entry-off { background: var(--surface-page); }
.ledger-entry-off td { color: var(--muted); }
.ledger-was { margin: 4px 0 0; padding-left: 18px; }
table.data .ledger-edit-row td { padding-top: 0; }
.ledger-edit-row .ledger-form { max-width: 28rem; }
.ledger-edit-row .btn { margin-top: 12px; }
.ledger-void { margin: 8px 0 0; }
.ledger-void .btn { margin-top: 0; }
.ledger-foot { margin-top: var(--space-5); }

@media (min-width: 640px) {
  .disclosure-happened .btn, .ledger-suggestion .btn { width: auto; }
}

@media (min-width: 960px) {
  .worth-actions .disclosure-happened > summary { width: auto; }
  .worth-actions > .disclosure-happened[open] { min-width: 320px; }
}
