:root {
  color-scheme: dark;
  --bg: #090b0c;
  --panel: #101315;
  --panel2: #141719;
  --line: #303638;
  --text: #f1f3f2;
  --muted: #929a9d;
  --cyan: #84d6a0;
  --green: #84d6a0;
  --blue: #84d6a0;
  --violet: #84d6a0;
  --purple: #84d6a0;
  --radius: 14px;
  --shadow: none;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #090b0c;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#bgCanvas,
.desktop-sidebar,
.desktop-page-title,
.back-btn,
.screen[data-screen="home"] > .hero,
.screen[data-screen="home"] > .quick-grid,
.screen[data-screen="home"] > .home-summary-list,
.screen[data-screen="home"] > .desktop-summary-grid,
.screen[data-screen="home"] > .home-footnote { display: none !important; }

.app-shell,
.app-shell.app--ultima {
  display: block !important;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0 16px calc(100px + env(safe-area-inset-bottom));
  overflow: clip;
  background: #090b0c;
  color: #f1f3f2;
  --ultima-bg: #090b0c;
  --ultima-surface: #101315;
  --ultima-surface-soft: #141719;
  --ultima-text: #f1f3f2;
  --ultima-muted: #929a9d;
  --ultima-gold: #84d6a0;
  --ultima-gold-light: #a0e1b4;
  --ultima-gold-dark: #476f52;
  --ultima-line: #303638;
  --ultima-premium-line: #303638;
  isolation: isolate;
}
body.auth-required .app-shell { display: none !important; }
.app-shell [hidden] { display: none !important; }

.app-shell::before,
.app-shell.app--ultima::before { display: none !important; }
.app-content { width: min(100%, 920px); min-width: 0; min-height: 100dvh; margin-inline: auto; }

.topbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 auto 18px;
  padding: 10px 0 4px;
  border: 0;
  background: transparent;
}
.topbar .brand { display: none !important; }
.top-actions { align-items: center; gap: 8px; }
.desktop-user-chip { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; color: #c9cecc; }
.desktop-user-chip > span { font-size: 12px; line-height: 1.2; }
.desktop-user-chip > small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.top-actions .icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #303638;
  border-radius: 50%;
  background: #15191b;
  box-shadow: none;
  backdrop-filter: none;
}
.profile-avatar-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.profile-avatar-button .avatar { width: 36px; height: 36px; border: 1px solid #3a4244; border-radius: 50%; background: #171b1d; color: #f1f3f2; font-size: 13px; }
.notif-dot { background: #84d6a0; box-shadow: 0 0 8px rgb(132 214 160 / 35%); }

.screen { width: min(100%, 920px); margin: 0 auto; }
.screen.active { animation: cabinet-enter .22s ease both; }
@keyframes cabinet-enter { from { opacity: .72; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-head { margin: 0 auto 18px; }
.page-head .page-kicker { margin-bottom: 7px; color: #aab1ae; font-size: 10px; font-weight: 650; letter-spacing: .08em; }
.page-head h1 { margin: 0 0 6px; color: #f1f3f2; font-size: 26px; font-weight: 680; line-height: 1.2; }
.page-head p { max-width: 58ch; margin: 0; color: #929a9d; font-size: 13px; line-height: 1.5; }

.home-welcome { display: grid; justify-items: center; gap: 6px; margin: 0 auto 20px; text-align: center; }
.home-brand-logo { display: block; width: 112px; height: 56px; margin: 0 auto 2px; object-fit: contain; filter: drop-shadow(0 0 13px rgb(132 214 160 / 26%)); transition: filter .22s ease, transform .22s ease; }
.home-brand-logo.is-active { filter: drop-shadow(0 0 14px rgb(105 218 139 / 48%)); }
.home-brand-logo.is-ending,
.home-brand-logo.is-expired { filter: drop-shadow(0 0 15px rgb(244 91 91 / 55%)); }
.home-welcome .page-kicker { margin: 0; color: #aeb5b2; font-size: 10px; font-weight: 700; letter-spacing: .09em; }
.home-greeting-user { color: #929a9d; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.home-greeting-user strong { color: #84d6a0; font-weight: 700; }
.home-welcome h1 { margin: 0; color: #f1f3f2; font-size: 30px; font-weight: 700; line-height: 1.15; }
.home-welcome > p { margin: 0; color: #929a9d; font-size: 13px; line-height: 1.5; }

.glass-card,
.app-shell.app--ultima .glass-card,
.app-shell.app--ultima .subscription-card,
.app-shell.app--ultima .detail-card,
.app-shell.app--ultima .section-card,
.app-shell.app--ultima .quick-card,
.app-shell.app--ultima .home-summary-list,
.app-shell.app--ultima .info-cell,
.app-shell.app--ultima .device-card,
.app-shell.app--ultima .profile-card,
.app-shell.app--ultima .connect-card,
.app-shell.app--ultima .family-hero,
.app-shell.app--ultima .support-panel,
.app-shell.app--ultima .support-chat,
.app-shell.app--ultima .payment-history-card {
  border: 1px solid #2c3234 !important;
  border-radius: 12px !important;
  background: #101315 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.screen[data-screen="home"] .subscription-card {
  display: block;
  margin: 0 auto 12px;
  padding: 0;
}
.screen[data-screen="home"] .subscription-card::before,
.screen[data-screen="home"] .subscription-card::after { display: none !important; }
.screen[data-screen="home"] .subscription-main { display: block; margin: 0; }
.screen[data-screen="home"] .subscription-info { width: 100%; }
.wizard-subscription-summary { display: grid; min-height: 82px; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
.wizard-subscription-stat { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 13px 10px; text-align: center; }
.wizard-subscription-stat + .wizard-subscription-stat { border-left: 1px solid #272d2f; }
.wizard-subscription-stat > small { color: #929a9d; font-size: 9px; line-height: 1.2; }
.wizard-subscription-stat > strong { color: #f1f3f2; font-size: 13px; line-height: 1.25; }
.wizard-subscription-stat > span { color: #929a9d; font-size: 10px; line-height: 1.25; }
.screen[data-screen="home"] .plan-row { display: block; }
.screen[data-screen="home"] .home-plan-copy { min-width: 0; }
.screen[data-screen="home"] .plan-row h2,
.app-shell.app--ultima .screen[data-screen="home"] .plan-row h2,
.app-shell.app--ultima .detail-topline h2 {
  margin: 7px 0 2px;
  background: none !important;
  color: #f1f3f2 !important;
  font-size: 19px;
  font-weight: 680;
  -webkit-text-fill-color: currentColor;
}
.screen[data-screen="home"] .home-expire-line { margin: 0; color: #929a9d; font-size: 12px; line-height: 1.45; }
.app-shell.app--ultima .status-pill { display: inline-flex; min-height: 25px; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid #34483b; border-radius: 999px; background: #142018; color: #a9e0ba; font-size: 11px; }
.app-shell.app--ultima .status-pill span { width: 6px; height: 6px; background: #84d6a0; box-shadow: 0 0 7px rgb(132 214 160 / 45%); }
.status-pill:has(span.is-expired),
.app-shell.app--ultima .status-pill.is-expired { border-color: #583234; background: #241517; color: #f19b9b; }
.wizard-plan-stat .plan-row h2 { margin: 0 !important; font-size: 13px !important; line-height: 1.25; }
.wizard-plan-stat .status-pill { order: 1; min-height: 0; padding: 0; border: 0; background: transparent; color: #a9e0ba; font-size: 9px; }
.wizard-plan-stat .home-plan-copy { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wizard-plan-stat .exclusive-plan-mark { display: none !important; }
.wizard-days-stat .home-progress { width: min(100%, 180px); height: 4px; margin: 2px 0 0; }
.wizard-days-stat .home-expire-line { max-width: 100%; overflow: hidden; color: #929a9d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.wizard-devices-stat #deviceCountInline { color: #f1f3f2; font-size: 13px; font-weight: 700; }
.screen[data-screen="home"] .subscription-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.screen[data-screen="home"] .subscription-meta .meta-item { display: flex; min-height: 42px; align-items: center; padding: 9px 11px; border: 1px solid #272d2f; border-radius: 9px; background: #141719; color: #d8ddda; font-size: 12px; }
.screen[data-screen="home"] .subscription-meta .meta-item strong { color: #f1f3f2; }
.screen[data-screen="home"] .home-progress { height: 4px; margin: 12px 0 0; overflow: hidden; border-radius: 999px; background: #292f31; }
.screen[data-screen="home"] .home-progress span { display: block; height: 100%; border-radius: inherit; background: #84d6a0 !important; box-shadow: none; }
.screen[data-screen="home"] .home-progress[hidden] { display: none !important; }
.screen[data-screen="home"] .home-progress:not([hidden]) span { width: var(--remaining-percent, 0%) !important; }
.screen[data-screen="home"] .home-plan-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 12px 0 0; }
.screen[data-screen="home"] .home-plan-actions .btn { display: flex; min-width: 0; min-height: 46px; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid #32393b !important; border-radius: 9px !important; background: #141719 !important; color: #e6eae7 !important; box-shadow: none !important; font-size: 13px; font-weight: 650; }
.screen[data-screen="home"] .home-plan-actions .btn-primary:not(.device-addon-home),
.app-shell.app--ultima .btn-primary,
.app-shell.app--ultima .copy-box button {
  border-color: #84d6a0 !important;
  background: #84d6a0 !important;
  color: #0a110c !important;
  box-shadow: none !important;
}
.screen[data-screen="home"] .home-plan-actions .btn-primary:not(.device-addon-home) { grid-column: 1 / -1; min-height: 48px; }
.screen[data-screen="home"] .home-plan-actions [data-route="subscription"] { display: none; }
.screen[data-screen="home"] .home-plan-actions [data-route="subscription"].is-renew-urgent { display: flex; grid-column: 1 / -1; min-height: 48px; border-color: #8e4246 !important; background: #351a1c !important; color: #ffb1b1 !important; }
.app-shell.app--ultima .exclusive-plan-mark { border-color: #303638 !important; background: #171b1d !important; color: #c2c9c5 !important; box-shadow: none !important; }
.screen[data-screen="home"] .home-plan-actions .device-addon-home { grid-column: 1 / -1; }
.screen[data-screen="home"] .helper { margin: 8px 2px 0; color: #929a9d; font-size: 11px; line-height: 1.45; }
.screen[data-screen="home"] .renew-link { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; border: 1px solid #8e4246; border-radius: 9px; background: #351a1c; color: #ffb1b1; font: inherit; font-weight: 700; cursor: pointer; }
.screen[data-screen="home"] .renew-link[hidden] { display: none !important; }
.screen[data-screen="home"] .home-plan-card:has(.renew-link:not([hidden])) .home-plan-actions { margin-top: 0; }

.wizard-dashboard-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 auto; }
.wizard-dashboard-link { display: grid; min-width: 0; min-height: 70px; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #2c3234; border-radius: 10px; background: #101315; color: #f1f3f2; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.wizard-dashboard-link:hover { border-color: #46514b; background: #141819; }
.wizard-dashboard-link > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.wizard-dashboard-link strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.wizard-dashboard-link small { overflow-wrap: anywhere; color: #929a9d; font-size: 10px; line-height: 1.35; }
.wizard-dashboard-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #303638; border-radius: 10px; color: #b8bfbc; }
.wizard-dashboard-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wizard-dashboard-arrow { color: #929a9d; font-size: 20px; }

.bottom-nav,
.app-shell.app--ultima .bottom-nav {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 16px;
  display: grid;
  width: auto;
  max-width: 920px;
  height: 60px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 auto;
  padding: 4px 6px;
  transform: none;
  border: 1px solid #303638 !important;
  border-radius: 15px !important;
  background: #101315 !important;
  box-shadow: 0 10px 32px rgb(0 0 0 / 34%) !important;
  backdrop-filter: none !important;
}
.bottom-nav .nav-item,
.app-shell.app--ultima .bottom-nav .nav-item,
.app-shell.app--ultima .bottom-nav .nav-item.active:not(.nav-item-connect) {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 2px;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #929a9d !important;
  box-shadow: none !important;
  text-align: center;
}
.bottom-nav .nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav .nav-item span { max-width: 100%; overflow: hidden; font-size: 10px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav .nav-item.active,
.app-shell.app--ultima .bottom-nav .nav-item.active,
.app-shell.app--ultima .bottom-nav .nav-item.active:not(.nav-item-connect) { color: #84d6a0 !important; }
.bottom-nav .nav-item.active::after { position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ""; }
.bottom-nav .nav-item-connect,
.app-shell.app--ultima .bottom-nav .nav-item-connect { order: 1; height: auto !important; align-self: stretch !important; transform: none !important; background: transparent !important; color: #929a9d !important; box-shadow: none !important; font-size: inherit !important; font-weight: inherit !important; }
.bottom-nav .nav-item[data-route="subscription"] { order: 2; }
.bottom-nav .nav-item[data-route="home"] { order: 3; }
.bottom-nav .nav-item[data-route="devices"] { order: 4; }
.bottom-nav .nav-item[data-route="more"] { order: 5; }
.bottom-nav .nav-item-connect.active { color: #84d6a0 !important; }

.screen:not([data-screen="home"]) .glass-card,
.screen:not([data-screen="home"]) .detail-card,
.screen:not([data-screen="home"]) .section-card,
.screen:not([data-screen="home"]) .family-hero,
.screen:not([data-screen="home"]) .device-card,
.screen:not([data-screen="home"]) .support-panel,
.screen:not([data-screen="home"]) .support-chat,
.screen:not([data-screen="home"]) .payment-history-card,
.screen:not([data-screen="home"]) .order-card,
.screen:not([data-screen="home"]) .subscription-stack-item {
  border-color: #2c3234 !important;
  border-radius: 11px !important;
  background: #101315 !important;
  box-shadow: none !important;
}
.screen:not([data-screen="home"]) .btn-primary,
.screen:not([data-screen="home"]) .app-shell.app--ultima .btn-primary { border-radius: 9px !important; box-shadow: none !important; }
.screen:not([data-screen="home"]) .btn-secondary { border: 1px solid #303638 !important; border-radius: 9px !important; background: #141719 !important; color: #e6eae7 !important; box-shadow: none !important; }
.screen:not([data-screen="home"]) .chip,
.screen:not([data-screen="home"]) .support-tabs button,
.screen:not([data-screen="home"]) .duration,
.screen:not([data-screen="home"]) .payment,
.screen:not([data-screen="home"]) .choice-card { border-color: #303638 !important; border-radius: 9px !important; background: #141719 !important; color: #e6eae7 !important; box-shadow: none !important; }
.screen:not([data-screen="home"]) .chip.active,
.screen:not([data-screen="home"]) .support-tabs button.active,
.screen:not([data-screen="home"]) .duration.selected,
.screen:not([data-screen="home"]) .payment.selected,
.screen:not([data-screen="home"]) .choice-card.selected { border-color: #84d6a0 !important; background: #152019 !important; color: #dff4e5 !important; }
input, textarea, select,
.screen[data-screen="connect"] .hub-subscription-select,
.screen[data-screen="connect"] .platform {
  border-color: #303638 !important;
  border-radius: 9px !important;
  background: #141719 !important;
  color: #f1f3f2 !important;
}
.screen[data-screen="connect"] .connect-card,
.app-shell.app--ultima .screen[data-screen="connect"] .connect-card { border-color: #2c3234 !important; border-radius: 12px !important; background: #101315 !important; box-shadow: none !important; }
.screen[data-screen="connect"] .connect-primary { width: min(100%, 440px) !important; border-radius: 9px !important; }
.screen[data-screen="connect"] .hub-subscription-context { border: 1px solid #2c3234 !important; border-radius: 10px !important; background: #101315 !important; }
.screen[data-screen="connect"] .connect-overview,
.app-shell.app--ultima .screen[data-screen="connect"] .connect-overview { border-color: #2c3234 !important; border-radius: 10px !important; background: #101315 !important; box-shadow: none !important; }
.screen[data-screen="connect"] .connect-overview article,
.app-shell.app--ultima .screen[data-screen="connect"] .connect-overview article { border-left-color: #2c3234 !important; }
.screen[data-screen="connect"] .connect-overview article > small,
.app-shell.app--ultima .screen[data-screen="connect"] .connect-overview article > small { color: #929a9d !important; }
.app-shell.app--ultima .connect-device-icon { background: #171b1d !important; color: #b8bfbc !important; }
.app-shell.app--ultima .connect-device-label small,
.connect-device-label small { color: #84d6a0 !important; }
.screen[data-screen="connect"] .connect-footer-actions .btn,
.app-shell.app--ultima .screen[data-screen="connect"] .connect-footer-actions .btn { border-color: #303638 !important; border-radius: 9px !important; background: #141719 !important; color: #e6eae7 !important; box-shadow: none !important; }
.screen[data-screen="more"] .more-menu { overflow: hidden; }
.screen[data-screen="more"] .more-row { border-color: #292f31 !important; background: transparent !important; }
.screen[data-screen="more"] .more-row:hover { background: #15191b !important; }
.screen[data-screen="profile"] .profile-card,
.screen[data-screen="family"] .family-hero,
.screen[data-screen="referral"] .family-hero { padding: 16px; }
.screen[data-screen="support"] .support-compose textarea,
.screen[data-screen="support"] .support-compose input { min-height: 44px; }

.app-loader { background: rgb(9 11 12 / 96%); backdrop-filter: blur(6px); }
.app-loader div { border-color: #303638; border-top-color: #84d6a0; }
.app-loader strong { color: #f1f3f2; font-size: 15px; font-weight: 600; }
.app-loader span { color: #929a9d; font-size: 12px; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #84d6a0 !important; outline-offset: 2px; }
@media (max-width: 680px) {
  .app-shell, .app-shell.app--ultima { padding-inline: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 50px; margin-bottom: 13px; padding-top: 8px; }
  .home-welcome { gap: 5px; margin-bottom: 16px; }
  .home-welcome h1 { font-size: 27px; }
  .home-welcome > p { max-width: 36ch; font-size: 12px; }
  .home-brand-logo { width: 100px; height: 50px; }
  .screen[data-screen="home"] .subscription-card { padding: 14px; }
  .screen[data-screen="home"] .subscription-meta { gap: 7px; }
  .screen[data-screen="home"] .subscription-meta .meta-item { min-height: 38px; padding: 8px; font-size: 11px; }
  .screen[data-screen="home"] .home-plan-actions { gap: 7px; }
  .wizard-dashboard-links { grid-template-columns: 1fr; gap: 7px; }
  .wizard-dashboard-link { min-height: 58px; grid-template-columns: 36px minmax(0, 1fr) auto; padding: 8px 10px; }
  .wizard-dashboard-icon { width: 36px; height: 36px; }
  .bottom-nav, .app-shell.app--ultima .bottom-nav { right: 16px; left: 16px; height: 58px; }
  .page-head h1 { font-size: 23px; }
  .screen[data-screen="connect"] .connect-footer-actions { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 360px) {
  .app-shell, .app-shell.app--ultima { padding-inline: 12px; }
  .bottom-nav, .app-shell.app--ultima .bottom-nav { right: 12px; left: 12px; }
  .screen[data-screen="home"] .home-plan-actions { grid-template-columns: 1fr; }
  .screen[data-screen="home"] .home-plan-actions .btn-primary:not(.device-addon-home),
  .screen[data-screen="home"] .home-plan-actions .device-addon-home { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
