:root {
  --bg: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-card-alt: #111;
  --bg-btn: #1f1f1f;
  --border: #2a2a2a;
  --border-alt: #222;
  --border2: #333;
  --text: #e0e0e0;
  --text-muted: #ccc;
  --text-dim: #888;
  --text-faint: #666;
  --text-faintest: #555;
  --text-bright: #e0e0e0;
}
[data-theme="light"] {
  --bg: #f5f5fa;
  --bg-card: #ffffff;
  --bg-card-alt: #eeeef5;
  --bg-btn: #ededf6;
  --border: #e0e0ee;
  --border-alt: #d8d8ee;
  --border2: #d0d0e0;
  --text: #1a1a2e;
  --text-muted: #444;
  --text-dim: #666;
  --text-faint: #777;
  --text-faintest: #888;
  --text-bright: #1a1a2e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  padding: 24px 16px 48px;
  transition: background .2s, color .2s;
}
.container { max-width: 520px; margin: 0 auto; }

.logo { text-align: center; margin-bottom: 24px; }
.logo h1 { font-size: 1.8rem; font-weight: 700; }
.logo h1 span { color: #7c6bff; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 14px;
  transition: background .2s, border-color .2s;
}

/* ── Статус ── */
.status-card { text-align: center; padding: 28px 22px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 18px; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.status-active   { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.status-trial    { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.status-expired  { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.status-loading  { background: rgba(124,107,255,0.1);  color: #7c6bff;  border: 1px solid rgba(124,107,255,0.2); }

.timer { font-size: 2rem; font-weight: 800; letter-spacing: -1px; margin: 4px 0 2px; }
.timer-label { font-size: 0.8rem; color: var(--text-faintest); }
.unlimited { font-size: 1.4rem; font-weight: 700; color: #34d399; }

.stats-row {
  display: flex; justify-content: center; gap: 28px;
  margin-top: 18px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-val { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); }
.stat-lbl { font-size: 0.75rem; color: var(--text-faintest); margin-top: 2px; }

/* ── Трафик ── */
.traffic-bar-wrap { margin-top: 16px; text-align: left; }
.traffic-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.traffic-label { font-size: 0.78rem; color: var(--text-faintest); }
.traffic-nums { font-size: 0.78rem; color: var(--text-dim); }
.traffic-nums b { color: var(--text-muted); }
.traffic-bar-bg { background: var(--border); border-radius: 6px; height: 6px; overflow: hidden; }
.traffic-bar-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }

/* ── Кнопки ── */
.btn-happ {
  display: block; width: 100%;
  background: #7c6bff; color: white; text-decoration: none;
  padding: 15px; border-radius: 12px; text-align: center;
  font-weight: 700; font-size: 1rem; margin-bottom: 10px;
  transition: background 0.15s; border: none; cursor: pointer;
  font-family: inherit;
}
.btn-happ:hover { background: #6a5aee; }
.btn-happ:active { opacity: 0.85; }

.btn-copy {
  display: block; width: 100%;
  background: var(--bg-btn); color: var(--text-muted); border: 1px solid var(--border2);
  padding: 13px; border-radius: 12px; text-align: center;
  font-size: 0.9rem; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background .2s;
}
.btn-copy:hover { border-color: #7c6bff; color: var(--text); }
.btn-copy.copied { border-color: #34d399; color: #34d399; }

/* ── QR ── */
.qr-wrap {
  display: flex; justify-content: center;
  background: white; border-radius: 12px; padding: 14px;
  margin: 0 auto; width: fit-content;
}

/* ── Приложения ── */
.apps-title { font-size: 0.9rem; font-weight: 600; color: var(--text-dim); margin-bottom: 12px; }
.app-list { display: flex; flex-direction: column; gap: 8px; }
.app-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card-alt); border: 1px solid var(--border-alt); border-radius: 10px;
  padding: 10px 14px;
  transition: background .2s, border-color .2s;
}
.app-name { font-size: 0.9rem; font-weight: 600; }
.app-platforms { font-size: 0.75rem; color: var(--text-faintest); margin-top: 2px; }
.app-links { display: flex; gap: 8px; }
.app-link {
  font-size: 0.75rem; color: #7c6bff; text-decoration: none;
  background: rgba(124,107,255,0.08); padding: 4px 10px; border-radius: 6px;
}
.app-link:hover { background: rgba(124,107,255,0.18); }

/* ── routing.help ── */
.routing-card {
  background: rgba(0,180,120,0.06);
  border: 1px solid rgba(0,180,120,0.2);
}
.routing-title { font-size: 0.95rem; font-weight: 700; color: #34d399; margin-bottom: 6px; }
.routing-text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.55; }
.routing-text a { color: #34d399; text-decoration: none; font-weight: 600; }

/* ── Expired ── */
.expired-card { text-align: center; }
.btn-renew {
  display: block; background: #7c6bff; color: white; text-decoration: none;
  padding: 14px; border-radius: 12px; font-weight: 700; font-size: 1rem;
  margin-top: 14px; transition: background 0.15s;
}
.btn-renew:hover { background: #6a5aee; }

.footer {
  text-align: center; margin-top: 24px;
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.footer a { color: var(--text-faint); text-decoration: none; font-size: 0.82rem; }
.footer a:hover { color: #7c6bff; }

.skeleton { background: var(--border); border-radius: 8px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Nav ── */
nav { position: sticky; top: 0; z-index: 200; background: var(--bg); border-bottom: 1px solid var(--border); transition: background .2s; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1100px; margin: 0 auto; gap: 16px; }
.nav-logo { font-size: 1.15rem; font-weight: 800; text-decoration: none; color: var(--text); }
.nav-logo span { color: #7c6bff; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: #7c6bff; }
.nav-btn { background: #7c6bff; color: #fff; text-decoration: none; padding: 8px 18px; border-radius: 10px; font-size: 0.88rem; font-weight: 600; transition: background .15s; white-space: nowrap; }
.nav-btn:hover { background: #6a5aee; }
.theme-toggle { background: none; border: 1px solid var(--border2); color: var(--text-muted); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s; flex-shrink: 0; }
.theme-toggle:hover { border-color: #7c6bff; color: #7c6bff; }
.burger { display: none; background: none; border: 1px solid var(--border2); color: var(--text-muted); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 600px) {
  .burger { display: flex; }
  .nav { padding: 12px 16px; position: relative; }
  .nav-links { display: none; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg); border-bottom: 1px solid var(--border); z-index: 300; padding: 8px 0; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 20px; font-size: 0.95rem; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
}
