@media (max-width: 600px) {
  body:has(#app > :is(.tab-home, .tab-support)) { overflow: hidden; }
  #app:has(> :is(.tab-home, .tab-support)) {
    height: 100dvh;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: calc(82px + var(--safe-bottom) + var(--tg-content-safe-area-inset-bottom, 0px));
    overflow: hidden;
  }
  #app > .tab-home {
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .tab-home .dashboard-subscription::before { inset: 0; }
  #app > .tab-support {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .tab-support > :is(.topbar, .page-title, .page-subtitle, .button + div) { display: none; }
  .tab-support > :not(#ticket-list) { flex: 0 0 auto; }
  .tab-support > .button { min-height: 44px; font-size: 14px; }
  .tab-support > .card .list-item { min-height: 54px; padding: 9px 13px; }
  .tab-support > .card .list-item .sub { font-size: 11px; }
  .tab-support > .segmented { margin: 0; }
  .tab-support #ticket-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .tab-support #ticket-list .empty { min-height: 0; height: min(100%, 164px); padding: 12px; gap: 10px; }
  .tab-home .topbar { justify-content: center; margin-bottom: 6px; }
  .tab-home .wordmark {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--tint);
  }
  .tab-home .wordmark img { display: none; }
  .tab-home .dashboard-subscription,
  .tab-home .dashboard-actions {
    width: min(100%, 386px);
    margin-inline: auto;
  }
  .tab-home .dashboard-subscription { padding-top: 122px; }
  .tab-home .subscription-planet {
    inset: 12px auto auto 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 96px;
  }
  .tab-home .dashboard-subscription .tabs { padding-left: 24px; gap: 8px; }
  .tab-home .dashboard-subscription .tabs button,
  .tab-home .dashboard-subscription .tabs button.active {
    min-width: 0;
    height: 29px;
    padding: 3px 12px;
    font-size: 12px;
    border-radius: 16px 16px 0 0;
  }
  .tab-home .dashboard-subscription .tabs button.active::after { display: none; }
  .tab-home .subscription-overview {
    min-height: 0;
    padding: 17px 20px 9px;
    border-radius: 25px 25px 0 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    background: var(--panel) !important;
    box-shadow: none;
  }
  body.light .tab-home .subscription-overview { background: var(--panel) !important; }
  .tab-home .subscription-kind { display: none; }
  .tab-home .subscription-overview h1 { margin: 0; font-size: 16px; }
  .tab-home .card-qr-button { top: 12px; right: 14px; }
  .tab-home .subscription-state { min-height: 0; padding: 3px 0 7px; }
  .tab-home .subscription-state strong {
    border: 0;
    box-shadow: none;
    transform: none;
    outline: none;
    font-size: 14px;
    padding: 0;
  }
  .tab-home .subscription-state.expired p { display: none; }
  .tab-home .subscription-stats {
    border: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }
  .tab-home .subscription-stats > * {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--tint);
  }
  .tab-home .subscription-stats span { font-size: 9px; margin-bottom: 1px; }
  .tab-home .subscription-stats strong { font-size: 12px; }
  .tab-home .dashboard-actions {
    margin-top: 0;
    padding: 0 20px 16px;
    gap: 10px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 25px 25px;
    background: var(--panel);
  }
  .tab-home .dashboard-actions > .button { min-height: 43px; font-size: 13px; }
  .tab-home .dashboard-actions > .button.outline { color: var(--pink); }
  .bottom-nav .mobile-tabs { display: grid; grid-template-columns: repeat(3, 43px); }
  .bottom-nav .mobile-tabs > button {
    width: 43px;
    height: 43px;
    min-width: 43px;
    min-height: 43px;
    padding: 0;
  }
  .bottom-nav .nav-label { display: none; }
}
.referral-qr {
  width: min(100%, 280px);
  margin: 10px auto 16px;
  border-radius: 17px;
  overflow: hidden;
  background: #ff79dc;
}
.referral-qr svg { display: block; width: 100%; height: auto; }

@media (max-width: 600px) and (max-height: 650px) {
  .tab-home .dashboard-subscription { padding-top: 94px; }
  .tab-home .subscription-planet { width: 74px; height: 74px; top: 6px; }
  .tab-home .subscription-overview { padding: 12px 14px 8px; }
  .tab-home .dashboard-actions { padding: 0 14px 12px; gap: 7px; }
  .tab-home .dashboard-actions > .button { min-height: 40px; }
}
@media (max-width: 600px) and (max-height: 580px) {
  .tab-home .topbar { padding: 2px 0 4px; min-height: 0; }
  .tab-home .dashboard-subscription { padding-top: 72px; }
  .tab-home .subscription-planet { width: 58px; height: 58px; }
  .tab-home .dashboard-subscription .tabs { min-height: 29px; }
  .tab-home .subscription-overview { padding-top: 9px; }
  .tab-home .dashboard-actions { padding-bottom: 9px; }
}
