/* maiVPN 8.2 — home dashboard only. Other pages are kept from 8.0. */
:root { --dashboard-red: #ff1738; }

/* Critical: the bottom bar must be viewport-fixed, never part of page flow. */
#content > .bottom-nav {
  position: fixed !important;
  inset: auto auto 0 50%;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 45;
  width: min(720px, 100%);
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background: rgba(13, 12, 15, .95);
  border-top: 1px solid rgba(255, 255, 255, .075);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
body.modal-open { overflow: hidden; }

/* The exact brand icon comes from the user-approved red m, not a font glyph. */
.brand-image,
.brand-symbol.brand-image {
  display: block;
  flex-shrink: 0;
  padding: 0;
  letter-spacing: normal;
  font-size: initial;
  line-height: normal;
  color: unset;
  background: transparent;
  transform: none;
  object-fit: contain;
  width: 80px;
  height: 54px;
  animation: none;
}
.brand-symbol.small.brand-image { width: 43px; height: 31px; }
.brand-symbol.gate-icon.brand-image { width: 118px; height: 79px; margin: 0 auto 25px; }
.loader .brand-image { width: 128px; height: 86px; }
.brand b .accent { font-size: inherit; color: var(--dashboard-red); }

/* The animated black and red atmosphere is limited to the HOME tab. */
body[data-current-page="home"] { background: #09080a; }
body[data-current-page="home"]::before,
body[data-current-page="home"]::after {
  content: "";
  pointer-events: none;
  position: fixed;
  z-index: 0;
  inset: -18%;
  border-radius: 50%;
  will-change: transform;
}
body[data-current-page="home"]::before {
  background: radial-gradient(ellipse 48% 37% at 91% 12%, rgba(236, 11, 42, .37), rgba(93, 4, 18, .08) 56%, transparent 80%);
  animation: mai-red-drift 18s ease-in-out infinite alternate;
}
body[data-current-page="home"]::after {
  background: radial-gradient(ellipse 55% 42% at 10% 88%, rgba(190, 5, 31, .22), rgba(65, 4, 18, .09) 55%, transparent 80%);
  animation: mai-red-drift-alt 23s ease-in-out infinite alternate;
}
body[data-current-page="home"] .app { position: relative; z-index: 1; }
body[data-current-page="home"] .topbar { background: rgba(12, 9, 11, .85); }

.dashboard-home { padding: 12px 16px calc(114px + env(safe-area-inset-bottom, 0px)); }
.dashboard-home button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.dashboard-home .surface {
  background: linear-gradient(150deg, rgba(27, 27, 31, .94), rgba(15, 16, 19, .96));
  border: 1px solid rgba(255, 255, 255, .068);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
.dashboard-home button.surface:active { border-color: rgba(255, 23, 56, .52); transform: scale(.985); }

/* Account tile */
.home-profile {
  width: 100%; padding: 13px 15px;
  display: flex; align-items: center; gap: 13px;
  border-radius: 19px;
  color: #f5f5f7; text-align: left;
  cursor: pointer;
}
.home-profile-icon {
  display: grid; place-items: center;
  flex: 0 0 49px; height: 49px;
  background: #170b0f;
  border-radius: 13px;
}
.home-profile-icon img { display: block; width: 36px; height: 27px; object-fit: contain; }
.home-profile-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 4px; }
.home-profile-copy strong { font-size: 15px; font-weight: 750; }
.home-profile-copy small { font-size: 13px; color: #a6a5ad; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-chevron { font-size: 30px; color: #9b98a1; line-height: 1; }

/* Subscription card matching the reference. */
.dashboard-home .dashboard-status {
  margin: 13px 0 0;
  padding: 17px 16px 16px;
  border-radius: 22px;
  color: #f7f7fa;
}
.dash-status-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dash-status-head > div { min-width: 0; }
.dash-muted { color: #a5a2ad; font-size: 12px; }
.dashboard-status .dash-status-head h3 { margin: 7px 0 0; font-size: 23px; font-weight: 780; letter-spacing: -.035em; line-height: 1.1; }
/* Explicit text color fixes the "blue Продлить" issue on iOS/Telegram. */
.dashboard-status button.dash-renew,
.dashboard-status button.dash-renew:link,
.dashboard-status button.dash-renew:visited {
  appearance: none;
  -webkit-appearance: none;
  background: var(--dashboard-red);
  border: 0;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.1;
  width: auto;
  min-width: 91px;
  flex-shrink: 0;
  padding: 12px 13px;
  border-radius: 13px;
  text-decoration: none;
  box-shadow: none;
}
.dash-status-description { margin: 16px 0 0; color: #aaa7b2; font-size: 13px; line-height: 1.5; }
.dash-progress { overflow: hidden; height: 7px; border-radius: 12px; background: #303036; margin-top: 17px; }
.dash-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--dashboard-red); transition: width .5s ease; }
.dash-status-metrics { margin-top: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 12px; }
.dash-status-metrics b { font-weight: 720; }
.dash-status-metrics span { text-align: right; color: #b2aeb7; }
.dash-status-until { margin: 12px 0 0; color: #a49ca6; font-size: 12px; }

/* Quick actions */
.dashboard-block { margin-top: 23px; }
.home-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 11px; }
.home-section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; font-weight: 800; }
.home-section-note { font-size: 11px; color: #8d8992; }
.home-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.home-action {
  cursor: pointer;
  border-radius: 17px;
  padding: 11px 7px 10px;
  min-width: 0;
  min-height: 104px;
  color: #f1f1f3;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px;
}
.home-action > span:last-child { font-size: 11px; font-weight: 630; line-height: 1.25; }
.home-action-icon { display: grid; place-items: center; color: var(--dashboard-red); height: 32px; width: 35px; }
.home-action-icon svg { width: 26px; height: 26px; }

/* Server cards: informational; no false promise that tapping changes VPN protocol. */
.home-servers { display: grid; gap: 8px; }
.home-server { display: flex; align-items: center; min-height: 65px; padding: 12px 13px; border-radius: 17px; gap: 11px; }
.server-flag { font-size: 26px; line-height: 1; flex-shrink: 0; }
.server-description { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.server-description b { color: #fff; font-weight: 680; font-size: 13px; }
.server-description small { color: #b3b1bb; display: flex; align-items: center; gap: 5px; font-size: 11px; }
.online-dot, .upcoming-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; flex-shrink: 0; }
.online-dot { background: #39d179; }
.upcoming-dot { background: #88858d; }
.server-detail { margin-left: auto; text-align: right; color: #9f9da7; font-size: 10px; max-width: 90px; }
.upcoming .server-description small,.upcoming .server-detail { color: #87858e; }

/* Home plan variants link to the corresponding tariff on the actual Tariffs tab. */
.home-text-link { border: none; background: none; color: var(--dashboard-red); font-size: 11px; cursor: pointer; padding: 0; font-weight: 750; }
.home-tariff-choices { display: grid; gap: 7px; }
.home-plan { display: flex; gap: 8px; justify-content: space-between; align-items: center; width: 100%; padding: 13px 14px; color: #eeeef1; border-radius: 15px; cursor: pointer; }
.home-plan-title { font-size: 13px; font-weight: 700; }
.home-plan-price { display: inline-flex; align-items: center; gap: 10px; color: #f8f8fa; font-size: 13px; font-weight: 800; white-space: nowrap; }
.home-plan-price > span { font-size: 21px; line-height: .6; color: var(--dashboard-red); font-weight: 500; }
/* Only a deliberate click may temporarily emphasize a plan. */
.tariff.spotlight { border-color: var(--dashboard-red) !important; box-shadow: 0 0 0 1px rgba(255, 23, 56, .2); }
.home-trial-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 18px; background: #26191e; border: 1px solid #463039; border-radius: 15px; color: #f7f5f7; padding: 13px 10px; font-weight: 650; font-size: 12px; }
.home-trial-btn:disabled { opacity: .54; cursor: not-allowed; }
.home-trial-btn svg { width: 18px; height: 18px; color: var(--dashboard-red); }
.home-device-guides { display: flex; justify-content: center; gap: 17px; margin-top: 15px; flex-wrap: wrap; }
.home-device-guides a { text-decoration: none; font-size: 12px; color: #ada0a6; }

@keyframes mai-red-drift { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: .7; } 100% { transform: translate3d(-9%, 9%, 0) scale(1.1); opacity: 1; } }
@keyframes mai-red-drift-alt { 0% { transform: translate3d(0, 3%, 0) scale(1); opacity: .5; } 100% { transform: translate3d(9%, -7%, 0) scale(1.07); opacity: .95; } }
@media (max-width: 350px) {
  .dashboard-home { padding-left: 12px; padding-right: 12px; }
  .home-actions { gap: 6px; }
  .home-action { padding: 11px 3px 9px; }
  .home-action > span:last-child { font-size: 10px; }
  .server-detail { max-width: 70px; font-size: 9px; }
}
@media (min-width: 600px) {
  .dashboard-home { padding-left: 26px; padding-right: 26px; }
  .home-action { min-height: 110px; }
  .server-detail { max-width: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-current-page="home"]::before,
  body[data-current-page="home"]::after { animation: none; }
}

/* v8.3: three persistent tabs; plan options on Home above the server list. */
.bottom-nav {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.dashboard-tariff-block {margin-top:22px;}
.home-tariff-choices {gap:9px;}
.home-plan {min-height:60px; transition:border-color .2s ease,transform .2s ease;}
.home-plan:active {transform:scale(.985);border-color:rgba(255,41,71,.48);}
#homePlansHeading{scroll-margin-top:95px;}
.dashboard-home .dashboard-block[aria-labelledby="homeServersHeading"]{margin-top:24px;}
