.dashboard-page .dashboard-layout { display: flex; min-width: 0; }
.dashboard-page .main-content, .dashboard-page #content-area { min-width: 0; max-width: 100%; }
.dashboard-page #content-area .grid > * { min-width: 0; }
.dashboard-page .sidebar-nav { width: 240px; flex: 0 0 240px; }
@media (min-width: 769px) {
  .dashboard-page .sidebar-nav { position: sticky; top: 64px; height: calc(100dvh - 64px); align-self: flex-start; overflow-y: auto; }
  .dashboard-page #dashboard-sidebar nav { position: static; min-height: 100%; box-sizing: border-box; }
}
.sidebar-contacts { padding-top: 24px; display: flex; flex-direction: column; gap: 4px; }
#dashboard-menu-toggle { display: none; }
.dashboard-drawer-backdrop, .dashboard-drawer-heading, .dashboard-drawer-logout { display: none; }
.dashboard-page #response-area { overflow-wrap: anywhere; }
.dashboard-page #response-area pre { max-width: 100%; overflow-x: auto; }
@media (max-width: 768px) {
  .dashboard-page .dashboard-layout { flex-direction: column; }
  .dashboard-page .site-header { height: auto; }
  .dashboard-page .dashboard-header-inner { position: relative; display: flex; flex-wrap: wrap; height: auto; padding: 12px; gap: 12px; }
  .dashboard-page #dashboard-menu-toggle { position: absolute; top: 6px; right: 8px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; flex: none; color: var(--c-ink); border-radius: 8px; }
  .dashboard-page #dashboard-menu-toggle:focus-visible { outline: 2px solid var(--c-brand); }
  .dashboard-page .dashboard-header-inner > .dashboard-profile { flex: 1 1 100%; min-width: 0; padding-right: 48px; min-height: 32px; }
  .dashboard-page .dashboard-header-inner > .ml-auto { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; width: 100%; margin: 0; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--c-line-soft); }
  .dashboard-page .dashboard-header-inner > .ml-auto > div { min-width: 0; height: 36px; }
  .dashboard-page .dashboard-header-inner > .ml-auto > div:nth-child(2) { justify-content: center; padding-inline: 8px; }
  .dashboard-page #logout-btn { display: none; }
  .dashboard-page #header-balance { font-size: 12px; white-space: nowrap; }
  .dashboard-page #topup-header-btn { height: 36px; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
  .dashboard-page .sidebar-nav { display: flex; flex-direction: column; position: fixed; inset: 0 0 0 auto; z-index: 101; width: min(340px, 88vw); height: 100dvh; flex: none; border: 0; border-left: 1px solid var(--c-line-soft); background: var(--c-bg-deep); backdrop-filter: none; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; overflow-y: auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .dashboard-page .sidebar-nav.mobile-open { transform: translateX(0); visibility: visible; }
  .dashboard-page .sidebar-nav nav { position: static; display: flex; flex-direction: column; gap: 6px; padding: 16px; overflow: visible; }
  .dashboard-page .sidebar-nav .nav-item { display: flex; width: 100%; margin: 0; padding: 12px 16px; gap: 12px; white-space: normal; }
  .dashboard-drawer-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--c-line-soft); font-size: 18px; color: var(--c-ink); }
  .dashboard-drawer-heading button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; }
  .dashboard-drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 100; background: #0009; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
  .dashboard-drawer-backdrop.open { opacity: 1; visibility: visible; }
  .dashboard-page .dashboard-drawer-logout { display: flex; align-items: center; justify-content: center; gap: 10px; margin: auto 20px 20px; padding: 12px; border: 1px solid var(--c-line-soft); border-radius: 8px; color: var(--c-ink-soft); }
  .dashboard-page .main-content { width: 100%; padding: 20px 12px; }
  .dashboard-page #content-area > .grid { display: grid; grid-template-columns: minmax(0, 1fr); }
  .dashboard-page #content-area > .grid > div { padding: 16px; }
  .dashboard-page #response-area { min-height: 220px; }
  .dashboard-page .keys-panel > .flex { flex-direction: column; align-items: stretch; gap: 12px; }
  .dashboard-page #keys-list > div > .flex { flex-wrap: wrap; gap: 12px; }
  .dashboard-page .usage-totals, .dashboard-page .usage-filters { grid-template-columns: minmax(0, 1fr); }
  .dashboard-page .modal-box { max-height: calc(100dvh - 32px); overflow-y: auto; padding: 16px; }
  .dashboard-page input, .dashboard-page textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-page .sidebar-nav, .dashboard-drawer-backdrop { transition: none; }
}
