@font-face { font-family: "Bodoni Moda"; src: url(fonts/BodoniModa.woff) format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Sora"; src: url(fonts/Sora.woff) format("woff"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #F6F0E4; --paper-up: #FFFCF6; --track: #E8DFCF; --line: #DCD2BF;
  --ink: #2A1B3D; --muted: #6B5F7A;
  --mint: #7FE0C2; --teal: #0B7A63; --salmon: #F4876B; --rust: #B8432A;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden; position: relative;
  background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 "Sora", system-ui, sans-serif;
}
#rosette { position: fixed; top: -90px; left: 50%; width: 760px; height: 760px; transform: translateX(-50%); pointer-events: none; z-index: 0; }
#rosette path { fill: none; stroke: var(--ink); stroke-width: .5; opacity: .07; }

.top, main, footer { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 800 17px/1 "Bodoni Moda", Georgia, serif; }
.brand img { border-radius: 50%; width: 30px; height: 30px; }
.tag { border: 1px solid var(--teal); color: var(--teal); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; }

h1 { font: 800 clamp(30px, 8.5vw, 38px)/1.1 "Bodoni Moda", Georgia, serif; margin: 28px 0 8px; }
h2 { font: 800 22px/1.2 "Bodoni Moda", Georgia, serif; margin: 34px 0 10px; }
.lead { color: var(--muted); margin: 0 0 22px; }

.field { display: block; margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.center { text-align: center; }

select, .money, .stepper {
  width: 100%; min-height: 52px; border-radius: var(--r); background: var(--paper-up);
  border: 1px solid var(--line); color: var(--ink);
}
select {
  appearance: none; -webkit-appearance: none; padding: 0 40px 0 14px; font: 600 16px "Sora", sans-serif;
  background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(-45deg, transparent 50%, var(--teal) 50%);
  background-size: 7px 7px; background-repeat: no-repeat;
  background-position: right 21px center, right 14px center;
}
.money { display: flex; align-items: center; padding: 0 14px; }
.money input {
  flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; color: var(--ink);
  font: 700 22px "Sora", sans-serif;
}
.money input::placeholder { color: #A99FB3; font-weight: 500; }
.cur { color: var(--teal); font-weight: 700; font-size: 14px; margin-left: 8px; }
select:focus-visible, .money:focus-within, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steppers .field { margin: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; text-align: center; overflow: hidden; }
.stepper button { height: 50px; border: 0; background: none; color: var(--teal); font: 500 22px/1 "Sora", sans-serif; cursor: pointer; }
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper output { font: 700 18px "Sora", sans-serif; }

.primary, .secondary {
  display: block; width: 100%; min-height: 52px; border-radius: var(--r); cursor: pointer;
  font: 700 16px "Sora", sans-serif; transition: transform .12s ease;
}
.primary { margin-top: 18px; border: 0; background: var(--ink); color: var(--paper); }
.secondary { margin-top: 28px; background: none; border: 1px solid var(--ink); color: var(--ink); }
.primary:active, .secondary:active { transform: scale(.98); }
.error { color: var(--rust); font-weight: 600; font-size: 14px; margin: 12px 0 0; }

.hero { text-align: center; padding-top: 22px; }
.kicker { font-size: 15px; margin: 0; color: var(--muted); }
.big { font: 900 clamp(76px, 24vw, 104px)/1 "Bodoni Moda", Georgia, serif; color: var(--teal); margin: 4px 0 2px; }
.big small { font-size: .45em; vertical-align: .55em; margin-left: 3px; }
.sub { font-size: 16px; margin: 0 0 18px; }
.sub strong { font-weight: 700; }
.scale { position: relative; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.scale-fill { height: 100%; width: 0; background: var(--mint); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.scale-mid { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--ink); }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }

.card { background: var(--paper-up); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { font: 800 26px/1.1 "Bodoni Moda", Georgia, serif; margin: 0 0 4px; overflow-wrap: anywhere; }
.stat-label { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 0; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--track); border-radius: var(--r); }
.tabs button { min-height: 44px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: 600 14px "Sora", sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--paper-up); box-shadow: 0 1px 2px rgba(42, 27, 61, .14); }

.rank { list-style: none; padding: 0; margin: 10px 0 0; }
.rank button {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; width: 100%; padding: 10px 2px; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.rank .home-row button { background: rgba(127, 224, 194, .24); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.rank .name { font-weight: 600; font-size: 14px; }
.rank .pct { font-weight: 700; font-size: 14px; }
.rank .note { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.rank .bar { grid-column: 1 / -1; height: 5px; border-radius: 9px; background: var(--track); margin-top: 4px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--mint); }
.rank .bar i.low { background: var(--salmon); }

.headline-buy { font: 800 19px/1.25 "Bodoni Moda", Georgia, serif; margin: 2px 0 8px; }
.headline-buy em { font-style: normal; color: var(--teal); }
.headline-buy em.dear { color: var(--rust); }
.buy { list-style: none; margin: 0; padding: 0; }
.buy li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.buy b { font-weight: 700; color: var(--teal); white-space: nowrap; }
.buy b.dear { color: var(--rust); }

.method { margin-top: 22px; color: var(--muted); font-size: 13.5px; }
.method summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ink); cursor: pointer; }
footer { padding-top: 22px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; }
footer a { color: var(--teal); display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { .scale-fill, .primary, .secondary { transition: none; } }
