:root {
  color-scheme: dark;
  --bg: #0d100d;
  --surface: #151915;
  --surface-2: #1a1f1a;
  --surface-3: #202620;
  --text: #f2f4ec;
  --muted: #a4aba0;
  --muted-2: #7b8378;
  --line: rgba(236, 241, 226, 0.12);
  --line-strong: rgba(236, 241, 226, 0.2);
  --accent: #baff39;
  --accent-hover: #c9ff64;
  --accent-text: #10140d;
  --cyan: #76d8e8;
  --danger: #ff7181;
  --danger-soft: rgba(255, 113, 129, 0.1);
  --success: #9af06c;
  --warning: #f2c761;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
  --font-main: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; max-width: 100%; overflow-x: hidden; background: var(--bg); }
body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 2%, rgba(118, 216, 232, 0.07), transparent 27rem),
    radial-gradient(circle at 8% 0%, rgba(186, 255, 57, 0.055), transparent 24rem),
    var(--bg);
  font: 500 16px/1.5 var(--font-main);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
body.has-modal,
body.support-modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 14px; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.035em; }
h1 { font-size: clamp(34px, 4.2vw, 62px); font-weight: 700; }
h2 { font-size: clamp(24px, 2.6vw, 36px); font-weight: 680; }
h3 { font-size: 19px; font-weight: 650; }
.small { font-size: 14px; }
.muted { color: var(--muted); }

button, .button, input, textarea, select { font: inherit; }
button, .button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
button:hover, .button:hover { background: var(--accent-hover); transform: translateY(-1px); }
button:active, .button:active { transform: translateY(0); }
button:disabled, .button[disabled] { opacity: 0.48; cursor: not-allowed; transform: none; }
.secondary, .button.secondary {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--line);
}
.secondary:hover, .button.secondary:hover { background: #283028; border-color: var(--line-strong); }
.danger, button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 113, 129, 0.34);
}
.danger:hover, button.danger:hover { color: #fff; background: rgba(255, 113, 129, 0.18); }
.logout-button {
  min-height: 40px;
  padding: 0 15px;
  color: var(--danger);
  background: transparent;
  border-color: rgba(255, 113, 129, 0.28);
}
.logout-button:hover { color: #fff; background: rgba(255, 113, 129, 0.12); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input, textarea, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  background: #111511;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
textarea { min-height: 132px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(186, 255, 57, 0.58); box-shadow: 0 0 0 3px rgba(186, 255, 57, 0.08); }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 650; }
form { display: grid; gap: 14px; }
code, pre { font-family: "SFMono-Regular", Consolas, monospace; }

.page { position: relative; z-index: 1; max-width: 100%; }
.layout {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding-inline: clamp(12px, 2vw, 32px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}
.app-header::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: rgba(13, 16, 13, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: inherit;
  pointer-events: none;
}
.admin-user-search { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-user-search label { flex: 1 1 240px; min-width: 0; }
.admin-user-search input { width: 100%; }
.header-brand { flex: 0 0 auto; display: flex; align-items: center; }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; width: 172px; height: 58px; object-fit: contain; object-position: left center; }
.header-navigation { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav a {
  min-height: 42px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a.active { color: var(--accent-text); background: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.header-tools form { display: block; }
.account-chip { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.account-initial { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-text); background: var(--accent); font-size: 13px; font-weight: 800; }
.account-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.mobile-nav-toggle { display: none; min-height: 42px; padding: 0 15px; color: var(--text); background: var(--surface-2); border-color: var(--line); }
.content { min-width: 0; padding: 42px 0 72px; transition: opacity 150ms ease, transform 150ms ease; }
.content.is-swapping { opacity: 0.35; transform: translateY(5px); }
.topbar { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.topbar h1 { max-width: 980px; font-size: clamp(30px, 3.2vw, 46px); }
.page-eyebrow, .section-label, .support-widget__eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.app-footer { padding: 24px 0 34px; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 13px; }
.app-footer div { display: flex; gap: 20px; }
.app-footer a:hover { color: var(--text); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr); gap: 16px; }
.overview-primary, .overview-secondary, .profiles-section, .card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.overview-primary { min-height: 360px; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(270px, .82fr); overflow: hidden; }
.balance-summary { min-width: 0; padding: clamp(28px, 4vw, 58px); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.balance-summary > strong { max-width: 100%; display: block; color: var(--text); font-size: clamp(48px, 6vw, 92px); line-height: .94; letter-spacing: -.065em; white-space: nowrap; font-weight: 680; }
.balance-summary .metric-value-compact { font-size: clamp(44px, 5.2vw, 78px); }
.balance-summary .button { margin-top: 34px; }
.overview-facts { border-left: 1px solid var(--line); display: grid; grid-template-rows: repeat(3, 1fr); }
.overview-fact { min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-bottom: 1px solid var(--line); }
.overview-fact:last-child { border-bottom: 0; }
.overview-fact span { color: var(--muted); font-size: 13px; }
.overview-fact strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: clamp(25px, 2.4vw, 40px); line-height: 1; letter-spacing: -.045em; white-space: nowrap; }
.overview-secondary { min-height: 360px; padding: 30px; display: flex; flex-direction: column; }
.days-value { margin-top: 22px; font-size: clamp(54px, 6vw, 88px); line-height: .9; letter-spacing: -.06em; }
.days-caption { margin-top: 9px; color: var(--muted); }
.secondary-charge { margin-top: auto; padding: 18px 0; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.secondary-charge span { color: var(--muted); }
.overview-secondary .small { margin-top: 16px; margin-bottom: 0; }
.profiles-section { margin-top: 16px; padding: clamp(22px, 3vw, 34px); }
.section-heading { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2 { font-size: clamp(26px, 2.8vw, 40px); }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(310px, .72fr) minmax(0, 1.45fr); gap: 16px; align-items: start; }
.card { min-width: 0; padding: clamp(22px, 3vw, 34px); }
.card > h2:first-child { margin-bottom: 12px; }
.card > p { color: var(--muted); }
.card a:not(.button) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.metric { min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.metric > span { font-size: 14px; }
.metric > strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: clamp(34px, 4vw, 62px); line-height: .95; letter-spacing: -.055em; white-space: nowrap; }
.notice { margin: 0 0 16px; padding: 15px 17px; color: #e8d7a6; background: rgba(242, 199, 97, 0.08); border: 1px solid rgba(242, 199, 97, 0.24); border-radius: 12px; }
.success-notice { color: var(--success); background: rgba(154, 240, 108, 0.07); border-color: rgba(154, 240, 108, 0.22); }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-md); background: #101410; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 17px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted-2); font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
td { color: #dfe3d9; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 150ms ease; }
tbody tr:hover { background: rgba(255,255,255,.022); }
.profiles-table { table-layout: fixed; }
.profiles-table th:nth-child(1) { width: 34%; }
.profiles-table th:nth-child(2) { width: 13%; }
.profiles-table th:nth-child(3) { width: 12%; }
.profiles-table th:nth-child(4) { width: 15%; }
.profiles-table th:nth-child(5) { width: 26%; }
.profiles-table td { min-width: 0; overflow-wrap: anywhere; }
.rename-profile-form { margin-top: 12px; grid-template-columns: minmax(145px, 1fr) auto; gap: 8px; }
.rename-profile-form input { min-height: 42px; }
.rename-profile-form button { min-height: 42px; padding-inline: 12px; font-size: 13px; white-space: nowrap; }
.actions { width: 100%; display: grid; gap: 8px; }
.actions form { display: flex; width: 100%; }
.profile-config-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.compact-action, .revoke-button { width: 100%; min-width: 0; min-height: 42px; padding-inline: 10px; font-size: 14px; white-space: nowrap; }
.download-action { grid-column: 1 / -1; width: 100%; }
.revoke-profile-form { display: block; width: 100%; }
.tooltip-wrap { width: 100%; }
.tooltip-wrap { display: inline-flex; position: relative; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.badge.ok { color: var(--success); border-color: rgba(154,240,108,.28); background: rgba(154,240,108,.07); }
.badge.warn { color: var(--warning); border-color: rgba(242,199,97,.28); background: rgba(242,199,97,.07); }
.badge.danger { color: var(--danger); border-color: rgba(255,113,129,.28); background: rgba(255,113,129,.07); }

.device-picker { display: grid; gap: 10px; }
.device-option { position: relative; grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #111511; cursor: pointer; }
.device-option:hover { border-color: var(--line-strong); }
.device-option input { width: 20px; min-height: 20px; accent-color: var(--accent); }
.device-option span { display: grid; gap: 3px; }
.device-option strong { color: var(--text); }
.device-option small { color: var(--muted); font-weight: 500; }
.plan-card { display: flex; flex-direction: column; min-height: 360px; }
.plan-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.plan-card > strong { margin: 30px 0 20px; font-size: clamp(36px, 4vw, 56px); line-height: 1; letter-spacing: -.05em; }
.cols-4 .plan-card > strong { font-size: clamp(34px, 3vw, 44px); white-space: nowrap; }
.benefit { flex: none; padding: 6px 9px; color: var(--accent-text); background: var(--accent); border-radius: 7px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.muted-benefit { color: var(--muted); background: var(--surface-3); }
.plan-lines { color: var(--muted); }
.plan-card form { margin-top: auto; }
.plan-card button { width: 100%; }
.payment-modal, .legal-modal, .qr-modal { position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 20px; }
.payment-modal[hidden], .legal-modal[hidden], .qr-modal[hidden] { display: none; }
.payment-modal__backdrop, .legal-modal__backdrop, .qr-modal__backdrop { position: absolute; inset: 0; background: rgba(4,6,4,.72); backdrop-filter: blur(10px); }
.payment-modal__panel, .legal-modal__panel, .qr-modal__panel { position: relative; z-index: 1; width: min(590px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow); }
.legal-modal__backdrop {
  background: rgba(4, 6, 4, 0.18);
  backdrop-filter: blur(18px) brightness(0.72);
  -webkit-backdrop-filter: blur(18px) brightness(0.72);
}
button.legal-modal__backdrop {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(4, 6, 4, 0.18);
  transform: none;
}
button.legal-modal__backdrop:hover {
  background: rgba(4, 6, 4, 0.18);
  transform: none;
}
button.legal-modal__backdrop:active { transform: none; }
.legal-modal__panel {
  width: min(1100px, 100%);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 40px;
  background: rgba(26, 31, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.legal-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  font-size: 24px;
}
.legal-modal__close:hover { background: rgba(255, 255, 255, 0.09); }
.legal-modal__content { min-width: 0; }
.legal-modal__content h1 {
  max-width: 940px;
  margin: 0 54px 22px 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.legal-modal__content h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.legal-modal__content p {
  margin: 0 0 14px;
  color: #dfe3d9;
  font-size: 16px;
  line-height: 1.68;
  letter-spacing: 0;
  font-weight: 500;
}
.legal-modal__content ul { margin: 8px 0 18px; padding-left: 24px; }
.legal-modal__content li { margin: 7px 0; color: #dfe3d9; font-size: 16px; line-height: 1.6; font-weight: 500; }
.payment-modal__summary { margin: 22px 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.payment-modal__summary div { padding: 15px; display: grid; gap: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.payment-modal__summary span { color: var(--muted); font-size: 12px; }
.payment-modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

.referral-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin: 22px 0; }
.referral-copy-row pre { margin: 0; min-width: 0; overflow: auto; padding: 14px; color: #dfe3d9; background: #0d110d; border: 1px solid var(--line); border-radius: 11px; white-space: nowrap; }
.referral-rules { display: grid; gap: 2px; color: var(--muted); }
.referral-summary { margin-top: 24px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 28px; border-top: 1px solid var(--line); font-weight: 700; }
.transaction-toggle { width: 100%; margin-top: 12px; }
.instruction-steps { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.instruction-steps > div { padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.instruction-steps > div:nth-child(2n) { border-right: 0; }
.instruction-steps ol { margin: 18px 0 0; padding-left: 21px; color: var(--muted); }
.instruction-steps li + li { margin-top: 9px; }
.legal-content { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0; }
.legal-card { background: var(--surface); }
.legal-card h2 { margin: 30px 0 12px; font-size: 24px; }
.legal-card li { margin: 8px 0; }

.support-widget { display: block; }
.support-widget__toggle { min-height: 40px; padding: 0 14px; color: var(--text); background: transparent; border-color: var(--line); }
.support-widget__toggle:hover { background: var(--surface-3); }
.support-widget__panel { position: fixed; inset: 0; z-index: 900; margin: auto; width: min(620px, calc(100% - 32px)); height: max-content; max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow); animation: modalIn 300ms cubic-bezier(.2,.8,.2,1) both; }
.support-widget__panel[hidden] { display: none; }
.support-widget__panel::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(4,6,4,.72); backdrop-filter: blur(10px); }
.support-widget__panel.is-closing { animation: modalOut 260ms ease both; }
.support-widget__head { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.support-widget__close { width: 42px; min-height: 42px; padding: 0; color: var(--text); background: transparent; border-color: var(--line); font-size: 24px; }
.support-widget__form { gap: 15px; }
.support-widget__form button { margin-top: 4px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-stage { width: min(540px, 100%); }
.auth-panel { padding: clamp(28px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.auth-panel .brand { margin-bottom: 34px; }
.auth-panel .brand-logo { width: 190px; }
.auth-panel > h1 { font-size: clamp(36px, 7vw, 56px); }
.auth-panel > p { margin: 12px 0 24px; color: var(--muted); }
.auth-panel form > button:not(.secondary) { width: 100%; margin-top: 4px; }
.field-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 650; }
.field-head a { color: var(--accent); font-size: 13px; }
.field-compact { margin-top: -14px; }
.check-line { grid-template-columns: auto 1fr; align-items: start; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 500; }
.check-line input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--accent); }
.check-line a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.auth-switch { margin-top: 24px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); }
.footer-links { margin-top: 26px; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted-2); }
.code-input { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .28em; }
.resend-code-form { margin-top: 10px; }
.resend-code-form button { width: 100%; }

.dashboard-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.chart-card { min-height: 210px; }
.mini-chart { height: 110px; display: flex; align-items: flex-end; gap: 4px; }
.mini-chart i { flex: 1; min-width: 4px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .7; }
.stat-row { padding: 12px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stats-card-list, .admin-users-list { display: grid; gap: 12px; }
.stats-card, .admin-user-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #111511; }
.stats-card__head, .admin-user-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.stats-card__id { color: var(--muted-2); font-family: monospace; font-size: 12px; }
.stats-split, .stats-traffic-grid, .stats-pill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.stat-pill { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 4px; }
.stat-pill span { color: var(--muted); font-size: 11px; }
.stats-status, .admin-user-status { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-muted-line { margin: 13px 0 0; color: var(--muted-2); font-size: 12px; }
.admin-user-metrics { margin-top: 18px; }
.admin-user-metrics > div { padding: 12px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 10px; }
.admin-user-actions { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr) auto; gap: 10px; align-items: start; }
.admin-adjust-form { display: grid; grid-template-columns: .65fr 1fr auto; }
.admin-role-form { display: grid; grid-template-columns: 1fr auto; }
.admin-user-profiles { margin-top: 16px; border-top: 1px solid var(--line); }
.admin-user-profiles summary { padding: 16px 0 0; cursor: pointer; color: var(--accent); font-weight: 700; }
.admin-profile-list { margin-top: 14px; display: grid; gap: 8px; }
.admin-profile-row { padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 10px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 1000; padding: 13px 16px; color: var(--accent-text); background: var(--accent); border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; animation: toastIn 220ms ease both; }
.toast.error { color: #fff; background: var(--danger); }
.motion-reveal { opacity: 0; transform: translateY(9px); }
.motion-reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity 360ms ease calc(var(--motion-index, 0) * 35ms), transform 360ms cubic-bezier(.2,.8,.2,1) calc(var(--motion-index, 0) * 35ms); }

@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .app-header { gap: 18px; }
  .nav a { padding-inline: 9px; font-size: 13px; }
  .account-email { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-actions { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-header { min-height: 68px; justify-content: space-between; }
  .brand-logo { width: 150px; height: 52px; }
  .mobile-nav-toggle { display: inline-flex; }
  .header-navigation { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: none; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(21,25,21,.98); box-shadow: var(--shadow); }
  .header-navigation.is-open { display: grid; gap: 14px; animation: modalIn 180ms ease both; }
  .nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .nav a { justify-content: center; }
  .header-tools { padding-top: 12px; justify-content: flex-end; border-top: 1px solid var(--line); }
  .account-email { display: inline; max-width: 210px; }
  .content { padding-top: 30px; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-primary { min-height: 330px; }
  .overview-secondary { min-height: 290px; }
  .days-value { font-size: 72px; }
  .split { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  input, textarea, select { font-size: 16px; }
  .header-tools { display: grid; grid-template-columns: auto 1fr auto; }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .account-chip { justify-self: stretch; }
  .account-email { max-width: 140px; }
  .topbar { margin-bottom: 20px; padding-bottom: 16px; }
  .topbar h1 { font-size: 36px; }
  .overview-primary { grid-template-columns: 1fr; }
  .balance-summary { min-height: 260px; padding: 26px; }
  .balance-summary > strong, .balance-summary .metric-value-compact { font-size: clamp(43px, 13vw, 66px); }
  .overview-facts { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; border-top: 1px solid var(--line); border-left: 0; }
  .overview-fact { padding: 17px 14px; border-right: 1px solid var(--line); border-bottom: 0; }
  .overview-fact:last-child { border-right: 0; }
  .overview-fact strong { font-size: 22px; }
  .overview-fact span { min-height: 38px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading .button { width: 100%; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .instruction-steps { grid-template-columns: 1fr; }
  .instruction-steps > div, .instruction-steps > div:nth-child(2n) { border-right: 0; }
  .instruction-steps > div:last-child { border-bottom: 0; }
  .referral-copy-row { grid-template-columns: 1fr; }
  .referral-copy-row button { width: 100%; }
  .payment-modal__summary { grid-template-columns: 1fr; }
  .payment-modal__summary div { border-right: 0; }
  .app-footer { flex-direction: column; }
  .app-footer div { flex-direction: column; gap: 9px; }
  .stats-split, .stats-traffic-grid, .stats-pill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-adjust-form, .admin-role-form { grid-template-columns: 1fr; }
  .admin-profile-row { align-items: stretch; flex-direction: column; }
  .admin-profile-row button { width: 100%; }

  .profiles-table, .profiles-table tbody, .profiles-table tr, .profiles-table td { display: block; width: 100%; }
  .profiles-table thead { display: none; }
  .profiles-table tr { padding: 18px; border-bottom: 1px solid var(--line); }
  .profiles-table tr:last-child { border-bottom: 0; }
  .profiles-table td, .profiles-table td:first-child, .profiles-table td:last-child { min-width: 0; padding: 8px 0; border: 0; }
  .profiles-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .profiles-table td:first-child { padding-top: 0; }
  .profiles-table td:first-child::before { display: none; }
  .rename-profile-form { grid-template-columns: minmax(0, 1fr) auto; }
  .actions-cell .actions { justify-content: stretch; }
  .profile-config-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .compact-action, .revoke-button, .download-action { width: 100%; }
  .revoke-profile-form { width: 100%; }
}

@media (max-width: 460px) {
  .layout { width: 100%; max-width: none; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .app-header { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .header-brand { min-width: 0; max-width: 132px; }
  .brand-logo { width: 100%; max-width: 132px; }
  .mobile-nav-toggle { min-height: 40px; padding-inline: 13px; }
  .header-tools { grid-template-columns: 1fr 1fr; }
  .nav-support { grid-column: 1 / -1; }
  .support-widget__toggle { width: 100%; }
  .account-email { max-width: 110px; }
  .content { padding: 24px 0 52px; }
  .topbar h1 { font-size: 32px; }
  .balance-summary { min-height: 230px; }
  .balance-summary > strong, .balance-summary .metric-value-compact { font-size: clamp(38px, 12vw, 52px); }
  .overview-facts { grid-template-columns: 1fr; }
  .overview-fact { min-height: 83px; border-right: 0; border-bottom: 1px solid var(--line); }
  .overview-fact:last-child { border-bottom: 0; }
  .overview-fact span { min-height: 0; }
  .overview-secondary { min-height: 260px; padding: 24px; }
  .days-value { font-size: 62px; }
  .card, .profiles-section { padding: 20px; border-radius: 18px; }
  .rename-profile-form { grid-template-columns: 1fr; }
  .profile-config-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-modal__actions { flex-direction: column-reverse; }
  .payment-modal__actions button { width: 100%; }
  .legal-modal { padding: 10px; }
  .legal-modal__panel { max-height: calc(100vh - 20px); padding: 22px 18px; border-radius: 18px; }
  .legal-modal__close { top: 14px; right: 14px; }
  .legal-modal__content h1 { margin-right: 48px; font-size: 26px; }
  .legal-modal__content h2 { font-size: 19px; }
  .legal-modal__content p, .legal-modal__content li { font-size: 15px; }
  .support-widget__panel { padding: 22px 18px; }
  .stats-split, .stats-traffic-grid, .stats-pill-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
