:root {
  --bg: #ffffff;
  --ink: #000000;
  --ink-2: #202020;
  --muted: #6b6b6b;
  --line: #e1e1e1;
  --surface: #f6f6f6;
  --accent: #c9584c;
  --accent-ink: #ffffff;
  --ok: #2e7d4f;
  --warn: #b8860b;
  --err: #b3261e;
  --font-display: "Chivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-card: 16px;
  --r-btn: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px -18px rgba(0, 0, 0, 0.25);
  --pad: clamp(16px, 4vw, 24px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.6vw, 16px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(var(--pad), env(safe-area-inset-top)) var(--pad)
    calc(var(--pad) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 4px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand .ico {
  width: 39px;
  height: 39px;
}

/* Wifi mark next to "WIFI": vertically centred, and coloured by the connection
   status (green connected / amber busy / red error). */
.wifi-ico {
  align-self: center;
  vertical-align: middle;
  color: var(--ok);
}

.wifi-ico.is-busy {
  color: var(--warn);
}

.wifi-ico.is-err {
  color: var(--err);
}

.hdr-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hdr-label {
  color: var(--muted);
}

.hdr-state {
  color: var(--ink);
  font-weight: 700;
}

.hdr-time {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.hdr-extend {
  width: auto;
  min-height: 13px;
  padding: 1px 4px;
  font-size: 0.33rem;
}

/* On narrow screens the status/time won't fit beside the title, so it drops to
   its own centred row directly under the title. */
@media (max-width: 560px) {
  .hdr-status {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .account {
    order: 2;
    margin-left: auto;
  }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: clamp(22px, 6vw, 27px);
}

.word-sep {
  color: var(--line);
  font-weight: 300;
}

.word-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: clamp(22px, 6vw, 27px);
  color: var(--muted);
}

.ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.account {
  color: var(--ink);
}

.main {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vw, 18px);
  flex: 1;
}

.offers {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vw, 18px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  margin: 4px 0 0;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  flex: none;
  display: block;
  width: 10px;
  height: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}

.dot.is-busy {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent);
}

.dot.is-err {
  background: var(--err);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 20%, transparent);
}

h1 {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  letter-spacing: 0.01em;
  line-height: 1.12;
}

.lede {
  margin: -4px auto 0;
  text-align: center;
  color: var(--muted);
  max-width: 34ch;
  font-size: 0.95rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  padding: var(--pad);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-plus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tag-accent {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent);
}

.badge {
  position: absolute;
  top: -11px;
  right: 16px;
  padding: 5px 12px;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.feat li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.feat li::before {
  content: "\2713";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  line-height: 1;
}

.unit {
  color: var(--muted);
  font-size: 0.9rem;
}

.price-sub {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.price-sub strong {
  color: var(--ink-2);
}

.durations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dur {
  min-height: 56px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.dur span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
}

.dur.is-on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, #fff);
}

.dur.is-on span {
  color: var(--accent);
}

/* Official PayPal button (PayPal gold, PayPal's own logo artwork) — rendered as
   plain HTML so it is fully branded and visible the instant the modal opens,
   with no SDK to download and nothing to wait for. */
.paypal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-btn);
  background: #ffc439;
  cursor: pointer;
  transition: background 0.15s ease;
}

.paypal-btn:hover {
  background: #f0b72f;
}

.paypal-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.paypal-btn .paypal-logo {
  height: 22px;
  width: auto;
  display: block;
}

.pay-modal {
  border: 0;
  padding: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border-radius: var(--r-card);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.pay-modal::backdrop {
  background: rgba(12, 12, 12, 0.5);
}

.pay-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.pay-modal-title {
  margin: 0 0 2px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn {
  min-height: 52px;
  width: 100%;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.assurance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.assurance .ico {
  width: 16px;
  height: 16px;
}

.pass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line));
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--ok) 6%, #fff);
}

.pass.is-expired {
  border-color: color-mix(in srgb, var(--err) 40%, var(--line));
  background: color-mix(in srgb, var(--err) 6%, #fff);
}

.pass-now {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pass-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pass-time {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pass.is-expired .pass-time {
  color: var(--err);
}

.pass-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pass-venue {
  color: var(--muted);
  font-size: 0.8rem;
}

.btn-sm {
  width: auto;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.neutral {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
}

.hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.85rem;
}

.hint-x {
  flex: none;
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.hint-x:hover {
  color: var(--ink);
}

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
}

.links a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.links a:hover {
  border-bottom-color: var(--ink);
}

.links span {
  color: var(--line);
}

.copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 460px);
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok {
  background: var(--ok);
}

.toast.err {
  background: var(--err);
}

@media (min-width: 820px) {
  .page {
    max-width: 1000px;
    gap: 18px;
  }
  .main {
    gap: 14px;
  }
  .offers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
  }
  .offers .card {
    height: 100%;
  }
  .offers .card > .btn {
    margin-top: auto;
  }
  .divider {
    flex-direction: column;
  }
  .divider::before,
  .divider::after {
    width: 1px;
    height: auto;
    flex: 1;
  }
  .divider span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.22em;
  }
}

/* ---------- Install-app prompt ---------- */
.save {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 14px;
  background: var(--surface-2, #fafafa);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.save-text {
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}
.save .btn-sm {
  width: auto;
  flex: 0 0 auto;
}
.save-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.save-row {
  display: flex;
  gap: 8px;
}
.save-url {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong, #d4d4d4);
  border-radius: 10px;
  background: #fff;
  color: var(--muted, #6f6f6f);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
}
.save-note {
  margin: 0;
  color: var(--muted, #6f6f6f);
  font-size: 0.8rem;
  line-height: 1.45;
}
.btn-sm {
  height: 40px;
  padding: 0 14px;
  flex: none;
}
@media (max-width: 460px) {
  .save-row { flex-wrap: wrap; }
  .save-url { flex-basis: 100%; }
}
