:root {
  color-scheme: light;
  --canvas: #ffffff;
  --paper: #ffffff;
  --wash: #f3f6fb;
  --heading: #162341;
  --ink: #1a2437;
  --quiet: #4b5a72;
  --accent: #2254c7;
  --accent-hover: #173e9b;
  --line: #dce3ee;
  --field-line: #8492a8;
  --warn: #7c4c0c;
  --error: #8d2924;
  font: 100%/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.field-error { color: #982c29; font-size: .9rem; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
.site-layout { min-height: 100vh; display: flex; flex-direction: column; }
.site-footer { margin-top: auto; padding-block: .85rem; border-top: 1px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
main { padding-bottom: .75rem; }
.shell { width: min(66rem, calc(100% - 3rem)); margin-inline: auto; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.032em; }
h1 { font-size: clamp(2.15rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.3rem, 2.45vw, 1.8rem); }
h3 { font-size: 1.05rem; }
.muted { color: var(--quiet); }
a { color: inherit; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); color: var(--heading); }
.header-inner, .site-header nav, .brand {
  display: flex;
  align-items: center;
}
.header-inner { justify-content: space-between; gap: .75rem; min-height: 3.65rem; }
.site-header nav { gap: clamp(.85rem, 3vw, 2rem); }
.service-link { color: var(--accent); font-size: .875rem; white-space: nowrap; }
.service-page { max-width: 46rem; margin-block: 1.5rem; }
.service-page h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); }
.service-page h2 { font-size: 1.18rem; margin-top: 1.35rem; }
.service-page p { margin-top: .55rem; }
.service-note { margin-top: 1.15rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--wash); }
.service-note h2 { margin-top: 0; }
.brand { gap: .65rem; white-space: nowrap; text-decoration: none; font-size: 1.18rem; font-weight: 720; letter-spacing: -.035em; }
.mark, .panel-icon { display: block; flex-shrink: 0; object-fit: contain; }
.mark { width: 2.15rem; height: 2.15rem; }
.skip {
  position: absolute;
  top: .65rem;
  left: .65rem;
  z-index: 4;
  transform: translateY(-180%);
  padding: .6rem 1rem;
  border-radius: .4rem;
  background: var(--paper);
  color: var(--ink);
}
.skip:focus { transform: none; }

#welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.25rem);
  margin-block: clamp(2.5rem, 6vw, 5.2rem) 1rem;
}
.hero { position: relative; }
.hero::before {
  content: "";
  display: block;
  width: 2rem;
  height: 3px;
  margin-bottom: .95rem;
  border-radius: 2px;
  background: var(--accent);
}
.hero h1 {
  color: var(--heading);
  font-size: clamp(2.15rem, 4.5vw, 3.65rem);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -.048em;
}
.hero em { display: block; color: var(--accent); font-style: normal; }
.hero-summary {
  max-width: 23rem;
  margin-top: .95rem;
  color: var(--quiet);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  text-wrap: pretty;
}

.hero-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  padding: clamp(1.15rem, 3vw, 1.8rem);
  border: 1px solid #c8d6ed;
  border-radius: 1.05rem;
  background: linear-gradient(145deg, #f8faff 0%, var(--paper) 70%);
  box-shadow: 0 .45rem 1.4rem #183b7720;
}
.offer-motif {
  position: absolute;
  z-index: -1;
  inset: .9rem .9rem auto auto;
  display: block;
  width: 5.25rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.panel-top { display: flex; align-items: center; gap: .6rem; padding-right: 5.5rem; }
.panel-top h2 { font-size: 1.1rem; }
.panel-icon { width: 2.6rem; height: 2.6rem; }
.panel-price { display: flex; flex-direction: column-reverse; gap: .2rem; }
.panel-price dt { color: var(--quiet); font-size: .9375rem; }
.hero-price, .balance-amount, .activation-price dd {
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hero-price { color: var(--heading); font-size: clamp(2.3rem, 4.8vw, 3.4rem); }
.panel-action { display: flex; align-items: center; justify-content: space-between; gap: .85rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.availability {
  display: flex;
  align-items: center;
  gap: .48rem;
  color: var(--warn);
  font-size: .9375rem;
  line-height: 1.35;
}
.availability::before { content: ""; flex: 0 0 .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.availability.ready { color: #276047; }
#welcome-register { flex-shrink: 0; }
.guide { grid-column: 1 / -1; }
.guide h2 { color: var(--heading); font-size: 1.13rem; }
.guide-grid {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: .7rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .7rem;
  list-style: none;
  color: var(--heading);
  font-size: .9375rem;
}
.guide-grid li { display: flex; align-items: center; gap: .55rem; padding: .8rem 1rem; counter-increment: step; }
.guide-grid li + li { border-left: 1px solid var(--line); }
.guide-grid li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  flex: 0 0 1.65rem;
  aspect-ratio: 1;
  border-radius: .35rem;
  background: #e8efff;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
}

.card { min-width: 0; padding: clamp(.9rem, 2.3vw, 1.35rem); border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); }
.card > p, .card > button, .card > form { margin-top: .8rem; }
.actions, .card-head, .page-head { display: flex; align-items: center; gap: .8rem; }
.actions { flex-wrap: wrap; }
.card-head, .page-head { justify-content: space-between; }
.auth {
  max-width: 32rem;
  margin: clamp(.85rem, 3vw, 2rem) auto 0;
  padding: clamp(.95rem, 3vw, 1.6rem);
}
.auth:has(.guest-option:not([hidden])) { max-width: 55rem; }
.auth h1 { margin-bottom: .95rem; font-size: clamp(1.7rem, 4vw, 2.35rem); }
.auth-layout { display: grid; }
.auth-layout:has(.guest-option:not([hidden])) { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: start; gap: 1.4rem; }
.guest-option { padding: .75rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--wash); }
.guest-option button { width: 100%; }
.guest-option:not([hidden]) + .auth-account #submit-auth { border-color: var(--field-line); background: var(--paper); color: var(--ink); }
.guest-option:not([hidden]) + .auth-account #submit-auth:hover:not(:disabled) { background: var(--wash); }
.auth .actions { justify-content: space-between; margin-top: .75rem; padding-top: .4rem; border-top: 1px solid var(--line); }
#submit-auth { margin-top: .3rem; }
.page-head { margin: clamp(.9rem, 3vw, 1.75rem) 0 .85rem; align-items: baseline; flex-wrap: wrap; }
.sync-state { flex-basis: 100%; color: var(--warn); font-size: .9375rem; }
.cards { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; }
.activation { border-color: #d8e2f5; background: #f4f7ff; }
.activation .card-head { justify-content: flex-start; }
.activation-price { margin-top: 1.1rem; }
.activation-price dt { color: var(--quiet); font-size: .9375rem; }
.country-field { max-width: 20rem; margin-top: .75rem; }
.country-trigger { display: flex; align-items: center; gap: .55rem; width: 100%; margin-top: .28rem; text-align: left; }
.country-trigger::after { content: ''; width: .5rem; height: .5rem; margin: -.25rem .15rem 0 auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.country-picker { width: min(28rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); color: var(--ink); box-shadow: 0 14px 42px #16234130; }
.country-picker::backdrop { background: #16234160; }
.country-picker-header { display: flex; justify-content: space-between; align-items: center; gap: .55rem; }
.country-picker-header h2 { font-size: 1.25rem; }
.country-search { margin-block: .8rem .5rem; }
.country-options { max-height: min(21rem, 50dvh); overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: .2rem; }
.country-options button { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; padding: .45rem .6rem; background: var(--paper); color: var(--ink); text-align: left; font-weight: 500; }
.country-options button:hover:not(:disabled), .country-options button[aria-current] { background: var(--wash); }

@font-face { font-family: 'Country Flags'; src: url('country-flags.woff2') format('woff2'); font-display: swap; }
.flag { width: 1.45rem; flex: 0 0 1.45rem; font: 1.2rem/1 'Country Flags', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.activation-price dd { margin-top: .2rem; }
.balance-amount { margin-top: .45rem; }
.history { margin-block: .75rem; }
.state-message { color: var(--warn); }
.empty-state { padding-top: .75rem; border-top: 1px solid var(--line); color: var(--quiet); }
.badge { display: inline-block; padding: .25rem .55rem; border-radius: .35rem; background: #e4edff; color: #1d4297; font-size: .875rem; }

button, input, select { font: inherit; }
button {
  min-height: 2.85rem;
  padding: .6rem .95rem;
  border: 1px solid transparent;
  border-radius: .52rem;
  background: var(--accent);
  color: white;
  font-weight: 690;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { background: #e2e8f4; color: #50617d; cursor: default; }
.secondary { border-color: var(--field-line); background: var(--paper); color: var(--ink); }
.secondary:hover:not(:disabled) { border-color: var(--accent); background: var(--wash); }
.secondary[aria-pressed="true"] { border-color: var(--accent); background: #e8efff; color: var(--accent); }
.compact { min-height: 2.6rem; padding: .4rem .8rem; font-size: .875rem; }
.link { background: transparent; padding: .35rem .15rem; color: var(--accent); font-weight: 650; }
.link:hover:not(:disabled) { background: transparent; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
form { display: grid; gap: .65rem; }
.auth-field { display: grid; gap: .25rem; }
.auth-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: .45rem; }
.auth-field-head .inline { flex-shrink: 0; gap: .33rem; font-size: .875rem; }
.field-hint { color: var(--quiet); font-size: .875rem; line-height: 1.3; }
.field-hint code { font-size: .93em; }
#auth-form [aria-invalid="true"] { border-color: var(--error); }
label { display: grid; gap: .32rem; color: var(--quiet); font-size: .9375rem; }
input:not([type="checkbox"]), select {
  width: 100%;
  min-height: 2.8rem;
  padding: .55rem .75rem;
  border: 1px solid var(--field-line);
  border-radius: .48rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.inline, .amount-presets, .copy-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.inline input { accent-color: var(--accent); width: 1.08rem; height: 1.08rem; margin: 0; }
.filter { display: flex; align-items: center; gap: .55rem; }
.filter select {
  width: auto;
  max-width: 100%;
  appearance: none;
  padding-right: 2rem;
  background:
    linear-gradient(45deg, transparent 50%, #50617d 50%) right 1rem center / .25rem .25rem no-repeat,
    linear-gradient(135deg, #50617d 50%, transparent 50%) right .75rem center / .25rem .25rem no-repeat,
    var(--paper);
}
.active, .instructions {
  margin-top: .95rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.active > p + *, .active > div + *, .instructions h3 + *, .instructions p + * { margin-top: .55rem; }
.order-wait { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .7rem; }
.instructions p { white-space: pre-wrap; }
.copy-row strong { margin-right: auto; font-variant-numeric: tabular-nums; }
.rows { list-style: none; padding: 0; margin: .55rem 0 0; }
.rows:empty { margin: 0; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: .45rem .8rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--line); }
.rows span, .rows small { overflow-wrap: anywhere; }
.rows small { font-size: .875rem; color: var(--quiet); }
.row-meta { display: block; margin-top: .15rem; }
.rows button { justify-self: start; }
.demo, #notice {
  width: fit-content;
  max-width: 100%;
  margin: .85rem 0;
  padding: .6rem .85rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--wash);
}
#notice.error { color: var(--error); border-color: #d3a6a0; background: #fff0ec; }

@media (max-width: 59rem) {
  #welcome { gap: 1.7rem; }
}
@media (min-width: 46.01rem) and (max-height: 42rem) {
  #welcome { margin-top: 2.45rem; row-gap: 2.4rem; }
}
@media (max-width: 46rem) {
  .shell { width: calc(100% - 2rem); }
  #welcome { grid-template-columns: 1fr; gap: .95rem; margin-top: 1.2rem; }
  .hero::before { display: none; }
  .hero h1 { font-size: clamp(1.75rem, 7.3vw, 2.6rem); letter-spacing: -.036em; }
  .hero em { display: inline-block; }
  .hero-summary { margin-top: .4rem; }
  .hero-panel { gap: .55rem; padding: .9rem; }
  .panel-top { padding-right: 0; }
  .panel-top .panel-icon { width: 1.85rem; height: 1.85rem; }
  .hero-price { font-size: 2rem; }
  .offer-motif { inset: .75rem .85rem auto auto; width: 3.65rem; }
  .panel-action { padding-top: .65rem; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid li { padding: .35rem .65rem; }
  .guide-grid li + li { border-left: 0; border-top: 1px solid var(--line); }
  .cards, .auth-layout:has(.guest-option:not([hidden])) { grid-template-columns: 1fr; }
  .auth-layout:has(.guest-option:not([hidden])) { gap: .7rem; }
}
@media (max-width: 33rem) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .history .card-head { flex-wrap: wrap; }
}
@media (max-width: 25rem) {
  .header-inner { gap: .4rem; }
  .site-header nav { gap: .45rem; }
  .site-header nav .compact { padding-inline: .55rem; }
  .guest-option { padding: 0; border: 0; background: transparent; }
  #auth-form { gap: .5rem; }
  .panel-action { gap: .5rem; }
  #welcome-register { padding-inline: .65rem; }
  .availability { font-size: .875rem; }
  .rows li { grid-template-columns: 1fr; }
}
@media (max-width: 25rem) and (max-height: 38rem) {
  #welcome { margin-block: .85rem 0; gap: .7rem; }
  .hero-panel { gap: .45rem; padding: .8rem; }
  .guide-grid { margin-top: .5rem; }
  .guide-grid li { padding-block: .25rem; }
  .guide-grid li::before { flex-basis: 1.4rem; }
  .auth { padding-block: .85rem; }
  .auth h1 { margin-bottom: .7rem; }
  .auth .actions { margin-top: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
