/* HSAProof — ledger paper, clinical ink, one green that means money.
   Fraunces for the numbers that matter, Public Sans for everything spoken,
   Plex Mono wherever a dollar or a date must line up. */

:root {
  /* ===== BPC ADVISORS PALETTE =====
     Fiduciary navy carries the chrome; financial green is reserved for
     money-positive meaning (balances, confirmations). To match the firm's
     exact brand: open the BPC logo, sample it with any color picker, and
     replace --brand (primary navy) and --green (chart-line green) here —
     every page inherits from this one block. */
  --brand: #16395C;          /* deep fiduciary navy — primary actions, chrome */
  --brand-deep: #0E2740;     /* hover / pressed */
  --brand-soft: #E7EDF4;     /* navy tint fills */
  --paper: #F5F7F9;          /* cool paper background */
  --card: #FFFFFF;
  --ink: #1A2733;            /* navy-black text */
  --ink-soft: #5B6B7A;
  --hair: #D8E0E8;
  --green: #1E7A52;          /* money green — balances, confirmed, growth */
  --green-soft: #E3F1E9;
  --amber: #B7791F;
  --amber-soft: #F7EEDD;
  --red: #B3402E;
  --red-soft: #F6E7E3;
  --shadow-1: 0 1px 2px rgba(14,39,64,.06), 0 2px 8px rgba(14,39,64,.05);
  --shadow-2: 0 4px 14px rgba(14,39,64,.10), 0 14px 40px rgba(14,39,64,.10);
  --ease: cubic-bezier(.33,.9,.3,1);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --body: "Public Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
/* ===== MOTION SYSTEM ===== */
button, .btn, a.btn, .chip, .tab, .year-chip, .menu-item, .social-btn, input, select, .bridge, .col, .stat, .txn, .claim {
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .22s var(--ease),
              transform .18s var(--ease), opacity .25s var(--ease);
}
.btn:hover, .social-btn:hover { transform: translateY(-1px); }
.btn:active, .social-btn:active, .tab:active { transform: translateY(0) scale(.98); }
.btn.confirm:hover { box-shadow: 0 6px 16px rgba(14,39,64,.22); }
.bridge, .col, .stat { will-change: transform; }
.bridge:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.bridge { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
dialog[open] { animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
dialog::backdrop { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
details.menu[open] .menu-panel { animation: pop .22s var(--ease); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

html { -webkit-text-size-adjust: 100%; }
::selection { background: var(--brand-soft); color: var(--brand-deep); }
* { scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 8px; }
a { color: var(--brand); text-underline-offset: 3px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--hair);
  background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
.wordmark { font-family: var(--display); font-weight: 650; font-size: 19px; letter-spacing: .01em; }
.wordmark em { font-style: italic; color: var(--brand); }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.chip {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--amber-soft); color: var(--amber);
  padding: 4px 10px; border-radius: 999px;
}
.chip.live { background: var(--green-soft); color: var(--green); }

.btn {
  font-family: var(--body); font-weight: 600; font-size: 13px;
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn.ghost { background: transparent; border-color: var(--hair); color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }
.btn.confirm { background: var(--brand); color: #fff; }
.btn.confirm:hover { background: var(--brand-deep); }
.btn.reject { background: transparent; color: var(--ink-soft); border-color: var(--hair); }
.btn.reject:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }
.btn.tiny { font-size: 12px; padding: 5px 10px; }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: -40px 0 auto 0; height: 300px;
  background: radial-gradient(60% 100% at 50% 0%, var(--brand-soft) 0%, transparent 70%);
  pointer-events: none; z-index: -1; }
.hero-inner-unused { text-align: center; padding: 48px 24px 34px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--brand);
}
.balance {
  font-family: var(--display); font-weight: 650; font-size: clamp(44px, 8vw, 72px);
  color: var(--green); line-height: 1.1; margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
}
.hero-sub { max-width: 560px; margin: 0 auto; color: var(--ink-soft); }
.statline {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  margin-top: 22px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft);
}
.statline b { color: var(--ink); font-weight: 600; }

/* ---------- sections ---------- */
main { max-width: 1060px; margin: 0 auto; padding: 0 20px 60px; }
.section-head { margin: 30px 0 14px; }
.section-head h2 { font-family: var(--display); font-weight: 650; font-size: 24px; }
.section-note, .col-note { color: var(--ink-soft); font-size: 13.5px; }

/* ---------- the signature: bridge cards ---------- */
.bridge {
  display: grid;
  grid-template-columns: 1fr 190px 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: opacity .25s, transform .25s;
}
.bridge.leaving { opacity: 0; transform: translateY(8px); }
.bridge .side { padding: 18px 20px; }
.bridge .side.right { text-align: right; }
.party-label {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-soft); margin-bottom: 6px;
}
.party-name { font-weight: 600; font-size: 15px; }
.party-meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.party-amount { font-family: var(--mono); font-weight: 600; font-size: 20px; margin-top: 8px; }
.lineitems { font-family: var(--mono); font-size: 12px; color: var(--green); margin-top: 4px; }

.spine {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 10px; text-align: center;
  border-left: 1px dashed var(--hair); border-right: 1px dashed var(--hair);
  background: linear-gradient(var(--paper), var(--card));
}
.equals {
  font-family: var(--display); font-size: 26px; line-height: 1; color: var(--green);
}
.badge {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; padding: 3px 9px; border-radius: 999px;
}
.badge.high { background: var(--green-soft); color: var(--green); }
.badge.medium { background: var(--amber-soft); color: var(--amber); }
.badge.review { background: var(--red-soft); color: var(--red); }
.badge.type { background: var(--paper); color: var(--ink-soft); }

.rationale {
  grid-column: 1 / -1;
  padding: 12px 20px 14px;
  border-top: 1px solid var(--hair);
  background: var(--paper);
  font-size: 13.5px; color: var(--ink-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.rationale .actions { display: flex; gap: 8px; flex-shrink: 0; }
.ai-note { color: var(--green); font-size: 13px; }

.bridge.confirmed { border-color: var(--green); }
.bridge.confirmed .rationale { background: var(--green-soft); color: var(--ink); }

/* ---------- unmatched columns ---------- */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 44px; }
.col h3 { font-family: var(--display); font-weight: 650; font-size: 18px; margin-bottom: 2px; }
.count { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); font-weight: 400; }
.simple-card {
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  padding: 14px 16px; margin-top: 10px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.simple-card .amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.simple-card.claim { border-left: 3px solid var(--amber); }
.simple-card.txn { border-left: 3px solid var(--red); }

footer { border-top: 1px solid var(--hair); margin-top: 20px; padding: 22px 28px 40px; }
footer p { max-width: 760px; margin: 0 auto; font-size: 12.5px; color: var(--ink-soft); text-align: center; }

.empty { color: var(--ink-soft); font-size: 13.5px; padding: 10px 2px; }


/* ===== RESPONSIVE SYSTEM ===== */
input, select, textarea { font-size: 16px; }        /* stop iOS zoom-on-focus */
.btn, .menu-item, .tab, .year-chip { min-height: 40px; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .topbar-right { flex-wrap: wrap; gap: 6px; }
  .columns { grid-template-columns: 1fr !important; }
  main { padding: 18px 16px 60px; }
}

@media (max-width: 640px) {
  .balance { font-size: clamp(34px, 11vw, 44px) !important; }
  .statline { gap: 10px 16px; font-size: 12.5px; flex-wrap: wrap; }
  #board-tabs { overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 14px 12px 0; }
  #board-tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: 0 0 auto; }
  #year-chips { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .menu-panel { position: fixed !important; left: 10px; right: 10px; top: 66px;
    min-width: 0 !important; max-height: 74vh; overflow-y: auto; box-shadow: var(--shadow-2); }
  .bridge { flex-direction: column !important; }
  .bridge .spine { border-left: none !important; border-top: 1px dashed var(--hair);
    border-bottom: 1px dashed var(--hair); padding: 12px 0 !important; margin: 10px 0; width: 100%; }
  .plan-progress { width: 100% !important; }
  dialog.dlg, dialog { width: 96% !important; max-width: 96% !important;
    max-height: 92vh; overflow-y: auto; margin: auto; }
  .row2 { flex-direction: column; gap: 0 !important; }
  .hero { padding: 30px 16px 8px !important; }
  .onboarding, #onboarding { font-size: 13px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .persona table, .clients { white-space: normal; }
}
