:root {
  color-scheme: dark;
  --ag-bg: #060a0c;
  --ag-panel: rgba(13, 20, 23, 0.91);
  --ag-panel-strong: rgba(17, 27, 30, 0.98);
  --ag-line: rgba(160, 185, 190, 0.13);
  --ag-muted: rgba(230, 240, 242, 0.56);
  --ag-green: #35e6a1;
  --ag-green-soft: rgba(53, 230, 161, 0.13);
  --ag-cyan: #24c8e5;
  --ag-danger: #ff6b78;
  --ag-radius: 20px;
}

html { scroll-behavior: smooth; }

.hidden { display: none !important; }

body {
  min-height: 100%;
  background:
    radial-gradient(900px 560px at 76% -12%, rgba(19, 189, 139, .14), transparent 62%),
    radial-gradient(760px 540px at -15% 40%, rgba(21, 157, 194, .09), transparent 62%),
    linear-gradient(145deg, #071012 0%, var(--ag-bg) 48%, #050708 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  right: -180px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  pointer-events: none;
  border-radius: 999px;
  opacity: .18;
  background: radial-gradient(circle, rgba(53,230,161,.30), rgba(36,200,229,.14) 42%, transparent 70%);
  filter: blur(4px);
}

.glass {
  background: linear-gradient(145deg, rgba(18, 27, 30, .96), rgba(8, 13, 16, .93)) !important;
  border: 1px solid var(--ag-line) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.glass .glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.dashboard-flow {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.dashboard-flow > * { margin-top: 0 !important; }

.app-main {
  min-height: 100%;
  padding: 20px 16px 104px;
}

.desktop-shell {
  width: min(100%, 1120px);
  margin-inline: auto;
  min-width: 0;
}

.dashboard-card {
  min-width: 0;
  max-width: 100%;
}

.dashboard-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 245, 190, .34), transparent);
  pointer-events: none;
}

.welcome-actions {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-orb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(53,230,161,.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.18), transparent 28%),
    linear-gradient(135deg, rgba(53,230,161,.17), rgba(36,200,229,.08));
  color: #b9ffe5;
  box-shadow: 0 12px 30px rgba(53,230,161,.10);
}

.theme-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: rgba(241,249,250,.78);
  font-size: 12px;
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(53,230,161,.22);
  background: rgba(53,230,161,.08);
}

.welcome-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-pills span {
  padding: 7px 10px;
  border: 1px solid rgba(53,230,161,.12);
  border-radius: 999px;
  background: rgba(53,230,161,.07);
  color: rgba(189,255,229,.82);
  font-size: 11px;
  font-weight: 800;
}

.product-service-card {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 17px;
  background:
    radial-gradient(220px 120px at 94% 20%, rgba(53,230,161,.10), transparent 60%),
    rgba(255,255,255,.035);
}

.product-service-card > * {
  position: relative;
  z-index: 1;
}

.product-location-pill {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
  color: rgba(232,241,242,.76);
  font-size: 11px;
  font-weight: 750;
}

.dashboard-view-hidden { display: none !important; }

.dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: rgba(255,255,255,.035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dashboard-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 10px;
  border-radius: 15px;
  color: rgba(232,241,242,.58);
  font-size: 12px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.dashboard-tab:hover {
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.86);
}

.dashboard-tab.is-active {
  background: linear-gradient(135deg, rgba(53,230,161,.18), rgba(36,200,229,.08));
  color: #bcffe5;
  box-shadow: inset 0 0 0 1px rgba(53,230,161,.14);
}

.side-link.is-active,
.mobile-bottom-nav a.is-active {
  color: #a8f7d7 !important;
}

.quick-action.is-active {
  border-color: rgba(53,230,161,.22);
  background: rgba(53,230,161,.065);
}

.hero-card {
  min-height: 235px;
  background:
    radial-gradient(470px 260px at 88% 50%, rgba(35, 229, 163, .20), transparent 65%),
    linear-gradient(135deg, rgba(15, 55, 52, .94), rgba(8, 18, 21, .96)) !important;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -70px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(66, 240, 179, .17);
  border-radius: 42% 58% 54% 46%;
  transform: rotate(22deg);
  box-shadow: inset 0 0 70px rgba(44, 235, 170, .08), 0 0 90px rgba(44, 235, 170, .05);
  pointer-events: none;
  z-index: -1;
}

.section-kicker {
  color: rgba(218, 234, 235, .58);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(53, 230, 161, .14);
  border-radius: 999px;
  background: var(--ag-green-soft);
  color: #91f5cf;
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #829095;
  box-shadow: 0 0 0 3px rgba(130,144,149,.08);
}

.status-dot.online { background: var(--ag-green); box-shadow: 0 0 12px rgba(53,230,161,.65); }
.status-dot.degraded { background: #f7c95c; box-shadow: 0 0 12px rgba(247,201,92,.50); }
.status-dot.offline { background: var(--ag-danger); box-shadow: 0 0 12px rgba(255,107,120,.48); }
.status-dot.idle { background: rgba(232,241,242,.38); box-shadow: none; }
.status-dot.checking { animation: ag-pulse 1.25s ease-in-out infinite; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  min-width: 0;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  color: rgba(240,247,248,.78);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  overflow: hidden;
}

.quick-action:hover {
  transform: translateY(-2px);
  border-color: rgba(53,230,161,.22);
  background: rgba(53,230,161,.065);
}

.quick-action-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(36,200,229,.10);
  color: #6bdeed;
}

.subscription-insights,
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.subscription-insights > div,
.security-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.subscription-insights span,
.security-item span {
  display: block;
  color: rgba(232,241,242,.42);
  font-size: 10px;
}

.subscription-insights strong,
.security-item strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: rgba(245,252,252,.86);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.onboarding-step {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.032);
  color: rgba(232,241,242,.68);
  font-size: 12px;
}

.onboarding-step strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(53,230,161,.12);
  color: #a8f7d7;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.guide-shortcut {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(232,241,242,.70);
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.guide-shortcut:hover {
  border-color: rgba(53,230,161,.20);
  background: rgba(53,230,161,.07);
  color: #fff;
}

.server-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(53,230,161,.10);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(53,230,161,.075), rgba(255,255,255,.025));
}

.server-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.server-filter {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: rgba(232,241,242,.58);
  font-size: 11px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.server-filter.is-active {
  border-color: rgba(53,230,161,.20);
  background: rgba(53,230,161,.10);
  color: #a8f7d7;
}

.server-chart {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: rgba(255,255,255,.026);
}

.server-chart-head,
.server-chart-row {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) 66px;
  align-items: center;
  gap: 10px;
}

.server-chart-head {
  grid-template-columns: 1fr auto;
  margin-bottom: 10px;
  color: rgba(232,241,242,.48);
  font-size: 11px;
}

.server-chart-group-title {
  margin: 13px 0 8px;
  padding-top: 11px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(168,247,215,.82);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.server-chart-head + .server-chart-group-title {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.server-chart-row + .server-chart-row { margin-top: 9px; }

.server-chart-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(232,241,242,.74);
  font-size: 11px;
}

.server-chart-label strong {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-chart-label span {
  flex: 0 0 auto;
  white-space: nowrap;
  color: rgba(232,241,242,.38);
}

.server-chart-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.server-chart-bar > span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #24c8e5, #35e6a1);
}

.server-chart-bar.degraded > span { background: linear-gradient(90deg, #f7c95c, #35e6a1); }
.server-chart-bar.offline > span { background: linear-gradient(90deg, #ff6b78, #f7c95c); }
.server-chart-value { text-align: right; color: rgba(232,241,242,.58); font-size: 11px; font-weight: 700; }

.uptime-value {
  color: #b8f8df;
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -.04em;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.server-tile,
.connection-tile {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.032);
}

.server-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.server-meta {
  overflow: hidden;
  color: var(--ag-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-protocols {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.server-protocols span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: rgba(232,241,242,.54);
  font-size: 9px;
  font-weight: 700;
}

.server-metrics {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  color: rgba(232,241,242,.62);
  font-size: 11px;
}

.capacity-ring {
  --capacity: 0deg;
  width: 70px;
  height: 70px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--ag-green) var(--capacity), rgba(255,255,255,.08) 0);
  position: relative;
}

.capacity-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #0d1517;
}

.capacity-ring > span { position: relative; z-index: 1; font-size: 12px; font-weight: 750; }

.capacity-ring.capacity-warning {
  background: conic-gradient(#f7c95c var(--capacity), rgba(255,255,255,.08) 0);
}

.connections-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.connection-refresh {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: rgba(232,241,242,.62);
  transition: color .2s ease, background .2s ease;
}

.connection-refresh:hover { background: rgba(255,255,255,.08); color: #fff; }
.connection-refresh.is-loading svg { animation: ag-spin .8s linear infinite; }

.connection-profile-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(232,241,242,.58);
  font-size: 11px;
  line-height: 1.35;
}

.connection-profile-state.online { color: rgba(157,248,210,.82); }
.connection-profile-state.stale { color: rgba(247,201,92,.78); }

.connection-explainer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(37,203,235,.10);
  border-radius: 13px;
  background: rgba(37,203,235,.045);
  color: rgba(232,241,242,.58);
  font-size: 11px;
  line-height: 1.5;
}

.connections-limit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(247,201,92,.16);
  border-radius: 15px;
  background: rgba(247,201,92,.065);
}

.connections-limit-notice strong,
.connections-limit-notice span {
  display: block;
}

.connections-limit-notice strong {
  color: #ffe1a2;
  font-size: 12px;
}

.connections-limit-notice span {
  margin-top: 3px;
  color: rgba(255,232,184,.70);
  font-size: 11px;
  line-height: 1.45;
}

.connections-limit-notice.is-warning {
  border-color: rgba(255,107,120,.22);
  background: rgba(255,107,120,.07);
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.connections-span-all { grid-column: 1 / -1; }

.connection-tile {
  background: linear-gradient(145deg, rgba(255,255,255,.04), rgba(53,230,161,.025));
}

.connection-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.connection-ip {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(161,241,213,.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-state {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(232,241,242,.54);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.connection-state.recent {
  border-color: rgba(53,230,161,.13);
  background: rgba(53,230,161,.08);
  color: rgba(157,248,210,.82);
}

.connection-state.stale {
  border-color: rgba(247,201,92,.14);
  background: rgba(247,201,92,.07);
  color: rgba(247,218,143,.78);
}

.connection-platform {
  margin-top: 11px;
  color: rgba(232,241,242,.46);
  font-size: 11px;
}

.connection-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.055);
}

.connection-dates span,
.connection-dates strong { display: block; }
.connection-dates span { color: rgba(232,241,242,.34); font-size: 9px; }
.connection-dates strong { margin-top: 3px; color: rgba(232,241,242,.70); font-size: 10px; font-weight: 600; }

.empty-state,
.error-state,
.loading-state {
  padding: 16px;
  border: 1px dashed rgba(255,255,255,.10);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  color: rgba(232,241,242,.58);
  font-size: 13px;
  line-height: 1.55;
}

.error-state { border-color: rgba(255,107,120,.18); color: rgba(255,210,214,.76); }

.retry-button {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.skeleton-line {
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.11), rgba(255,255,255,.04));
  background-size: 220% 100%;
  animation: ag-shimmer 1.35s linear infinite;
}

.tile-ready { animation: ag-enter .32s ease both; }

.sr-only-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.topup-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.topup-choice-btn {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.topup-choice-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.055);
}

.topup-choice-btn.is-active {
  border-color: rgba(53,230,161,.24);
  background: linear-gradient(135deg, rgba(53,230,161,.14), rgba(36,200,229,.055));
}

.topup-choice-btn span,
.topup-choice-btn strong {
  display: block;
}

.topup-choice-btn span {
  color: rgba(245,252,252,.86);
  font-size: 13px;
  font-weight: 800;
}

.topup-choice-btn strong {
  margin-top: 5px;
  overflow: hidden;
  color: rgba(232,241,242,.48);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topup-choice-btn.is-active strong { color: rgba(168,247,215,.82); }

.support-topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.support-topic-grid button {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  color: rgba(232,241,242,.70);
  font-size: 11px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.support-topic-grid button:hover {
  border-color: rgba(36,200,229,.18);
  background: rgba(36,200,229,.06);
  color: #fff;
}

.support-history-title {
  color: rgba(232,241,242,.48);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.support-ticket {
  margin-top: 9px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.032);
}

.support-ticket.empty {
  color: rgba(232,241,242,.48);
  font-size: 12px;
}

.support-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.support-ticket-head strong {
  overflow: hidden;
  color: rgba(245,252,252,.86);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-ticket-head span {
  flex: 0 0 auto;
  color: rgba(232,241,242,.36);
  font-size: 10px;
}

.support-ticket p {
  margin-top: 7px;
  color: rgba(232,241,242,.58);
  font-size: 12px;
  line-height: 1.45;
}

.support-ticket-status {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(53,230,161,.09);
  color: #a8f7d7;
  font-size: 10px;
  font-weight: 800;
}

body.light-theme:not(.sub-look) {
  --ag-bg: #f4fbf8;
  --ag-panel: rgba(255, 255, 255, .86);
  --ag-panel-strong: rgba(255, 255, 255, .96);
  --ag-line: rgba(27, 81, 84, .14);
  --ag-muted: rgba(21, 43, 50, .58);
  --ag-green: #06b982;
  --ag-green-soft: rgba(6, 185, 130, .11);
  --ag-cyan: #0898ad;
  color: #10242a !important;
  background:
    radial-gradient(900px 560px at 84% -12%, rgba(6, 185, 130, .18), transparent 62%),
    radial-gradient(760px 540px at -12% 38%, rgba(8, 152, 173, .12), transparent 62%),
    linear-gradient(145deg, #f8fffc 0%, #edf8f5 52%, #e9f3f7 100%) !important;
}

body.light-theme:not(.sub-look).text-white,
body.light-theme:not(.sub-look).bg-neutral-950 {
  color: #10242a !important;
}

body.light-theme:not(.sub-look)::before {
  opacity: .45;
  background-image:
    linear-gradient(rgba(14, 66, 72, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 66, 72, .045) 1px, transparent 1px);
}

body.light-theme:not(.sub-look)::after {
  opacity: .24;
  background: radial-gradient(circle, rgba(6,185,130,.22), rgba(8,152,173,.12) 45%, transparent 72%);
}

body.light-theme:not(.sub-look) .glass {
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(241,249,247,.88)) !important;
  border-color: var(--ag-line) !important;
  box-shadow: 0 18px 48px rgba(22, 70, 77, .10), inset 0 1px rgba(255,255,255,.75);
}

body.light-theme:not(.sub-look) aside {
  background: rgba(245, 253, 250, .82) !important;
  border-color: rgba(27, 81, 84, .12) !important;
  box-shadow: 18px 0 48px rgba(22, 70, 77, .08);
}

body.light-theme:not(.sub-look) .dashboard-tabs,
body.light-theme:not(.sub-look) .mobile-bottom-nav {
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(27, 81, 84, .12) !important;
  box-shadow: 0 14px 34px rgba(22, 70, 77, .08);
}

body.light-theme:not(.sub-look) .hero-card {
  background:
    radial-gradient(470px 260px at 88% 50%, rgba(6,185,130,.18), transparent 65%),
    linear-gradient(135deg, rgba(235,255,249,.96), rgba(245,250,255,.94)) !important;
}

body.light-theme:not(.sub-look) .dashboard-card::before {
  background: linear-gradient(90deg, transparent, rgba(6,185,130,.40), transparent);
}

body.light-theme:not(.sub-look) .brand-orb {
  border-color: rgba(6,185,130,.20);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.95), transparent 28%),
    linear-gradient(135deg, rgba(6,185,130,.18), rgba(8,152,173,.08));
  color: #047a5b;
}

body.light-theme:not(.sub-look) .theme-toggle {
  background: rgba(16, 51, 58, .055);
  border-color: rgba(27, 81, 84, .12);
  color: rgba(16, 36, 42, .78);
}

body.light-theme:not(.sub-look) .welcome-pills span,
body.light-theme:not(.sub-look) .status-chip,
body.light-theme:not(.sub-look) .server-filter.is-active,
body.light-theme:not(.sub-look) .dashboard-tab.is-active {
  border-color: rgba(6,185,130,.20);
  background: rgba(6,185,130,.10);
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) .dashboard-tab,
body.light-theme:not(.sub-look) .server-filter,
body.light-theme:not(.sub-look) .quick-action,
body.light-theme:not(.sub-look) .server-tile,
body.light-theme:not(.sub-look) .connection-tile,
body.light-theme:not(.sub-look) .product-service-card,
body.light-theme:not(.sub-look) .product-location-pill,
body.light-theme:not(.sub-look) .topup-choice-btn,
body.light-theme:not(.sub-look) .support-ticket,
body.light-theme:not(.sub-look) .subscription-insights > div,
body.light-theme:not(.sub-look) .security-item,
body.light-theme:not(.sub-look) .onboarding-step,
body.light-theme:not(.sub-look) .server-chart,
body.light-theme:not(.sub-look) .server-summary,
body.light-theme:not(.sub-look) .empty-state,
body.light-theme:not(.sub-look) .loading-state {
  border-color: rgba(27, 81, 84, .11);
  background: rgba(255,255,255,.55);
  color: rgba(16, 36, 42, .72);
}

body.light-theme:not(.sub-look) .dashboard-card,
body.light-theme:not(.sub-look) .dashboard-card .font-semibold,
body.light-theme:not(.sub-look) .dashboard-card strong,
body.light-theme:not(.sub-look) .glass .font-semibold,
body.light-theme:not(.sub-look) .glass strong,
body.light-theme:not(.sub-look) .server-chart-value,
body.light-theme:not(.sub-look) .uptime-value {
  color: #10242a !important;
}

body.light-theme:not(.sub-look) .product-service-card {
  background:
    radial-gradient(220px 120px at 94% 20%, rgba(6,185,130,.12), transparent 60%),
    rgba(255,255,255,.60);
}

body.light-theme:not(.sub-look) .quick-action:hover,
body.light-theme:not(.sub-look) .topup-choice-btn:hover {
  background: rgba(6,185,130,.08);
  border-color: rgba(6,185,130,.20);
}

body.light-theme:not(.sub-look) .topup-choice-btn.is-active {
  border-color: rgba(6,185,130,.24);
  background: linear-gradient(135deg, rgba(6,185,130,.13), rgba(8,152,173,.06));
}

body.light-theme:not(.sub-look) .capacity-ring::after {
  background: #f5fbf8;
}

body.light-theme:not(.sub-look) .skeleton-line {
  background: linear-gradient(90deg, rgba(16,51,58,.05), rgba(16,51,58,.12), rgba(16,51,58,.05));
  background-size: 220% 100%;
}

body.light-theme:not(.sub-look) input,
body.light-theme:not(.sub-look) textarea,
body.light-theme:not(.sub-look) select {
  background: rgba(16, 51, 58, .055) !important;
  color: #10242a !important;
  border-color: rgba(27, 81, 84, .12) !important;
}

body.light-theme:not(.sub-look) input::placeholder,
body.light-theme:not(.sub-look) textarea::placeholder {
  color: rgba(16, 36, 42, .42) !important;
}

body.light-theme:not(.sub-look) .text-white { color: #10242a !important; }
body.light-theme:not(.sub-look) [class*="text-white/"] { color: rgba(16, 36, 42, .62) !important; }
body.light-theme:not(.sub-look) [class*="bg-white/"] { background-color: rgba(16, 51, 58, .06) !important; }
body.light-theme:not(.sub-look) [class*="border-white/"] { border-color: rgba(27, 81, 84, .12) !important; }
body.light-theme:not(.sub-look) [class*="text-amber"],
body.light-theme:not(.sub-look) [class*="text-yellow"] {
  color: #7c4a03 !important;
}
body.light-theme:not(.sub-look) [class*="bg-amber"],
body.light-theme:not(.sub-look) [class*="bg-yellow"] {
  background-color: rgba(180, 105, 4, .13) !important;
}
body.light-theme:not(.sub-look) [class*="border-amber"],
body.light-theme:not(.sub-look) [class*="border-yellow"] {
  border-color: rgba(180, 105, 4, .24) !important;
}
body.light-theme:not(.sub-look) [class*="text-sky"],
body.light-theme:not(.sub-look) [class*="text-cyan"] {
  color: #075d6c !important;
}
body.light-theme:not(.sub-look) [class*="text-red"] {
  color: #9f1d2d !important;
}
body.light-theme:not(.sub-look) [class*="text-emerald"] {
  color: #047a5b !important;
}
body.light-theme:not(.sub-look) .text-emerald-200,
body.light-theme:not(.sub-look) .text-emerald-300,
body.light-theme:not(.sub-look) .side-link.is-active,
body.light-theme:not(.sub-look) .mobile-bottom-nav a.is-active {
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) #rotateSub,
body.light-theme:not(.sub-look) #rotateSubNote,
body.light-theme:not(.sub-look) .connections-limit-notice,
body.light-theme:not(.sub-look) .connection-state.stale {
  border-color: rgba(180, 105, 4, .24) !important;
  background: rgba(180, 105, 4, .11) !important;
  color: #7c4a03 !important;
}

body.light-theme:not(.sub-look) .connections-limit-notice strong,
body.light-theme:not(.sub-look) .connections-limit-notice span {
  color: #7c4a03 !important;
}

body.light-theme:not(.sub-look) .connections-limit-notice.is-warning {
  border-color: rgba(159, 29, 45, .24) !important;
  background: rgba(159, 29, 45, .09) !important;
}

body.light-theme:not(.sub-look) #legalOverlay,
body.light-theme:not(.sub-look) #noticeOverlay,
body.light-theme:not(.sub-look) #telegramConfirmOverlay {
  background: rgba(239, 248, 245, .88) !important;
}

/* Light theme final contrast pass: keep every custom card readable. */
body.light-theme:not(.sub-look),
body.light-theme:not(.sub-look) .dashboard-card,
body.light-theme:not(.sub-look) .glass {
  color: #10242a !important;
}

body.light-theme:not(.sub-look) [class*="text-white"] {
  color: rgba(16, 36, 42, .72) !important;
}

body.light-theme:not(.sub-look) .text-white,
body.light-theme:not(.sub-look) .dashboard-card .text-lg,
body.light-theme:not(.sub-look) .dashboard-card .text-base,
body.light-theme:not(.sub-look) .dashboard-card .font-semibold,
body.light-theme:not(.sub-look) .dashboard-card strong,
body.light-theme:not(.sub-look) .glass .font-semibold,
body.light-theme:not(.sub-look) .glass strong,
body.light-theme:not(.sub-look) .server-tile .font-semibold,
body.light-theme:not(.sub-look) .connection-tile .font-semibold,
body.light-theme:not(.sub-look) .product-service-card .font-semibold,
body.light-theme:not(.sub-look) .support-ticket-head strong,
body.light-theme:not(.sub-look) .capacity-ring > span,
body.light-theme:not(.sub-look) .uptime-value,
body.light-theme:not(.sub-look) .server-chart-value {
  color: #10242a !important;
}

body.light-theme:not(.sub-look) .section-kicker {
  color: rgba(4, 122, 91, .92) !important;
}

body.light-theme:not(.sub-look) .dashboard-card p,
body.light-theme:not(.sub-look) .dashboard-card .text-xs,
body.light-theme:not(.sub-look) .dashboard-card .text-sm,
body.light-theme:not(.sub-look) .server-meta,
body.light-theme:not(.sub-look) .server-metrics,
body.light-theme:not(.sub-look) .server-chart-head,
body.light-theme:not(.sub-look) .server-chart-label strong,
body.light-theme:not(.sub-look) .server-chart-label span,
body.light-theme:not(.sub-look) .server-chart-value,
body.light-theme:not(.sub-look) .connection-platform,
body.light-theme:not(.sub-look) .connection-dates span,
body.light-theme:not(.sub-look) .connection-dates strong,
body.light-theme:not(.sub-look) .connection-explainer,
body.light-theme:not(.sub-look) .subscription-insights span,
body.light-theme:not(.sub-look) .subscription-insights strong,
body.light-theme:not(.sub-look) .security-item span,
body.light-theme:not(.sub-look) .security-item strong,
body.light-theme:not(.sub-look) .support-ticket-head span,
body.light-theme:not(.sub-look) .support-ticket p,
body.light-theme:not(.sub-look) .support-history-title,
body.light-theme:not(.sub-look) #serversCheckedAt,
body.light-theme:not(.sub-look) #serversOverallMeta,
body.light-theme:not(.sub-look) #infraSidebarMeta,
body.light-theme:not(.sub-look) #globalHint,
body.light-theme:not(.sub-look) #verifyHint,
body.light-theme:not(.sub-look) #securityHint,
body.light-theme:not(.sub-look) #supportHint,
body.light-theme:not(.sub-look) #topupHint,
body.light-theme:not(.sub-look) #subLimitHint,
body.light-theme:not(.sub-look) #bindEmailHint,
body.light-theme:not(.sub-look) #authHint,
body.light-theme:not(.sub-look) #resetHint,
body.light-theme:not(.sub-look) #connectionsHint,
body.light-theme:not(.sub-look) #wlStatus,
body.light-theme:not(.sub-look) #wlPeriod {
  color: rgba(16, 36, 42, .70) !important;
}

body.light-theme:not(.sub-look) .quick-action,
body.light-theme:not(.sub-look) .guide-shortcut,
body.light-theme:not(.sub-look) .support-topic-grid button,
body.light-theme:not(.sub-look) .product-service-card,
body.light-theme:not(.sub-look) .product-location-pill,
body.light-theme:not(.sub-look) .server-tile,
body.light-theme:not(.sub-look) .connection-tile,
body.light-theme:not(.sub-look) .subscription-insights > div,
body.light-theme:not(.sub-look) .security-item,
body.light-theme:not(.sub-look) .onboarding-step,
body.light-theme:not(.sub-look) .server-chart,
body.light-theme:not(.sub-look) .connection-explainer,
body.light-theme:not(.sub-look) .support-ticket,
body.light-theme:not(.sub-look) .empty-state,
body.light-theme:not(.sub-look) .loading-state {
  border-color: rgba(27, 81, 84, .16) !important;
  background: rgba(255, 255, 255, .72) !important;
  color: rgba(16, 36, 42, .76) !important;
}

body.light-theme:not(.sub-look) .quick-action:hover,
body.light-theme:not(.sub-look) .guide-shortcut:hover,
body.light-theme:not(.sub-look) .support-topic-grid button:hover {
  border-color: rgba(6, 185, 130, .26) !important;
  background: rgba(6, 185, 130, .10) !important;
}

body.light-theme:not(.sub-look) .server-protocols span,
body.light-theme:not(.sub-look) .connection-state,
body.light-theme:not(.sub-look) .support-ticket-status,
body.light-theme:not(.sub-look) .product-location-pill,
body.light-theme:not(.sub-look) .welcome-pills span {
  border-color: rgba(6, 185, 130, .22) !important;
  background: rgba(6, 185, 130, .11) !important;
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) .server-chart-group-title,
body.light-theme:not(.sub-look) .connection-ip,
body.light-theme:not(.sub-look) .connection-state.active,
body.light-theme:not(.sub-look) .status-chip,
body.light-theme:not(.sub-look) .server-filter.is-active,
body.light-theme:not(.sub-look) .dashboard-tab.is-active {
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) .topup-choice-btn span,
body.light-theme:not(.sub-look) .support-topic-grid button,
body.light-theme:not(.sub-look) .guide-shortcut,
body.light-theme:not(.sub-look) .quick-action {
  color: rgba(16, 36, 42, .78) !important;
}

body.light-theme:not(.sub-look) .topup-choice-btn strong {
  color: rgba(16, 36, 42, .62) !important;
}

body.light-theme:not(.sub-look) .topup-choice-btn.is-active span,
body.light-theme:not(.sub-look) .topup-choice-btn.is-active strong {
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) [class*="text-emerald"] {
  color: #047a5b !important;
}

body.light-theme:not(.sub-look) [class*="text-amber"],
body.light-theme:not(.sub-look) [class*="text-yellow"] {
  color: #7c4a03 !important;
}

body.light-theme:not(.sub-look) [class*="text-sky"],
body.light-theme:not(.sub-look) [class*="text-cyan"] {
  color: #075d6c !important;
}

body.light-theme:not(.sub-look) [class*="text-red"] {
  color: #9f1d2d !important;
}

body.light-theme:not(.sub-look) .capacity-ring::after {
  background: #f5fbf8 !important;
}

body.light-theme:not(.sub-look) .error-state {
  border-color: rgba(159, 29, 45, .22) !important;
  background: rgba(159, 29, 45, .08) !important;
  color: #9f1d2d !important;
}

#infraSidebarState { min-height: 76px; }

.mobile-bottom-nav {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.mobile-bottom-nav > a {
  min-width: 0;
  flex: 1 1 0;
  padding-inline: 2px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes ag-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ag-shimmer { to { background-position: -220% 0; } }
@keyframes ag-pulse { 50% { opacity: .35; transform: scale(.82); } }
@keyframes ag-spin { to { transform: rotate(360deg); } }

@media (min-width: 1024px) {
  .app-main {
    margin-left: 268px;
    padding: 24px 30px 52px;
  }

  .dashboard-flow {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr) !important;
    grid-auto-flow: row dense;
    gap: 14px !important;
    align-items: start;
  }

  #welcomeCard, #dashboardTabs, #authCard, #resetCard,
  #serversCard, #connectionsCard, #tariffsCard { grid-column: 1 / -1 !important; }
  #welcomeCard { order: 0; }
  #dashboardTabs { order: 1; position: sticky; top: 14px; z-index: 12; }
  #authCard, #resetCard { order: 5; }
  #statusCard { grid-column: 1; order: 10; }
  #quickActionsCard { grid-column: 2; order: 10; }
  #productCard { grid-column: 1 / -1; order: 20; }
  #serversCard { order: 10; }
  #connectionOnboardingCard { grid-column: 1; order: 10; }
  #guidesCard { grid-column: 2; order: 10; }
  #connectionsCard { order: 20; }
  #tariffsCard { order: 10; max-width: 920px; justify-self: center; width: 100%; }
  #accountCard, #securityCard, #twoFactorCard, #telegramWidgetCard, #emailBindCard, #infoCard {
    grid-column: 1 / -1;
    max-width: 860px;
    justify-self: center;
    width: 100%;
  }
  #accountCard { order: 10; }
  #securityCard { order: 20; }
  #twoFactorCard { order: 25; }
  #telegramWidgetCard, #emailBindCard { order: 30; }
  #infoCard { order: 40; }
  #supportCard, #newsCard {
    grid-column: 1 / -1;
    max-width: 820px;
    justify-self: center;
    width: 100%;
  }
  #supportCard { order: 10; }
  #newsCard { order: 20; }

  .server-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #connectionsList { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  body.guest-mode .desktop-shell.dashboard-flow {
    grid-template-columns: 1fr !important;
    max-width: 820px;
  }

  body.guest-mode #welcomeCard,
  body.guest-mode #telegramWidgetCard,
  body.guest-mode #authCard,
  body.guest-mode #productCard,
  body.guest-mode #serversCard,
  body.guest-mode #newsCard,
  body.guest-mode #infoCard {
    grid-column: 1 / -1 !important;
    max-width: none;
    justify-self: center;
    width: 100%;
  }

  body.guest-mode #telegramWidgetCard { order: 4; }
  body.guest-mode #authCard { order: 5; }
  body.guest-mode #productCard {
    order: 20;
  }
  body.guest-mode #serversCard {
    order: 30;
  }
  body.guest-mode #newsCard { order: 40; }
  body.guest-mode #infoCard { order: 50; }
  body.guest-mode .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.guest-mode #guidesCard { display: none !important; }
}

@media (min-width: 1280px) {
  .server-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .app-main { padding: 14px 12px calc(92px + env(safe-area-inset-bottom)) !important; }
  .hero-card { min-height: 210px; }
  #welcomeCard { order: 0; }
  #dashboardTabs { order: 1; position: sticky; top: 8px; z-index: 12; overflow-x: auto; }
  .dashboard-tabs { display: flex; scrollbar-width: none; }
  .dashboard-tabs::-webkit-scrollbar { display: none; }
  .dashboard-tab { flex: 0 0 auto; min-width: 118px; }
  #statusCard { order: 10; }
  #quickActionsCard { order: 20; }
  #productCard { order: 30; }
  #connectionOnboardingCard { order: 30; }
  #guidesCard { order: 35; }
  #serversCard { order: 40; }
  #connectionsCard { order: 45; }
  #tariffsCard { order: 50; }
  #accountCard { order: 60; }
  #securityCard { order: 65; }
  #twoFactorCard { order: 66; }
  #telegramWidgetCard, #emailBindCard { order: 70; }
  #supportCard { order: 80; }
  #newsCard { order: 100; }
  #infoCard { order: 110; }

  body.guest-mode #telegramWidgetCard { order: 2; }
  body.guest-mode #authCard { order: 3; }
  body.guest-mode #productCard { order: 4; }
  body.guest-mode #serversCard { order: 5; }
  body.guest-mode #guidesCard { display: none !important; }
}

@media (max-width: 560px) {
  .server-grid { grid-template-columns: 1fr; }
  .connections-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-action { min-height: 72px; align-items: center; gap: 7px; padding: 10px 2px; text-align: center; font-size: 9px; }
  .quick-action-icon { width: 30px; height: 30px; }
  #welcomeCard > .flex { align-items: flex-start; gap: 12px; }
  .welcome-actions { flex-direction: column-reverse; align-items: flex-end; }
  .theme-toggle { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .brand-orb { width: 38px; height: 38px; border-radius: 14px; }
  .dashboard-tabs { margin-inline: -2px; }
  .dashboard-tab { min-width: 112px; padding: 10px 9px; }
  .subscription-insights,
  .security-grid,
  .onboarding-steps,
  .onboarding-actions,
  .support-topic-grid,
  .topup-choice { grid-template-columns: 1fr; }
  .server-chart { padding: 12px; }
  .server-chart-head { grid-template-columns: 1fr; gap: 3px; }
  .server-chart-row { grid-template-columns: 112px minmax(0, 1fr) 52px; gap: 8px; }
  .server-chart-label { flex-direction: column; align-items: flex-start; gap: 2px; }
  .connections-limit-notice { align-items: flex-start; flex-direction: column; }
  .server-summary { padding: 13px; }
  .uptime-value { font-size: 20px; }
  .dashboard-card { border-radius: 18px !important; padding: 16px !important; }
  #tariffs { grid-template-columns: 1fr; }
  .dashboard-card p,
  .dashboard-card .text-xs,
  .dashboard-card .text-sm { overflow-wrap: anywhere; }
  .mobile-bottom-nav { inset-inline: 8px !important; font-size: 9px !important; }
}

@media (max-width: 390px) {
  .connections-heading { align-items: flex-start; }
  .connections-heading .capacity-ring { width: 58px; height: 58px; }
  .connection-dates { grid-template-columns: 1fr; }
  .connection-state { font-size: 8px; }
}

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

/* Portal features -------------------------------------------------------- */
#dashboardTabs { display: none !important; }

body.authed-mode .welcome-description,
body.authed-mode .welcome-pills,
body.authed-mode #productCard { display: none !important; }

body.guest-mode #serverFilterTabs,
body.guest-mode #serverHealthChart { display:none !important; }

body.guest-mode .mobile-bottom-nav,
body.guest-mode > aside { display:none !important; }

body.authed-mode #welcomeCard { padding-block: 16px !important; }

.page-subtitle { margin-top: 2px; }

.header-icon-button,
.compact-action {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.055);
  color: rgba(239,248,249,.82);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.header-icon-button:hover,
.compact-action:hover {
  transform: translateY(-1px);
  border-color: rgba(53,230,161,.25);
  background: rgba(53,230,161,.09);
}

.header-icon-button:disabled,
.compact-action:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.header-icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.header-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding-inline: 5px;
  border: 2px solid #0b1215;
  border-radius: 999px;
  background: #35e6a1;
  color: #042219;
  font-size: 9px;
  font-weight: 900;
}

.compact-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
}

.compact-action.is-busy { cursor: wait; opacity: .62; }

.auth-field {
  display: grid;
  gap: 7px;
  color: rgba(230,240,242,.64);
  font-size: 11px;
  font-weight: 700;
}

.password-field { position: relative; display: block; }

.password-field > button {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 11px;
  color: rgba(230,240,242,.65);
  background: rgba(255,255,255,.055);
}

.auth-consent,
.diagnostics-consent,
.connection-trust-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: rgba(230,240,242,.60);
  font-size: 11px;
  line-height: 1.45;
}

.auth-consent input,
.diagnostics-consent input,
.connection-trust-toggle input,
.preference-grid input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--ag-green);
}

.auth-consent button { color: #79eac0; text-decoration: underline; text-underline-offset: 2px; }

.two-factor-login-step,
.two-factor-note,
.two-factor-enrollment {
  border: 1px solid rgba(53,230,161,.15);
  border-radius: 16px;
  background: rgba(53,230,161,.055);
  padding: 13px;
}

.two-factor-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #8ff1cc;
  background: rgba(53,230,161,.11);
}

.two-factor-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  color: var(--ag-muted);
  background: rgba(255,255,255,.045);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.two-factor-status.is-enabled {
  border-color: rgba(53,230,161,.2);
  color: #a8f7d7;
  background: rgba(53,230,161,.09);
}

.two-factor-note {
  color: var(--ag-muted);
  font-size: 11px;
  line-height: 1.5;
}

.two-factor-note.is-success { color: #b0f6dc; }

.two-factor-qr {
  width: min(100%, 260px);
  min-height: 224px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
}

.two-factor-qr img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 232px;
}

.two-factor-secret {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.two-factor-secret code {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  color: #dffbf0;
  background: rgba(0,0,0,.18);
  font-size: 11px;
  letter-spacing: .08em;
}

.period-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.period-chip {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(230,240,242,.68);
  font-size: 10px;
  font-weight: 750;
}

.period-chip.accent { border-color: rgba(53,230,161,.18); color: #a8f7d7; background: rgba(53,230,161,.08); }
.period-chip.whitelist { border-color: rgba(36,200,229,.18); color: #9beafa; background: rgba(36,200,229,.07); }
.period-chip.pending { border-color: rgba(246,190,74,.18); color: #f5d78e; background: rgba(246,190,74,.07); }

.notification-list,
.payment-list,
.session-list,
.event-timeline { display: grid; gap: 9px; }

.notification-item {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  color: inherit;
  text-align: left;
}

.notification-item.is-unread {
  border-color: rgba(53,230,161,.19);
  background: linear-gradient(120deg, rgba(53,230,161,.09), rgba(255,255,255,.035));
}

.notification-item.severity-warning { border-left: 3px solid #e7b94c; }
.notification-item.severity-critical,
.notification-item.severity-error { border-left: 3px solid var(--ag-danger); }

.notification-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-item-head strong { font-size: 12px; }
.notification-item-head time { color: var(--ag-muted); font-size: 9px; white-space: nowrap; }
.notification-message { display: block; margin-top: 5px; color: var(--ag-muted); font-size: 11px; line-height: 1.45; }

.notification-preferences,
.change-password-panel {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  padding: 11px 12px;
}

.notification-preferences summary,
.change-password-panel summary { cursor: pointer; color: rgba(230,240,242,.72); font-size: 11px; font-weight: 750; }

.preference-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.preference-grid label { display: flex; align-items: center; gap: 7px; color: var(--ag-muted); font-size: 11px; }

.segmented-control {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.segmented-control button {
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--ag-muted);
  font-size: 10px;
  font-weight: 800;
}

.segmented-control button.is-active { background: rgba(53,230,161,.13); color: #aef8dc; }

.traffic-chart {
  min-height: 188px;
  padding: 13px 12px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    rgba(255,255,255,.02);
  background-size: 100% 25%;
}

.traffic-bars { height: 160px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(8px,1fr); gap: 5px; align-items: stretch; }
.traffic-bars.days-30 { gap: 2px; }
.traffic-column { min-width: 0; display: grid; grid-template-rows: 1fr 22px; gap: 5px; align-items:end; }
.traffic-bar-pair { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.traffic-bar { width: min(9px,45%); min-height: 0; border-radius: 4px 4px 2px 2px; transition: height .35s ease; }
.traffic-bar.main { background: linear-gradient(180deg, #35e6a1, #139f76); }
.traffic-bar.whitelist { background: linear-gradient(180deg, #38d8ef, #168fa9); }
.traffic-column > span { overflow: hidden; color: rgba(230,240,242,.42); font-size: 8px; text-align:center; white-space: nowrap; }
.traffic-column > span.is-muted { opacity: .25; }
.traffic-legend { display:flex; flex-wrap:wrap; gap:14px; color:var(--ag-muted); font-size:10px; }
.traffic-legend span { display:inline-flex; align-items:center; gap:6px; }
.legend-dot { width:8px; height:8px; border-radius:999px; }
.legend-dot.main { background:#35e6a1; }
.legend-dot.whitelist { background:#38d8ef; }

.event-item { display:grid; grid-template-columns:12px minmax(0,1fr); gap:10px; }
.event-marker { width:10px; height:10px; margin-top:5px; border:2px solid rgba(53,230,161,.5); border-radius:999px; background:#10231f; box-shadow:0 0 0 4px rgba(53,230,161,.06); }
.event-item.severity-critical .event-marker { border-color:var(--ag-danger); box-shadow:0 0 0 4px rgba(255,107,120,.07); }
.event-content { padding:0 0 13px; border-bottom:1px solid rgba(255,255,255,.06); }
.event-head { display:flex; justify-content:space-between; gap:10px; }
.event-head strong { font-size:12px; }
.event-status { color:#94edce; font-size:9px; font-weight:800; }
.event-content p { margin-top:4px; color:var(--ag-muted); font-size:11px; }
.event-content time { display:block; margin-top:5px; color:rgba(230,240,242,.40); font-size:9px; }

.payment-return-state {
  margin-bottom: 13px;
  padding: 11px 13px;
  border: 1px solid rgba(36,200,229,.18);
  border-radius: 14px;
  background: rgba(36,200,229,.07);
  color: #a7effa;
  font-size: 11px;
}
.payment-return-state.is-success { border-color:rgba(53,230,161,.2); background:rgba(53,230,161,.08); color:#aff7dd; }
.payment-return-state.is-error { border-color:rgba(255,107,120,.24); background:rgba(255,107,120,.08); color:#ffc1c7; }
.payment-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 13px; border:1px solid rgba(255,255,255,.07); border-radius:15px; background:rgba(255,255,255,.03); }
.payment-info, .payment-amount { display:grid; gap:4px; }
.payment-info strong, .payment-amount strong { font-size:12px; }
.payment-info span { color:var(--ag-muted); font-size:10px; }
.payment-amount { justify-items:end; text-align:right; }
.payment-status { padding:4px 7px; border-radius:999px; background:rgba(255,255,255,.06); color:var(--ag-muted); font-size:9px; font-weight:800; }
.payment-status.status-paid { background:rgba(53,230,161,.1); color:#9cf1d1; }
.payment-status.status-failed, .payment-status.status-cancelled { background:rgba(255,107,120,.1); color:#ffb5bd; }

.support-ticket-open { width:100%; color:inherit; text-align:left; }
.support-ticket-preview { display:block; margin-top:6px; color:var(--ag-muted); font-size:11px; }
.ticket-thread { display:grid; gap:9px; margin-top:11px; padding-top:11px; border-top:1px solid rgba(255,255,255,.07); }
.ticket-message { max-width:88%; padding:10px 11px; border-radius:14px; background:rgba(255,255,255,.045); }
.ticket-message.sender-user { justify-self:end; background:rgba(53,230,161,.08); }
.ticket-message strong { font-size:10px; }
.ticket-message p { margin-top:4px; color:rgba(230,240,242,.75); font-size:11px; white-space:pre-wrap; }
.ticket-message time { display:block; margin-top:5px; color:rgba(230,240,242,.38); font-size:8px; }
.ticket-reply { width:100%; resize:vertical; border-radius:14px; background:rgba(255,255,255,.07); padding:11px; color:#fff; font-size:12px; outline:none; }
.ticket-actions { display:flex; flex-wrap:wrap; gap:8px; }

.session-item { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:10px; padding:12px; border:1px solid rgba(255,255,255,.07); border-radius:15px; background:rgba(255,255,255,.03); }
.session-item.is-current { border-color:rgba(53,230,161,.17); background:rgba(53,230,161,.055); }
.session-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.055); color:#73eabf; }
.session-info { min-width:0; display:grid; gap:3px; }
.session-info strong { font-size:12px; }
.session-info span { color:var(--ag-muted); font-size:9px; }
.session-badge { color:#8cebc9; font-size:9px; font-weight:800; }

.referral-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.referral-stat { display:grid; gap:3px; padding:13px; border:1px solid rgba(255,255,255,.07); border-radius:15px; background:rgba(255,255,255,.03); }
.referral-stat strong { color:#b6f9df; font-size:18px; }
.referral-stat span { color:var(--ag-muted); font-size:10px; }
.referral-actions { display:grid; grid-template-columns:1fr; gap:9px; }
.referral-actions button:disabled { opacity:.4; cursor:not-allowed; }

.danger-zone { border-color:rgba(255,107,120,.13) !important; }
.danger-action { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px; border:1px solid rgba(255,255,255,.07); border-radius:15px; background:rgba(255,255,255,.03); }
.danger-action.is-critical { border-color:rgba(255,107,120,.16); background:rgba(255,107,120,.045); }
.danger-action > div { display:grid; gap:4px; }
.danger-action strong { font-size:12px; }
.danger-action span { color:var(--ag-muted); font-size:10px; line-height:1.45; }

.qr-shell { display:grid; place-items:center; min-height:260px; padding:16px; border-radius:18px; background:#fff; }
.qr-shell img { display:block; width:min(100%,280px); height:auto; }
.modal-overlay > div { overflow-y:auto; }

.connection-preferences { margin-top:11px; padding-top:10px; border-top:1px solid rgba(255,255,255,.065); }
.connection-preferences-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.trusted-source { color:var(--ag-muted); font-size:9px; }
.trusted-source.is-trusted { color:#8eeecb; }
.connection-preferences-editor { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:center; margin-top:10px; }
.connection-alias-input { width:100%; border-radius:12px; background:rgba(255,255,255,.07); padding:9px 10px; color:#fff; font-size:11px; outline:none; }
.connection-trust-toggle { grid-column:1 / -1; }
.connection-edit-hint { grid-column:1 / -1; color:var(--ag-muted); font-size:9px; }

body.light-theme:not(.sub-look) #qrOverlay,
body.light-theme:not(.sub-look) #accessResetOverlay { background:rgba(226,242,239,.88) !important; }

body.light-theme:not(.sub-look) .header-icon-button,
body.light-theme:not(.sub-look) .compact-action,
body.light-theme:not(.sub-look) .notification-item,
body.light-theme:not(.sub-look) .notification-preferences,
body.light-theme:not(.sub-look) .change-password-panel,
body.light-theme:not(.sub-look) .segmented-control,
body.light-theme:not(.sub-look) .traffic-chart,
body.light-theme:not(.sub-look) .payment-item,
body.light-theme:not(.sub-look) .session-item,
body.light-theme:not(.sub-look) .referral-stat,
body.light-theme:not(.sub-look) .danger-action,
body.light-theme:not(.sub-look) .ticket-message,
body.light-theme:not(.sub-look) .two-factor-status,
body.light-theme:not(.sub-look) .two-factor-login-step,
body.light-theme:not(.sub-look) .two-factor-note,
body.light-theme:not(.sub-look) .two-factor-enrollment,
body.light-theme:not(.sub-look) .two-factor-secret code {
  border-color:rgba(27,81,84,.14) !important;
  background-color:rgba(255,255,255,.70) !important;
  color:#10242a !important;
}

body.light-theme:not(.sub-look) .notification-item.is-unread,
body.light-theme:not(.sub-look) .session-item.is-current,
body.light-theme:not(.sub-look) .ticket-message.sender-user {
  border-color:rgba(6,185,130,.24) !important;
  background:rgba(6,185,130,.08) !important;
}

body.light-theme:not(.sub-look) .notification-message,
body.light-theme:not(.sub-look) .notification-item-head time,
body.light-theme:not(.sub-look) .notification-preferences summary,
body.light-theme:not(.sub-look) .change-password-panel summary,
body.light-theme:not(.sub-look) .preference-grid label,
body.light-theme:not(.sub-look) .traffic-column > span,
body.light-theme:not(.sub-look) .traffic-legend,
body.light-theme:not(.sub-look) .event-content p,
body.light-theme:not(.sub-look) .event-content time,
body.light-theme:not(.sub-look) .payment-info span,
body.light-theme:not(.sub-look) .session-info span,
body.light-theme:not(.sub-look) .referral-stat span,
body.light-theme:not(.sub-look) .danger-action span,
body.light-theme:not(.sub-look) .ticket-message p,
body.light-theme:not(.sub-look) .ticket-message time,
body.light-theme:not(.sub-look) .support-ticket-preview,
body.light-theme:not(.sub-look) .trusted-source,
body.light-theme:not(.sub-look) .connection-edit-hint,
body.light-theme:not(.sub-look) .auth-field,
body.light-theme:not(.sub-look) .auth-consent,
body.light-theme:not(.sub-look) .diagnostics-consent,
body.light-theme:not(.sub-look) .connection-trust-toggle {
  color:rgba(16,36,42,.68) !important;
}

body.light-theme:not(.sub-look) .period-chip { border-color:rgba(27,81,84,.14); background:rgba(255,255,255,.7); color:#29494f; }
body.light-theme:not(.sub-look) .period-chip.accent,
body.light-theme:not(.sub-look) .period-chip.whitelist,
body.light-theme:not(.sub-look) .period-chip.pending,
body.light-theme:not(.sub-look) .event-status,
body.light-theme:not(.sub-look) .session-badge,
body.light-theme:not(.sub-look) .trusted-source.is-trusted { color:#047a5b !important; }
body.light-theme:not(.sub-look) .header-notification-badge { border-color:#eff9f6; }
body.light-theme:not(.sub-look) .ticket-reply,
body.light-theme:not(.sub-look) .connection-alias-input { border:1px solid rgba(27,81,84,.14); background:rgba(255,255,255,.85); color:#10242a; }
body.light-theme:not(.sub-look) .payment-return-state { color:#075d6c; }
body.light-theme:not(.sub-look) .payment-return-state.is-success { color:#047a5b; }
body.light-theme:not(.sub-look) .payment-return-state.is-error { color:#9f1d2d; }
body.light-theme:not(.sub-look) .danger-action.is-critical { border-color:rgba(159,29,45,.2) !important; background:rgba(159,29,45,.06) !important; }
body.light-theme:not(.sub-look) .two-factor-status.is-enabled,
body.light-theme:not(.sub-look) .two-factor-note.is-success {
  border-color:rgba(6,185,130,.24) !important;
  background:rgba(6,185,130,.08) !important;
  color:#047a5b !important;
}

@media (min-width: 1024px) {
  body.authed-mode > aside { display:flex !important; }
  body.guest-mode .app-main { margin-left:0 !important; }
  body.authed-mode .dashboard-flow { grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr) !important; }
  #welcomeCard { grid-column:1 / -1 !important; order:0; }
  #notificationsCard { grid-column:2; order:20; }
  #trafficHistoryCard { grid-column:1; order:20; }
  #serverEventsCard { grid-column:1 / -1; order:20; }
  #paymentsHistoryCard { grid-column:1 / -1; order:20; max-width:920px; width:100%; justify-self:center; }
  #sessionsCard, #referralCard, #dangerZoneCard {
    grid-column:1 / -1;
    max-width:860px;
    width:100%;
    justify-self:center;
  }
  #sessionsCard { order:30; }
  #referralCard { order:40; }
  #dangerZoneCard { order:50; }
  #telegramWidgetCard, #emailBindCard { order:60; }
  #infoCard { order:70; }
}

@media (max-width: 1023px) {
  #notificationsCard { order:22; }
  #trafficHistoryCard { order:24; }
  #serverEventsCard { order:42; }
  #paymentsHistoryCard { order:52; }
  #sessionsCard { order:66; }
  #referralCard { order:67; }
  #dangerZoneCard { order:68; }
}

@media (max-width: 560px) {
  .welcome-actions { flex-direction:row; align-items:center; gap:6px; }
  .theme-toggle { min-width:34px; justify-content:center; }
  body.authed-mode #themeToggleText { display:none; }
  .header-icon-button { width:36px; height:36px; border-radius:12px; }
  body.authed-mode .brand-orb { width:36px; height:36px; }
  .preference-grid { grid-template-columns:1fr; }
  .segmented-control button { padding-inline:7px; }
  .traffic-chart { min-height:172px; padding-inline:8px; }
  .traffic-bars { height:145px; gap:3px; }
  .traffic-bars.days-30 { gap:1px; }
  .payment-item, .danger-action { align-items:flex-start; flex-direction:column; }
  .payment-amount { width:100%; grid-template-columns:1fr auto; align-items:center; justify-items:start; text-align:left; }
  .referral-actions { grid-template-columns:1fr; }
  .connection-preferences-editor { grid-template-columns:1fr; }
  .connection-trust-toggle, .connection-edit-hint { grid-column:1; }
  .server-tile { cursor:pointer; }
  .server-tile .server-meta,
  .server-tile .server-protocols { display:none; }
  .server-tile.is-expanded .server-meta { display:block; }
  .server-tile.is-expanded .server-protocols { display:flex; }
  .server-tile:focus-visible { outline:2px solid rgba(53,230,161,.45); outline-offset:2px; }
  .notification-item-head { display:grid; gap:3px; }
  .ticket-message { max-width:94%; }
}

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