:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --panel: rgba(255, 255, 255, .045);
  --panel-strong: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .105);
  --line-soft: rgba(255, 255, 255, .065);
  --text: #f5f7fb;
  --muted: #8f98a9;
  --muted-2: #687181;
  --gold: #f5b301;
  --gold-light: #ffd86b;
  --gold-dark: #e8890c;
  --green: #3ddc97;
  --red: #ff6d7c;
  --blue: #67a8ff;
  --radius: 19px;
  --shadow: 0 12px 36px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  padding: 0 0 calc(82px + env(safe-area-inset-bottom));
  background:
    radial-gradient(800px 440px at 50% -160px, rgba(245, 179, 1, .19), transparent 68%),
    radial-gradient(560px 480px at 100% 78%, rgba(55, 102, 190, .14), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
.hidden { display: none !important; }

.gate {
  min-height: 100vh;
  padding: 25vh 28px 40px;
  text-align: center;
  background:
    radial-gradient(500px 320px at 50% 25%, rgba(245, 179, 1, .14), transparent 70%),
    var(--bg);
}
.gate-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  color: #1b1302;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  box-shadow: 0 8px 30px rgba(245, 179, 1, .28);
}
.gate h1 { max-width: 320px; margin: 0 auto 10px; font-size: 25px; line-height: 1.08; }
.gate p { max-width: 320px; margin: 0 auto; color: var(--muted); line-height: 1.5; }

#app { max-width: 680px; margin: 0 auto; }
.topbar {
  min-height: calc(74px + env(safe-area-inset-top));
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(11, 14, 19, .96), rgba(11, 14, 19, .76) 76%, transparent);
  backdrop-filter: blur(18px);
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #1b1302;
  font-size: 21px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  box-shadow: 0 5px 21px rgba(245, 179, 1, .25), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.brand-title { font-size: 17px; font-weight: 780; line-height: 1.1; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; }
.icon-button {
  width: 37px;
  height: 37px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
  font-size: 23px;
  line-height: 1;
}
.icon-button:active { transform: scale(.95); }

main { padding: 2px 15px 20px; }
.screen { display: none; animation: appear .2s ease-out; }
.screen.active { display: block; }
@keyframes appear { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card {
  position: relative;
  margin: 0 0 13px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
}
.hero-card {
  padding: 21px 18px 18px;
  background:
    radial-gradient(360px 170px at 15% 0%, rgba(245, 179, 1, .16), transparent 70%),
    var(--panel);
}
.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero-value {
  margin: 8px 0 3px;
  color: var(--gold-light);
  font-size: clamp(42px, 12vw, 62px);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: .96;
  text-shadow: 0 4px 30px rgba(245, 179, 1, .2);
}
.hero-value.compact { font-size: 42px; }
.hero-meta { min-height: 18px; color: var(--muted); font-size: 12px; }
.primary-button, .secondary-button {
  min-height: 45px;
  padding: 0 17px;
  border-radius: 13px;
  font-weight: 750;
  border: 0;
  transition: transform .12s ease, filter .12s ease;
}
.primary-button {
  color: #1b1302;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  box-shadow: 0 6px 22px rgba(245, 179, 1, .24), inset 0 1px 0 rgba(255,255,255,.62);
}
.primary-button:active { transform: scale(.965); filter: brightness(.94); }
.secondary-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
}
.secondary-button:active { transform: scale(.975); }
.wide { width: 100%; margin-top: 15px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.metric-card { min-height: 105px; margin-bottom: 13px; padding: 15px; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 12px; }
.metric-card b { display: block; margin: 11px 0 4px; font-size: 23px; letter-spacing: -.04em; }
.metric-card small { font-size: 11px; }
.section-head { min-height: 21px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2 { margin: 0; font-size: 16px; line-height: 1.2; }
.muted, .card p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card p { margin: 10px 0 0; }
.product-card { padding-bottom: 16px; }
.product-name { margin-top: 17px; font-size: 19px; font-weight: 750; }
.key-value { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0 0; color: var(--muted); font-size: 12px; }
.key-value b { color: var(--text); font-size: 12px; font-weight: 650; text-align: right; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.live { color: var(--green); border-color: rgba(61,220,151,.38); background: rgba(61,220,151,.08); }
.status-pill.warn { color: var(--gold-light); border-color: rgba(245,179,1,.4); background: rgba(245,179,1,.08); }
.status-pill.danger { color: var(--red); border-color: rgba(255,109,124,.4); background: rgba(255,109,124,.08); }
.alert-card { border-color: rgba(245,179,1,.27); }

.package-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.package-card {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.035);
  text-align: left;
}
.package-card.selected { border-color: rgba(245,179,1,.72); background: rgba(245,179,1,.09); box-shadow: 0 0 0 1px rgba(245,179,1,.17), 0 8px 20px rgba(245,179,1,.08); }
.package-card b { display: block; margin-top: 7px; font-size: 21px; }
.package-card small { color: var(--muted); font-size: 11px; }
.package-card .package-price { color: var(--gold-light); font-size: 13px; font-weight: 750; }
.route-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 15px; padding: 4px; border-radius: 13px; background: rgba(0,0,0,.22); }
.route-tab { min-height: 37px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 700; }
.route-tab.active { color: #1b1302; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.route-panel { padding-top: 17px; }
.route-title { font-size: 15px; font-weight: 750; }
.field-label { display: block; margin: 17px 0 7px; color: var(--muted); font-size: 11px; }
.field {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: rgba(0,0,0,.19);
}
.field:focus { border-color: rgba(245,179,1,.62); box-shadow: 0 0 0 3px rgba(245,179,1,.1); }
.quote-box { margin-top: 11px; padding: 13px; border: 1px dashed rgba(245,179,1,.35); border-radius: 13px; color: var(--muted); background: rgba(245,179,1,.045); font-size: 12px; line-height: 1.55; }
.quote-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.quote-line b { color: var(--text); font-weight: 650; text-align: right; }
.quote-line.total { margin-top: 6px; padding-top: 9px; border-top: 1px solid rgba(245,179,1,.2); color: var(--gold-light); }
.quote-line.total b { color: var(--gold-light); font-size: 14px; }
.route-status { min-height: 18px; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.legal-card ul { margin: 12px 0 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.legal-card li + li { margin-top: 8px; }

.date-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 15px; }
.date-fields .field { min-width: 0; padding: 0 8px; font-size: 12px; }
.date-fields span { color: var(--muted-2); }
.usage-total { background: radial-gradient(370px 170px at 12% 0%, rgba(103,168,255,.14), transparent 70%), var(--panel); }
.usage-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.usage-list, .payments-list { margin-top: 14px; }
.usage-row { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.usage-row:first-child { border-top: 0; }
.usage-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.usage-row-head b { font-weight: 700; }
.usage-row-head span { color: var(--muted); }
.usage-bar { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.usage-bar > i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #9d7cff); }
.usage-row-foot { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted-2); font-size: 10px; }
.empty-state { padding: 20px 4px 6px; color: var(--muted-2); font-size: 13px; text-align: center; }
.payment-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.payment-row:first-child { border-top: 0; }
.payment-title { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.payment-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.payment-right { text-align: right; }
.payment-amount { font-size: 14px; font-weight: 750; }
.payment-status { display: inline-block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.payment-status.paid { color: var(--green); }
.payment-status.pending { color: var(--gold-light); }
.support-card { background: radial-gradient(350px 150px at 100% 0, rgba(103,168,255,.11), transparent 70%), var(--panel); }
.links-card { padding: 4px 17px; }
.link-row { width: 100%; display: flex; justify-content: space-between; padding: 15px 0; border: 0; border-top: 1px solid var(--line-soft); color: var(--text); background: transparent; text-align: left; font-size: 13px; }
.link-row:first-child { border-top: 0; }
.link-row span { color: var(--muted); font-size: 20px; line-height: 12px; }
.roadmap-row { display: flex; align-items: center; gap: 12px; padding: 13px 0 0; color: var(--muted); font-size: 12px; }
.roadmap-row b { color: var(--gold-light); font-size: 11px; }

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 1px;
  min-height: calc(67px + env(safe-area-inset-bottom));
  padding: 6px 9px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(11,14,19,.9);
  backdrop-filter: blur(20px);
}
.tab { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; color: var(--muted-2); background: transparent; font-size: 10px; font-weight: 650; }
.tab-icon { display: grid; place-items: center; height: 22px; font-size: 22px; line-height: 1; }
.tab.active { color: var(--gold-light); filter: drop-shadow(0 0 8px rgba(245,179,1,.28)); }
.toast { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 18px; z-index: 20; max-width: 600px; margin: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: rgba(23,28,37,.96); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: none; }

@media (min-width: 620px) {
  main { padding-right: 20px; padding-left: 20px; }
  .package-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .topbar { padding-right: 20px; padding-left: 20px; }
}
