/* ProbateLedger components. Every value comes from tokens.css (generated from tokens.json).
   Class prefix: pl-. Components are plain HTML + these classes; no script needed. */

/* ---------- Wordmark: "Probate" in ink, "Ledger" in ledger green, an accountant's double rule beneath "Ledger" ---------- */
.pl-wordmark { display: inline-flex; align-items: baseline; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.2px; color: var(--ink); text-decoration: none; line-height: 1; }
.pl-wordmark b { font-weight: 700; color: var(--ledger); padding-bottom: 4px; border-bottom: 3px double var(--stamp); }
.pl-wordmark--lg { font-size: 40px; }
.pl-wordmark--lg b { border-bottom-width: 5px; padding-bottom: 6px; }

/* ---------- Button: one primary action per view (von Restorff: the only ledger-filled element) ---------- */
.pl-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--tap-min); padding: var(--space-3) var(--space-6); border-radius: var(--radius-sm); border: 2px solid transparent; font-family: var(--font-sans); font-size: 18px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.pl-btn--primary { background: var(--ledger); color: var(--on-ledger); }
.pl-btn--primary:hover { background: var(--ledger-deep); }
.pl-btn--secondary { background: transparent; color: var(--ledger); border-color: var(--ledger); }
.pl-btn--secondary:hover { background: var(--ledger-tint); }
.pl-btn--text { background: none; border: none; padding-inline: 0; color: var(--ledger); text-decoration: underline; text-underline-offset: 3px; min-height: auto; }
.pl-btn[disabled], .pl-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pl-btn--block { width: 100%; }
.pl-btn:focus-visible, .pl-chip:focus-within, .pl-input:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pl-btn__sub { display: block; font-size: 14px; font-weight: 400; opacity: .9; }

/* ---------- FiledStamp: the clerk's FILED stamp. Real filing dates only. ---------- */
.pl-stamp { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-1) var(--space-2); border: 2px solid var(--stamp); outline: 1px solid var(--stamp); outline-offset: 2px; border-radius: var(--radius-sm); color: var(--stamp); font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: 2px; line-height: 1; text-transform: uppercase; transform: rotate(-3deg); white-space: nowrap; }
.pl-stamp small { font-size: 10px; letter-spacing: 1.5px; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) { .pl-stamp--new { animation: pl-stamp-in .35s ease-out both; } }
@keyframes pl-stamp-in { from { transform: rotate(-3deg) scale(1.25); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }

/* ---------- LedgerFigure: a real count with its source. Double rule = final, verified figure. ---------- */
.pl-figure { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.pl-figure__value { font-family: var(--font-mono); font-size: 48px; font-weight: 500; line-height: 1; color: var(--ledger); font-variant-numeric: tabular-nums; align-self: flex-start; padding-bottom: 6px; border-bottom: 4px double var(--stamp); }
.pl-figure__label { font-family: var(--font-sans); font-size: 16px; line-height: 1.4; color: var(--ink); max-width: 28ch; }
.pl-figure__source { font-family: var(--font-mono); font-size: 13px; line-height: 1.4; color: var(--ink-muted); }

/* ---------- LeadCard: a case file. Manila tab carries county + filing date. Redacted fields stay visibly redacted. ---------- */
.pl-lead { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); padding-top: calc(var(--space-6) + 6px); display: grid; gap: var(--space-4); min-width: 0; }
.pl-lead__tab { position: absolute; top: -14px; left: var(--space-6); background: var(--manila); color: var(--manila-ink); font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; padding: 6px 12px 4px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pl-lead__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
.pl-lead__title { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--ink); margin: 0; }
.pl-lead__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.pl-lead__fields dt { font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-muted); }
.pl-lead__fields dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pl-redact { background: var(--ink); color: transparent; border-radius: 2px; user-select: none; padding: 0 .3em; }
.pl-lead__why { margin: 0; padding-left: 1.1em; font-size: 15px; line-height: 1.5; color: var(--ink); display: grid; gap: var(--space-1); }
.pl-lead__scores { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-score { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.pl-score b { font-weight: 600; color: var(--ledger); }
.pl-score--best { background: var(--ledger-tint); border-color: var(--ledger); }

/* ---------- SeatMeter: true buyer-cap status from the database. Never hard-coded. ---------- */
.pl-seats { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-sans); font-size: 15px; color: var(--ink); }
.pl-seats__boxes { display: inline-flex; gap: 4px; }
.pl-seats__box { width: 14px; height: 14px; border: 2px solid var(--rule-strong); border-radius: 2px; }
.pl-seats__box--taken { background: var(--ink); border-color: var(--ink); }
.pl-seats--full { color: var(--warn); font-weight: 600; }

/* ---------- PlanCard: total cost first, per-lead math second, renewal terms in plain sight ---------- */
.pl-plan { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: var(--space-8) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pl-plan--featured { background: var(--ledger-tint); border: 2px solid var(--ledger); box-shadow: var(--shadow-card); }
.pl-plan__name { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0; color: var(--ink); }
.pl-plan__price { display: flex; align-items: baseline; gap: var(--space-2); font-family: var(--font-mono); color: var(--ink); }
.pl-plan__price strong { font-size: 44px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.pl-plan__per { font-family: var(--font-mono); font-size: 14px; color: var(--ink-muted); }
.pl-plan__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: 16px; line-height: 1.45; }
.pl-plan__list li { padding-left: 1.4em; position: relative; }
.pl-plan__list li::before { content: ""; position: absolute; left: 0; top: .55em; width: .75em; height: .4em; border-left: 2px solid var(--ledger); border-bottom: 2px solid var(--ledger); transform: rotate(-45deg); }
.pl-plan__terms { font-size: 14px; line-height: 1.5; color: var(--ink-muted); margin: 0; }

/* ---------- Timeline: speed shown as days on one scale ---------- */
.pl-timeline { display: grid; gap: var(--space-4); }
.pl-timeline__row { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: var(--space-4); align-items: center; }
.pl-timeline__label { font-size: 15px; font-weight: 600; color: var(--ink); }
.pl-timeline__track { position: relative; height: 34px; background: var(--surface-sunk); border-radius: var(--radius-sm); overflow: hidden; }
.pl-timeline__bar { position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; padding-inline: var(--space-2); font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.pl-timeline__bar--us { background: var(--ledger); color: var(--on-ledger); }
.pl-timeline__bar--them { background: var(--ink-muted); color: var(--paper); }
.pl-timeline__axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); margin-left: calc(min(180px, 30%) + var(--space-4)); }
@media (max-width: 560px) { .pl-timeline__row { grid-template-columns: 1fr; gap: var(--space-1); } .pl-timeline__axis { margin-left: 0; } }

/* ---------- Notice: compliance and outreach rules. Always a word label, never color alone. ---------- */
.pl-notice { border: 1px solid var(--warn); background: var(--warn-tint); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); color: var(--ink); font-size: 16px; line-height: 1.55; display: grid; gap: var(--space-2); }
.pl-notice__label { font-size: 12px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--warn); }
.pl-notice--info { border-color: var(--ledger); background: var(--ledger-tint); }
.pl-notice--info .pl-notice__label { color: var(--ledger-deep); }

/* ---------- CountyPicker: checkable chips with live counts ---------- */
.pl-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); }
.pl-chip { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); min-height: var(--tap-min); background: var(--surface); border: 2px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; }
.pl-chip input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ledger); grid-row: span 2; }
.pl-chip__name { font-weight: 600; font-size: 16px; color: var(--ink); }
.pl-chip__meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-muted); }
.pl-chip:has(input:checked) { border-color: var(--ledger); background: var(--ledger-tint); }
.pl-chip:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* ---------- Input ---------- */
.pl-input { width: 100%; min-height: var(--tap-min); padding: var(--space-2) var(--space-3); border: 2px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 17px; }
.pl-check { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; font-size: 15px; line-height: 1.5; color: var(--ink); }
.pl-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ledger); }
