:root {
  --bg: #eef8ef;
  --card: #ffffff;
  --text: #1c2a21;
  --muted: #8f9495;
  --line: #ecf0ed;
  --green-1: #a8e7ba;
  --green-2: #66cd88;
  --green-3: #44b46d;
  --shadow: 0 10px 24px rgba(39, 88, 52, 0.08);

  --app-bg: radial-gradient(circle at 50% -40%, #f9fdf9 0%, var(--bg) 70%);
  --top-bg-url: url("icon/backstage%20for%20logo.jpg");
  --top-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.75) 100%);
  --top-soft: radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.65) 48%, rgba(255, 255, 255, 0.55) 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--app-bg);
  color: var(--text);
  min-height: 100vh;
}

body,
.card,
.menu-item,
.mini-item,
.theme-toggle,
.subtitle {
  transition:
    background-color 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 420ms ease,
    background 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logo {
  transition: opacity 420ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.theme-animating .logo {
  opacity: 0.15;
  transform: translateY(-6px) scale(0.99);
}

.logo-center {
  width: 100%;
  display: flex;
  justify-content: center;
}

.logo-area {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

.theme-toggle {
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 5;
  width: 56px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 320ms ease,
    background 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle:hover {
  filter: brightness(0.92);
  transform: scale(0.98);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle__icon {
  position: relative;
  z-index: 2;
  font-size: 14px;
  line-height: 1;
  color: var(--text);
  transform: translateX(-10px);
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), color 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  left: 4px;
  top: 3px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transition:
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 24px 16px 12px;
  position: relative;
}

.app-shell {
  overflow: visible;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card {
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid #f2f5f3;
}

.panel {
  padding: 14px 14px 10px;
}

.panel-section {
  position: relative;
}

.panel-divider {
  height: 1px;
  background: var(--line);
  margin: 14px 6px;
}

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  background-image:
    var(--top-soft),
    var(--top-bg-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.top::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    var(--top-overlay);
  pointer-events: none;
}

.top > * {
  position: relative;
  z-index: 1;
}

#mainScreen.is-active .top,
#mainScreen.is-active .plan,
#mainScreen.is-active .menu,
#mainScreen.is-active .duo {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#mainScreen.is-active .top { animation-delay: 40ms; }
#mainScreen.is-active .plan { animation-delay: 110ms; }
#mainScreen.is-active .menu { animation-delay: 170ms; }
#mainScreen.is-active .duo  { animation-delay: 230ms; }

#mainScreen.is-active .menu-item,
#mainScreen.is-active .mini-item {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#mainScreen.is-active .menu-item:nth-child(1) { animation-delay: 210ms; }
#mainScreen.is-active .menu-item:nth-child(2) { animation-delay: 260ms; }
#mainScreen.is-active .mini-item:nth-child(1) { animation-delay: 310ms; }
#mainScreen.is-active .mini-item:nth-child(2) { animation-delay: 360ms; }

.logo {
  width: min(320px, 100%);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  opacity: 1;
  transform: translateY(0);
}

/* Re-run logo entrance animation reliably when returning to main. */
#mainScreen.is-active .logo {
  opacity: 0;
  transform: translateY(-24px);
  animation: logoDropIn 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 90ms forwards;
}

.subtitle {
  margin-top: 10px;
  color: rgba(17, 35, 23, 0.62);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  font-variation-settings: "wght" 650;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(236, 240, 237, 0.9);
  backdrop-filter: blur(6px);
}

.plan {
  padding: 8px 6px 2px;
}

.plan-header,
.plan-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.plan-header {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.right {
  text-align: right;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 46px;
  font-weight: 700;
}

.state-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: #f0faf2;
}

.date {
  font-size: 54px;
  font-weight: 700;
}

.menu {
  display: grid;
  gap: 12px;
  padding: 2px 0;
  margin-bottom: 0;
}

.menu-item,
.mini-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  min-height: 104px;
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  padding: 0 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, filter 220ms ease;
  will-change: transform;
}

.menu-item--accent {
  background: linear-gradient(100deg, var(--green-3) 0%, #2f9f61 100%);
  border: none;
}

.menu-item--admin {
  background: linear-gradient(100deg, rgba(165, 130, 255, 0.16) 0%, rgba(214, 199, 255, 0.18) 100%);
  border-color: rgba(165, 130, 255, 0.42);
  box-shadow: 0 14px 28px rgba(132, 94, 247, 0.12);
}

.menu-item--admin .title {
  color: #1c2a21;
}

.menu-item--admin .hint {
  color: rgba(28, 42, 33, 0.72);
}

.menu-item--admin .icon {
  background: rgba(165, 130, 255, 0.16);
}

body[data-theme="dark"] .menu-item.menu-item--admin {
  background: linear-gradient(100deg, rgba(112, 78, 200, 0.44) 0%, rgba(78, 55, 140, 0.30) 100%);
  border-color: rgba(165, 130, 255, 0.46);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] .menu-item.menu-item--admin .title {
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .menu-item.menu-item--admin .hint {
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .menu-item.menu-item--admin .icon {
  background: rgba(165, 130, 255, 0.18);
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.8);
}

.icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.menu-item--accent .icon {
  background: rgba(255, 255, 255, 0.25);
}

.meta {
  display: grid;
  gap: 4px;
}

.title {
  font-size: 36px;
  font-weight: 750;
  letter-spacing: 0.15px;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.hint {
  font-size: 29px;
  color: #8f9892;
  font-weight: 520;
  letter-spacing: 0.1px;
}

.menu-item--accent .title,
.menu-item--accent .hint {
  color: #fff;
}

.menu-item:hover,
.mini-item:hover {
  transform: translateY(-2px);
  filter: brightness(0.93);
  box-shadow: 0 14px 30px rgba(39, 88, 52, 0.14);
}

.menu-item:active,
.mini-item:active,
.menu-item.is-pressed,
.mini-item.is-pressed {
  transform: translateY(0) scale(0.975);
  filter: brightness(0.9);
  box-shadow: 0 8px 18px rgba(39, 88, 52, 0.1);
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 0;
}

.mini-item {
  min-height: 96px;
  grid-template-columns: 58px 1fr;
  padding: 0 14px;
}

.mini-item .title {
  font-size: 28px;
}

.mini-item .hint {
  font-size: 22px;
}

.menu-item:focus-visible,
.mini-item:focus-visible {
  outline: 3px solid rgba(102, 205, 136, 0.35);
  outline-offset: 2px;
}

.tariff-panel {
  padding: 2px 0 0;
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.tariff-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tariff-title {
  font-size: 24px;
  font-weight: 800;
}

.tariff-back {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  padding: 0;
  transition: filter 200ms ease, transform 160ms ease;
}

.tariff-back:hover {
  filter: brightness(0.95);
}

.tariff-back:active {
  transform: scale(0.96);
}

.tariff-back-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tariff-subtitle {
  color: var(--muted);
  font-size: 16px;
}

.tariff-bubble {
  border-radius: 18px;
}

.tariff-list {
  display: grid;
  gap: 10px;
}

.tariff-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px 46px 14px 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  position: relative;
  transition:
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 260ms ease,
    box-shadow 320ms ease,
    border-color 320ms ease,
    background 360ms ease;
}

.tariff-item--active {
  background: linear-gradient(100deg, rgba(68, 180, 109, 0.12) 0%, rgba(47, 159, 97, 0.08) 100%);
  border: 1px solid rgba(53, 163, 95, 0.85);
  box-shadow: 0 12px 26px rgba(41, 125, 76, 0.14);
  color: var(--text);
}


.tariff-item__top {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tariff-item__title {
  font-size: 24px;
  font-weight: 750;
}

.tariff-item__badge {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(53, 163, 95, 0.14);
  color: #2e9d63;
  border: 1px solid rgba(53, 163, 95, 0.2);
}

.tariff-item__hint {
  color: #2e9d63;
  font-size: 15px;
  font-weight: 650;
}

.tariff-item__bottom {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.tariff-item__price {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.tariff-item__devices {
  font-size: 14px;
  color: #2e9d63;
  font-weight: 650;
}

.tariff-item__selector {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #35a35f;
}

.tariff-item--active .tariff-item__badge {
  background: rgba(53, 163, 95, 0.16);
  color: #2e9d63;
  border-color: rgba(53, 163, 95, 0.26);
}

.tariff-item--active .tariff-item__hint,
.tariff-item--active .tariff-item__devices {
  color: #2e9d63;
}

.tariff-item--active .tariff-item__selector {
  border-color: #35a35f;
  box-shadow: inset 0 0 0 5px rgba(53, 163, 95, 0.95);
}

.tariff-item:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

.tariff-item:active {
  transform: scale(0.985);
}

.tariff-item:focus-visible {
  outline: 3px solid rgba(102, 205, 136, 0.35);
  outline-offset: 2px;
}

.card-lite {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
}

.devices {
  display: grid;
  gap: 10px;
}

.devices-head {
  display: grid;
  gap: 4px;
}

.devices-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.devices-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.devices-price {
  color: var(--muted);
  font-size: 14px;
}

.devices-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}

.devices-slider-wrap {
  position: relative;
  height: 30px;
  padding-right: 7px;
}

.devices-slider::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(53, 163, 95, 0.24) 0%, rgba(53, 163, 95, 0.1) 100%);
  border: 1px solid rgba(53, 163, 95, 0.22);
}

.devices-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -7px;
  border: none;
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  opacity: 0;
}

.devices-slider::-moz-range-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(53, 163, 95, 0.24) 0%, rgba(53, 163, 95, 0.1) 100%);
  border: 1px solid rgba(53, 163, 95, 0.22);
}

.devices-slider::-moz-range-thumb {
  -moz-appearance: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  opacity: 0;
}

.slider-leaf {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(41, 125, 76, 0.25));
}

.devices-foot {
  font-size: 15px;
}

.tariff-inc-title {
  font-size: 20px;
  margin-bottom: 14px;
}

.includes {
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 16px;
}

.include-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  line-height: 1.35;
}

.include-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-top: 2px;
}

.tariff-sticky-wrap {
  position: sticky;
  bottom: 4px;
  z-index: 8;
  padding: 0 8px calc(6px + env(safe-area-inset-bottom));
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pay-btn {
  pointer-events: auto;
  width: 100%;
  border: none;
  border-radius: 20px;
  background: linear-gradient(100deg, #37b86d 0%, #2f9f61 45%, #298954 100%);
  color: #fff;
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  box-shadow: 0 16px 34px rgba(41, 125, 76, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 180ms ease, filter 220ms ease, box-shadow 280ms ease;
}

.pay-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.pay-btn:active {
  transform: scale(0.985);
  filter: brightness(0.92);
}

.pay-btn-title {
  font-size: 19px;
  font-weight: 800;
}

.pay-btn-sub {
  font-size: 14px;
  opacity: 0.96;
  letter-spacing: 0.15px;
}

.support-chat-btn {
  pointer-events: auto;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(53, 163, 95, 0.24);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(39, 88, 52, 0.12);
  transition: transform 160ms ease, filter 220ms ease, background 240ms ease;
}

.support-chat-btn--static {
  margin: 4px 8px 0;
  width: calc(100% - 16px);
}

.support-chat-btn:hover {
  filter: brightness(0.96);
}

.support-chat-btn:active {
  transform: scale(0.985);
}

.support-chat-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.support-panel {
  display: grid;
  gap: 12px;
}

.support-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-chat-card {
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 16px 14px;
}

.support-chat-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(53, 163, 95, 0.24);
  background: rgba(53, 163, 95, 0.08);
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.support-chat-main-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.support-chat-title {
  font-size: 22px;
  font-weight: 760;
}

.support-chat-text {
  color: var(--muted);
  font-size: 15px;
}

.support-chat-main-btn {
  margin-top: 2px;
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(100deg, #37b86d 0%, #2f9f61 45%, #298954 100%);
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 760;
}

.setup-panel {
  display: grid;
  gap: 12px;
}

.setup-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.setup-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(53, 163, 95, 0.3);
  background: rgba(53, 163, 95, 0.16);
  color: #2f9f61;
  font-size: 13px;
  font-weight: 760;
  display: grid;
  place-items: center;
}

.setup-step--active {
  background: linear-gradient(120deg, #37b86d 0%, #2f9f61 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(41, 125, 76, 0.24);
}

.setup-step-line {
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: rgba(53, 163, 95, 0.28);
}

.setup-title {
  text-align: center;
  font-size: 28px;
  font-weight: 780;
}

.setup-subtitle {
  text-align: center;
  color: #2f9f61;
  font-size: 17px;
  font-weight: 650;
  margin-top: -6px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setup-option {
  min-height: 110px;
  border-radius: 16px;
  border: 1px solid rgba(53, 163, 95, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(39, 88, 52, 0.1);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  padding: 12px 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 220ms ease, box-shadow 220ms ease, background 260ms ease, border-color 220ms ease;
}

.setup-option-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.setup-option:hover {
  transform: translateY(-2px);
  filter: brightness(0.96);
}

.setup-option:active,
.setup-option.is-pressed {
  transform: scale(0.975);
}

.setup-option--active {
  background: linear-gradient(120deg, rgba(68, 180, 109, 0.2) 0%, rgba(47, 159, 97, 0.1) 100%);
  border-color: rgba(53, 163, 95, 0.8);
  box-shadow: 0 12px 24px rgba(41, 125, 76, 0.16);
}

.setup-devices-wrap {
  overflow: hidden;
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 360ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 240ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.setup-devices-wrap:not(.is-open) {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.setup-devices-title {
  text-align: center;
  color: #2f9f61;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.setup-devices-list {
  display: grid;
  gap: 8px;
}

.setup-device-item {
  border: 1px solid rgba(53, 163, 95, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  min-height: 56px;
  padding: 0 42px 0 14px;
  text-align: left;
  position: relative;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  transition:
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 240ms ease,
    box-shadow 320ms ease,
    border-color 320ms ease,
    background 360ms ease;
}

.setup-device-item:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

.setup-device-item:active,
.setup-device-item.is-pressed {
  transform: scale(0.985);
}

.setup-device-item__selector {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #35a35f;
}

.setup-device-item--active {
  background: linear-gradient(100deg, rgba(68, 180, 109, 0.12) 0%, rgba(47, 159, 97, 0.08) 100%);
  border: 1px solid rgba(53, 163, 95, 0.85);
  box-shadow: 0 12px 24px rgba(41, 125, 76, 0.14);
}

.setup-device-item--active .setup-device-item__selector {
  box-shadow: inset 0 0 0 5px rgba(53, 163, 95, 0.95);
}

.setup-next-btn {
  margin-top: 8px;
  min-height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(100deg, #37b86d 0%, #2f9f61 45%, #298954 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 760;
  box-shadow: 0 16px 30px rgba(41, 125, 76, 0.26);
  transition: transform 170ms ease, filter 220ms ease;
}

.setup-next-btn:hover {
  filter: brightness(0.96);
}

.setup-next-btn:active {
  transform: scale(0.985);
}

.support-faq-title {
  font-size: 24px;
  font-weight: 780;
}

.support-faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.faq-item.is-open {
  border-color: rgba(53, 163, 95, 0.35);
  box-shadow: 0 8px 18px rgba(39, 88, 52, 0.1);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  position: relative;
  padding-right: 36px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 18px;
  height: 18px;
  background: url("icon/checkbox.png") center / contain no-repeat;
  transition: transform 220ms ease, filter 220ms ease;
}

.faq-item.is-open summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.faq-item p {
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.profile-panel {
  display: grid;
  gap: 12px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 19, 13, 0.22);
  backdrop-filter: blur(6px);
}

.profile-loading[hidden] {
  display: none !important;
}

.profile-loading-card {
  width: min(420px, calc(100vw - 32px));
  border-radius: 18px;
  border: 1px solid rgba(53, 163, 95, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(26, 67, 38, 0.22);
  padding: 16px 14px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.profile-loading-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(53, 163, 95, 0.2);
  background: rgba(53, 163, 95, 0.08);
  display: grid;
  place-items: center;
}

.profile-loading-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.profile-loading-title {
  font-size: 20px;
  font-weight: 800;
}

.profile-loading-sub {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.profile-content {
  display: grid;
  gap: 12px;
}

.profile-main-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-user-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(53, 163, 95, 0.12);
}

.profile-user-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.profile-username {
  font-size: 24px;
  font-weight: 780;
}

.profile-status {
  color: var(--muted);
  font-size: 14px;
}

.profile-id {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.profile-block {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.profile-block-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.profile-block-value {
  font-size: 17px;
  color: #2f9f61;
  font-weight: 700;
}

.profile-block-subtitle {
  font-size: 22px;
  font-weight: 750;
}

.profile-block-text,
.profile-note,
.profile-mini-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.profile-email-input {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 16px;
}

.profile-email-btn {
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(100deg, #37b86d 0%, #2f9f61 45%, #298954 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 760;
}

.profile-link {
  color: #2f9f61;
  text-decoration: none;
  font-weight: 700;
}

.profile-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.profile-card h3 {
  font-size: 24px;
}

.profile-card p {
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-stat {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 8px;
  text-align: center;
  display: grid;
  gap: 2px;
}

.profile-stat b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 18px;
  color: #2f9f61;
}

.profile-stat-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.profile-stat span {
  color: var(--muted);
  font-size: 12px;
}

.profile-ref-link {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 42px 10px 10px;
  font-size: 13px;
  word-break: break-all;
}

.profile-ref-link-wrap {
  position: relative;
}

.profile-copy-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 160ms ease, filter 220ms ease, background-color 220ms ease;
}

.profile-copy-btn:hover {
  filter: brightness(0.95);
  background: rgba(53, 163, 95, 0.08);
}

.profile-copy-btn:active {
  transform: translateY(-50%) scale(0.94);
}

.profile-copy-btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.profile-copy-btn.is-copied .profile-copy-icon-default {
  display: none;
}

.profile-copy-btn:not(.is-copied) .profile-copy-icon-copied {
  display: none;
}

.faq-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease;
}

.faq-content p {
  overflow: hidden;
}

.faq-item.is-open .faq-content {
  max-height: var(--faq-open-height, 280px);
  opacity: 1;
}

.purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.purchase-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.purchase-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 19, 13, 0.36);
  backdrop-filter: blur(3px);
}

.purchase-modal__card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 24px));
  border-radius: 18px;
  border: 1px solid rgba(53, 163, 95, 0.45);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 40px rgba(26, 67, 38, 0.25);
  padding: 18px 16px 16px;
  display: grid;
  gap: 10px;
  transform: translateY(12px) scale(0.98);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.purchase-modal.is-open .purchase-modal__card {
  transform: translateY(0) scale(1);
}

.purchase-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}

.purchase-modal__title {
  font-size: 31px;
  font-weight: 780;
  line-height: 1.1;
  padding-right: 28px;
}

.purchase-modal__subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 2px;
}

.purchase-modal__action {
  border: none;
  border-radius: 14px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 760;
  cursor: pointer;
  transition: transform 160ms ease, filter 220ms ease;
}

.purchase-modal__action:hover {
  filter: brightness(0.95);
}

.purchase-modal__action:active {
  transform: scale(0.985);
}

.purchase-modal__action--primary {
  background: linear-gradient(100deg, #37b86d 0%, #2f9f61 45%, #298954 100%);
  color: #fff;
}

.purchase-modal__action--secondary {
  background: #173147;
  color: #e8f0f8;
}

@media (max-width: 1100px) {
  .plan-header { font-size: 15px; }
  .state { font-size: 18px; }
  .state-icon { width: 34px; height: 34px; font-size: 18px; }
  .date { font-size: 34px; }
  .title { font-size: 16px; }
  .hint { font-size: 13px; }
  .mini-item .title { font-size: 15px; }
  .mini-item .hint { font-size: 12px; }
}

@media (max-width: 560px) {
  .duo {
    grid-template-columns: 1fr;
  }
}

@keyframes logoDropIn {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes profilePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(53, 163, 95, 0.45);
  }
  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 10px rgba(53, 163, 95, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(53, 163, 95, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .top,
  .plan,
  .menu,
  .duo,
  .menu-item,
  .mini-item,
  .logo,
  .screen {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .theme-toggle {
    transition: none !important;
  }

  body,
  .card,
  .menu-item,
  .mini-item,
  .subtitle,
  .screen {
    transition: none !important;
  }

  .screen.is-active {
    animation: none !important;
  }
}

body[data-theme="dark"] {
  --bg: #1f2124;
  --card: #2a2d31;
  --text: #e9eef2;
  --muted: #a7aeb7;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.28);

  --app-bg: radial-gradient(circle at 50% -40%, #2c2f34 0%, #1b1d20 70%);
  --top-bg-url: url("icon/Dark%20Theme/backstage%20for%20logo%20dark.png");
  --top-soft: radial-gradient(circle at 40% 20%, rgba(24, 26, 28, 0.2) 0%, rgba(24, 26, 28, 0.35) 48%, rgba(24, 26, 28, 0.55) 100%);
  --top-overlay: linear-gradient(180deg, rgba(16, 18, 20, 0.2) 0%, rgba(16, 18, 20, 0.55) 100%);
}

body[data-theme="dark"] .menu-item:not(.menu-item--accent),
body[data-theme="dark"] .mini-item {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
}

body[data-theme="dark"] .tariff-item:not(.tariff-item--active),
body[data-theme="dark"] .card-lite {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .devices-slider,
body[data-theme="dark"] .devices-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, rgba(95, 209, 154, 0.24) 0%, rgba(95, 209, 154, 0.08) 100%);
  border: 1px solid rgba(95, 209, 154, 0.24);
}

body[data-theme="dark"] .devices-slider::-webkit-slider-thumb {
}

body[data-theme="dark"] .devices-slider::-moz-range-track {
  background: linear-gradient(90deg, rgba(95, 209, 154, 0.24) 0%, rgba(95, 209, 154, 0.08) 100%);
  border-color: rgba(95, 209, 154, 0.24);
}

body[data-theme="dark"] .devices-slider::-moz-range-thumb {
}

body[data-theme="dark"] .slider-leaf {
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.35));
}

body[data-theme="dark"] .tariff-item__badge {
  background: rgba(53, 163, 95, 0.2);
  border-color: rgba(53, 163, 95, 0.3);
  color: #5fd19a;
}

body[data-theme="dark"] .tariff-item__hint,
body[data-theme="dark"] .tariff-item__devices {
  color: #5fd19a;
}

body[data-theme="dark"] .tariff-item__selector {
  border-color: #5fd19a;
}

body[data-theme="dark"] .tariff-item--active {
  background: linear-gradient(100deg, rgba(34, 111, 72, 0.35) 0%, rgba(21, 90, 56, 0.26) 100%);
  border-color: rgba(95, 209, 154, 0.75);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .tariff-item--active .tariff-item__badge {
  background: rgba(95, 209, 154, 0.2);
  border-color: rgba(95, 209, 154, 0.34);
  color: #7be0b0;
}

body[data-theme="dark"] .tariff-item--active .tariff-item__hint,
body[data-theme="dark"] .tariff-item--active .tariff-item__devices {
  color: #7be0b0;
}

body[data-theme="dark"] .tariff-back {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
}

body[data-theme="dark"] .pay-btn {
  background: linear-gradient(100deg, #226f48 0%, #1b5f3d 45%, #144a30 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .support-chat-btn {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .support-chat-card,
body[data-theme="dark"] .faq-item {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
}

body[data-theme="dark"] .support-chat-icon-wrap {
  background: rgba(95, 209, 154, 0.16);
  border-color: rgba(95, 209, 154, 0.26);
}

body[data-theme="dark"] .support-chat-main-btn {
  background: linear-gradient(100deg, #1f6f46 0%, #1b5f3d 45%, #144a30 100%);
}

body[data-theme="dark"] .setup-option {
  background: rgba(42, 45, 49, 0.92);
  border-color: rgba(95, 209, 154, 0.35);
  color: #ffffff;
}

body[data-theme="dark"] .setup-option--active {
  background: linear-gradient(120deg, rgba(34, 111, 72, 0.45) 0%, rgba(21, 90, 56, 0.26) 100%);
  border-color: rgba(95, 209, 154, 0.8);
}

body[data-theme="dark"] .setup-step {
  background: rgba(95, 209, 154, 0.16);
  border-color: rgba(95, 209, 154, 0.4);
  color: #7be0b0;
}

body[data-theme="dark"] .setup-step--active {
  background: linear-gradient(100deg, #1f6f46 0%, #1b5f3d 45%, #144a30 100%);
  color: #fff;
}

body[data-theme="dark"] .setup-step-line {
  background: rgba(95, 209, 154, 0.35);
}

body[data-theme="dark"] .setup-subtitle {
  color: #7be0b0;
}

body[data-theme="dark"] .setup-next-btn {
  background: linear-gradient(100deg, #1f6f46 0%, #1b5f3d 45%, #144a30 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .setup-devices-title {
  color: #7be0b0;
}

body[data-theme="dark"] .setup-device-item {
  background: rgba(42, 45, 49, 0.92);
  border-color: rgba(95, 209, 154, 0.35);
  color: #ffffff;
}

body[data-theme="dark"] .setup-device-item__selector {
  border-color: #5fd19a;
}

body[data-theme="dark"] .setup-device-item--active {
  background: linear-gradient(100deg, rgba(34, 111, 72, 0.35) 0%, rgba(21, 90, 56, 0.26) 100%);
  border-color: rgba(95, 209, 154, 0.75);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .setup-device-item--active .setup-device-item__selector {
  box-shadow: inset 0 0 0 5px rgba(95, 209, 154, 0.95);
}

body[data-theme="dark"] .faq-item summary::after {
  background-image: url("icon/Dark%20Theme/checkbox%20dark.png");
}

body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .profile-main-card,
body[data-theme="dark"] .profile-block,
body[data-theme="dark"] .profile-loading,
body[data-theme="dark"] .profile-stat,
body[data-theme="dark"] .profile-ref-link,
body[data-theme="dark"] .profile-email-input {
  background: rgba(42, 45, 49, 0.92);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .profile-loading {
  background: rgba(5, 6, 8, 0.48);
}

body[data-theme="dark"] .profile-loading-card {
  background: rgba(28, 31, 36, 0.96);
  border-color: rgba(95, 209, 154, 0.35);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .profile-loading-title {
  color: #f4f7fa;
}

body[data-theme="dark"] .profile-email-btn {
  background: linear-gradient(100deg, #1f6f46 0%, #1b5f3d 45%, #144a30 100%);
}

body[data-theme="dark"] .profile-user-icon {
  background: rgba(95, 209, 154, 0.14);
}

body[data-theme="dark"] .profile-link {
  color: #7be0b0;
}

body[data-theme="dark"] .profile-stat b {
  color: #5fd19a;
}

body[data-theme="dark"] .profile-copy-btn:hover {
  background: rgba(95, 209, 154, 0.14);
}

body[data-theme="dark"] .purchase-modal__backdrop {
  background: rgba(5, 6, 8, 0.56);
}

body[data-theme="dark"] .purchase-modal__card {
  background: rgba(28, 31, 36, 0.98);
  border-color: rgba(95, 209, 154, 0.45);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .purchase-modal__title {
  color: #f4f7fa;
}

body[data-theme="dark"] .purchase-modal__subtitle {
  color: #b5bfca;
}

body[data-theme="dark"] .purchase-modal__close {
  color: #f4f7fa;
}

body[data-theme="dark"] .purchase-modal__action--primary {
  background: linear-gradient(100deg, #1f6f46 0%, #1b5f3d 45%, #144a30 100%);
}

body[data-theme="dark"] .purchase-modal__action--secondary {
  background: #18293b;
  color: #dce6f0;
}

body[data-theme="dark"] .menu-item.menu-item--accent {
  background: linear-gradient(100deg, #1f6f46 0%, #155a38 100%);
  border: none;
}

body[data-theme="dark"] .menu-item .title,
body[data-theme="dark"] .mini-item .title {
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .menu-item .hint,
body[data-theme="dark"] .mini-item .hint {
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .menu-item .icon,
body[data-theme="dark"] .mini-item .icon {
  background: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .menu-item--accent .icon {
  background: rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .subtitle {
  color: rgba(233, 238, 242, 0.72);
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .state-icon {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"] .theme-toggle::before {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  transform: translateX(22px);
}

body[data-theme="dark"] .theme-toggle__icon {
  transform: translateX(10px);
  color: rgba(233, 238, 242, 0.9);
}

/* Ensure admin button theme isn't overridden in dark mode */
body[data-theme="dark"] .menu-item.menu-item--admin {
  background: linear-gradient(100deg, rgba(112, 78, 200, 0.44) 0%, rgba(78, 55, 140, 0.30) 100%) !important;
  border-color: rgba(165, 130, 255, 0.46) !important;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36) !important;
}

body[data-theme="dark"] .menu-item.menu-item--admin .icon {
  background: rgba(165, 130, 255, 0.18) !important;
}
