:root {
  --black: #070707;
  --graphite: #111211;
  --panel: #151514;
  --panel-soft: #1a1917;
  --gold: #d3a454;
  --gold-bright: #f0c777;
  --gold-dim: #8d692e;
  --wine: #4a090d;
  --red: #8f171d;
  --text: #f2f0eb;
  --muted: #aaa59c;
  --line: rgba(211, 164, 84, 0.32);
  --success: #79c56b;
  --danger: #d56464;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--black); color: var(--text); }
body { overflow-x: hidden; }
button, a { font: inherit; }
button { color: inherit; }

.carbon-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 85% 7%, rgba(114, 14, 19, .28), transparent 34%),
    radial-gradient(circle at 0% 82%, rgba(91, 10, 14, .2), transparent 38%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px),
    #080808;
  pointer-events: none;
}

.app-shell { position: relative; min-height: 100dvh; max-width: 760px; margin: 0 auto; padding-bottom: 112px; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 13px;
  min-height: 78px; padding: var(--safe-top) 18px 12px;
  background: linear-gradient(180deg, rgba(7,7,7,.98), rgba(7,7,7,.88) 75%, transparent);
  backdrop-filter: blur(14px);
}
.brand-mark { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; }
.topbar-divider { width: 1px; height: 38px; background: linear-gradient(transparent, var(--gold), transparent); opacity: .65; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.identity strong, .identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity strong { font-size: 15px; letter-spacing: .03em; }
.identity span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #27231e; border: 1px solid var(--line); color: var(--gold); font-size: 11px; font-weight: 800; overflow: hidden; background-size: cover; background-position: center; }
.icon-button { border: 1px solid var(--line); background: rgba(20,19,17,.8); border-radius: 12px; width: 40px; height: 40px; }
.bell { color: var(--gold); opacity: .72; }

.view { padding: 8px 18px 24px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 8vw, 42px); letter-spacing: -.035em; }
.page-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.card {
  position: relative; overflow: hidden; background: linear-gradient(155deg, rgba(24,23,21,.97), rgba(10,10,10,.98));
  border: 1px solid var(--line); border-radius: 22px; padding: 19px; box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.card + .card, .section + .section { margin-top: 14px; }
.subscription-card::before, .gift-card.ready::before {
  content: ""; position: absolute; inset: 0; opacity: .28; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(110,10,16,.65) 0 4px, transparent 4px 11px);
}
.card > * { position: relative; }
.brand-title { font-size: 25px; font-weight: 850; letter-spacing: .07em; }
.tariff-title { margin-top: 4px; color: var(--gold-bright); font-size: 20px; font-weight: 750; }
.status-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(121,197,107,.42); border-radius: 999px; background: rgba(41,87,35,.18); color: #a8d99d; font-size: 12px; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.status-pill.warn { color: #e2b95f; border-color: rgba(226,185,95,.4); background: rgba(100,68,14,.16); }
.status-pill.off { color: #df8585; border-color: rgba(223,133,133,.35); background: rgba(110,21,25,.18); }
.term { color: var(--muted); margin: 18px 0 10px; line-height: 1.5; }
.term strong { color: var(--gold-bright); }
.progress-track { height: 9px; border: 1px solid var(--gold-dim); border-radius: 999px; overflow: hidden; background: #080808; }
.progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5b080d, #ab2026); border-radius: inherit; transition: width .35s ease; }

.actions { display: grid; gap: 10px; margin-top: 18px; }
.button {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 12px 16px;
  border-radius: 15px; border: 1px solid var(--line); background: rgba(13,13,12,.84); color: var(--gold-bright);
  text-decoration: none; cursor: pointer;
}
.button.primary { color: #160d02; border-color: #ebc77e; background: linear-gradient(120deg, #b98234, #f0c777 48%, #9c6a28); font-weight: 750; }
.button[disabled] { cursor: not-allowed; opacity: .45; filter: grayscale(.5); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stat-card { padding: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: rgba(18,18,17,.78); }
.stat-label { display: block; color: var(--muted); font-size: 13px; }
.stat-value { display: block; margin-top: 8px; color: var(--gold-bright); font-size: 22px; font-weight: 750; }
.traffic-list { display: grid; gap: 10px; }
.traffic-card { padding: 15px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(10,10,10,.7); }
.traffic-card header { display: flex; justify-content: space-between; gap: 12px; }
.traffic-card small { display: block; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.exhausted { color: #e19570; }

.section-title { margin: 24px 0 11px; color: var(--gold); font-size: 15px; letter-spacing: .02em; }
.list { display: grid; gap: 10px; }
.list-button {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 15px; text-align: left; color: var(--text);
  background: linear-gradient(145deg, rgba(22,22,21,.96), rgba(11,11,11,.96)); border: 1px solid var(--line);
  border-radius: 16px; text-decoration: none; cursor: pointer;
}
.list-button .glyph { width: 34px; color: var(--gold); font-size: 21px; text-align: center; }
.list-button strong { display: block; font-size: 14px; }
.list-button small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.chevron { margin-left: auto; color: var(--gold); }

.tariff-list { display: grid; gap: 13px; }
.tariff-card { display: grid; gap: 14px; }
.tariff-top { display: flex; justify-content: space-between; gap: 16px; }
.tariff-price { color: var(--gold-bright); text-align: right; font-size: 22px; font-weight: 750; white-space: nowrap; }
.tariff-price small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 3px; }
.tariff-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 10px; border-radius: 999px; color: #d7d1c8; background: #191816; border: 1px solid rgba(255,255,255,.08); font-size: 11px; }
.availability { color: #a8d99d; font-size: 13px; }
.availability.closed { color: #df8585; }

.gift-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 14px; }
.tab { padding: 10px 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: #10100f; color: var(--muted); font-size: 11px; }
.tab.active { color: var(--gold-bright); border-color: var(--gold-dim); }
.gift-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }

.empty-state, .error-state { text-align: center; padding: 38px 20px; }
.empty-state .brand-mark { width: 96px; height: 96px; margin-bottom: 18px; }
.empty-state h1, .error-state h1 { margin: 0; font-size: 25px; }
.empty-state p, .error-state p { color: var(--muted); line-height: 1.55; }
.maintenance { min-height: calc(100dvh - 130px); display: grid; place-items: center; }

.bottom-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20; width: min(760px, 100%);
  grid-template-columns: repeat(5, 1fr); align-items: end; padding: 10px 8px var(--safe-bottom);
  background: rgba(8,8,8,.94); border-top: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(18px);
}
.bottom-nav:not([hidden]) { display: grid; }
.nav-item { position: relative; display: grid; place-items: center; gap: 5px; border: 0; background: transparent; color: #888580; font-size: 10px; min-height: 54px; cursor: pointer; }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--gold-bright); }
.nav-primary { transform: translateY(-9px); width: 66px; height: 66px; justify-self: center; border: 1px solid var(--gold-dim); border-radius: 50%; background: radial-gradient(circle, #5d3511, #17110b 66%); color: var(--gold-bright); box-shadow: 0 0 24px rgba(210,151,62,.18); }
.nav-primary .nav-icon { font-size: 27px; }

.skeleton { border-radius: 14px; background: linear-gradient(90deg, #171717 20%, #24211d 50%, #171717 80%); background-size: 220% 100%; animation: shimmer 1.4s infinite linear; }
.title-skeleton { width: 52%; height: 36px; margin: 20px 0; }
.hero-skeleton { height: 280px; }
.row-skeleton { height: 90px; margin-top: 14px; }
.row-skeleton.short { width: 72%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@keyframes shimmer { to { background-position: -220% 0; } }
@media (min-width: 680px) {
  .view { padding-inline: 32px; }
  .topbar { padding-inline: 32px; }
  .tariff-list { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
