* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.7 var(--font); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: .25em; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.03em; }
h3 { font-size: 1.25rem; letter-spacing: -.02em; }
img, svg { max-width: 100%; }
button:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
.container { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.positive { color: var(--positive); } .negative { color: var(--negative); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 1rem; top: -8rem; z-index: 100; padding: .75rem 1rem; background: var(--accent); color: var(--surface); }
.skip:focus { top: 1rem; }
/* Opaque base materials keep text contrast independent of ambient light. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; padding: .7rem 1.15rem; border: 1px solid #71829a; border-radius: var(--r-control); background: var(--glass), #17243acc; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 1px 0 #ffffff16, 0 3px 8px #02071133; text-decoration: none; font-weight: 600; line-height: 1.4; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.btn-primary { color: #0f192b; border-color: #79f6e1; border-bottom-color: #189d92; background: linear-gradient(155deg, #a2f9e7, #35e6cb 44%, #00cfbd); box-shadow: inset 0 1px 0 #edfff9b3, inset 0 -3px 0 #087e794d, 0 5px 0 #062b32, 0 12px 24px -10px #00e5cc55; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); border-color: #b5c2d6; box-shadow: inset 0 1px 0 #ffffff22, 0 9px 18px #02071155; }
  .btn-primary:hover { border-color: #b2ffef; box-shadow: inset 0 1px 0 #ffffffb3, inset 0 -3px 0 #087e794d, 0 5px 0 #062b32, 0 16px 32px -10px #00e5cc70; }
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #02071140; }
.btn-primary:active { transform: translateY(3px); box-shadow: inset 0 2px 5px #087e7955, 0 1px 0 #062b32, 0 6px 18px -10px #00e5cc44; }
.btn:disabled { transform: none; }
.btn-danger { color: var(--negative); border-color: var(--negative); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.card { background: var(--material); border: 1px solid #ffffff0d; border-radius: var(--r-card); padding: var(--s5); box-shadow: var(--shadow); }
.card-premium { border: 1px solid transparent; background: var(--material) padding-box, var(--edge) border-box; box-shadow: var(--shadow-raised); transition: transform .25s var(--ease), box-shadow .25s; }
@media (hover: hover) and (pointer: fine) { .card-premium:hover { transform: translateY(-5px); box-shadow: var(--edge-light), 0 6px 12px #02071155, 0 32px 54px -18px #020711dd, -10px 20px 52px -22px #00e5cc55, 20px 24px 58px -24px #7c5cff55, 12px 30px 54px -28px #ff5fa24d; } }
.gradient-number { color: #c2afff; background: var(--spectrum); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
/* Real money movements retain their semantic color, never a decorative gradient. */
.positive, .negative { background: none; -webkit-text-fill-color: currentColor; }
.field { display: grid; gap: .5rem; }
.field + .field { margin-top: 1rem; }
input, select, textarea { min-height: 48px; width: 100%; color: var(--text); background: linear-gradient(145deg, #0b1425, #17243a); box-shadow: inset 0 2px 5px #02071140, 0 1px 0 #ffffff09; border: 1px solid var(--control); border-radius: var(--r-control); padding: .7rem .85rem; }
/* Native menus need explicit colors as well as the closed select control. */
select { color-scheme: dark; background-color: var(--surface); color: var(--text); }
select option, select optgroup { background-color: var(--surface); color: var(--text); }
input[aria-invalid='true'] { border-color: var(--negative); }
.field-error { color: var(--negative); font-size: .875rem; }
.otp { display: flex; gap: .5rem; }
.otp input { min-width: 0; width: 2.7rem; padding: .5rem 0; text-align: center; font-family: var(--mono); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border: 1px solid var(--border); border-radius: 99px; font-size: .875rem; }
.badge-success { color: var(--positive); border-color: #00e87a66; }
.badge-error { color: var(--negative); border-color: #ff507066; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 1rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .875rem; font-weight: 500; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
[role='tab'] { min-height: 44px; border: 1px solid var(--control); border-radius: var(--r-control); padding: .5rem 1rem; background: transparent; }
[role='tab'][aria-selected='true'] { border-color: var(--accent); color: var(--accent); background: #00e5cc0a; }
[role='tabpanel'] { padding-block: 1rem; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 1.5rem; color: var(--text); background: var(--material); border: 1px solid #71829a66; border-radius: var(--r-modal); box-shadow: var(--shadow); }
dialog[open] { animation: modal-in .18s var(--ease); }
dialog::backdrop { background: #030916bb; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; width: min(360px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--material); border: 1px solid var(--control); border-left: 3px solid var(--positive); padding: 1rem; border-radius: var(--r-control); box-shadow: var(--shadow); margin-top: .5rem; }
.toast-error { border-left-color: var(--negative); }
.empty, .notice { padding: 1.25rem; background: var(--material); border: 1px solid #ffffff10; box-shadow: var(--shadow); border-radius: var(--r-control); }
.skeleton { height: 1.2rem; margin-block: .75rem; background: #a8b7cc1c; border-radius: 4px; }
.skeleton-lg { height: 3.5rem; width: 70%; }
.copy-value { display: flex; align-items: center; gap: 1rem; }
.copy-value code { min-width: 0; overflow-wrap: anywhere; }
.mobile-nav { display: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .mobile-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); } .mobile-nav a, .mobile-nav button { min-height: 56px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
input[type='checkbox'] { width: 20px; min-height: 20px; accent-color: var(--accent); flex: none; }
textarea { min-height: 120px; resize: vertical; }

@media (max-width: 800px) { .btn { backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { .btn:hover, .btn:active, .card-premium:hover { transform: none; } }
@media (forced-colors: active) { .gradient-number { background: none; -webkit-text-fill-color: currentColor; } .card, .btn { border: 1px solid CanvasText; } }
/* The fixed negative red needs a deeper backing on the lighter material stops. */
.negative, .field-error, .badge-error, .btn-danger { background: #0f192b; }
.negative, .field-error { padding: .1em .3em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
