:root {
  --ink: #0b0c10;
  --paper: #f7f7f5;
  --muted: rgba(247, 247, 245, 0.58);
  --faint: rgba(247, 247, 245, 0.34);
  --line: rgba(247, 247, 245, 0.12);
  --gold: #e6c07b;
  --surface: rgba(255, 255, 255, 0.035);
  --err: #f0b4b4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding: 0 0 calc(28px + env(safe-area-inset-bottom));
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.top {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 0 0;
}

.k {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.min {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.min input {
  width: 112px;
  height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--paper);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.min input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sent {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--faint);
  padding-bottom: 14px;
}

main { width: 100%; }

.empty, .sum, .again, .status, .err, footer {
  width: min(720px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 12px;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  max-width: 28rem;
  margin-bottom: 28px;
}

.call, .ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  border: 0;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.call {
  background: var(--paper);
  color: var(--ink);
}

.call:hover { filter: brightness(1.05); }
.call:active { opacity: 0.9; }
.call:focus-visible, .ghost:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ghost {
  margin-top: 10px;
  min-height: 52px;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 500;
}

.ghost:active { background: var(--surface); }

.stage-wrap {
  width: 100%;
  margin: 0 0 18px;
}

.stage {
  position: relative;
  width: 100%;
  background: #050608;
}

.stage img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.overlay { position: absolute; inset: 0; }

.mark {
  position: absolute;
  border: 1px solid rgba(230, 192, 123, 0.75);
  box-shadow: inset 0 0 0 1px rgba(11, 12, 16, 0.4);
}

.pill {
  position: absolute;
  left: -1px;
  top: -1px;
  max-width: min(240px, 86vw);
  padding: 5px 8px 6px;
  background: #0b0c10;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.3;
  pointer-events: none;
}

.pill .n {
  display: block;
  font-weight: 500;
}

.pill .p {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.status {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 12px;
}

.err {
  color: var(--err);
  margin-bottom: 14px;
  line-height: 1.45;
}

.sum {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 16px 10px;
  margin-bottom: 16px;
}

.total {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.total small {
  display: block;
  margin-top: 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.items {
  list-style: none;
  margin-top: 10px;
}

.items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
  font-size: 16px;
}

.items .why {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
  margin-top: 3px;
  font-weight: 400;
}

.items .px {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--gold);
  white-space: nowrap;
  padding-top: 2px;
}

.again { margin-top: 8px; }

footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.6;
}

@media (min-width: 720px) {
  .stage-wrap {
    width: min(720px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
  }
}
