@font-face {
  font-family: Bricolage;
  src: url('/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/dm-sans.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --back: #0b1019;
  --card: #111923;
  --input: #0d141d;
  --line: #303946;
  --light: #f5f2e9;
  --secondary: #b4becb;
  --gold: #ecd29a;
  --gold-line: #705e3f;
  --display: Bricolage, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--back); color: var(--light); font: 16px/1.5 'DM Sans', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.wrap { width: min(1140px, calc(100% - 80px)); margin: 0 auto; }
.skip { position: absolute; inset: -60px auto auto 10px; background: var(--gold); color: var(--back); padding: 9px 14px; }
.skip:focus { top: 10px; }
.mast { border-bottom: 1px solid var(--line); }
nav { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 16px; }
nav .back { margin-inline-start: auto; }
.language-select { color: var(--light); background: var(--input); border: 1px solid var(--line); padding: 8px; border-radius: 8px; font: inherit; font-size: .86rem; cursor: pointer; max-width: 12em; }
[dir="rtl"] .back span, [dir="rtl"] #jump button>span:last-child { transform: scaleX(-1); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .stats strong { letter-spacing: normal; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 750 23px/1 var(--display); letter-spacing: .09em; }
.brand:hover { text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--secondary); font-weight: 600; font-size: .88rem; padding: 10px 0; }
.back span { color: var(--gold); }
.intro { padding: clamp(32px,5vw,68px) 0 30px; }
.mode { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: .79rem; font-weight: 650; }
.mode i { width: 8px; height: 8px; border: 2px solid var(--gold); border-radius: 50%; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 650; line-height: 1.1; }
h1 { margin: 13px 0 12px; font-size: clamp(2.4rem,5.2vw,4.6rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.45rem,2.3vw,1.9rem); letter-spacing: -.035em; }
h3 { margin-top: 22px; font-size: 1.09rem; letter-spacing: -.015em; }
.intro p { margin: 0; max-width: 63ch; color: var(--secondary); }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: stretch; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: clamp(20px,2.5vw,32px); }
.card-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); background: var(--input); border-radius: 9px; }
.wallet { background: transparent; border: 0; border-radius: 6px; color: var(--secondary); font-size: .82rem; font-weight: 650; padding: 6px 9px; }
.wallet[aria-pressed=true] { background: #3b3428; color: var(--gold); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 18px; padding: 17px 20px; border: 1px solid #433d33; border-radius: 10px; background: #1d2022; }
.stats span { color: #d7cbb5; font-size: .84rem; }
.stats strong { display: block; font: 600 clamp(2.1rem,3vw,2.8rem)/1.2 var(--display); color: var(--gold); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, auto); gap: 8px 15px; margin: 0; font-size: .9rem; }
dt, .section-copy, .note { color: var(--secondary); }
dd { max-width: 20ch; margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.balance-list { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
label { font-size: .84rem; font-weight: 650; }
.input-wrap { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; padding: 0 14px; background: var(--input); border: 1px solid #495464; border-radius: 8px; }
.input-wrap:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.input-wrap input { min-width: 0; width: 100%; padding: 8px 0; color: var(--light); background: transparent; border: 0; outline: 0; font-size: 1.35rem; font-weight: 600; }
.input-wrap span { color: var(--secondary); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.actions button, #reset { padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-size: .9rem; font-weight: 700; color: #17160f; background: var(--gold); }
.actions .secondary, #reset { color: var(--light); background: transparent; border-color: #485363; }
.actions button:hover:not(:disabled) { background: #f8dfaa; }
.actions .secondary:hover:not(:disabled), #reset:hover, #jump button:hover:not(:disabled) { color: var(--gold); background: #22262b; border-color: var(--gold-line); }
.note { margin: 12px 0 0; font-size: .8rem; }
.section-copy { margin: 10px 0 20px; font-size: .94rem; max-width: 50ch; }
#jump { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#jump button { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1px 6px; align-items: center; text-align: start; overflow-wrap: anywhere; padding: 9px 11px; border: 1px solid var(--line); color: var(--light); background: var(--input); border-radius: 8px; }
#jump button>span:first-child { grid-column: 1/-1; color: var(--secondary); font-size: .75rem; }
#jump b { font: 620 1.04rem/1.35 var(--display); }
#jump button>span:last-child { color: var(--gold); }
.ledger-info { border-bottom: 1px solid var(--line); padding-bottom: 19px; margin: 22px 0 18px; }
ul { list-style: none; padding: 0; margin: 9px 0 0; }
li { padding: 6px 0; color: var(--secondary); font-size: .86rem; }
li+li { border-top: 1px solid var(--line); }
#notice { min-height: 1.6em; margin: 14px 0; font-size: .92rem; color: var(--gold); }
#notice.error { color: #ffb8a0; }
footer { padding: 16px 0 28px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
footer p { margin: 0; max-width: 60ch; color: var(--secondary); font-size: .85rem; }
#reset { white-space: nowrap; font-weight: 550; font-size: .82rem; }
@media(max-width:800px) {
  .wrap { width: min(100% - 40px,680px); }
  .grid { grid-template-columns: 1fr; }
  nav { min-height: 62px; }
  .intro { padding: 30px 0 24px; }
}
@media(max-width:440px) {
  .wrap { width: calc(100% - 30px); }
  .card { padding: 18px; }
  .stats { gap: 10px; padding: 12px; }
  .stats span { display: block; }
  footer { flex-direction: column; align-items: flex-start; }
  nav { flex-wrap: wrap; gap: 5px 12px; padding-block: 9px; }
  nav .back { max-width: 38%; min-width: 0; line-height: 1.2; }
  .language-select { max-width: 7.5em; }
  .tabs { max-width: 100%; }
  .wallet { min-width: 0; }
  h1 { overflow-wrap: anywhere; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); overflow-wrap: anywhere; }
}
