:root {
    --ink: #0f0f10;
    --ink-2: #3d3a36;
    --muted: #6d6860;
    --black: #0d0d0e;
    --black-2: #19191c;
    --red: #e10600;
    --red-dark: #b80500;
    --red-tint: #fde8e6;
    --green: #0f7a3d;
    --green-tint: #e3f4ea;
    --amber: #a35a00;
    --paper: #f6f3ee;
    --card: #ffffff;
    --line: #e7e1d8;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(20, 16, 10, 0.05), 0 10px 30px rgba(20, 16, 10, 0.07);
    --head: "Inter Tight", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: rgba(225, 6, 0, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2 { font-family: var(--head); letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgba(225, 6, 0, 0.45); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.neg { color: var(--red); }
.warn { color: var(--amber); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 50px; padding: 0 26px;
    border: 0; border-radius: 999px;
    font: 600 16px/1 "Inter", sans-serif;
    text-decoration: none; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 6px 0; opacity: 0.75; }
.link-btn:hover { opacity: 1; text-decoration: underline; }

/* Top bar */
.bar { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 10; }
.bar-inner {
    width: min(1200px, calc(100% - 40px)); margin: 0 auto;
    display: flex; align-items: center; gap: 28px; min-height: 70px;
}
.brand img { height: 34px; width: auto; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a {
    color: rgba(255, 255, 255, 0.72); text-decoration: none; font-weight: 600; font-size: 15px;
    padding: 9px 16px; border-radius: 999px;
}
.tabs a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tabs a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.14); }
.who { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.who-name { font-weight: 600; }
.who-name em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--red); padding: 3px 8px; border-radius: 999px; margin-left: 6px; }
.who form { margin: 0; }

.wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 40px 0 80px; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.sub { color: var(--muted); margin-top: 8px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 10px; text-decoration: none; }

/* Stat tiles */
.grid-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--card); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-big { font-family: var(--head); font-weight: 800; font-size: clamp(34px, 4.4vw, 48px); letter-spacing: -0.03em; line-height: 1.05; margin: 10px 0 8px; }
.stat-foot { color: var(--muted); font-size: 14px; }
.stat-hero { background: var(--black); color: #fff; }
.stat-hero .stat-label, .stat-hero .stat-foot { color: rgba(255, 255, 255, 0.66); }
.stat-hero.is-low .stat-big { color: #ff6b61; }
.stat.is-low:not(.stat-hero) .stat-big { color: var(--red); }
.stat-warn { margin-top: 12px; font-size: 14px; font-weight: 600; color: #ff8b82; }
.meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; margin: 6px 0 12px; }
.meter span { display: block; height: 100%; background: var(--red); border-radius: inherit; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.card-head a { font-size: 14px; font-weight: 600; color: var(--red); text-decoration: none; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.split > .card, .stack > .card { margin-bottom: 0; }
.stack { display: grid; gap: 18px; }
.empty { color: var(--muted); padding: 18px 0; }
.help { color: var(--muted); font-size: 14px; margin-top: 18px; }

.filter {
    border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px;
    min-width: 220px; background: var(--paper);
}
.filter:focus { outline: none; border-color: var(--red); background: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 0 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td a { font-weight: 600; text-decoration: none; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #faf8f4; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.pill-in { background: var(--green-tint); color: var(--green); }
.pill-out { background: #efebe5; color: var(--ink-2); }
.pill-live { background: var(--green-tint); color: var(--green); }
.pill-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #18a957; margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.pill-warn { background: #fff1db; color: var(--amber); margin-left: 6px; }
.row-flag td { background: #fffaf1; }
.notice { background: #fff1db; color: #6b3d00; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin-bottom: 14px; }
.fixed { display: block; font-size: 12px; color: var(--muted); }
.fix-cell { text-align: right; }
.fix summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--red); list-style: none; }
.fix summary::-webkit-details-marker { display: none; }
.fix[open] summary { margin-bottom: 8px; }
.fix-form { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 13px; }
.fix-form label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.fix-form input { border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; color: var(--ink); }
.fix-form input[type="number"] { width: 72px; }
.fix-form input[type="text"] { width: 150px; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.rules ul { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.rules li { margin-bottom: 6px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); font-size: 13px; }
.list a { font-weight: 600; text-decoration: none; }

/* Weekly bars */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; height: 200px; align-items: end; }
.bar-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; }
.bar-col .bar-fill { align-self: end; display: block; background: var(--black); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.bar-col:last-child .bar-fill { background: var(--red); }
.bar-val { font-size: 12px; font-weight: 600; color: var(--ink-2); min-height: 18px; }
.bar-lbl { font-size: 12px; color: var(--muted); }
.bar-col > .bar-fill { grid-row: 2; }

/* Buy */
.head-balance { background: var(--black); color: #fff; border-radius: var(--radius); padding: 14px 22px; text-align: right; }
.head-balance span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.6); }
.head-balance strong { font: 800 26px/1.2 var(--head); letter-spacing: -0.02em; }
.head-balance.is-low strong { color: #ff6b61; }
.buy { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.buy-main { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 30px; }
.buy-side { display: grid; gap: 18px; position: sticky; top: 90px; }
.buy-side .card { margin: 0; }
.step { display: flex; align-items: center; gap: 10px; font: 700 17px/1.2 var(--head); margin: 0 0 14px; padding: 0; }
.step span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--black); color: #fff; font-size: 13px; }
.packages { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.packages legend { grid-column: 1 / -1; }
.package { position: relative; cursor: pointer; }
.package input { position: absolute; opacity: 0; }
.package-body { display: grid; gap: 4px; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; transition: border-color 0.15s, box-shadow 0.15s; }
.package:hover .package-body { border-color: #cbbfae; }
.package input:checked + .package-body { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-tint); }
.package input:focus-visible + .package-body { outline: 3px solid rgba(225, 6, 0, 0.45); outline-offset: 2px; }
.package-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.package-name { font-weight: 700; }
.package-price { font: 800 34px/1.1 var(--head); letter-spacing: -0.03em; }
.package-meta { color: var(--muted); font-size: 14px; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: var(--red); color: #fff; padding: 3px 8px; border-radius: 999px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 14px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pay-tabs { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.pay-tab { border: 0; background: none; font: 600 15px/1 "Inter", sans-serif; padding: 10px 22px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.pay-tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 16, 10, 0.12); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.secure { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }
.pay-panel .form-error, #pay-error { margin-top: 14px; }
.summary dl { margin: 14px 0 0; }
.summary dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 600; }
.summary-total { border-bottom: 0 !important; font-size: 18px; }
.summary-total dd { font: 800 24px/1 var(--head); }
.done { text-align: center; padding: 56px 28px; max-width: 560px; margin: 20px auto; }
.done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--green-tint); color: var(--green); font-size: 32px; font-weight: 700; display: grid; place-items: center; margin: 0 auto 18px; }
.done .sub { margin-bottom: 18px; }
.done-balance { font-size: 18px; margin-bottom: 24px; }
.done-balance strong { font: 800 28px/1 var(--head); }
.done .notice { text-align: left; }

/* Login */
.is-login { background: var(--black); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; }
.login-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 13, 14, 0.1) 30%, rgba(13, 13, 14, 0.85)); }
.login-art-copy { position: absolute; left: 48px; right: 48px; bottom: 48px; color: #fff; z-index: 1; }
.kicker { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: #ff6b61; margin-bottom: 10px; }
.login-tag { font-family: var(--head); font-weight: 800; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.03em; line-height: 1.05; max-width: 14ch; }
.login-panel { background: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 88px); }
.login-panel > * { width: 100%; max-width: 380px; }
.login-logo { height: 44px; width: auto; margin-bottom: 40px; }
.pin-form { margin-top: 28px; display: grid; gap: 16px; }
.pin-input {
    width: 100%; text-align: center; font: 700 34px/1 var(--head); letter-spacing: 0.4em; padding: 16px 0 16px 0.4em;
    border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.pin-input:focus { outline: none; border-color: var(--red); }
.pin-input::placeholder { color: #cfc7bb; }
.form-error { color: var(--red); font-weight: 600; font-size: 15px; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button {
    min-height: 60px; border: 0; border-radius: var(--radius-sm); background: #fff; box-shadow: 0 1px 2px rgba(20, 16, 10, 0.08);
    font: 700 22px/1 var(--head); color: var(--ink); cursor: pointer; transition: background 0.15s, transform 0.08s;
}
.keypad button:hover { background: #f0ece6; }
.keypad button:active { transform: scale(0.97); }
.keypad .key-soft { font: 600 15px/1 "Inter", sans-serif; color: var(--muted); background: transparent; box-shadow: none; }

@media (max-width: 980px) {
    .grid-stats, .grid-4 { grid-template-columns: 1fr 1fr; }
    .stat-hero { grid-column: 1 / -1; }
    .split { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .buy { grid-template-columns: 1fr; }
    .buy-side { position: static; }
}
@media (max-width: 760px) {
    .packages, .row-2 { grid-template-columns: 1fr; }
    .row-3 { grid-template-columns: 1fr 1fr; }
    .row-3 .field:last-child { grid-column: 1 / -1; }
    .buy-main { padding: 20px; }
    .head-balance { text-align: left; }
    .login { grid-template-columns: 1fr; }
    .login-art { display: none; }
    .bar-inner { flex-wrap: wrap; gap: 10px 18px; padding: 12px 0; }
    .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
    .who { margin-left: auto; }
    .who-name { display: none; }
    .wrap { padding-top: 28px; }
    .head { flex-direction: column; align-items: flex-start; }
    .card { padding: 20px; }
    .card-head { flex-wrap: wrap; }
    .filter { min-width: 0; width: 100%; }
    .bars { gap: 6px; height: 170px; }
    .bar-val { font-size: 10px; }
}
@media (max-width: 480px) {
    .grid-stats, .grid-4 { grid-template-columns: 1fr; }
}
