:root {
  --bg: #f8fbff;
  --ink: #071739;
  --muted: #53678e;
  --blue: #2f86ff;
  --line: #dce6f5;
  --card: rgba(255, 255, 255, .82);
  --shadow: 0 28px 70px rgba(42, 92, 160, .16);
  --button-shadow: 0 18px 30px rgba(45, 127, 238, .28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0;
}

body {
  position: relative;
  min-height: 100dvh;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 18%, rgba(177, 211, 255, .36), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 52%, #f2f8ff 100%);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.auth-page {
  overflow: hidden;
}

body.auth-orbit-page {
  min-height: 100dvh;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(80, 111, 255, .22), transparent 32%),
    linear-gradient(180deg, #15142b 0%, #06070d 52%, #030407 100%);
  color: #fff;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(calc(100vw - 32px), 460px);
  min-height: auto;
  max-height: calc(100dvh - 32px);
  display: grid;
  align-items: center;
  justify-items: center;
  overflow: auto;
  padding: 38px 38px 32px;
  border: 1px solid rgba(177, 193, 219, .68);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .64)),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: translate(-50%, -50%);
}

.auth-panel {
  width: min(100%, 360px);
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-mark {
  position: relative;
  width: 70px;
  height: 56px;
  margin-bottom: 8px;
}

.bubble {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(232, 243, 255, .92), rgba(72, 145, 243, .74));
  box-shadow: inset 10px 12px 28px rgba(255, 255, 255, .46);
}

.bubble-one {
  left: 10px;
  bottom: 5px;
  width: 47px;
  height: 47px;
}

.bubble-two {
  right: 8px;
  bottom: 5px;
  width: 37px;
  height: 37px;
  opacity: .9;
}

.bubble-three {
  top: 0;
  left: 29px;
  width: 35px;
  height: 35px;
  opacity: .55;
}

.title {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
}

.subtitle {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 400;
}

.telegram-button {
  width: min(100%, 350px);
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  padding: 0 24px;
  border: 1px solid rgba(130, 183, 255, .72);
  border-radius: 18px;
  background: linear-gradient(135deg, #9ccaff 0%, #5aa3ff 48%, var(--blue) 100%);
  color: #fff;
  box-shadow: var(--button-shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.telegram-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
  box-shadow: 0 22px 38px rgba(45, 127, 238, .32);
}

.telegram-button:active {
  transform: translateY(0);
  box-shadow: var(--button-shadow);
}

.telegram-login-widget {
  min-height: 52px;
  display: grid;
  place-items: center;
  margin-top: 12px;
}

.telegram-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #5aa3ff;
}

.telegram-label {
  min-width: 0;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 400;
  white-space: normal;
}

.hint {
  max-width: 315px;
  margin: 28px 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.42;
}

.proxy-button {
  width: min(100%, 320px);
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1.5px solid #91bbff;
  border-radius: 16px;
  background: rgba(255, 255, 255, .48);
  color: #146fff;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.proxy-button:hover {
  transform: translateY(-1px);
  border-color: #5f9cff;
  background: rgba(255, 255, 255, .7);
}

.proxy-icon {
  width: 30px;
  height: 30px;
  color: #5b9dff;
}

.proxy-label {
  min-width: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 400;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #6a7da0;
  font-size: 14px;
  line-height: 1.4;
}

.orbit-auth {
  position: relative;
  width: min(100%, 520px);
  min-height: 100dvh;
  display: grid;
  align-content: end;
  justify-items: center;
  margin: 0 auto;
  padding: 34px 26px 42px;
  isolation: isolate;
}

.orbit-auth::before {
  content: "";
  position: absolute;
  inset: 18px 12px;
  z-index: -2;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 48px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 105, 178, .18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .04),
    0 36px 80px rgba(0, 0, 0, .42);
}

.orbit-stage {
  position: absolute;
  top: 72px;
  left: 50%;
  width: min(440px, 94vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#05060b, #05060b) padding-box,
    linear-gradient(135deg, rgba(255, 99, 176, .86), rgba(255, 190, 95, .72), rgba(88, 132, 255, .42)) border-box;
  opacity: .55;
}

.orbit-ring-outer {
  inset: 0;
  transform: rotate(-18deg);
  opacity: .36;
}

.orbit-ring-middle {
  inset: 72px;
  transform: rotate(18deg);
  opacity: .58;
}

.orbit-ring-inner {
  inset: 142px;
  opacity: .88;
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 159, 112, .86);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 83, 166, .3), rgba(255, 255, 255, .02) 58%, transparent 72%);
  box-shadow: 0 0 42px rgba(255, 99, 176, .28);
  transform: translate(-50%, -50%);
}

.bolt-shape {
  width: 45px;
  height: 64px;
  display: block;
  background: linear-gradient(145deg, #ff68bc, #ffcf78 72%);
  clip-path: polygon(58% 0, 17% 52%, 50% 52%, 42% 100%, 88% 40%, 56% 40%);
  filter: drop-shadow(0 14px 22px rgba(255, 104, 188, .34));
}

.orbit-icon {
  position: absolute;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .62));
  color: #2f86ff;
  box-shadow:
    inset 8px 10px 16px rgba(255, 255, 255, .38),
    0 18px 34px rgba(0, 0, 0, .34);
  transform: translate(-50%, -50%) rotate(-8deg);
}

.orbit-icon-shield {
  top: 28%;
  left: 14%;
  background: linear-gradient(145deg, #f7fbff, #8ac0ff);
}

.orbit-icon-phone {
  top: 21%;
  left: 73%;
  background: linear-gradient(145deg, #ff9fc6, #7057ff);
  color: #fff;
  transform: translate(-50%, -50%) rotate(8deg);
}

.orbit-icon-location {
  top: 68%;
  left: 30%;
  background: linear-gradient(145deg, #ffd66f, #8d53ff);
  color: #fff;
  transform: translate(-50%, -50%) rotate(12deg);
}

.orbit-icon-chat {
  top: 40%;
  left: 78%;
  border-radius: 999px;
  background: linear-gradient(145deg, #c4ff9a, #ffffff);
  color: #13253f;
}

.orbit-icon-calendar {
  top: 12%;
  left: 48%;
  background: linear-gradient(145deg, #ff916d, #6c4cff);
  color: #fff;
  transform: translate(-50%, -50%) rotate(7deg);
}

.orbit-icon-router {
  top: 48%;
  left: 18%;
  background: linear-gradient(145deg, #b7a4ff, #6d43f5);
  color: #fff;
}

.orbit-object {
  position: relative;
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .24));
}

.object-calendar {
  width: 42px;
  height: 44px;
  border-radius: 10px 10px 12px 12px;
  background:
    linear-gradient(180deg, #ff8f82 0 30%, transparent 31%),
    linear-gradient(145deg, #fff7bf, #6f55ff);
  box-shadow: inset 7px 8px 12px rgba(255, 255, 255, .26);
}

.object-calendar::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #fff4b8;
  box-shadow: 12px 0 0 #fff4b8, 24px 0 0 rgba(255,255,255,.74), 0 12px 0 rgba(255,255,255,.74), 12px 12px 0 rgba(255,255,255,.68), 24px 12px 0 rgba(255,255,255,.54);
}

.object-calendar::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 10px;
  width: 7px;
  height: 11px;
  border-radius: 999px;
  background: #d8dce8;
  box-shadow: 17px 0 0 #d8dce8;
}

.object-headphones {
  width: 46px;
  height: 45px;
  border: 8px solid #ffb45c;
  border-bottom: 0;
  border-radius: 28px 28px 8px 8px;
  background: transparent;
}

.object-headphones::before,
.object-headphones::after {
  content: "";
  position: absolute;
  top: 20px;
  width: 16px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ff6ba9, #5a35ff);
  box-shadow: inset 5px 6px 8px rgba(255, 255, 255, .22);
}

.object-headphones::before {
  left: -12px;
  transform: rotate(12deg);
}

.object-headphones::after {
  right: -12px;
  transform: rotate(-12deg);
}

.object-pin {
  width: 34px;
  height: 44px;
  border-radius: 999px 999px 999px 10px;
  background: linear-gradient(145deg, #ffcc65, #8d41ff 72%);
  transform: rotate(45deg);
  box-shadow: inset 7px 8px 11px rgba(255, 255, 255, .25);
}

.object-pin::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
}

.object-pin::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: -12px;
  width: 31px;
  height: 12px;
  border: 4px solid #7b32d8;
  border-radius: 999px;
  transform: rotate(-45deg);
  opacity: .82;
}

.object-backpack {
  width: 40px;
  height: 46px;
  border-radius: 14px 14px 16px 16px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.3) 0 18%, transparent 19% 81%, rgba(255,255,255,.18) 82%),
    linear-gradient(145deg, #c79bff, #6b3df6);
  box-shadow: inset 7px 8px 11px rgba(255, 255, 255, .22);
}

.object-backpack::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -7px;
  width: 22px;
  height: 14px;
  border: 4px solid #d6bbff;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.object-backpack::after {
  content: "";
  position: absolute;
  left: 9px;
  bottom: 5px;
  width: 22px;
  height: 15px;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffe6a7, #e6a86f);
}

.object-shield {
  width: 40px;
  height: 46px;
  background: linear-gradient(145deg, #d7ecff, #4d9aff);
  clip-path: polygon(50% 0, 91% 16%, 82% 72%, 50% 100%, 18% 72%, 9% 16%);
  box-shadow: inset 7px 8px 10px rgba(255, 255, 255, .28);
}

.object-shield::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 16px;
  width: 14px;
  height: 9px;
  border-left: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(-45deg);
}

.object-router {
  width: 48px;
  height: 32px;
  margin-top: 8px;
  border-radius: 10px 10px 14px 14px;
  background: linear-gradient(145deg, #e7f3ff, #82b9ff 45%, #5d65ff);
  box-shadow: inset 7px 8px 11px rgba(255, 255, 255, .25);
}

.object-router::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -14px;
  width: 32px;
  height: 17px;
  border: 4px solid rgba(255,255,255,.8);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.object-router::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #35d58f;
  box-shadow: 12px 0 0 rgba(255,255,255,.78), 24px 0 0 rgba(255,255,255,.52);
}

.orbit-avatar {
  position: absolute;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .34);
  transform: translate(-50%, -50%);
}

.orbit-avatar-one {
  top: 24%;
  left: 30%;
  background: linear-gradient(145deg, #ff9a7f, #ffd0bd);
}

.orbit-avatar-two {
  top: 60%;
  left: 16%;
  background: linear-gradient(145deg, #b9d9ff, #edf6ff);
}

.orbit-avatar-three {
  top: 30%;
  left: 88%;
  background: linear-gradient(145deg, #ffe56f, #fff1a7);
}

.orbit-avatar-four {
  top: 68%;
  left: 72%;
  background: linear-gradient(145deg, #c45eff, #f1c0ff);
}

.memoji {
  position: relative;
  width: 66px;
  height: 66px;
  display: block;
  border-radius: 999px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .28));
  isolation: isolate;
}

.memoji-face {
  position: absolute;
  left: 13px;
  top: 15px;
  width: 40px;
  height: 43px;
  border-radius: 48% 48% 46% 46%;
  background:
    radial-gradient(circle at 36% 40%, #332414 0 3px, transparent 4px),
    radial-gradient(circle at 66% 40%, #332414 0 3px, transparent 4px),
    radial-gradient(circle at 50% 57%, rgba(169, 93, 51, .28) 0 4px, transparent 5px),
    linear-gradient(145deg, #ffd9bd, #eca174);
  box-shadow:
    inset 8px 10px 14px rgba(255, 255, 255, .28),
    inset -6px -8px 13px rgba(123, 63, 35, .14);
}

.memoji-hair {
  position: absolute;
  left: 9px;
  top: 6px;
  z-index: 2;
  width: 48px;
  height: 25px;
  border-radius: 999px 999px 38% 38%;
  background:
    radial-gradient(ellipse at 25% 44%, #1d1a17 0 9px, transparent 10px),
    radial-gradient(ellipse at 48% 28%, #2a2520 0 11px, transparent 12px),
    radial-gradient(ellipse at 70% 45%, #1d1a17 0 10px, transparent 11px),
    linear-gradient(145deg, #3f332b, #171412);
  box-shadow: inset 6px 7px 10px rgba(255, 255, 255, .08);
}

.memoji-glasses {
  position: absolute;
  left: 18px;
  top: 30px;
  z-index: 4;
  width: 31px;
  height: 13px;
  background:
    radial-gradient(circle at 24% 50%, transparent 0 5px, #2d2724 6px 7px, transparent 8px),
    radial-gradient(circle at 76% 50%, transparent 0 5px, #2d2724 6px 7px, transparent 8px),
    linear-gradient(90deg, transparent 0 44%, #2d2724 45% 55%, transparent 56%);
}

.memoji-smile {
  position: absolute;
  left: 50%;
  top: 44px;
  z-index: 5;
  width: 18px;
  height: 8px;
  border-radius: 0 0 999px 999px;
  background: #fff;
  border-top: 3px solid #7a342d;
  transform: translateX(-50%);
}

.memoji-beard-shape {
  position: absolute;
  left: 10px;
  top: 35px;
  z-index: 3;
  width: 46px;
  height: 28px;
  border-radius: 24px 24px 999px 999px;
  background: linear-gradient(145deg, #3d332d, #171412);
  clip-path: polygon(0 0, 100% 0, 90% 72%, 50% 100%, 10% 72%);
}

.memoji-mask-shape {
  position: absolute;
  left: 13px;
  top: 36px;
  z-index: 5;
  width: 40px;
  height: 22px;
  border-radius: 10px 10px 18px 18px;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255,255,255,.7) 8% 10%, transparent 11% 89%, rgba(255,255,255,.7) 90% 92%, transparent 93%),
    linear-gradient(145deg, #f2f4f8, #c6ccd6);
  box-shadow: inset 0 -5px 10px rgba(110, 120, 135, .16);
}

.memoji-laptop-screen {
  position: absolute;
  left: 4px;
  bottom: 0;
  z-index: 7;
  width: 58px;
  height: 28px;
  border-radius: 6px 6px 10px 10px;
  background: linear-gradient(145deg, #f4f5f8, #979da8);
  box-shadow: inset 0 6px 10px rgba(255, 255, 255, .42);
}

.memoji-laptop-screen::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 10px;
  height: 12px;
  border-radius: 999px 999px 50% 50%;
  background: rgba(255, 255, 255, .56);
  transform: translateX(-50%);
}

.memoji-thumb {
  position: absolute;
  right: -4px;
  bottom: 7px;
  z-index: 8;
  width: 22px;
  height: 30px;
  border-radius: 12px 12px 9px 9px;
  background: linear-gradient(145deg, #ffd9bd, #eca174);
  transform: rotate(-18deg);
  box-shadow: inset 5px 6px 8px rgba(255, 255, 255, .24);
}

.memoji-thumb::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 1px;
  width: 12px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffd9bd, #eca174);
  transform: rotate(42deg);
}

.memoji-mask .memoji-hair {
  left: 14px;
  width: 38px;
  height: 24px;
  border-radius: 999px 999px 18px 18px;
}

.memoji-thumbs .memoji-hair {
  left: 7px;
  top: 7px;
  width: 52px;
  height: 42px;
  border-radius: 34px 34px 20px 20px;
  background:
    radial-gradient(circle at 14% 54%, #231d19 0 9px, transparent 10px),
    radial-gradient(circle at 32% 28%, #2f2823 0 10px, transparent 11px),
    radial-gradient(circle at 70% 30%, #2f2823 0 11px, transparent 12px),
    radial-gradient(circle at 90% 55%, #231d19 0 8px, transparent 9px),
    linear-gradient(145deg, #3f332b, #171412);
}

.memoji-thumbs .memoji-face {
  top: 17px;
}

.memoji-beard .memoji-hair {
  transform: rotate(-8deg);
}

.orbit-auth-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  display: grid;
  justify-items: center;
  padding-top: min(58vh, 470px);
  text-align: center;
}

.orbit-brand {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, .58);
  font-size: 15px;
  font-weight: 650;
}

.orbit-title {
  max-width: 390px;
  margin: 0;
  font-size: clamp(38px, 9vw, 58px);
  line-height: .95;
  font-weight: 850;
  letter-spacing: 0;
}

.orbit-copy {
  max-width: 320px;
  margin: 16px 0 26px;
  color: rgba(255, 255, 255, .68);
  font-size: 15px;
  line-height: 1.45;
}

.orbit-telegram-button {
  width: min(100%, 360px);
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #05060b;
  cursor: pointer;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}

.orbit-telegram-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 58px rgba(0, 0, 0, .42);
}

.orbit-telegram-button .telegram-icon {
  width: 38px;
  height: 38px;
  color: #2f86ff;
  background: rgba(47, 134, 255, .1);
}

.orbit-telegram-button .telegram-label {
  color: #05060b;
  font-weight: 800;
}

.orbit-proxy-button {
  min-height: 42px;
  margin-top: 14px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .76);
  cursor: pointer;
}

.orbit-status {
  max-width: 330px;
  color: rgba(255, 255, 255, .6);
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .auth-shell {
    min-height: auto;
    padding: 32px 28px 28px;
    border-radius: 24px;
  }

  .brand-mark {
    transform: scale(.88);
    margin-bottom: 8px;
  }

  .subtitle {
    margin-bottom: 24px;
  }

  .telegram-button {
    min-height: 64px;
    grid-template-columns: 38px 1fr;
    gap: 14px;
    padding: 0 20px;
  }

  .telegram-icon {
    width: 36px;
    height: 36px;
  }

  .telegram-label {
    font-size: clamp(18px, 5.3vw, 20px);
  }

  .hint {
    margin: 26px 0 18px;
  }

  .proxy-button {
    min-height: 58px;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 0 18px;
  }

  .proxy-icon {
    width: 30px;
    height: 30px;
  }

  body.auth-orbit-page {
    padding: 0;
  }

  .orbit-auth {
    padding: 24px 18px 30px;
  }

  .orbit-auth::before {
    inset: 10px 8px;
    border-radius: 34px;
  }

  .orbit-stage {
    top: 54px;
    width: min(350px, 96vw);
  }

  .orbit-ring-middle {
    inset: 58px;
  }

  .orbit-ring-inner {
    inset: 112px;
  }

  .orbit-core {
    width: 92px;
    height: 92px;
  }

  .orbit-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .orbit-avatar {
    width: 58px;
    height: 58px;
  }

  .memoji {
    transform: scale(.82);
  }

  .orbit-auth-panel {
    padding-top: min(56vh, 390px);
  }

  .orbit-title {
    max-width: 330px;
  }

  .orbit-telegram-button {
    min-height: 60px;
  }
}

.app-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mini-mark {
  position: relative;
  width: 44px;
  height: 36px;
  flex: 0 0 auto;
}

.mini-mark .bubble-one {
  left: 5px;
  bottom: 3px;
  width: 30px;
  height: 30px;
}

.mini-mark .bubble-two {
  right: 5px;
  bottom: 3px;
  width: 24px;
  height: 24px;
}

.mini-mark .bubble-three {
  top: 0;
  left: 19px;
  width: 23px;
  height: 23px;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 650;
}

.brand-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.notification-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.cabinet-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(145, 187, 255, .52);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  box-shadow: 0 10px 24px rgba(42, 92, 160, .08);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.cabinet-icon:hover {
  transform: translateY(-1px);
  border-color: #5f9cff;
  background: rgba(255, 255, 255, .9);
}

.cabinet-menu {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 22;
  display: none;
  min-width: 230px;
  padding: 8px;
  border: 1px solid rgba(145, 187, 255, .52);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .78)),
    var(--card);
  box-shadow: 0 18px 44px rgba(42, 92, 160, .16);
  backdrop-filter: blur(18px);
}

.cabinet-menu.open {
  display: block;
}

.cabinet-menu-item {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.cabinet-menu-item:hover {
  background: rgba(47, 134, 255, .09);
  color: var(--blue);
}

.cabinet-menu-profile {
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(145, 187, 255, .28);
}

.cabinet-menu-profile strong {
  font-size: 14px;
  line-height: 1.2;
}

.cabinet-menu-profile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.notification-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(145, 187, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--blue);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.notification-button:hover {
  transform: translateY(-1px);
  border-color: #5f9cff;
  background: rgba(255, 255, 255, .9);
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ff5f7a;
}

.notification-dot.hidden {
  display: none;
}

.notification-panel {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  display: none;
  padding: 14px;
  border: 1px solid rgba(177, 193, 219, .68);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .78)),
    var(--card);
  box-shadow: 0 22px 54px rgba(42, 92, 160, .18);
  backdrop-filter: blur(20px);
}

.notification-panel.open {
  display: block;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notification-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 750;
}

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

.app-choice,
.plan-type-control,
.quick-reasons,
.payment-methods,
.checkout-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-choice button,
.plan-type-control button,
.quick-reasons button,
.payment-methods button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.app-choice button.active,
.plan-type-control button.active,
.quick-reasons button.active,
.payment-methods button.active {
  border-color: rgba(47, 134, 255, .42);
  background: rgba(47, 134, 255, .1);
  color: var(--blue);
}

.plan-type-control {
  align-items: center;
  justify-content: flex-end;
}

.plan-type-control span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(145, 187, 255, .34);
  border-radius: 14px;
  background: rgba(255, 255, 255, .56);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  touch-action: pan-y;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease, background .18s ease;
  user-select: none;
}

.notification-item.removing {
  opacity: 0;
  transform: translateX(-110%);
}

.notification-item.unread {
  background: rgba(47, 134, 255, .07);
}

.notification-item.empty {
  cursor: default;
}

.notification-item-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #9eb2d8;
}

.notification-item.unread .notification-item-dot {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47, 134, 255, .12);
}

.notification-item h3 {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 750;
}

.notification-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hero-panel,
.panel,
.plan-card {
  border: 1px solid rgba(177, 193, 219, .68);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .68)),
    var(--card);
  box-shadow: 0 18px 46px rgba(42, 92, 160, .12);
  backdrop-filter: blur(20px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 24px;
  margin-bottom: 14px;
}

.state-switcher {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.demo-mode .state-switcher {
  display: flex;
}

.state-switcher button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.state-switcher button.active {
  border-color: rgba(47, 134, 255, .5);
  background: rgba(47, 134, 255, .1);
  color: var(--blue);
}

.hero-panel[data-status="pending"] .eyebrow {
  color: #a76a00;
}

.hero-panel[data-status="expired"] .eyebrow {
  color: #c64057;
}

.hero-panel[data-status="empty"] .eyebrow {
  color: var(--muted);
}

.load-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  margin: -2px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 169, 69, .36);
  border-radius: 18px;
  background: rgba(255, 248, 235, .72);
  color: #7a4b00;
}

.load-alert[hidden] {
  display: none;
}

.load-alert strong {
  font-size: 14px;
}

.load-alert span {
  grid-column: 1;
  color: #8b6426;
  font-size: 13px;
  line-height: 1.35;
}

.load-alert .ghost-small {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.payment-return {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: -2px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(145, 187, 255, .44);
  border-radius: 18px;
  background: rgba(255, 255, 255, .66);
  box-shadow: 0 12px 32px rgba(42, 92, 160, .08);
}

.payment-return[hidden] {
  display: none;
}

.payment-return-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(47, 134, 255, .14);
  border: 8px solid rgba(47, 134, 255, .08);
}

.payment-return[data-tone="success"] {
  border-color: rgba(61, 190, 132, .34);
  background: rgba(235, 255, 246, .72);
}

.payment-return[data-tone="success"] .payment-return-icon {
  background: #2bcf8f;
  border-color: rgba(43, 207, 143, .14);
}

.payment-return[data-tone="error"] {
  border-color: rgba(226, 83, 103, .34);
  background: rgba(255, 244, 246, .72);
}

.payment-return[data-tone="error"] .payment-return-icon {
  background: #e25367;
  border-color: rgba(226, 83, 103, .14);
}

.payment-return strong,
.payment-return span {
  display: block;
}

.payment-return strong {
  font-size: 14px;
}

.payment-return span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hero-action {
  min-width: 138px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 750;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  font-weight: 650;
}

.hero-copy {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(61, 190, 132, .34);
  border-radius: 999px;
  background: rgba(69, 213, 141, .12);
  color: #16835a;
  font-size: 14px;
  font-weight: 650;
}

.status-pill-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.status-pill-small[data-status="pending"] {
  border-color: rgba(218, 149, 29, .34);
  background: rgba(255, 184, 65, .12);
  color: #9a6400;
}

.status-pill-small[data-status="pending"] .status-dot {
  background: #e5a72f;
  box-shadow: 0 0 0 5px rgba(229, 167, 47, .12);
}

.status-pill-small[data-status="expired"] {
  border-color: rgba(223, 76, 102, .34);
  background: rgba(223, 76, 102, .1);
  color: #b12d48;
}

.status-pill-small[data-status="expired"] .status-dot {
  background: #df4c66;
  box-shadow: 0 0 0 5px rgba(223, 76, 102, .12);
}

.status-pill-small[data-status="empty"] {
  border-color: rgba(145, 187, 255, .36);
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
}

.status-pill-small[data-status="empty"] .status-dot {
  background: #9eb2d8;
  box-shadow: 0 0 0 5px rgba(158, 178, 216, .12);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #24c979;
  box-shadow: 0 0 0 5px rgba(36, 201, 121, .12);
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 4px;
  margin: 6px 0 26px;
}

.nav-tabs button {
  position: relative;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.nav-tabs button:focus {
  outline: 0;
}

.nav-tabs button:focus-visible {
  color: var(--ink);
}

.nav-tabs button.active {
  color: var(--ink);
}

.nav-tabs button.active::after {
  content: "";
  position: absolute;
  left: 38%;
  right: 38%;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8bbfff, var(--blue));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 14px;
  margin-bottom: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel.active.dashboard-grid,
.tab-panel.active .dashboard-grid {
  display: grid;
}

.panel {
  border-radius: 22px;
  padding: 18px;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.section-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 750;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading .panel-title {
  margin-bottom: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-card {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.app-choice {
  margin: 0 0 10px;
}

.detail-card {
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
}

.metric-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 750;
}

.family-upgrade {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(145, 187, 255, .36);
  border-radius: 16px;
  background: rgba(255, 255, 255, .48);
}

.family-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(47, 134, 255, .1);
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
}

.family-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 750;
}

.family-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ghost-small {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(145, 187, 255, .58);
  border-radius: 12px;
  background: rgba(255, 255, 255, .64);
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.ghost-small:focus,
.primary-small:focus,
.notification-button:focus,
.action-button:focus {
  outline: 0;
}

.ghost-small:focus-visible,
.primary-small:focus-visible,
.notification-button:focus-visible,
.action-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 134, 255, .16);
}

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

.action-button {
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(145, 187, 255, .58);
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.action-button.disabled,
.action-button:disabled {
  opacity: .54;
  cursor: default;
}

.action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(47, 134, 255, .12);
  color: var(--blue);
}

.action-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.action-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.plans-section {
  margin-top: 6px;
}

.plans-section.attention {
  animation: plansAttention 2s ease;
}

@keyframes plansAttention {
  0% {
    border-color: rgba(47, 134, 255, .38);
    box-shadow: 0 18px 46px rgba(42, 92, 160, .12);
    transform: translateY(0);
  }
  28% {
    border-color: rgba(47, 134, 255, .95);
    background:
      linear-gradient(145deg, rgba(239, 247, 255, .98), rgba(255, 255, 255, .78)),
      var(--card);
    box-shadow: 0 28px 78px rgba(47, 134, 255, .32), 0 0 0 8px rgba(47, 134, 255, .16);
    transform: translateY(-3px);
  }
  62% {
    border-color: rgba(47, 134, 255, .82);
    box-shadow: 0 24px 68px rgba(47, 134, 255, .22), 0 0 0 5px rgba(47, 134, 255, .1);
    transform: translateY(-1px);
  }
  100% {
    border-color: rgba(177, 193, 219, .68);
    box-shadow: 0 18px 46px rgba(42, 92, 160, .12);
    transform: translateY(0);
  }
}

.plan-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
}

.plan-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid rgba(145, 187, 255, .34);
  border-radius: 18px;
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.plan-card.current {
  border-color: rgba(47, 134, 255, .5);
}

.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 134, 255, .1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}

.plan-name {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.plan-price {
  margin: 0;
  font-size: 26px;
  line-height: 1;
  font-weight: 750;
}

.plan-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-features {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.primary-small {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #8bbfff, var(--blue));
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.support-box {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-top: 12px;
}

.quick-reasons {
  margin-top: 14px;
}

.chat-thread {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.support-live {
  width: fit-content;
  margin: 10px 0 0;
  padding: 6px 10px;
  border: 1px solid rgba(61, 190, 132, .26);
  border-radius: 999px;
  background: rgba(69, 213, 141, .09);
  color: #16835a;
  font-size: 12px;
  font-weight: 700;
}

.chat-message {
  max-width: 76%;
  padding: 12px 14px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
}

.chat-message.user {
  justify-self: end;
  background: rgba(47, 134, 255, .1);
}

.chat-message p {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.4;
}

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

.support-input {
  width: 100%;
  min-height: 98px;
  grid-column: 1 / -1;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid rgba(145, 187, 255, .58);
  border-radius: 16px;
  background: rgba(255, 255, 255, .64);
  color: var(--ink);
  font: inherit;
}

.support-input:focus {
  outline: 0;
  border-color: rgba(47, 134, 255, .58);
  box-shadow: 0 0 0 3px rgba(47, 134, 255, .12);
}

.attach-button {
  justify-self: start;
}

.notice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.referral-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.referral-link {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 18px;
  background: rgba(255, 255, 255, .56);
}

.connection-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 750;
}

.connection-copy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.connection-code {
  display: block;
  max-width: 100%;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(145, 187, 255, .32);
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
  color: #31517d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-placeholder {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
}

.qr-placeholder img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.qr-placeholder img:not([src]) {
  display: none;
}

.connection-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.devices-panel,
.billing-panel,
.referral-rules,
.guide-card,
.client-install-card,
.empty-subscription-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(145, 187, 255, .42);
  border-radius: 18px;
  background: rgba(255, 255, 255, .5);
}

.empty-subscription-panel {
  display: grid;
  gap: 10px;
}

.client-install-card {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: center;
}

.client-install-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-install-button {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(145, 187, 255, .38);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.client-install-button:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 134, 255, .58);
  background: rgba(255, 255, 255, .82);
}

.client-install-button strong {
  font-size: 14px;
}

.client-install-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.empty-subscription-panel[hidden] {
  display: none;
}

.connection-card[hidden],
.client-install-card[hidden],
.guide-card[hidden],
.devices-panel[hidden] {
  display: none;
}

.guide-steps {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.guide-steps li + li {
  margin-top: 6px;
}

.device-limit {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.device-list,
.invoice-list {
  display: grid;
  gap: 10px;
}

.device-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(145, 187, 255, .34);
  border-radius: 16px;
  background: rgba(255, 255, 255, .56);
}

.device-item.disabled {
  opacity: .58;
}

.device-item.disabled .ghost-small {
  cursor: default;
}

.device-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(47, 134, 255, .1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.device-item h4 {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.2;
}

.device-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.billing-panel {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.invoice-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(145, 187, 255, .34);
  border-radius: 16px;
  background: rgba(255, 255, 255, .56);
}

.invoice-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.invoice-item.muted {
  opacity: .72;
}

.ticket-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(61, 190, 132, .28);
  border-radius: 999px;
  background: rgba(69, 213, 141, .1);
  color: #16835a;
  font-size: 12px;
  font-weight: 700;
}

.referral-rules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.referral-rules article {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(145, 187, 255, .34);
  border-radius: 16px;
  background: rgba(255, 255, 255, .56);
}

.referral-rules strong {
  font-size: 17px;
}

.referral-rules span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(7, 23, 57, .22);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: grid;
}

.modal-card {
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid rgba(177, 193, 219, .68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .78)),
    var(--card);
  box-shadow: 0 22px 54px rgba(42, 92, 160, .22);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.payment-summary div {
  padding: 10px 12px;
  border: 1px solid rgba(145, 187, 255, .38);
  border-radius: 14px;
  background: rgba(255, 255, 255, .56);
}

.payment-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.payment-summary strong {
  font-size: 15px;
}

.checkout-steps {
  margin-top: 16px;
}

.checkout-steps span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(158, 178, 216, .12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.checkout-steps span.active {
  background: rgba(47, 134, 255, .12);
  color: var(--blue);
}

.payment-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.payment-methods {
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  top: var(--toast-top, 42px);
  right: var(--toast-right, calc(max(16px, calc((100vw - 1040px) / 2)) + 56px));
  z-index: 60;
  display: none;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(145, 187, 255, .48);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(42, 92, 160, .18);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(18px, -50%) scale(.985);
  transition:
    opacity .42s cubic-bezier(.22, 1, .36, 1),
    transform .42s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.toast.visible {
  display: block;
}

.toast.show {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

.toast.closing {
  opacity: 0;
  transform: translate(14px, -50%) scale(.985);
}

@media (max-width: 820px) {
  .app-shell {
    padding-top: 8px;
  }

  .hero-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-action {
    width: 100%;
  }

  .metric-row,
  .detail-grid,
  .referral-stats,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .family-upgrade {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .family-upgrade .ghost-small {
    grid-column: 2;
    justify-self: start;
  }

  .panel-heading {
    align-items: center;
    flex-direction: row;
  }

  .plan-type-control {
    justify-content: flex-start;
  }

  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .referral-box {
    align-items: stretch;
    flex-direction: column;
  }

  .device-item,
  .billing-panel,
  .client-install-card,
  .guide-card,
  .referral-rules {
    grid-template-columns: 1fr;
  }

  .client-install-grid {
    grid-template-columns: 1fr;
  }

  .load-alert {
    grid-template-columns: 1fr;
  }

  .load-alert .ghost-small {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }

  .payment-return {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .payment-return .ghost-small {
    grid-column: 2;
    justify-self: start;
  }

  .notification-wrap {
    margin-right: 0;
  }

  .cabinet-icon {
    width: 38px;
    height: 38px;
  }

  .device-item {
    align-items: start;
  }

  .support-box {
    grid-template-columns: 1fr;
  }

  .connection-card {
    grid-template-columns: 1fr;
  }

  .connection-actions {
    width: 100%;
  }

  .connection-actions .primary-small,
  .connection-actions .ghost-small {
    width: 100%;
  }

  .qr-placeholder {
    justify-self: start;
  }

  .payment-summary {
    grid-template-columns: 1fr;
  }

  .cabinet-menu {
    width: min(260px, calc(100vw - 24px));
  }

  .chat-message {
    max-width: 92%;
  }

  .notification-panel {
    position: fixed;
    top: 68px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    transform: translateY(-14px) scale(.985);
  }

  .toast.show {
    transform: translateY(0) scale(1);
  }

  .toast.closing {
    transform: translateY(-10px) scale(.985);
  }
}
