:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  color: #daf1de;
  background: #051f20;
  --mint: #daf1de;
  --muted: #a8c8b5;
  --gold: #ffeb97;
  --line: #8eb69b45;
  --ink: #102e25;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 0 0, #8eb69b45, transparent 43rem), linear-gradient(135deg, #163832 0%, #082722 48%, #031817 100%); min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; border: 1px solid #e4c567; border-radius: 7px; padding: .8rem 1.25rem; font-weight: 600; background: var(--gold); color: #173529; min-height: 46px; transition: background .15s, border-color .15s; }
button:hover { background: #f6dc80; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
button.secondary { background: #051f2080; color: var(--gold); border-color: #e6c666; }
button.secondary:hover { background: #235347; }
button.quiet { background: transparent; border-color: transparent; color: var(--gold); font-size: .875rem; padding: .6rem .8rem; }
button.quiet:hover { background: #8eb69b15; border-color: var(--line); }
.site-header { border-bottom: 1px solid #d4b96755; background: #031a1860; }
.header-inner { max-width: 1200px; margin: auto; padding: 10px 28px; display: flex; gap: 20px; align-items: center; min-height: 100px; }
.brand { display: block; line-height: 0; margin-right: auto; flex-shrink: 0; border-radius: 6px; }
.brand img { width: 280px; height: auto; display: block; mix-blend-mode: screen; }
main { max-width: 1200px; margin: auto; padding: 30px 28px 48px; min-height: calc(100vh - 195px); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.035em; line-height: 1.15; }
h2 { font-size: 1.35rem; font-weight: 500; letter-spacing: -.02em; }
p { line-height: 1.65; }
.small { font-size: .875rem; color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--gold); font-size: .75rem; letter-spacing: .13em; font-weight: 600; text-transform: uppercase; }
.total-panel, .gate, .connect-panel { border: 1px solid var(--line); background: linear-gradient(120deg, #23534760, #051f2090 65%); box-shadow: inset 0 1px 0 #daf1de15, 0 8px 24px #00000012; border-radius: 15px; }
.total-panel { padding: 26px 32px; margin-bottom: 16px; background: radial-gradient(ellipse at 0 0, #8eb69b3d, transparent 65%), linear-gradient(115deg, #163832, #051f2090); border-color: #acc5a366; }
.balance-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.total-panel h2 { color: var(--gold); margin: 0; font-size: 1.5rem; }
.balance-amount-row { display: flex; align-items: center; gap: 14px; }
.total { font-size: clamp(2.5rem, 6.5vw, 5.1rem); font-weight: 550; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#balance-updated { margin: 0; max-width: 190px; text-align: right; font-size: .75rem; }
.balance-amount-row .total { min-width: 0; }
.refresh-button { width: 40px; height: 40px; min-height: 40px; padding: 8px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px; }
.refresh-button svg { width: 22px; height: 22px; }
.refresh-button[aria-busy="true"] svg { animation: refreshing 1s linear infinite; }
@keyframes refreshing { to { transform: rotate(360deg); } }
#refresh-status { margin: 14px 0 0; max-width: 640px; }
#missing-balances { margin: 12px 0 0; }
.activity { color-scheme: light; background: #fff; color: var(--ink); border: 1px solid #fff; border-radius: 14px; padding: 0 12px 8px; box-shadow: 0 12px 30px #00000018; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 14px 12px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; font-weight: 600; }
.activity .small { color: #52695e; font-size: .75rem; }
#empty-transactions { padding: 12px 14px; color: #52695e; }
.table-wrap { width: 100%; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; font-size: .875rem; }
th { font-weight: 500; padding: 12px 14px; background: #edf3ed; color: #244438; border-bottom: 1px solid #dce5de; }
th:first-child { border-radius: 8px 0 0 0; }
th:last-child { border-radius: 0 8px 0 0; }
td { padding: 15px 14px; border-bottom: 1px solid #e0e6e1; vertical-align: top; line-height: 1.5; }
tr:last-child td { border-bottom: 0; }
th.amount { width: 17%; }
th.description { width: 32%; }
th.date { width: 13%; }
th.account-column { width: 24%; }
th.status-column { width: 14%; }
.amount { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.amount { font-size: 1.05rem; font-weight: 550; }
.income { color: #217148; }
.description, .account-column { overflow-wrap: anywhere; }
.date { white-space: nowrap; }
.pending, .posted { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: .75rem; white-space: nowrap; }
.pending { background: #fff1c6; color: #70510b; border: 1px solid #dfbd64; }
.posted { background: #ecf3ea; color: #355b3d; border: 1px solid #b4ccb1; }
.mobile-detail { display: none; }
.sync-details { font-size: .75rem; color: var(--muted); margin: 22px 0 10px; }
.sync-details p { margin: 0 0 3px; }
.connection-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
footer { max-width: 1144px; margin: auto; padding: 22px 0; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; }
.footer-credit { opacity: .8; margin-left: 5px; }
.gate { max-width: 500px; margin: 30px auto; padding: 34px; }
.gate > p { color: var(--muted); }
.gate .eyebrow { color: var(--gold); }
label { display: block; font-size: .875rem; font-weight: 550; margin: 1.1rem 0; }
input { display: block; width: 100%; margin-top: .5rem; border: 1px solid #8eb69b88; padding: .8rem; border-radius: 7px; background: #031c19; color: var(--mint); min-height: 48px; }
input::placeholder { color: #abc6b7; }
form > button { width: 100%; margin: .4rem 0 1.2rem; }
.notice { background: #173e32; border: 1px solid #8eb69b80; color: var(--mint); border-radius: 8px; padding: 14px 18px; margin-bottom: 24px; font-size: .9rem; }
.notice.error { background: #492921; color: #ffe3ce; border-color: #ad7662; }
.connect-panel { padding: 34px; display: flex; align-items: center; gap: 36px; justify-content: space-between; }
.connect-panel > div { max-width: 650px; }
.connect-panel p { color: var(--muted); }
.connect-panel h2 { color: var(--gold); }
.connect-panel button { white-space: nowrap; }
.connection-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--gold); border: 1px solid #d4b96780; border-radius: 10px; font-size: 1.6rem; margin-bottom: 20px; }
.enrollment { background: #8eb69b15; border: 1px solid var(--line); padding: 20px; border-radius: 8px; }
.enrollment dt { font-size: .8rem; color: var(--muted); }
.enrollment dd { margin: 5px 0 15px; }
.enrollment dd:last-child { margin-bottom: 0; }
code { overflow-wrap: anywhere; font-size: 1rem; user-select: all; }
dialog { max-width: min(480px, calc(100% - 32px)); border: 1px solid #8eb69b88; border-radius: 14px; padding: 28px; color: var(--mint); background: #0b2b26; }
dialog::backdrop { background: #00110de0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 0 12px; padding: 10px 18px; min-height: 0; }
  .brand img { width: 225px; }
  #logout { padding: .5rem; font-size: .8rem; }
  main { padding: 22px 18px 32px; }
  .total-panel { padding: 22px; }
  .total-panel h2 { font-size: 1.2rem; }
  .balance-heading-row { gap: 12px; }
  #balance-updated { max-width: 110px; font-size: .65rem; }
  .total { font-size: clamp(2.1rem, 8.8vw, 4rem); }
  .activity { padding: 0 6px 6px; }
  .section-heading { padding: 17px 10px 12px; align-items: center; }
  .section-heading .small { font-size: .65rem; max-width: 70px; text-align: right; }
  table { font-size: .875rem; }
  th, td { padding-left: 9px; padding-right: 9px; }
  th.amount { width: 29%; }
  th.description { width: 48%; }
  th.date { width: 23%; }
  td { padding-top: 16px; padding-bottom: 16px; }
  td.amount { font-size: clamp(.85rem, 3.8vw, 1.1rem); }
  th { font-size: .8rem; }
  .date { font-size: .8rem; }
  .account-column, .status-column { display: none; }
  .mobile-detail { display: block; color: #526c5c; font-size: .7rem; margin-top: 5px; line-height: 1.5; }
  .pending-text { color: #805b0b; }
  .posted-text { color: #376a4a; }
  .connection-actions { justify-content: flex-start; }
  footer { margin: 0 18px; padding: 20px 0; flex-direction: column; text-align: center; gap: 5px; }
  .gate { padding: 26px 22px; margin: 5px auto; }
  .connect-panel { flex-direction: column; align-items: stretch; padding: 26px; gap: 14px; }
  .dialog-actions { flex-direction: column; }
}
@media (max-width: 360px) {
  main { padding-left: 10px; padding-right: 10px; }
  .header-inner { padding-left: 12px; padding-right: 12px; }
  .brand img { width: 196px; }
  .total-panel { padding: 18px; }
  th, td { padding-left: 5px; padding-right: 5px; }
  th { font-size: .75rem; }
  th.amount { width: 34%; }
  th.description { width: 43%; }
  td.amount { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } .refresh-button svg { animation: none !important; } }
