/* NIVA customer site. The account figures, identity mark and editorial tables
   carry the visual hierarchy. Route-specific controls keep their own states. */
:root {
  --niva-sheet: #fff;
  --niva-canvas: #eff3f9;
  --niva-text: #152940;
  --niva-muted: #4c6078;
  --niva-rule: #ced9e6;
  --niva-soft: #e9f0f9;
  --niva-blue: #145dc0;
  --niva-shadow: 0 1px 2px #132c4709, 0 8px 22px -18px #132c4755;
  --niva-night: #142c50;
}
:root.dark, :root[data-theme="dark"] {
  --niva-sheet: #182333;
  --niva-canvas: #101923;
  --niva-text: #edf4fe;
  --niva-muted: #b0c1d5;
  --niva-rule: #344459;
  --niva-soft: #202f44;
  --niva-blue: #94c2ff;
  --niva-shadow: 0 1px 2px #0002, 0 10px 24px -20px #000a;
}
html:root[data-niva-view] .dashboard-layout.dashboard-layout, html:root[data-niva-view] .auth-layout.auth-layout {
  background: linear-gradient(140deg,transparent 36%,#809ed00b),var(--niva-canvas);
}
html:root[data-niva-view] .dashboard-layout .app-header {
  background: var(--niva-sheet);
  border-bottom: 1px solid var(--niva-rule);
  box-shadow: none;
}
html:root[data-niva-view] .dashboard-layout .desktop-sidebar.sidebar {
  background: radial-gradient(ellipse at 5% 99%,#304a71 0,transparent 38%),linear-gradient(155deg,#132b47,#172a43 68%,#1c304d);
  border-right: 1px solid #1b314b;
}
html:root[data-niva-view] .dashboard-layout .desktop-sidebar .sidebar-top,
html:root[data-niva-view] .dashboard-layout .desktop-sidebar .sidebar-bottom { border-color: #e2efff22; }
html:root[data-niva-view] .dashboard-layout .sidebar .logo-text { color: #f5f8fd; font-weight: 720; letter-spacing: -.025em; }
html:root[data-niva-view] .dashboard-layout .sidebar-nav { gap: 5px; padding-top: 17px; }
html:root[data-niva-view] .dashboard-layout .sidebar .nav-item { color: #cad9ec; }
html:root[data-niva-view] .dashboard-layout .sidebar .nav-item:hover { background: #ffffff12; color: white; }
html:root[data-niva-view] .dashboard-layout .sidebar .nav-item-active {
  color: #fff; border-left-color: #96c8ff;
  background: linear-gradient(90deg,#3a618a,#345273);
}
html:root[data-niva-view] .dashboard-layout .sidebar .user-info { background: #c4d9f217; }
html:root[data-niva-view] .dashboard-layout .sidebar :is(.user-email,.settings-btn,.collapse-btn) { color: #d0def0; }
html:root[data-niva-view] .dashboard-layout .sidebar .collapse-btn:hover { color: white; background: #ffffff16; }
html:root[data-niva-view] .dashboard-layout :is(.welcome-title,.page-title,.dl2-title,.wh-heading h2),
html:root[data-niva-view] .auth-layout .form-title,html:root[data-niva-view] .legal-page .legal-title {
  color:var(--niva-text); font-weight:740; letter-spacing:-.035em; line-height:1.22;
}
html:root[data-niva-view] .dashboard-layout :is(.welcome-header,.store-header,.sub-header,.settings-header,.kb-head,.page-header,.dl2-top,.wh-wallet-heading) {
  padding-bottom: 14px; border-bottom: 1px solid var(--niva-rule);
}
html:root[data-niva-view] .dashboard-layout :is(.panel-card,.ticket-card,.kb-card,.dl2-card) { box-shadow:var(--niva-shadow); }
html:root[data-niva-view] .dashboard-layout :is(.panel-title,.kb-category-title,.wh-section-head h3) { color:var(--niva-text); }
html:root[data-niva-view] .dashboard-layout :is(.welcome-sub,.dl2-sub) { color:var(--niva-muted); }
/* Set the curve strength on the branded surface that draws it. */
.dashboard-container .hero-card, .auth-layout .brand-panel, [data-niva-view="why"] .hero .live-panel {
  --niva-signal: repeating-radial-gradient(ellipse at 108% 122%, transparent 0 21px, var(--niva-curve-ink, #aad4ff20) 22px, transparent 23px 38px), linear-gradient(112deg,#112944 8%,#193e70 60%,#304c8d);
}
html:root[data-niva-view] .dashboard-container .hero-card, html:root[data-niva-view] .auth-layout .brand-panel {
  color:#f3f7ff; background:var(--niva-signal); border:1px solid #355780;
  box-shadow:inset 0 1px 0 #d9eaff30,0 12px 26px -19px #122944aa;
}
html:root[data-niva-view] .dashboard-container .hero-card {
  --niva-curve-ink: #aad4ff10;
  box-shadow: inset 0 1px 0 #d9eaff21, 0 3px 9px -6px #12294455;
}
html:root[data-niva-view] .dashboard-container .hero-card .hero-value {
  color:#fff; background:none; -webkit-text-fill-color:currentColor;
  font-family: var(--niva-font-family, system-ui, sans-serif);
  font-variant-numeric: lining-nums proportional-nums;
  font-weight: 600;
  letter-spacing: -.035em;
}
.hero-value .hero-unit {
  font-size: .5em;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}
html:root[data-niva-view] .dashboard-container .hero-card :is(.hero-label,.hero-progress-text,.hero-detail-link) { color:#daeaff; }
html:root[data-niva-view] .dashboard-container .hero-card .hero-plan { color:#eff6ff; background:#ffffff14; border-color:#bad9ff55; }
html:root[data-niva-view] .dashboard-container .hero-card .hero-progress-bar { background:#ffffff26; }
html:root[data-niva-view] .dashboard-container .hero-card .hero-progress-fill { background:linear-gradient(90deg,#76baff,#b6dcff); }
html:root[data-niva-view] .dashboard-container .hero-card :is(.btn-hero-cta,.btn-hero-secondary) {
  border:1px solid #dbeaff70; box-shadow:none;
}
html:root[data-niva-view] .dashboard-container .hero-card .btn-hero-cta { background:#e7f2ff; color:#12365d; }
html:root[data-niva-view] .dashboard-container .hero-card .btn-hero-cta:not(.btn-hero-renew) { height: 44px; }
html:root[data-niva-view] .dashboard-container .hero-card .btn-hero-secondary { background:#182f51; color:#f0f6ff; }
html:root[data-niva-view] .dashboard-container .hero-card .hero-expired-note { background:#0e223e; color:#d9e6f5; }
/* Account and navigation share a surface. Keeping their DOM siblings independent
   leaves navigation available when the account request fails. */
html:root[data-niva-view] .dashboard-container {
  --account-radius: var(--nc-outer, 18px);
  --account-inset: clamp(12px, 2.5vw, 30px);
  --account-surface: var(--niva-sheet);
  --account-wash: #6291cf12;
  --account-line: color-mix(in srgb, var(--niva-rule) 74%, transparent);
}
html:root[data-niva-view] .dashboard-container .mini-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(6px, 1vw, 16px);
  padding: 8px var(--account-inset);
  margin-bottom: 0;
  background: radial-gradient(ellipse 80% 94% at 0 0, var(--account-wash), transparent), var(--account-surface);
  border: 0;
  border-radius: var(--account-radius) var(--account-radius) 0 0;
  box-shadow: none;
}
/* Metric typography is set by each group and shared by every sibling. */
.niva-metric {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--niva-text);
  text-align: start;
}
button.niva-metric { appearance: none; cursor: pointer; }
.niva-metric-heading {
  display: flex;
  align-items: center;
  gap: var(--metric-icon-gap, 5px);
  color: var(--niva-muted);
  font-size: var(--metric-label-size, 12px);
  font-weight: 500;
  line-height: 1.35;
}
.niva-metric-icon { width: 13px; height: 13px; flex: none; background-color: currentColor; }
.niva-metric-value {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: var(--metric-size, 13px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.015em;
}
.niva-metric-value, .niva-metric-detail,
.stats-grid .stat-box .stat-value, .wh-quick-summary dd, .metrics-grid .metric-num {
  font-variant-numeric: lining-nums tabular-nums;
}
.niva-metric-detail { color: var(--niva-muted); font-size: 11px; line-height: 1.35; }
.plan-meta-grid .niva-metric[data-status="expiring"] .niva-metric-value,
.niva-metric[data-status="expiring"] .niva-metric-detail { color: var(--metric-warning); }
.plan-meta-grid .niva-metric[data-status="expired"] .niva-metric-value,
.niva-metric[data-status="expired"] .niva-metric-detail { color: var(--metric-expired, var(--niva-muted)); }
.mini-stats-grid {
  --metric-size: clamp(16px, 1.5vw, 22px);
  --metric-warning: #976013;
}
:root.dark .mini-stats-grid { --metric-warning: #f5c670; }
.plan-meta-grid { --metric-warning: #c48a1a; --metric-expired: #475569; }
:root.dark .plan-meta-grid { --metric-warning: #fbbf24; --metric-expired: #cbd5e1; }
.mini-stats-grid > .niva-metric {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  justify-content: stretch;
  justify-items: start;
  align-self: stretch;
  font-family: var(--niva-font-family, system-ui, sans-serif);
  min-height: 44px;
  border-radius: 6px;
  padding: 3px 2px;
}

html:root[data-niva-view] .dashboard-container .quick-links {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  padding: 3px clamp(6px, 1.25vw, 16px);
  background: var(--account-surface);
  border-radius: var(--account-radius);
}
html:root[data-niva-view] .dashboard-container .mini-stats-grid + .quick-links { border-radius: 0 0 var(--account-radius) var(--account-radius); }
html:root[data-niva-view] .dashboard-container .mini-stats-grid + .quick-links::before {
  content: "";
  position: absolute;
  inset: 0 var(--account-inset) auto;
  height: 1px;
  background: var(--account-line);
  pointer-events: none;
}
html:root[data-niva-view] .dashboard-container .quick-links .ql-item {
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 clamp(4px, .55vw, 9px);
  color: var(--niva-text);
  background: transparent;
  border: 0;
  border-radius: 8px !important;
  box-shadow: none;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
}
html:root[data-niva-view] .dashboard-container .quick-links .ql-icon {
  flex: none;
  width: 17px;
  height: 17px;
  background-color: var(--niva-blue) !important;
}
html:root[data-niva-view] .dashboard-container :is(.ql-item,button.niva-metric):focus-visible {
  outline: 2px solid var(--niva-blue);
  outline-offset: -2px;
}
@media (hover: hover) {
  html:root[data-niva-view] .dashboard-container .mini-stats-grid > button.niva-metric:hover,
  html:root[data-niva-view] .dashboard-container .quick-links .ql-item:hover {
    color: var(--niva-blue);
    background: var(--niva-soft);
    transform: none;
    box-shadow: none;
  }
}
@media (min-width: 992px) {
  html:root[data-niva-view] .dashboard-container .mini-stats-grid {
    grid-column: 1;
    min-height: 78px;
    padding-block: 7px;
    align-items: stretch;
    border-radius: var(--account-radius) 0 0 var(--account-radius);
  }
  html:root[data-niva-view] .dashboard-container .quick-links {
    align-content: center;
    padding: 3px 8px;
  }
  html:root[data-niva-view] .dashboard-container .mini-stats-grid + .quick-links {
    margin-inline-start: calc(-1 * var(--dashboard-column-gap));
    border-radius: 0 var(--account-radius) var(--account-radius) 0;
  }
  html:root[data-niva-view] .dashboard-container .mini-stats-grid + .quick-links::before {
    inset: 22% auto 22% 0;
    height: auto;
    width: 1px;
  }
}
@media (min-width: 992px) and (max-width: 1199px) {
  html:root[data-niva-view] .dashboard-container .quick-links { padding-inline: 4px; gap: 0; }
  html:root[data-niva-view] .dashboard-container .quick-links .ql-item { gap: 4px; padding-inline: 3px; }
}
@media (max-width: 380px) {
  html:root[data-niva-view] .dashboard-container .mini-stats-grid { gap: 5px; padding-inline: 10px; }
  .mini-stats-grid { --metric-label-size: 11px; --metric-icon-gap: 4px; --metric-size: 14px; }
}

html:root[data-niva-view] .dashboard-container .quick-links .ql-item:active {
  background: var(--niva-soft);
  color: var(--niva-blue);
  box-shadow: inset 0 0 0 1px var(--niva-rule);
}
@media (prefers-reduced-motion: no-preference) {
  .quick-links .ql-icon { transition: transform .15s ease-out; }
  .quick-links .ql-item:active .ql-icon { transform: scale(.93); }
}
html:root[data-niva-view] .dashboard-container .hero-card-expired .hero-progress-fill-expired {background:#99a9bc !important;}
html:root[data-niva-view] .dashboard-layout .package-grid .pk-card {box-shadow:var(--niva-shadow);}
html:root[data-niva-view] .plans-page .package-grid .pk-card .traffic-volume {font-variant-numeric:tabular-nums;letter-spacing:-.045em;}
html:root[data-niva-view] .dashboard-layout .wh-balance .wh-amount {letter-spacing:-.065em;font-variant-numeric:tabular-nums;}
html:root[data-niva-view] .dashboard-layout :is(.legal-panel,.kb-article,.article-body,.msg-text) {overflow-wrap:anywhere;}
html:root[data-niva-view] .dashboard-layout .kb-card .article-row {min-height:46px;}
html:root[data-niva-view] .dashboard-layout .kb-category-title {font-weight:700;}
html:root[data-niva-view] .dashboard-layout .wh-sheet {border-color:var(--niva-rule);}
html:root[data-niva-view] .legal-page .legal-panel {border-top:3px solid var(--niva-blue);box-shadow:var(--niva-shadow);}
html:root[data-niva-view] .legal-page .markdown-body {max-width:72ch;margin-inline:auto;line-height:1.8;}
html:root[data-niva-view] .auth-layout .auth-card {background:var(--niva-sheet);box-shadow:var(--niva-shadow);border:1px solid var(--niva-rule);}
html:root[data-niva-view] .auth-layout .brand-panel .brand-name {
  color:#f5f8ff; background:none; -webkit-text-fill-color:currentColor;letter-spacing:-.055em;
}
html:root[data-niva-view] .auth-layout .brand-panel :is(.brand-tagline,.brand-features li) {color:#d1e1f5;}
html:root[data-niva-view] .auth-layout .brand-panel .feat-dot {background:#88bbfa;}
html:root[data-niva-view] .auth-layout .brand-panel :is(.node-preview,.live-metrics) {
  background:#122d4d; border:1px solid #a8ccf73e; box-shadow:none;
}
html:root[data-niva-view] .auth-layout .brand-panel :is(.metric-num,.node-lat,.node-region) {color:#f1f6ff;}
html:root[data-niva-view] .auth-layout .brand-panel :is(.metrics-title,.metric-label,.node-preview-head,.node-unit) {color:#c6dbf3;}
html:root[data-niva-view] .auth-layout .brand-panel .node-bar {background:#284866;}
html:root[data-niva-view] .auth-layout .brand-panel .node-bar i {background:linear-gradient(90deg,#9eb7ff,#7fd0ff);}
@media (min-width:992px) {
  html:root[data-niva-view] .dashboard-layout .main-area { --content-wide: 1140px; --visual-content-width:1140px; }
  html:root[data-niva-view] .dashboard-layout :is(.carousel-page,.secondary-route) {padding:clamp(24px,2.6vw,46px) clamp(20px,3.6vw,64px) 44px;}
  html:root[data-niva-view] .dashboard-layout :is(.carousel-page,.secondary-route) > :is(.dashboard-container,.subscription-container,.plans-page,.wallet-hub,.wallet-original-promotion,.settings-container,.dl2,.knowledge-container,.tickets-container,.traffic-details) {
    width:100%; max-width:1140px;
  }
  html:root[data-niva-view] .dashboard-layout :is(.welcome-title,.store-header .page-title,.sub-header .page-title,.settings-header .page-title,.kb-head .page-title,.page-header .page-title,.wh-heading h2,.dl2-title) {font-size:clamp(28px,2.25vw,38px);}
  html:root[data-niva-view] .dashboard-container {--dashboard-column-gap:18px;grid-template-columns:minmax(0,1.45fr) minmax(232px,.8fr);gap:18px var(--dashboard-column-gap);}
  html:root[data-niva-view] .dashboard-container .hero-card {
    display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.45fr);gap:14px 34px;
    align-items:center; padding:clamp(24px,2.5vw,40px);
  }
  html:root[data-niva-view] .dashboard-container .hero-header {grid-column:1/-1;}
  html:root[data-niva-view] .dashboard-container .hero-value {grid-column:1;grid-row:2;font-size:clamp(50px,5.4vw,80px);line-height:1.04;}
  html:root[data-niva-view] .dashboard-container .hero-progress {grid-column:1;grid-row:3;}
  html:root[data-niva-view] .dashboard-container .btn-hero-cta {grid-column:2;grid-row:2;align-self:center;}
  html:root[data-niva-view] .dashboard-container .btn-hero-secondary {grid-column:2;grid-row:3;}
  html:root[data-niva-view] .dashboard-container .hero-expired-note {grid-column:1/-1;grid-row:4;justify-self:start;}
  html:root[data-niva-view] .subscription-container .subscription-grid { grid-template-columns:minmax(0,1.18fr) minmax(0,1fr);gap:16px;align-items:start; }
  html:root[data-niva-view] .settings-container .tab-panel:has(> .pd-disclosure) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start;}
  html:root[data-niva-view] .settings-container .tab-panel:has(> .pd-disclosure) > .panel-card {margin:0;}
  html:root[data-niva-view] .settings-container .tab-panel:has(> .pd-disclosure) > :first-child,
  html:root[data-niva-view] .settings-container .tab-panel:has(> .pd-disclosure) > :not(.panel-card) {grid-column:1/-1;}
  html:root[data-niva-view] .knowledge-container {display:grid;grid-template-columns:minmax(150px,.32fr) minmax(0,1fr);gap:18px 26px;align-content:start;align-items:start;}
  html:root[data-niva-view] .knowledge-container > * {grid-column:2;min-width:0;}
  html:root[data-niva-view] .knowledge-container .kb-head {grid-column:1/-1;margin:0;}
  html:root[data-niva-view] .knowledge-container .kb-cats {grid-column:1;grid-row:2 / span 4;display:flex;flex-direction:column;align-items:stretch;position:sticky;top:0;gap:3px;padding:0;margin:0;}
  html:root[data-niva-view] .knowledge-container .kb-cat {justify-content:flex-start;min-height:40px;}
  html:root[data-niva-view] .knowledge-container .kb-cat-n {margin-inline-start:auto;}
  html:root[data-niva-view] .knowledge-container:not(:has(.kb-cats)) {display:block;}
  html:root[data-niva-view] .dashboard-layout .dl2-body {grid-template-columns:minmax(0,1.25fr) minmax(0,.85fr);}
  html:root[data-niva-view] .dashboard-layout .tickets-container,html:root[data-niva-view] .dashboard-layout .traffic-details {margin-inline:auto;}
}
@media (min-width:1240px) {
  html:root[data-niva-view] .subscription-container .subscription-grid > .panel-card:has(.qi-plats) {grid-column:1 !important;}
  html:root[data-niva-view] .subscription-container .subscription-grid > .niva-dns-slot {grid-column:2;}
}
@media (min-width:1200px) {
  html:root[data-niva-view] .wallet-hub > .wh-wallet-heading {max-width:none;}
  html:root[data-niva-view] .dashboard-layout .carousel-page > .wallet-hub {
    max-width:var(--visual-content-width) !important;
  }
  html:root[data-niva-view] .dashboard-layout .wallet-hub .wh-account-layout.wh-sheet {
    display:grid;grid-template-columns:minmax(230px,.48fr) minmax(0,1fr);align-items:start;
    gap:20px;background:transparent;border:0;box-shadow:none;overflow:visible;
  }
  html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-balance, html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-ledger {
    min-width:0;box-sizing:border-box;background:var(--niva-sheet);border:1px solid var(--niva-rule);
    border-radius:16px !important;box-shadow:var(--niva-shadow);margin:0;
  }
  html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-balance {padding:24px;background:linear-gradient(145deg,var(--niva-sheet),var(--niva-soft));border-top:3px solid var(--niva-blue);}
  html:root[data-niva-view] .wallet-hub .wh-sheet .wh-balance-top {display:grid;grid-template-columns:minmax(0,1fr);gap:20px;}
  html:root[data-niva-view] .wallet-hub .wh-sheet .wh-quick-summary {justify-content:flex-start;gap:24px;}
  html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-ledger {padding:16px;}
}
@media (min-width:1024px) {
  html:root[data-niva-view] .auth-layout .auth-body {max-width:1180px;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(25px,4vw,70px);}
  html:root[data-niva-view] .auth-layout .auth-body::after {content:none;}
  html:root[data-niva-view] .auth-layout .brand-panel {border-radius:24px;padding:clamp(28px,3.4vw,52px);gap:26px;}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-text {gap:18px;}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-name {font-size:clamp(48px,5.3vw,78px);}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-features {gap:8px;}
  html:root[data-niva-view] .auth-layout .auth-card {justify-self:stretch;max-width:none;padding:clamp(28px,3vw,48px);}
}
@media (max-width:1023px) {
  html:root[data-niva-view] .auth-layout .auth-body {justify-content:flex-start;align-items:stretch;gap:0;width:100%;max-width:540px;margin-inline:auto;padding:20px 18px;}
  html:root[data-niva-view] .auth-layout .brand-panel {display:block;flex:none;position:relative;border-radius:18px 18px 0 0;padding:20px 24px;}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-name {margin:0;font-weight:750;font-size:clamp(28px,7vw,44px);line-height:1.12;}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-tagline {margin:5px 0 0;font-size:13px;}
  /* The mobile sign-in masthead uses the existing brand heading. The desktop
     latency board stays on its original desktop-only surface. */
  html:root[data-niva-view] .auth-layout .brand-panel :is(.brand-features,.brand-data,.live-metrics){display:none;}
  html:root[data-niva-view] .auth-layout .auth-card {max-width:none;padding:24px clamp(16px,4vw,28px);border-radius:0 0 18px 18px !important;border-top:0;}
}
@media (max-width:991px) {
  html:root[data-niva-view] .nav-fixed-wrapper .bottom-nav .nav-item {min-height:44px;}
  html:root[data-niva-view] .nav-fixed-wrapper .bottom-nav .nav-text {color:var(--niva-muted);}
  html:root[data-niva-view] .nav-fixed-wrapper .bottom-nav .nav-item.active :is(.nav-text,.nav-icon) {color:var(--niva-blue);}
  html:root[data-niva-view] .dashboard-layout .main-area {--content-narrow: 740px; --visual-content-width:740px;}
  html:root[data-niva-view] .dashboard-layout :is(.carousel-page,.secondary-route) > :is(.dashboard-container,.subscription-container,.plans-page,.wallet-hub,.wallet-original-promotion,.settings-container,.dl2,.knowledge-container,.tickets-container,.traffic-details) {max-width:740px;}
  html:root[data-niva-view] .dashboard-layout :is(.welcome-header,.store-header,.sub-header,.settings-header,.kb-head,.page-header,.dl2-top,.wh-wallet-heading) {padding-bottom:10px;margin-bottom:14px;}
  html:root[data-niva-view] .dashboard-layout :is(.welcome-title,.store-header .page-title,.sub-header .page-title,.settings-header .page-title,.kb-head .page-title,.page-header .page-title,.dl2-title,.wh-heading h2) {font-size:clamp(22px,5.2vw,29px);}
  html:root[data-niva-view] .dashboard-container .hero-card {padding:20px;gap:14px;}
  html:root[data-niva-view] .dashboard-container .hero-value {font-size:clamp(40px,10vw,58px);line-height:1.05;}
  html:root[data-niva-view] .dashboard-container .hero-card .btn-hero-cta {min-height:44px;}
  html:root[data-niva-view] .dashboard-layout .kb-head {align-items:stretch;}
  html:root[data-niva-view] .dashboard-layout .kb-cats {padding-block:3px 8px;}
  html:root[data-niva-view] .dashboard-layout .wh-ledger {min-width:0;}
}
@media (min-width:600px) and (max-width:991px) {
  html:root[data-niva-view] .plans-page .package-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  html:root[data-niva-view] .plans-page .package-grid .pk-wide {grid-column:1/-1;}
}
@media (max-width:599px) {
  html:root[data-niva-view] .dashboard-layout .plans-page .package-grid {grid-template-columns:minmax(0,1fr);gap:10px;}
  html:root[data-niva-view] .dashboard-layout .plans-page .product-card.pk-card:not(.pk-wide) {
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center;padding:15px;
  }
  html:root[data-niva-view] .dashboard-layout .plans-page .pk-card:not(.pk-wide) .card-top-info,
  html:root[data-niva-view] .dashboard-layout .plans-page .pk-card:not(.pk-wide) .pk-main {grid-column:1/-1;width:100%;}
  html:root[data-niva-view] .dashboard-layout .plans-page .pk-card:not(.pk-wide) .pk-spec {margin:0;min-width:0;}
  html:root[data-niva-view] .dashboard-layout .plans-page .pk-card:not(.pk-wide) .pk-btn {width:auto;min-width:82px;min-height:40px;margin:0;padding-inline:12px;}
}

/* The public field notes use the same blue as the account area, with more
   room for long Chinese text and a dedicated column for the route snapshot. */
:root[data-niva-view="why"] {
  --bg-deep:var(--niva-canvas);--bg-mid:var(--niva-sheet);--bg-elev:var(--niva-sheet);
  --bg-sunken:var(--niva-soft);--bg-soft:var(--niva-soft);--ink:var(--niva-text);
  --ink-dim:var(--niva-muted);--ink-faint:var(--niva-muted);--blue:var(--niva-blue);
  --silver:var(--niva-muted);--border:var(--niva-rule);--border-strong:var(--niva-rule);
  --grid-line:transparent;--mesh:none;--wrap:1240px;
}
[data-niva-view="why"] .hero {border-bottom:1px solid var(--niva-rule);background:linear-gradient(120deg,var(--niva-sheet),var(--niva-canvas) 78%);}
[data-niva-view="why"] .hero h1.display.long {color:var(--niva-text);font-weight:680;letter-spacing:-.045em;text-wrap:pretty;max-width:21ch;}
[data-niva-view="why"] .hero .display .accent {text-decoration-color:var(--niva-blue);text-decoration-thickness:.065em;text-underline-offset:.15em;}
[data-niva-view="why"] .hero .live-panel {
  --ink:#fff;--ink-dim:#d0def0;--ink-faint:#bbcee6;--blue:#a8d4ff;--border:#b3cdea40;
  --bg-mid:#142c50;--primary-alpha:#d8e9ff1c;
  background:var(--niva-signal);border:1px solid #446388;border-radius:18px;color:#eaf3ff;
  box-shadow:0 18px 34px -23px #102a4bb0;
}
[data-niva-view="why"] .hero .live-panel::before {display:none;}
[data-niva-view="why"] .live-panel .live-hdr,[data-niva-view="why"] .live-panel .live-foot {background:#102947b8;}
[data-niva-view="why"] .hero .live-panel :is(.title,.stat,.flag,.name,.regs,.clock,.live-foot,.live-foot a) {color:#cfdef1;}
[data-niva-view="why"] .hero .live-panel :is(.ping,.clock,.stat,.title,.live-foot p) {color:#e7f2ff;}
[data-niva-view="why"] .live-panel .row {border-color:#cedff640;}
[data-niva-view="why"] .live-panel .flag {color:#e8f5ff;}
[data-niva-view="why"] .sec-title {text-wrap:pretty;letter-spacing:-.035em;}
[data-niva-view="why"] .feat,[data-niva-view="why"] .step {border-top:2px solid var(--niva-rule);box-shadow:none;}
[data-niva-view="why"] .plan,[data-niva-view="why"] .datasheet {box-shadow:var(--niva-shadow);}
[data-niva-view="why"] .ds-row .ds-k {color:var(--niva-muted);}
@media (min-width:1024px) {
  [data-niva-view="why"] .hero {padding:clamp(60px,6vw,104px) 0;}
  [data-niva-view="why"] .hero-grid {grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(32px,5vw,84px);}
  [data-niva-view="why"] section:not(#pricing) > .wrap:has(> .reveal:first-child .sec-title) {
    display:grid;grid-template-columns:minmax(230px,.63fr) minmax(0,1.37fr);gap:18px clamp(32px,5vw,72px);align-items:start;
  }
  [data-niva-view="why"] section:not(#pricing) > .wrap:has(> .reveal:first-child .sec-title) > * {grid-column:2;min-width:0;margin-block-start:0;}
  [data-niva-view="why"] section:not(#pricing) > .wrap:has(> .reveal:first-child .sec-title) > :first-child {grid-column:1;grid-row:1 / span 6;}
  [data-niva-view="why"] section:not(#pricing) .wrap .sec-title {font-size:clamp(27px,2.35vw,38px);line-height:1.25;}
  [data-niva-view="why"] .stack-diagram.all {grid-template-columns:repeat(2,minmax(0,1fr));}
  [data-niva-view="why"] section {padding-block:70px;}
}
@media (max-width:720px) {
  [data-niva-view="why"] {--gutter:clamp(16px,4.6vw,28px);}
  [data-niva-view="why"] .top #tt {display:inline-flex;align-items:center;justify-content:center;min-height:40px;}
  [data-niva-view="why"] .hero {padding:32px 0 36px;}
  [data-niva-view="why"] .hero-grid {gap:20px;}
  [data-niva-view="why"] .hero h1.display.long {font-size:clamp(29px,7vw,41px);line-height:1.22;margin-bottom:14px;}
  [data-niva-view="why"] .hero .trust-row {gap:6px 14px;}
  [data-niva-view="why"] section {padding-block:42px;}
  [data-niva-view="why"] .stack-diagram.all {gap:0;}
  [data-niva-view="why"] .stack-diagram.all .step {text-align:start;border-radius:0;border:0;border-inline-start:2px solid var(--niva-rule);padding:10px 15px;box-shadow:none;background:transparent;}
  [data-niva-view="why"] .stack-diagram.all .step .n {margin:0 0 4px;}
}
:root[data-niva-view="dns"] .nd-page {width:100%;max-width:1120px;margin-inline:auto;}
:root[data-niva-view="dns"] .nd-page-header .page-title {letter-spacing:-.04em;}
@media (min-width:1050px) {
  :root[data-niva-view="dns"] .nd-page {display:grid;grid-template-columns:minmax(280px,.78fr) minmax(0,1.22fr);align-content:start;align-items:start;gap:20px;}
  :root[data-niva-view="dns"] .nd-page > * {min-width:0;margin:0;}
  :root[data-niva-view="dns"] .nd-page-header {grid-column:1/-1;}
  :root[data-niva-view="dns"] .nd-panel:has(+ [hidden]) {grid-column:1/-1;}
}
/* Compact companion pages follow the device appearance before an account is available. */
@media (prefers-color-scheme:dark) {
  :root[data-niva-view="handoff"] {--niva-sheet:#182333;--niva-canvas:#101923;--niva-rule:#344459;--niva-text:#edf4fe;--niva-muted:#b0c1d5;--niva-blue:#94c2ff;}
}
[data-niva-view="handoff"] body {margin:0;padding:clamp(16px,4vw,48px);min-height:100vh;box-sizing:border-box;background:var(--niva-canvas);color:var(--niva-text);}
[data-niva-view="handoff"] main {
  width:100%;box-sizing:border-box;max-width:560px;margin:clamp(16px,7vh,76px) auto;
  padding:clamp(20px,4vw,40px);border:1px solid var(--niva-rule);border-top:4px solid var(--niva-blue);
  background:var(--niva-sheet);border-radius:18px;box-shadow:var(--niva-shadow);
}
[data-niva-view="handoff"] h1 {letter-spacing:-.035em;line-height:1.2;color:var(--niva-text);}
[data-niva-view="handoff"] :is(.hint,#identity) {color:var(--niva-muted);}
[data-niva-view="handoff"] a {color:var(--niva-blue);}
[data-niva-view="handoff"] button {min-height:44px;}

/* Light surfaces use a low-chroma canvas, a cool rim and a short contact
   shadow. Interactive and status-specific borders keep their component colors. */
html:root[data-niva-view][data-theme="light"] {
  --niva-canvas: #edf0f3;
  --surface-rim: #d0d7df;
  --surface-lift: 0 1px 2px #15283e0c;
}
html:root[data-niva-view][data-theme="light"] :is(.dashboard-layout.dashboard-layout,.auth-layout.auth-layout,.legal-page) {
  background: radial-gradient(ellipse 90% 68% at 95% 0%, #e8edf2, transparent 78%),
              linear-gradient(155deg, #f5f6f8, var(--niva-canvas) 58%, #f0f2f4);
}
html:root[data-niva-view][data-theme="light"] :is(
  .auth-layout .auth-card,
  .settings-container .tab-panel > .panel-card,
  .subscription-grid > .panel-card:not(.card-expired,.card-expiring),
  .knowledge-container .kb-card,
  .tickets-container .ticket-card:not(:hover),
  .traffic-details .list-card,
  .dl2 .dl2-card,
  .nd-page > .nd-panel
) {
  border-color: var(--surface-rim);
  box-shadow: var(--surface-lift);
}
html:root[data-niva-view][data-theme="light"] :is(
  .legal-page .legal-panel,
  .plans-page .package-grid .pk-card:not(:hover,:focus-within),
  .wallet-hub .wh-bills,
  .datasheet,
  .plans .plan
) { box-shadow: var(--surface-lift); }
html:root[data-niva-view][data-theme="light"] .dashboard-layout :is(.carousel-page,.secondary-route):has(> :is(.wallet-hub,.wallet-original-promotion)) {
  background-color: transparent;
}
@media (min-width: 1200px) {
  html:root[data-niva-view][data-theme="light"] .wallet-hub .wh-sheet > .wh-balance {
    background: linear-gradient(145deg, var(--niva-sheet) 40%, #f1f4f7) !important;
    border: 1px solid var(--surface-rim) !important;
    box-shadow: var(--surface-lift) !important;
  }
}
@media (prefers-color-scheme: light) {
  html:root[data-niva-view="handoff"] { --niva-canvas: #edf0f3; }
  html:root[data-niva-view="handoff"] main { box-shadow: 0 1px 2px #15283e0c; }
}

html:root[data-niva-view][data-theme="light"] .dashboard-container :is(.mini-stats-grid,.quick-links) {
  border: 1px solid var(--surface-rim);
}
@media (max-width: 991px) {
  html:root[data-niva-view][data-theme="light"] .dashboard-container .mini-stats-grid { border-bottom: 0; }
  html:root[data-niva-view][data-theme="light"] .dashboard-container .mini-stats-grid + .quick-links { border-top: 0; }
}
@media (min-width: 992px) {
  html:root[data-niva-view][data-theme="light"] .dashboard-container .mini-stats-grid { border-right: 0; }
  html:root[data-niva-view][data-theme="light"] .dashboard-container .mini-stats-grid + .quick-links { border-left: 0; }
}
