/* ============================================================
   App (auth + dashboard + legal) — light theme
   Used by views/partials/head.ejs. Anonymous app pages keep styles.css.
   ============================================================ */

:root {
  --bg: #f5f7fb;
  --bg-deep: #f5f7fb;
  --card: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e3e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6478;
  --muted-2: #7c869b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8efff;
  --green: #16a34a;
  --green-soft: #e9f8ee;
  --amber: #d97706;
  --amber-soft: #fff4e5;
  --red: #dc2626;
  --red-soft: #fdecec;
  /* legacy variable names used by inline styles in templates */
  --cyan: #2563eb;
  --blue: #2563eb;
  --pink: #dc2626;
  --lime: #16a34a;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --container: 1120px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; border-radius: 8px; }
::selection { background: #cfe0ff; }

/* decorative glows from the dark theme are not used */
.page-glow { display: none; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem;
  border-radius: 11px; background: var(--primary); color: #fff;
  font-size: 0.85rem; font-weight: 800;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.brand-name { font-size: 1.02rem; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.topbar-link {
  display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  color: var(--text); font-weight: 700; font-size: 0.92rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.topbar-link:hover { border-color: var(--primary); color: var(--primary-dark); }
.topbar-link-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.topbar-link-primary:hover { background: var(--primary-dark); color: #fff; }
.topbar-form { display: inline; margin: 0; }
.topbar-form .topbar-link { cursor: pointer; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 1; margin-top: 2rem; padding: 1.4rem 0 calc(1.2rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.footer-inner {
  width: min(calc(100% - 2rem), var(--container)); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 2rem;
  color: var(--muted-2); font-size: 0.86rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-nav a { color: var(--muted); font-weight: 600; }
.footer-nav a:hover { color: var(--primary-dark); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-block; margin: 0 0 0.7rem; padding: 0.25rem 0.7rem;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.1rem; padding: 0.75rem 1.3rem;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: 0.98rem; letter-spacing: 0.01em; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: 0.6; cursor: default; transform: none; }
.button-primary, .button-cta {
  background: var(--primary); color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}
.button-primary:hover, .button-cta:hover { background: var(--primary-dark); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3); }
.button-secondary { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.button-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }
.button-google { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); margin-bottom: 0.5rem; }
.button-google:hover { border-color: var(--text-2); }
.button-full { width: 100%; }

/* ---------- Alerts ---------- */
.alert { margin: 0 0 1.1rem; padding: 0.85rem 1rem; border-radius: 12px; font-size: 0.94rem; line-height: 1.5; border: 1px solid transparent; }
.alert p { margin: 0; }
.alert p + p { margin-top: 0.3rem; }
.alert-error { background: var(--red-soft); color: #991b1b; border-color: #f5c2c2; }
.alert-success { background: var(--green-soft); color: #166534; border-color: #bfe6cb; }

/* ---------- Forms ---------- */
.form-label { display: block; margin-bottom: 0.95rem; }
.form-label > span { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--text-2); }
.form-label-opt { font-weight: 500; color: var(--muted-2); }
.form-input {
  display: block; width: 100%; min-height: 3.1rem; padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  color: var(--text); font-family: inherit; font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder { color: #a3adc2; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14); }
.form-input-code { text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.3em; }

.form-consent {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: flex-start;
  margin-bottom: 0.95rem; padding: 0.85rem 0.95rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer;
  transition: border-color 0.2s ease;
}
.form-consent:hover { border-color: var(--line-strong); }
.form-consent input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.form-consent-box {
  position: relative; display: inline-block; width: 1.3rem; height: 1.3rem; margin-top: 0.1rem;
  border: 2px solid var(--line-strong); border-radius: 6px; background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.form-consent-box::after {
  content: ""; position: absolute; left: 0.36rem; top: 0.1rem; width: 0.3rem; height: 0.6rem;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); opacity: 0;
}
.form-consent input[type="checkbox"]:checked + .form-consent-box { background: var(--primary); border-color: var(--primary); }
.form-consent input[type="checkbox"]:checked + .form-consent-box::after { opacity: 1; }
.form-consent input[type="checkbox"]:focus-visible + .form-consent-box { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }
.form-consent-text { font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.form-consent-text a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }

.captcha-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.captcha-img { height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.captcha-refresh {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text-2);
  font-size: 1.2rem; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease;
}
.captcha-refresh:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ---------- Auth pages ---------- */
.auth-page {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: center;
  min-height: calc(100vh - 220px); padding: 1.5rem 1rem 3rem;
}
.auth-card {
  width: min(100%, 440px); padding: 2.2rem;
  border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff;
  box-shadow: var(--shadow-md);
}
.auth-header { margin-bottom: 1.4rem; }
.auth-header h1 { margin: 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
.auth-subtitle { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.98rem; line-height: 1.5; }
.auth-description { margin: 0 0 1.2rem; color: var(--muted); font-size: 0.96rem; line-height: 1.55; }
.auth-form { margin: 0; }
.auth-form .button { margin-top: 0.3rem; }
.auth-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0; color: var(--muted-2); font-size: 0.84rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.4rem; margin-top: 1.3rem; font-size: 0.92rem; font-weight: 600; }
.auth-links a, .auth-links button { color: var(--primary-dark); background: none; border: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }
.auth-links a:hover, .auth-links button:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-perks { display: grid; gap: 0.45rem; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.auth-perks li { display: flex; align-items: center; gap: 0.55rem; color: var(--text-2); font-size: 0.92rem; font-weight: 600; }
.auth-perks li::before {
  content: ""; width: 1.2rem; height: 1.2rem; border-radius: 50%; flex-shrink: 0;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}
.error-code { font-size: 3.4rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 0.6rem; letter-spacing: -0.03em; }

/* ---------- Legal pages ---------- */
.legal-page { position: relative; z-index: 1; }
.legal-card { padding: 2.2rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-sm); }
.legal-card h1 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
.legal-meta { margin: 0.6rem 0 0; color: var(--muted-2); font-size: 0.9rem; }
.legal-section { margin-top: 1.8rem; }
.legal-section h2 { margin: 0 0 0.7rem; font-size: 1.15rem; font-weight: 800; }
.legal-section p { margin: 0 0 0.8rem; color: var(--text-2); font-size: 0.97rem; line-height: 1.65; }
.legal-section a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.legal-list { margin: 0 0 0.8rem; padding-left: 1.2rem; color: var(--text-2); font-size: 0.97rem; line-height: 1.65; }
.legal-list li { margin-bottom: 0.4rem; }
@media (max-width: 720px) { .legal-card { padding: 1.4rem; } }

/* ---------- Dashboard shell ---------- */
.dash { position: relative; z-index: 1; width: min(calc(100% - 1.5rem), 560px); margin: 0 auto; padding: 0.5rem 0 6.5rem; }
.dash-section { margin-bottom: 1.1rem; }
.dash-section-plain { background: none; }
.dash-section-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.7rem; font-size: 1.08rem; font-weight: 800; }
.dash-section-title svg { color: var(--primary); }

.dash-settings-header { margin: 0.4rem 0 1.2rem; }
.dash-back { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.dash-back:hover { color: var(--primary-dark); }
.dash-name { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.015em; }

/* Hero user card */
.dash-hero {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.6rem 1.2rem 1.4rem; margin-bottom: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-sm);
}
.dash-hero-glow { display: none; }
.dash-avatar {
  display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff;
  font-size: 1.6rem; font-weight: 800; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
.dash-hero-name { margin: 0.8rem 0 0; font-size: 1.4rem; font-weight: 800; }
.dash-hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.86rem; font-weight: 700; cursor: pointer;
}
.dash-hero-badge svg { width: 16px; height: 16px; }
.dash-hero-badge-active { background: var(--green-soft); color: var(--green); }
.dash-hero-badge-expired { background: var(--amber-soft); color: var(--amber); }

/* Tariff alerts */
.dash-tariff-alert { margin-bottom: 1rem; padding: 1rem 1.1rem; border-radius: var(--radius-lg); border: 1px solid transparent; }
.dash-tariff-alert-expired { background: var(--red-soft); border-color: #f5c2c2; }
.dash-tariff-alert-warning { background: var(--amber-soft); border-color: #f7dcb0; }
.dash-tariff-alert-content { display: flex; align-items: flex-start; gap: 0.7rem; }
.dash-tariff-alert-content svg { margin-top: 0.15rem; }
.dash-tariff-alert-expired svg { color: var(--red); }
.dash-tariff-alert-warning svg { color: var(--amber); }
.dash-tariff-alert strong { display: block; font-size: 1rem; }
.dash-tariff-alert p { margin: 0.2rem 0 0; color: var(--text-2); font-size: 0.92rem; }

/* Tariff bar */
.dash-tariff-bar { margin-bottom: 1rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.dash-tariff-bar-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; color: var(--muted); }
.dash-tariff-bar-status { padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.dash-tariff-bar-status-warning { background: var(--amber-soft); color: var(--amber); }
.dash-tariff-bar-status-expired { background: var(--red-soft); color: var(--red); }
.dash-tariff-progress { height: 0.5rem; margin-top: 0.6rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.dash-tariff-progress-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.4s ease; }
.dash-tariff-progress-warning { background: var(--amber); }
.dash-tariff-progress-expired { background: var(--red); }

/* Stats */
.dash-stats { display: flex; align-items: center; margin-bottom: 1rem; padding: 0.9rem 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.dash-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.dash-stat-link:hover .dash-stat-value { color: var(--primary-dark); }
.dash-stat-value { font-size: 1.15rem; font-weight: 800; }
.dash-stat-online { color: var(--green); }
.dash-stat-label { font-size: 0.78rem; color: var(--muted); }
.dash-stat-divider { width: 1px; height: 2rem; background: var(--line); }

/* Hero CTA: open in Incy */
.dash-cta-hero {
  position: relative; display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 1rem; padding: 1rem 1.1rem;
  border-radius: var(--radius-lg); background: var(--primary); color: #fff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
.dash-cta-hero:hover { transform: translateY(-2px); background: var(--primary-dark); }
.dash-cta-hero-glow { display: none; }
.dash-cta-hero-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: rgba(255, 255, 255, 0.18); }
.dash-cta-hero-body { flex: 1; display: flex; flex-direction: column; }
.dash-cta-hero-title { font-size: 1.05rem; font-weight: 800; }
.dash-cta-hero-body small { font-size: 0.84rem; opacity: 0.85; }
.dash-cta-hero-arrow { transform: rotate(180deg); opacity: 0.85; }

/* Connection guide */
.guide { display: grid; gap: 0.5rem; }
.guide-item { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.guide-item[open] { border-color: #bfd3ff; }
.guide-summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.95rem 1.1rem; cursor: pointer; font-weight: 700; list-style: none; }
.guide-summary::-webkit-details-marker { display: none; }
.guide-summary > svg:first-child { color: var(--primary); }
.guide-summary span { flex: 1; }
.guide-summary > svg:last-child { color: var(--muted-2); transition: transform 0.2s ease; }
.guide-item[open] .guide-summary > svg:last-child { transform: rotate(180deg); }
.guide-body { padding: 0 1.1rem 1.1rem; color: var(--text-2); font-size: 0.94rem; line-height: 1.55; }
.guide-body p { margin: 0 0 0.6rem; }
.guide-apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.guide-app {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.guide-app:hover { border-color: var(--primary); background: var(--primary-soft); }
.guide-app svg { color: var(--primary); }
.guide-app strong { display: block; font-size: 0.92rem; }
.guide-app small { display: block; color: var(--muted); font-size: 0.78rem; }
.guide-divider { display: flex; align-items: center; gap: 0.7rem; margin: 0.8rem 0; color: var(--muted-2); font-size: 0.82rem; }
.guide-divider::before, .guide-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guide-steps { margin: 0; padding-left: 1.2rem; }
.guide-steps li { margin-bottom: 0.35rem; }

/* Subscription card */
.dash-sub-card { position: relative; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.dash-sub-glow { display: none; }
.dash-sub-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.dash-sub-status { padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 0.82rem; font-weight: 700; }
.dash-sub-devices { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--bg); color: var(--text-2); font-size: 0.82rem; font-weight: 700; }
.dash-sub-devices svg { width: 15px; height: 15px; }
.dash-sub-devices-full { background: var(--amber-soft); color: var(--amber); }
.dash-sub-fomo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--amber-soft); color: #92400e; font-size: 0.84rem; }
.dash-sub-fomo-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.dash-sub-url-wrap { margin-bottom: 0.8rem; }
.dash-sub-url {
  padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: var(--text-2);
  word-break: break-all; line-height: 1.45;
}
.dash-sub-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%;
  min-height: 3.1rem; border-radius: 999px; background: var(--primary); color: #fff;
  font-weight: 800; font-size: 0.98rem; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}
.dash-sub-btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.dash-sub-btn-hint { margin: 0.5rem 0 0.8rem; text-align: center; color: var(--muted-2); font-size: 0.8rem; }
.dash-sub-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dash-sub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.8rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text);
  font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.dash-sub-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.dash-sub-btn.copied { background: var(--green-soft); border-color: #bfe6cb; color: var(--green); }
.dash-ref-text { margin: 0 0 0.8rem; color: var(--text-2); font-size: 0.92rem; line-height: 1.5; }
.dash-ref-buttons { grid-template-columns: 1fr; }

/* Devices CTA */
.dash-devices-cta {
  display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.7rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}
.dash-devices-cta:hover { border-color: var(--primary); }
.dash-devices-cta-full { border-color: #f7dcb0; background: var(--amber-soft); }
.dash-devices-cta-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); }
.dash-devices-cta-body { flex: 1; display: flex; flex-direction: column; }
.dash-devices-cta-body strong { font-size: 0.98rem; }
.dash-devices-cta-body small { color: var(--muted); font-size: 0.82rem; }
.dash-devices-cta-arrow { color: var(--muted-2); transform: rotate(180deg); }

.dash-tariff-extend {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; min-height: 2.9rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 0.92rem;
}
.dash-tariff-extend-warn { border-color: #f7dcb0; background: var(--amber-soft); color: #92400e; }
.dash-tariff-extend svg { color: var(--amber); }

/* Telegram proxy */
.dash-tg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.dash-tg { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); transition: border-color 0.2s ease; }
.dash-tg:hover { border-color: var(--primary); }
.dash-tg-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.dash-tg-dot-pink { background: var(--primary); }
.dash-tg strong { display: block; font-size: 0.92rem; }
.dash-tg small { display: block; color: var(--muted); font-size: 0.78rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Quick actions */
.dash-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.dash-action-form { margin: 0; display: contents; }
.dash-action {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; width: 100%; padding: 0.85rem 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; color: var(--text);
  font-size: 0.84rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.2s ease;
}
.dash-action:hover { border-color: var(--primary); }
.dash-action-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); }
.dash-action-logout .dash-action-icon { background: var(--red-soft); color: var(--red); }

/* Bottom nav (mobile) */
.dash-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.dash-bottomnav-item { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.4rem 0; border-radius: 12px; color: var(--muted); }
.dash-bottomnav-item small { font-size: 0.66rem; font-weight: 700; }
.dash-bottomnav-active { color: var(--primary); }
@media (min-width: 721px) { .dash-bottomnav { display: none; } .dash { padding-bottom: 2rem; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 5.5rem; z-index: 60;
  display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem;
  border-radius: 999px; background: var(--text); color: #fff; font-size: 0.88rem; font-weight: 700; white-space: nowrap;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(16px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast svg { color: #86efac; }
.toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }

/* QR modal */
.qr-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, 0.55); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease; }
.qr-overlay.active { opacity: 1; visibility: visible; }
.qr-modal { width: min(100%, 360px); padding: 1.6rem; border-radius: var(--radius-xl); background: #fff; text-align: center; box-shadow: var(--shadow-lg); }
.qr-modal canvas { display: block; margin: 0 auto; max-width: 100%; border-radius: 12px; }
.qr-modal-title { margin-bottom: 1rem; font-size: 1.05rem; font-weight: 800; }
.qr-modal-hint { margin: 1rem 0; color: var(--muted); font-size: 0.86rem; }
.qr-close-btn { width: 100%; min-height: 2.9rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer; }
.qr-close-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

/* Settings / tariff card */
.dash-form-card { padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.dash-tariff-card { padding: 1rem 1.1rem; border: 1px solid #bfe6cb; border-radius: var(--radius-lg); background: var(--green-soft); }
.dash-tariff-expired { border-color: #f5c2c2; background: var(--red-soft); }
.dash-tariff-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.dash-tariff-top strong { font-size: 1.05rem; }
.dash-tariff-card p { margin: 0.35rem 0 0; color: var(--text-2); font-size: 0.9rem; }
.dash-proxy-status { padding: 0.2rem 0.65rem; border-radius: 999px; background: #fff; color: var(--green); font-size: 0.8rem; font-weight: 700; }
.dash-tariff-expired .dash-proxy-status { color: var(--red); }

/* Tariff selection */
.tariff-group { margin-bottom: 1.4rem; }
.tariff-group-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.tariff-group-title { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; font-weight: 800; }
.tariff-group-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); }
.tariff-group-icon svg { width: 16px; height: 16px; }
.tariff-group-sub { color: var(--muted-2); font-size: 0.84rem; }
.tariff-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.tariff-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 2rem 0.9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
  color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tariff-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tariff-card-tag { position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%); padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.tariff-card-name { font-size: 0.86rem; font-weight: 700; color: var(--muted); }
.tariff-card-price { margin-top: 0.3rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.tariff-card-price small { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.tariff-card-meta { margin-top: 0.15rem; margin-bottom: 0.9rem; color: var(--muted); font-size: 0.84rem; }
.tariff-card-benefit { margin-top: -0.4rem; margin-bottom: 0.9rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 0.76rem; font-weight: 700; }
.tariff-card-action { margin-top: auto; padding-top: 0.55rem; width: 100%; padding: 0.55rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 0.88rem; font-weight: 800; }
.tariff-card:hover .tariff-card-action { background: var(--primary); color: #fff; }

/* Payment modal */
.pay-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.pay-overlay.active { opacity: 1; pointer-events: auto; }
.pay-modal { width: min(100%, 380px); padding: 1.8rem; border-radius: var(--radius-xl); background: #fff; text-align: center; box-shadow: var(--shadow-lg); transform: translateY(10px); transition: transform 0.2s ease; }
.pay-overlay.active .pay-modal { transform: none; }
.pay-title { margin: 0; font-size: 1.1rem; font-weight: 800; }
.pay-price { margin-top: 0.4rem; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.pay-price small { font-size: 1rem; color: var(--muted); }
.pay-period { margin: 0.2rem 0 1.2rem; color: var(--muted); font-size: 0.9rem; }
.pay-methods { display: grid; gap: 0.5rem; }
.pay-method {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.85rem 0.95rem; text-align: left;
  border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; color: var(--text); cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pay-method:hover { border-color: var(--primary); background: var(--primary-soft); }
.pay-method svg { color: var(--primary); }
.pay-method strong { display: block; font-size: 0.95rem; }
.pay-method small { display: block; color: var(--muted); font-size: 0.8rem; }
.pay-close-btn { margin-top: 0.9rem; width: 100%; min-height: 2.8rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer; }
.pay-close-btn:hover { border-color: var(--text-2); }
.pay-go-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 3.1rem; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25); }
.pay-go-btn:hover { background: var(--primary-dark); }
.pay-spinner { width: 2.4rem; height: 2.4rem; margin: 0.5rem auto 0; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-check { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin: 0 auto 0.8rem; border-radius: 50%; background: var(--green-soft); color: var(--green); }

/* Devices */
.devices-summary { padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.devices-summary-row { display: flex; justify-content: space-between; align-items: center; }
.devices-summary-label { font-weight: 700; color: var(--text-2); }
.devices-summary-value { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); }
.devices-summary-full { color: var(--amber); }
.devices-progress { height: 0.5rem; margin-top: 0.7rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.devices-progress-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.devices-progress-fill-full { background: var(--amber); }
.devices-summary-hint { display: flex; gap: 0.5rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.devices-summary-hint-warning { color: #92400e; }
.devices-summary-hint-warning svg { color: var(--amber); flex-shrink: 0; margin-top: 0.1rem; }
.devices-summary .dash-tariff-extend { margin: 0.8rem 0 0; }
.devices-list { display: grid; gap: 0.6rem; }
.device-card { display: flex; gap: 0.8rem; padding: 0.95rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.device-card-blocked { background: var(--bg); opacity: 0.85; }
.device-card-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); flex-shrink: 0; }
.device-card-blocked .device-card-icon { background: var(--line); color: var(--muted); }
.device-card-body { flex: 1; min-width: 0; }
.device-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.device-card-name { font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-status { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.device-status-active { background: var(--green-soft); color: var(--green); }
.device-status-blocked { background: var(--line); color: var(--muted); }
.device-card-meta { color: var(--muted); font-size: 0.84rem; }
.device-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; }
.device-card-seen { color: var(--muted-2); font-size: 0.8rem; }
.device-toggle-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.device-toggle-btn:disabled { opacity: 0.6; cursor: default; }
.device-toggle-btn-block { color: var(--red); }
.device-toggle-btn-block:hover { border-color: var(--red); }
.device-toggle-btn-unblock { color: var(--green); }
.device-toggle-btn-unblock:hover { border-color: var(--green); }
.device-toggle-icon svg { width: 14px; height: 14px; }
.devices-note { margin: 0.8rem 0 0; color: var(--muted-2); font-size: 0.82rem; line-height: 1.5; }

/* Support */
.support-form { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.support-textarea { display: block; width: 100%; min-height: 7rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 0.96rem; resize: vertical; }
.support-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14); }
.support-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.7rem; }
.support-chars { color: var(--muted-2); font-size: 0.82rem; }
.support-submit-btn { min-height: 2.8rem; padding: 0.5rem 1.3rem; border: none; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; font-size: 0.92rem; cursor: pointer; }
.support-submit-btn:hover { background: var(--primary-dark); }
.support-submit-btn:disabled { opacity: 0.6; cursor: default; }
.support-list { display: grid; gap: 0.6rem; }
.support-ticket { padding: 0.95rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.support-ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.45rem; }
.support-ticket-id { color: var(--muted-2); font-size: 0.82rem; font-weight: 700; }
.support-status { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; background: var(--line); color: var(--muted); }
.support-status-0 { background: var(--primary-soft); color: var(--primary-dark); }
.support-status-2 { background: var(--amber-soft); color: var(--amber); }
.support-ticket-question { color: var(--text); font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; }
.support-ticket-answer { margin-top: 0.6rem; padding: 0.7rem 0.8rem; border-radius: 10px; background: var(--green-soft); color: #166534; font-size: 0.92rem; line-height: 1.5; }
.support-ticket-date { margin-top: 0.5rem; color: var(--muted-2); font-size: 0.78rem; }
.support-empty { margin: 0; padding: 1.2rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); font-size: 0.92rem; text-align: center; line-height: 1.5; }

/* ---------- Dashboard home (v2) ---------- */
.dash-profile { display: flex; align-items: center; gap: 0.8rem; margin: 0.4rem 0 1rem; }
.dash-profile-avatar { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; font-size: 1.25rem; font-weight: 800; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28); flex-shrink: 0; }
.dash-profile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-profile-body strong { font-size: 1.15rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-profile-body small { color: var(--muted); font-size: 0.86rem; }
.dash-profile-settings { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); transition: border-color 0.2s ease, color 0.2s ease; }
.dash-profile-settings:hover { border-color: var(--primary); color: var(--primary-dark); }

.status-card { margin-bottom: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-md); }
.status-head { display: flex; align-items: flex-start; gap: 0.85rem; }
.status-icon { display: grid; place-items: center; flex-shrink: 0; width: 2.8rem; height: 2.8rem; border-radius: 14px; }
.status-icon svg { width: 24px; height: 24px; }
.status-text strong { display: block; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em; }
.status-text p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.status-progress { height: 0.5rem; margin-top: 1rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.status-progress-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.status-actions { display: grid; gap: 0.5rem; margin-top: 1rem; }
.status-hint { margin: -0.1rem 0 0; text-align: center; color: var(--muted-2); font-size: 0.8rem; }
.status-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.status-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem 0.5rem 0.6rem; border-radius: 12px; background: var(--bg); color: var(--text); transition: background 0.2s ease; }
.status-chip svg { width: 18px; height: 18px; color: var(--primary); }
.status-chip span { display: flex; flex-direction: column; line-height: 1.15; }
.status-chip strong { font-size: 0.92rem; }
.status-chip small { color: var(--muted); font-size: 0.74rem; }
a.status-chip:hover { background: var(--primary-soft); }
.status-chip-warn { background: var(--amber-soft); }
.status-chip-warn svg { color: var(--amber); }

.status-active .status-icon { background: var(--green-soft); color: var(--green); }
.status-active .status-progress-fill { background: var(--green); }
.status-warn .status-icon { background: var(--amber-soft); color: var(--amber); }
.status-warn .status-progress-fill { background: var(--amber); }
.status-warn { border-color: #f7dcb0; }
.status-expired .status-icon { background: var(--red-soft); color: var(--red); }
.status-expired .status-progress-fill { background: var(--red); }
.status-expired { border-color: #f5c2c2; }
.status-none .status-icon { background: var(--primary-soft); color: var(--primary-dark); }

.dash-notice { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: #fff; font-size: 0.9rem; line-height: 1.45; }
.dash-notice span { flex: 1; }
.dash-notice svg:last-child { transform: rotate(180deg); color: var(--muted-2); }
.dash-notice-warn { background: var(--amber-soft); border-color: #f7dcb0; color: #92400e; }
.dash-notice-warn svg:first-child { color: var(--amber); }

.connect-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.connect-step { display: flex; gap: 0.85rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.connect-step-num { display: grid; place-items: center; flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 0.95rem; }
.connect-step-body { flex: 1; min-width: 0; }
.connect-step-body strong { display: block; font-size: 1rem; line-height: 1.3; }
.connect-step-body p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.connect-step-body .button { margin-top: 0.7rem; }
.connect-muted { color: var(--muted-2) !important; font-size: 0.86rem !important; }
.connect-stores { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.connect-store { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.9rem 0.5rem 0.7rem; border-radius: 12px; background: var(--text); color: #fff; transition: background 0.2s ease, transform 0.2s ease; }
.connect-store:hover { background: #1e293b; transform: translateY(-1px); }
.connect-store svg { width: 20px; height: 20px; }
.connect-store span { display: flex; flex-direction: column; line-height: 1.15; }
.connect-store small { font-size: 0.64rem; opacity: 0.8; }
.connect-store strong { font-size: 0.92rem; }

.connect-manual, .dash-extra { margin-top: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.dash-extra { margin: 0 0 1.1rem; }
.connect-manual[open], .dash-extra[open] { border-color: #bfd3ff; }
.connect-manual summary, .dash-extra summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 700; font-size: 0.95rem; list-style: none; }
.connect-manual summary::-webkit-details-marker, .dash-extra summary::-webkit-details-marker { display: none; }
.connect-manual summary > svg:first-child, .dash-extra summary > svg:first-child { color: var(--primary); }
.connect-manual summary span, .dash-extra summary span { flex: 1; }
.connect-manual summary > svg:last-child, .dash-extra summary > svg:last-child { color: var(--muted-2); transition: transform 0.2s ease; }
.connect-manual[open] summary > svg:last-child, .dash-extra[open] summary > svg:last-child { transform: rotate(180deg); }
.connect-manual-body, .dash-extra-body { padding: 0 1.1rem 1.1rem; }
.connect-manual-body p, .dash-extra-body p { margin: 0 0 0.7rem; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.connect-manual-body .dash-sub-url { margin-bottom: 0.6rem; }

.dash-actions-4 { grid-template-columns: repeat(4, 1fr); }
.dash-logout-form { margin: 0.9rem 0 0; text-align: center; }
.dash-logout-link { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none; padding: 0.4rem 0.6rem; color: var(--muted); font-size: 0.88rem; font-weight: 600; cursor: pointer; border-radius: 8px; }
.dash-logout-link:hover { color: var(--red); }
.dash-logout-link svg { width: 16px; height: 16px; }
@media (max-width: 400px) { .dash-actions-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tariffs (v2) ---------- */
.dash-lead { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.tariff-current { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; padding: 0.7rem 0.95rem; border-radius: 12px; background: var(--green-soft); color: #166534; font-size: 0.9rem; }
.tariff-current-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.tariff-current-expired { background: var(--red-soft); color: #991b1b; }
.tariff-current-expired .tariff-current-dot { background: var(--red); }

.tariff-chips-label { margin: 0.2rem 0 0.6rem; color: var(--muted); font-size: 0.88rem; }
.tariff-chips { display: flex; gap: 0.45rem; margin: 0 -0.75rem 1rem; padding: 0 0.75rem 0.3rem; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tariff-chips::-webkit-scrollbar { display: none; }
@media (min-width: 721px) { .tariff-chips { flex-wrap: wrap; margin: 0 0 1rem; padding: 0; overflow: visible; } }
.tariff-chip { flex: 0 0 auto; scroll-snap-align: start; min-height: 2.5rem; padding: 0.45rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text-2); font-weight: 700; font-size: 0.9rem; white-space: nowrap; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.tariff-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
.tariff-chip:not(.is-active):hover { border-color: var(--primary); color: var(--primary-dark); }

.tariff-group { display: none; }
.tariff-group.is-active { display: block; }
.tariff-list { display: grid; gap: 0.55rem; }
.tariff-row { position: relative; display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.95rem 1rem; border: 2px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.tariff-row:hover { border-color: #bfd3ff; }
.tariff-row-popular { border-color: #bfd3ff; }
.tariff-row.is-selected { border-color: var(--primary); background: #f3f7ff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.tariff-row-radio { flex-shrink: 0; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; transition: border-color 0.2s ease, background 0.2s ease; }
.tariff-row.is-selected .tariff-row-radio { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 0.75rem no-repeat; }
.tariff-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.tariff-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.tariff-row-title strong { font-size: 1.05rem; font-weight: 800; }
.tariff-row-tag { padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--primary); color: #fff; font-style: normal; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; }
.tariff-row-main small { color: var(--muted); font-size: 0.84rem; }
.tariff-row-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.tariff-row-side strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.tariff-row-badge { padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-style: normal; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }

.tariff-notes { margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.tariff-notes li { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--text-2); font-size: 0.88rem; line-height: 1.45; }
.tariff-notes svg { width: 16px; height: 16px; color: var(--green); margin-top: 0.15rem; }
.dash-tariffs .support-empty a { color: var(--primary-dark); text-decoration: underline; }

body.has-checkout .dash { padding-bottom: 19rem; }
.checkout { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform 0.22s ease; }
.checkout.is-open { transform: none; }
.checkout[hidden] { display: none; }
.checkout-inner { position: relative; width: min(100%, 560px); margin: 0 auto; padding: 1.1rem 1.1rem 1rem; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 -4px 40px rgba(15, 23, 42, 0.16), var(--shadow-lg); }
.checkout-step { display: grid; gap: 0.7rem; }
.checkout-step[hidden] { display: none; }
.checkout-summary { display: flex; flex-direction: column; padding-right: 2.5rem; }
.checkout-label { color: var(--muted-2); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.checkout-summary strong { font-size: 1.1rem; line-height: 1.25; }
.checkout-meta { color: var(--muted); font-size: 0.86rem; }
.checkout-total { display: flex; align-items: baseline; justify-content: space-between; padding: 0.6rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.checkout-total strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.checkout-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.checkout-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3.1rem; padding: 0.6rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.checkout-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.checkout-btn svg { width: 18px; height: 18px; }
.checkout-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25); }
.checkout-btn-primary:hover { background: var(--primary-dark); color: #fff; }
.checkout-note { margin: 0; color: var(--muted-2); font-size: 0.78rem; line-height: 1.45; text-align: center; }
.checkout-loading-text { margin: 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.checkout .pay-spinner { margin: 0.4rem auto 0; }
.checkout-error { margin: 0; padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--red-soft); color: #991b1b; font-size: 0.9rem; line-height: 1.45; }
.checkout-close { position: absolute; top: 0.8rem; right: 0.8rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: none; border-radius: 50%; background: var(--bg); color: var(--muted); cursor: pointer; }
.checkout-close:hover { color: var(--text); }
.checkout-close svg { width: 16px; height: 16px; }
@media (min-width: 721px) { .checkout { padding-bottom: 1rem; } }
@media (max-width: 720px) { .checkout { bottom: calc(3.6rem + env(safe-area-inset-bottom)); padding-bottom: 0.5rem; } body.has-checkout .dash { padding-bottom: 24rem; } }
@media (max-width: 480px) { .checkout-methods { grid-template-columns: 1fr; } }

/* ---------- Cookie consent (shared partial, light) ---------- */
.cookie-consent {
  position: fixed; left: 0.9rem; right: 0.9rem; bottom: calc(0.9rem + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; align-items: center; gap: 1rem; max-width: 860px; margin: 0 auto; padding: 1rem 1.2rem;
  border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px); transition: opacity 0.28s ease, transform 0.28s ease;
}
.cookie-consent.is-visible { opacity: 1; transform: translateY(0); }
.cookie-consent[hidden] { display: none; }
.cookie-consent-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); }
.cookie-consent-text { flex: 1; min-width: 0; }
.cookie-consent-text strong { display: block; margin-bottom: 0.2rem; font-size: 0.95rem; }
.cookie-consent-text p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.cookie-consent-text a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-actions { display: flex; flex-shrink: 0; gap: 0.5rem; }
.cookie-consent-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.6rem; padding: 0.5rem 1rem; border-radius: 999px; font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.cookie-consent-decline { border: 1px solid var(--line-strong); background: #fff; color: var(--text); }
.cookie-consent-decline:hover { border-color: var(--text-2); }
.cookie-consent-accept { border: 1px solid transparent; background: var(--primary); color: #fff; }
.cookie-consent-accept:hover { background: var(--primary-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .brand-name { display: none; }
  .auth-page { padding: 0.5rem 0.75rem 2.5rem; min-height: 0; }
  .auth-card { padding: 1.5rem 1.2rem; }
  .footer-inner { flex-direction: column; }
  .cookie-consent { flex-direction: column; align-items: flex-start; gap: 0.8rem; padding: 1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-btn { flex: 1; min-height: 2.8rem; }
}
@media (max-width: 400px) {
  .tariff-cards { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
