.dashboard-nav .mobile-support { display: none; }
.cabinet-shell .skip { z-index: 20; }

html[data-telegram-app] {
  --cabinet-telegram-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --cabinet-telegram-bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px));
  --cabinet-telegram-left: calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px));
  --cabinet-telegram-right: calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px));
}

.dashboard-nav .rail-menu a[aria-current] {
  background: #222b40;
  box-shadow: inset 0 0 0 1px #343f56;
}

.dashboard .workspace { max-width: 1330px; }
.dashboard .masthead { margin-bottom: clamp(20px, 3vw, 35px); }
.dashboard .masthead h1 { font-size: clamp(27px, 3.25vw, 45px); }

.dashboard-card.feature {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas:
    'stage heading'
    'stage details';
  grid-template-rows: auto 1fr;
  overflow: visible;
  border-color: #363c49;
  border-radius: 18px;
  background: #1b1e24;
}

.dashboard-card-heading {
  grid-area: heading;
  min-width: 0;
  padding: clamp(24px, 3.2vw, 43px) clamp(22px, 3.2vw, 45px) 0;
}

.dashboard-card h2 {
  max-width: none;
  font-size: clamp(22px, 2.45vw, 34px);
  line-height: 1.26;
  letter-spacing: -.05em;
}

.dashboard-card .availability {
  margin: 11px 0 0;
  font-weight: 750;
  line-height: 1.45;
}

.dashboard-card .dashboard-card-stage {
  grid-area: stage;
  min-width: 0;
  padding: clamp(25px, 4vw, 57px);
  border-right: 1px solid #343b48;
  border-radius: 17px 0 0 17px;
  background: radial-gradient(ellipse at 42% 60%, #233d73 0, #1d2b48 45%, #1a2130 85%);
}

.dashboard-card .product-card {
  width: min(100%, 430px);
  padding: clamp(17px, 2.2vw, 30px);
  border-color: #758bca;
  background:
    repeating-linear-gradient(3deg, #f3f6ff07 0 1px, transparent 1px 5px),
    linear-gradient(127deg, #11234d 10%, #123d9b 50%, #2558ba 73%, #112c64 100%);
  box-shadow: 0 16px 30px #080f24c0, inset 0 1px 1px #ecf1ff75;
}

.dashboard-card .product-card::before {
  inset: -65% -38% -9% 44%;
  border-color: #a7c7ff70;
  box-shadow: 0 0 0 16px #b1c8ff23, 0 0 0 38px #9fbaff1b, 0 0 0 61px #7797e916;
}

.dashboard-card .product-card .wordmark img { width: clamp(109px, 13vw, 172px); }
.dashboard-card .card-caption { font-size: clamp(12px, 1.05vw, 14px); }

.dashboard-card-details {
  grid-area: details;
  min-width: 0;
  padding: 21px clamp(22px, 3.2vw, 45px) clamp(23px, 2.8vw, 39px);
}

.dashboard-balance {
  margin: 0;
  padding: 15px 0 14px;
  border-block: 1px solid #383f4c;
}

.dashboard-balance dt { color: #b7bfcc; font-size: 13px; }
.dashboard-balance dd {
  margin: 3px 0 0;
  color: #eef1f7;
  font: 500 clamp(20px, 2.1vw, 27px)/1.2 Manrope, sans-serif;
  letter-spacing: -.035em;
}

.dashboard-card-details > p:not(.dashboard-calculation) {
  max-width: 46ch;
  margin-top: 15px;
  color: #bbc3d0;
  font-size: 14px;
}

.dashboard-card-details > p.service-error { color: #ffd2bf; }
.dashboard-card-details .actions { margin-top: 16px; }
.dashboard-card-details .button { min-height: 46px; padding-inline: 16px; }
.dashboard-card-details .button-primary {
  color: #fff;
  border-color: #6279d5;
  background: #2448b7;
  transition: background-color .18s ease;
}
.dashboard-card-details .button-primary:hover { background: #2e56c9; }
.dashboard-card-details .button-secondary { border-color: #4a5467; }
.dashboard-card-details .button-secondary:hover { border-color: #9aa8bd; }
.dashboard-calculation { margin-top: 7px; color: #b7bfcc; font-size: 12px; }

.dashboard-provider {
  margin-top: 16px;
  padding-inline-start: 13px;
  border-inline-start: 1px solid #8a7957;
  color: #b9c3d1;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.dashboard-provider strong { display: block; color: var(--ink); font-size: 14px; }
.dashboard-provider p + p { margin-top: 5px; }
.dashboard-provider .legal { margin-top: 0; gap: 0 13px; }
.dashboard-provider .legal a { min-height: 44px; text-decoration: underline; }

.dashboard-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(27px, 5vw, 66px);
  margin-top: clamp(28px, 3.5vw, 46px);
}

.dashboard-sections .workspace-section { min-width: 0; margin-top: 0; scroll-margin-top: 22px; }
.dashboard-sections .workspace-section h2 { margin-bottom: 12px; font-size: clamp(18px, 2vw, 24px); }
.dashboard-sections .workspace-row {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  padding: 14px 0 13px;
}
.dashboard-sections .workspace-row h3 { font-weight: 750; }
.dashboard-sections .workspace-row > .nav-icon { margin-top: 4px; color: #a2aec6; }
.dashboard-sections .quiet-link { min-height: 44px; color: #aebeff; text-decoration: underline; }
.dashboard .workspace-footer { margin-top: 26px; }

@media (max-width: 985px) {
  .dashboard-card .dashboard-card-stage { padding: clamp(20px, 3.2vw, 35px); }
  .dashboard-sections { gap: 30px; }
}

@media (min-width: 761px) and (max-width: 880px) {
  .dashboard-card h2 { font-size: 21px; }
  .dashboard-card-heading, .dashboard-card-details { padding-left: 18px; padding-right: 18px; }
  .dashboard-card .dashboard-card-stage { padding: 17px; }
  .dashboard-card .product-card { padding: 14px; }
}

@media (max-width: 760px) {
  .cabinet-shell { display: block; }
  .cabinet-shell .workspace {
    padding-bottom: max(94px, calc(84px + max(env(safe-area-inset-bottom, 0px), var(--cabinet-telegram-bottom, 0px))));
  }
  .dashboard-nav.rail {
    position: relative;
    display: flex;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top, 0px), var(--cabinet-telegram-top, 0px))
      max(16px, env(safe-area-inset-right, 0px), var(--cabinet-telegram-right, 0px)) 8px
      max(16px, env(safe-area-inset-left, 0px), var(--cabinet-telegram-left, 0px));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-nav.rail .wordmark img { width: clamp(118px, 34vw, 145px); }
  .dashboard-nav.rail > .wordmark { min-height: 44px; padding-inline: 0; }
  .dashboard-nav .rail-links { display: none; }
  .dashboard-nav .mobile-support {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #c7d2e6;
    font-weight: 750;
    font-size: 13px;
  }
  .dashboard-nav .rail-menu {
    position: fixed;
    z-index: 6;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    margin: 0;
    padding: 7px max(9px, env(safe-area-inset-right, 0px), var(--cabinet-telegram-right, 0px))
      calc(7px + max(env(safe-area-inset-bottom, 0px), var(--cabinet-telegram-bottom, 0px)))
      max(9px, env(safe-area-inset-left, 0px), var(--cabinet-telegram-left, 0px));
    border-top: 1px solid #414957;
    background: #141820;
  }
  .dashboard-nav .rail-menu a {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 5px 3px;
    font-size: 12px;
    line-height: 1.15;
  }
  .dashboard-nav .rail-menu a:focus-visible { outline-offset: -2px; }
  .dashboard-nav .rail-menu .nav-icon {
    display: block;
    flex: none;
  }
  .dashboard .workspace {
    padding-top: 20px;
    padding-right: max(15px, env(safe-area-inset-right));
    padding-left: max(15px, env(safe-area-inset-left));
  }
  .dashboard .masthead { margin-bottom: 17px; }
  .dashboard .masthead h1 { font-size: clamp(23px, 6vw, 35px); line-height: 1.25; }
  .dashboard .masthead .telegram { min-height: 44px; }
  .dashboard-card.feature {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: 'heading' 'stage' 'details';
    border-radius: 15px;
  }
  .dashboard-card-heading { padding: 18px 17px 0; }
  .dashboard-card .availability { margin-top: 6px; }
  .dashboard-card .dashboard-card-stage {
    padding: 16px clamp(20px, 6.5vw, 40px) 18px;
    border-right: 0;
    border-radius: 0;
    background: radial-gradient(ellipse at 50% 58%, #233750 0, #1c2738 45%, #1b1e24 79%);
  }
  .dashboard-card .product-card { width: min(100%, 357px); }
  .dashboard-card .product-card .wordmark img { width: min(38vw, 155px); }
  .dashboard-card .card-chip { right: 23px; }
  .dashboard-card-details { padding: 0 17px 19px; }
  .dashboard-balance { padding: 9px 0 10px; }
  .dashboard-card-details > p:not(.dashboard-calculation) { margin-top: 11px; }
  .dashboard-card-details .actions { margin-top: 12px; }
  .dashboard-sections { grid-template-columns: 1fr; gap: 24px; }
  .dashboard-sections .workspace-section { scroll-margin-top: max(15px, env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-card-details .button-primary { transition: none; }
}

@media (max-width: 380px) {
  .dashboard-card-details .button { padding-inline: 12px; font-size: 13px; }
}
