/* NIVA customer site. The account figures, identity mark and editorial tables
   carry the visual hierarchy. Route-specific controls keep their own states. */
:root {
  /* The component scale starts at the phone's default text size. Extra
     viewport width primarily buys columns and margins, not bigger controls. */
  --niva-unit: clamp(1rem, calc(.9375rem + .25vw), 1.125rem);
  --niva-gutter: clamp(1rem, calc(.5rem + 2vw), 2rem);
  --niva-form-width: 30rem;
  --niva-card-width: 27rem;
  --niva-reading-width: 42rem;
  --niva-pair-width: calc(2 * var(--niva-card-width) + var(--niva-unit));
  --niva-pair-tracks: repeat(2, minmax(0, 1fr));
  --niva-column-width: 36rem;
  --niva-workspace-width: 64rem;
  --niva-title-size: calc(1.375 * var(--niva-unit));
  --niva-brand-size: calc(1.75 * var(--niva-unit));
  --niva-figure-size: calc(2.5 * var(--niva-unit));
  --niva-control-height: calc(2.75 * var(--niva-unit));
  --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] {
  --nc-control: calc(.5625 * var(--niva-unit));
}
html:root[data-niva-view] .dashboard-layout {
  --content-narrow: var(--niva-column-width);
  --content-wide: var(--niva-workspace-width);
  --visual-content-width: var(--niva-card-width);
  --visual-card-padding: calc(1.375 * var(--niva-unit));
  --visual-section-gap: var(--niva-unit);
}
html:root[data-niva-view] .dashboard-layout :is(.carousel-page, .secondary-route) {
  container: niva-route / inline-size;
  padding-left: max(var(--niva-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--niva-gutter), env(safe-area-inset-right, 0px));
}
html:root[data-niva-view] .dashboard-layout :is(.carousel-page, .secondary-route) > div {
  /* Route bundles also declare important widths. The shell owns this limit. */
  width: 100%;
  min-width: 0;
  max-width: var(--visual-content-width) !important;
  margin-inline: auto;
}
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),
html:root[data-niva-view] .legal-page .legal-title {
  font-size: var(--niva-title-size);
}
html:root[data-niva-view] .dashboard-layout :is(.panel-title, .card-title) {
  font-size: calc(.9375 * var(--niva-unit));
  line-height: 1.47;
}
html:root[data-niva-view] .auth-layout .form-title {
  font-size: calc(1.5 * var(--niva-unit));
}
html:root[data-niva-view] .niva-btn {
  max-width: 100%;
  gap: calc(.5 * var(--niva-unit));
}
html:root[data-niva-view] .niva-btn--sm {
  padding: calc(.4375 * var(--niva-unit)) calc(.875 * var(--niva-unit));
  font-size: calc(.8125 * var(--niva-unit));
}
html:root[data-niva-view] .niva-btn--md {
  padding: calc(.625 * var(--niva-unit)) calc(1.125 * var(--niva-unit));
  font-size: calc(.875 * var(--niva-unit));
}
html:root[data-niva-view] .niva-btn--lg {
  min-height: calc(3 * var(--niva-unit));
  height: auto;
  padding: .5em calc(1.5 * var(--niva-unit));
  font-size: calc(.9375 * var(--niva-unit));
}
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;
  font-size: var(--niva-figure-size);
  line-height: 1.05;
  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) {
  min-height: var(--niva-control-height);
  height: auto;
  font-size: calc(.875 * var(--niva-unit));
}
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: calc(.75 * var(--niva-unit));
  --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, calc(.75 * var(--niva-unit)));
  font-weight: 500;
  line-height: 1.35;
}
.niva-metric-icon { width: 1.08333em; height: 1.08333em; 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: var(--niva-unit);
  --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: var(--niva-control-height);
  padding: 0 clamp(4px, .55vw, 9px);
  color: var(--niva-text);
  background: transparent;
  border: 0;
  border-radius: 8px !important;
  box-shadow: none;
  font-size: calc(.8125 * var(--niva-unit));
  font-weight: 550;
  line-height: 1.35;
}
html:root[data-niva-view] .dashboard-container .quick-links .ql-icon {
  flex: none;
  width: 1.3077em;
  height: 1.3077em;
  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 (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;}
/* Keep a benefit and its action in the same track as the list reflows. */
html:root[data-niva-view] .dashboard-layout .perks-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}
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 {max-width:45rem;}
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 {
  font-size:var(--niva-brand-size); 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);}
html:root[data-niva-view] .dashboard-container .hero-card {
  padding: calc(1.25 * var(--niva-unit));
  gap: calc(.875 * var(--niva-unit));
}
/* Independent cards share a bounded column. A route earns a second column
   when both cards fit after navigation, gutters and browser zoom. */
html:root[data-niva-view] .dashboard-layout :is(.knowledge-container,.wallet-hub) {
  --visual-content-width: var(--niva-column-width);
}
html:root[data-niva-view] .dashboard-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
html:root[data-niva-view] .dashboard-container .hero-card,
html:root[data-niva-view] .dashboard-layout .dl2-body .dl2-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
html:root[data-niva-view] .dashboard-container :is(.hero-card,.quick-links,.welcome-header) {
  margin-bottom: var(--visual-section-gap);
}
html:root[data-niva-view] .dashboard-layout .dl2-hero > * {
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
}
html:root[data-niva-view] .dashboard-layout :is(.dl2-body,.ticket-list,.view-section:has(> .list-card)) {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: start;
  gap: var(--visual-section-gap);
}
html:root[data-niva-view] .dashboard-layout .dl2-body > * { grid-column: 1 / -1; }
html:root[data-niva-view] .subscription-container .subscription-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: var(--visual-section-gap);
  align-items: start;
}
html:root[data-niva-view] .dashboard-layout .settings-container .tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--visual-section-gap);
}
html:root[data-niva-view] .settings-container .tab-panel > .panel-card {margin-block: 0;}
@container niva-route (min-width: 43rem) {
  html:root[data-niva-view] .dashboard-layout :is(.dashboard-container,.subscription-container,.settings-container,.dl2,.traffic-details,.tickets-container,.knowledge-container,.wallet-original-promotion,.wallet-hub:has(.promotion-original)) {
    --visual-content-width: var(--niva-pair-width);
  }
  html:root[data-niva-view] .dashboard-layout .plans-page { --visual-content-width: var(--niva-workspace-width); }
  html:root[data-niva-view] .dashboard-container:has(> .hero-card) {
    display: grid;
    grid-template-columns: var(--niva-pair-tracks);
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    column-gap: var(--visual-section-gap);
  }
  html:root[data-niva-view] .dashboard-container > * {grid-column: 1 / -1;}
  html:root[data-niva-view] .dashboard-container:has(> .hero-card) > .hero-card {grid-column: 1;grid-row: span 3;margin: 0;}
  html:root[data-niva-view] .dashboard-container:has(> .hero-card) > :is(.mini-stats-grid,.quick-links,.notice-card) {grid-column: 2;}
  html:root[data-niva-view] .dashboard-layout :is(.dl2-body,.ticket-list,.view-section:has(> .list-card),.promotion-original) {
    display: grid;
    grid-template-columns: var(--niva-pair-tracks);
    gap: var(--visual-section-gap);
    align-items: start;
  }
  html:root[data-niva-view] .dashboard-layout .dl2-body > :is(.dl2-hero,.pd-download-guide) {grid-column: auto;}
  html:root[data-niva-view] .subscription-container .subscription-grid:has(.qi) {
    display: block;
    columns: 2;
    column-gap: var(--visual-section-gap);
  }
  html:root[data-niva-view] .subscription-container .subscription-grid:has(.qi) > .panel-card {
    break-inside: avoid;
    margin: 0 0 var(--visual-section-gap);
  }
  html:root[data-niva-view] .subscription-grid:has(.qi) > .panel-card:has(.plan-info-header) {break-before: column;}
  html:root[data-niva-view] .subscription-grid .cooldown-banner {column-span: all;}
  html:root[data-niva-view] .dashboard-layout .settings-container .tab-panel:has(> .pd-disclosure) {
    display: block;
    columns: 2;
    column-gap: var(--visual-section-gap);
  }
  html:root[data-niva-view] .dashboard-layout .settings-container .tab-panel:has(> .pd-disclosure) > * {
    break-inside: avoid;
    margin-block: 0 var(--visual-section-gap);
  }
  html:root[data-niva-view] .settings-container .tab-panel:has(> .pd-disclosure) > :nth-child(4) {break-before:column;}
  html:root[data-niva-view] .dashboard-layout .dl2-body:has(.pd-download-guide:not([open])) > .dl2-hero {grid-column:1;grid-row:1 / span 4;}
  html:root[data-niva-view] .dashboard-layout .dl2-body:has(.pd-download-guide:not([open])) > :not(.dl2-hero) {grid-column:2;}
  html:root[data-niva-view] .dashboard-layout .subscription-container:has(.sub-header [role="tab"]:last-child[aria-selected="true"]),
  html:root[data-niva-view] .dashboard-layout .settings-container:has(.settings-header [role="tab"]:last-child[aria-selected="true"]) {--visual-content-width:var(--niva-reading-width);}
  html:root[data-niva-view] .knowledge-container {display:grid;grid-template-columns:minmax(9.5rem,.32fr) minmax(0,1fr);gap:var(--visual-section-gap) var(--niva-gutter);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;}
}
@media (min-width:992px) {
  html:root[data-niva-view] .dashboard-layout :is(.carousel-page,.secondary-route) {
    padding-block: var(--niva-gutter) var(--niva-control-height);
  }
  html:root[data-niva-view] .dashboard-layout .wallet-hub {--visual-content-width: var(--niva-reading-width);}
  html:root[data-niva-view] .wallet-hub > .wh-wallet-heading {max-width:none;}
  html:root[data-niva-view] .dashboard-layout .wallet-hub .wh-account-layout.wh-sheet {
    display:grid;grid-template-columns:minmax(0,1fr);align-items:start;
    gap:var(--visual-section-gap);background:transparent;border:0;box-shadow:none;overflow:visible;
  }
  html:root[data-niva-view] .dashboard-layout .wallet-hub .wh-account-layout.wh-sheet > :is(.wh-balance.panel-card,.wh-ledger) {
    min-width:0;box-sizing:border-box;background:var(--niva-sheet);border:1px solid var(--niva-rule);
    border-radius:var(--nc-outer,18px) !important;box-shadow:var(--niva-shadow);margin:0;
  }
  html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-balance {padding:var(--visual-card-padding);}
  html:root[data-niva-view] .wallet-hub .wh-sheet > .wh-ledger {padding:var(--visual-section-gap);}
  html:root[data-niva-view] .dashboard-layout .wallet-hub .wh-sheet .wh-balance-top {
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--visual-section-gap);align-items:center;
  }
  html:root[data-niva-view] .wallet-hub .wh-sheet .wh-quick-summary {grid-column:1/-1;grid-row:2;justify-content:flex-start;gap:var(--visual-card-padding);}
  html:root[data-niva-view] .wallet-hub .wh-sheet .wh-balance-top > button {grid-column:2;grid-row:1;width:auto;}
  @container niva-route (min-width: 55rem) {
    html:root[data-niva-view] .dashboard-layout .wallet-hub:has(.wh-sheet) {--visual-content-width:var(--niva-workspace-width);}
    html:root[data-niva-view] .dashboard-layout .wallet-hub .wh-account-layout.wh-sheet {grid-template-columns:minmax(17rem,.48fr) minmax(0,1fr);}
  }
}
@media (min-width:1024px) {
  html:root[data-niva-view] .auth-layout .auth-body {max-width:var(--niva-workspace-width);grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:var(--niva-gutter);}
  html:root[data-niva-view] .auth-layout .auth-body::after {content:none;}
  html:root[data-niva-view] .auth-layout .brand-panel {border-radius:calc(1.125 * var(--niva-unit));padding:var(--niva-gutter);gap:var(--niva-unit);}
  html:root[data-niva-view] .auth-layout .brand-panel .brand-text {gap:18px;}
  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:var(--niva-form-width);padding:var(--niva-gutter);--nc-auth-inset:calc(var(--niva-gutter) + 1px);}
}
@media not all and (min-width: 1024px) {
  html:root[data-niva-view] .auth-layout .auth-body {justify-content:flex-start;align-items:stretch;gap:0;width:100%;max-width:var(--niva-form-width);margin-inline:auto;padding:20px 1.125rem;}
  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;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:1.5rem var(--niva-unit);border-radius:0 0 18px 18px !important;border-top:0;}
}
@media not all and (min-width: 992px) {
  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 :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 .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;}
}
html:root[data-niva-view] .dashboard-layout .plans-page .package-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,18rem),1fr));
  gap:var(--visual-section-gap);
  align-items:start;
}
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:calc(.375 * var(--niva-unit)) .75rem;
  align-items:center;padding:var(--niva-unit);
}
html:root[data-niva-view] .plans-page .pk-card:not(.pk-wide) :is(.pk-main,.card-top-info) {grid-column:1/-1;width:100%;margin:0;}
html:root[data-niva-view] .plans-page .pk-card:not(.pk-wide) .pk-main {display:flex;flex-direction:row;justify-content:space-between;align-items:baseline;flex-wrap:wrap;}
html:root[data-niva-view] .plans-page .pk-card:not(.pk-wide) .pk-spec {min-width:0;margin:0;}
html:root[data-niva-view] .plans-page .pk-card:not(.pk-wide) .pk-btn {width:auto;min-width:5.125rem;margin:0;justify-self:end;}
html:root[data-niva-view] .plans-page .pk-shared .perks-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr));align-items:start;}

html:root[data-niva-view] .plans-page .package-grid .product-card.pk-wide {
  grid-column:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"top top" "main main" "spec btn";
  align-items:center;gap:calc(.375 * var(--niva-unit)) .75rem;
  padding:var(--niva-unit);background:var(--niva-sheet);
}
html:root[data-niva-view] .plans-page .pk-wide .card-top-info {grid-area:top;margin:0;}
html:root[data-niva-view] .plans-page .pk-wide .pk-main {grid-area:main;}
html:root[data-niva-view] .plans-page .pk-wide .pk-spec {grid-area:spec;margin:0;}
html:root[data-niva-view] #app .plans-page .pk-wide .pk-btn.pk-select {grid-area:btn;justify-self:end;margin:0;}
html:root[data-niva-view] .plans-page .pk-wide::after {content:none;}
html:root[data-niva-view] .dashboard-layout .dl2-body .dl2-steps {
  display:grid;grid-template-columns:minmax(0,1fr);gap:var(--visual-section-gap);
}
html:root[data-niva-view] .dashboard-layout .dl2-steps > .dl2-step {
  flex-direction:row;align-items:flex-start;gap:calc(.625 * var(--niva-unit));
}
html:root[data-niva-view] .dashboard-layout .dl2-steps > .dl2-step > div {min-width:0;flex:1 1 calc(100% - 3rem);}
html:root[data-niva-view] .dashboard-layout .dl2-body .dl2-grid {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));
}
html:root[data-niva-view] .plans-page .pk-wide .pk-spec {white-space:normal;overflow:visible;text-overflow:clip;}
@container niva-route (min-width: 43rem) {
  html:root[data-niva-view] .dashboard-layout .plans-page:has(.package-grid > .pk-card:nth-child(2):last-child) {--visual-content-width:var(--niva-pair-width);}
  html:root[data-niva-view] .dashboard-layout .plans-page:has(.package-grid > .pk-card:only-child),
  html:root[data-niva-view] .dashboard-layout .dashboard-container:not(:has(> .hero-card)) {--visual-content-width:var(--niva-card-width);}
}
/* Grid and flex route stacks own the space below their heading. */
html:root[data-niva-view] .dashboard-layout :is(.settings-container,.plans-page) {
  row-gap: var(--visual-section-gap);
}
html:root[data-niva-view] .dashboard-layout :is(.settings-container,.plans-page) > :is(.settings-header,.store-header) {
  margin-block-end: 0;
}

html:root[data-niva-view] .dashboard-layout .plans-page > .store-header + * {
  margin-block-start: 0;
}

/* 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:var(--niva-workspace-width);--gutter:var(--niva-gutter);
}
[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 {font-size:calc(1.8125 * var(--niva-unit));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:calc(3 * var(--niva-unit)) 0;}
  [data-niva-view="why"] .hero-grid {grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:var(--niva-gutter);}
  [data-niva-view="why"] section:not(#pricing) .wrap .sec-title {font-size:var(--niva-brand-size);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) {
  :root[data-niva-view="why"] {--gutter:clamp(1rem,4.6vw,1.75rem);}
  [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 {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 {
  box-sizing:border-box;
  width:100%;
  max-width:calc(var(--niva-column-width) + 2 * var(--niva-gutter));
  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 {max-width:var(--niva-workspace-width);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-page:has(.nd-fleet[hidden]) {display:block;max-width:calc(var(--niva-card-width) + 2 * var(--niva-gutter));}
  :root[data-niva-view="dns"] .nd-page:has(.nd-fleet[hidden]) .nd-page-header {margin-bottom:var(--niva-unit);}
}
/* 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:var(--niva-gutter);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:var(--niva-form-width);margin:clamp(1rem,7vh,4rem) auto;
  padding:calc(1.25 * var(--niva-unit));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 {font-size:var(--niva-brand-size);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:var(--niva-control-height);max-width:100%;}

/* 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);
}
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; }
