/* =========================================================
   Responsive hardening — tablet/mobile ONLY
   Desktop base styles are intentionally untouched.
   Do not add desktop-first visual redesigns here.
   ========================================================= */

@media (max-width: 1024px) {
  .dash-main,
  .panel-content,
  .panel-main,
  .site-footer__inner,
  .auth-page__inner,
  .help-wrap,
  .acct-settings {
    min-width: 0;
  }

  .dash-page__header-actions,
  .panel-page__actions,
  .panel-form-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  /* Long tokens stay readable without page-level overflow */
  .order-id,
  .order-id__code,
  .apiu-key,
  .ud-mono,
  .dash-flash__item,
  .site-footer__social-text,
  .site-footer__desc {
    max-width: 100%;
  }

  .apiu-key,
  .ud-mono,
  .site-footer__social-text {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  pre,
  code,
  .docs-main pre,
  .docs-main code,
  .api-code,
  .tok-comment {
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
  }

  .panel-toolbar__search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .panel-select {
    max-width: 100%;
  }

  .hist-modal,
  .acct-modal {
    padding: 12px;
    align-items: flex-start;
  }

  .hist-modal__dialog,
  .acct-modal__dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: min(90vh, 640px);
    overflow: auto;
  }

  .panel-dialog,
  .ref-dialog,
  .nv-dialog {
    width: min(100%, calc(100vw - 24px));
    max-width: min(100%, calc(100vw - 24px));
  }

  .dash-notify__panel {
    width: min(360px, calc(100vw - 16px));
    right: 0;
    left: auto;
  }
}

@media (max-width: 640px) {
  .order-id {
    flex-wrap: wrap;
  }

  .order-id__code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .panel-toolbar .panel-select {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .panel-dialog__actions,
  .ref-dialog__actions,
  .acct-modal__actions {
    flex-wrap: wrap;
  }

  .panel-dialog__actions > *,
  .ref-dialog__actions > *,
  .acct-modal__actions > * {
    flex: 1 1 auto;
  }

  .site-footer__social {
    flex-wrap: wrap;
  }

  .site-footer__social-link {
    max-width: 100%;
  }

  .auth-otp {
    gap: 6px;
  }

  .auth-otp__digit {
    height: 46px;
    font-size: 18px;
    border-radius: 10px;
  }

  .dash-balance strong,
  .dash-page__subtitle {
    overflow-wrap: anywhere;
  }

  .dash-topnav__right {
    gap: 4px;
  }

  .acct-tabs__item {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}

@media (max-width: 430px) {
  .auth-otp {
    gap: 4px;
  }

  .auth-otp__digit {
    height: 42px;
    font-size: 16px;
  }

  .dash-main {
    width: calc(100% - 16px);
  }

  .dash-topnav__inner {
    width: calc(100% - 16px);
  }
}

@media (max-width: 360px) {
  .auth-otp__digit {
    height: 40px;
    font-size: 15px;
  }

  .site-footer__cols {
    grid-template-columns: 1fr;
  }
}

/* Landscape phones: keep sticky chrome usable */
@media (max-height: 480px) and (orientation: landscape) {
  .hist-modal__dialog,
  .acct-modal__dialog,
  .dash-notify__panel {
    max-height: calc(100vh - 24px);
  }

  .dash-nav {
    max-height: calc(100vh - 64px);
  }
}
