@media (max-width: 1279px) and (min-width: 768px) {
  .app-layout { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { width: 72px; }
  .brand-label, .nav-item span, .nav-section, .sidebar-status span:last-child, .account-copy { display: none; }
  .sidebar-brand { justify-content: center; }
  .sidebar-brand .brand { display: none; }
  .sidebar-toggle { transform: rotate(180deg); }
  .nav-item, .sidebar-status, .sidebar-account { justify-content: center; padding-inline: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  h1 { font-size: 21px; }
  .app-layout { display: block; min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { position: sticky; display: flex; height: 60px; padding: 0 16px; }
  .topbar-context { display: none; }
  .mobile-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
  .mobile-brand strong { white-space: nowrap; }
  .topbar-actions { gap: 8px; }
  .theme-form select { width: 74px; min-width: 74px; min-height: 44px; padding-inline: 6px; }
  .desktop-only { display: none; }
  .main-content { padding: 24px 16px 32px; }
  .page-header { margin-bottom: 20px; }
  .page-header.split { align-items: stretch; flex-direction: column; }
  .page-header.split .button { width: 100%; min-height: 44px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 118px; padding: 12px; }
  .metric-value { font-size: 19px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 14px; }
  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--background) 94%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
  }
  .mobile-nav-item {
    display: grid;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    text-decoration: none;
  }
  .mobile-nav-item svg { width: 22px; height: 22px; }
  .mobile-nav-item.active { color: var(--primary); }
  .mobile-nav-item.scan svg { color: var(--primary); }
  .mobile-nav-item.disabled { opacity: 0.58; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { min-height: 44px; }
  .table-panel { border: 0; background: transparent; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tr { display: grid; gap: 8px; margin-bottom: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
  td { display: flex; height: auto; min-height: 28px; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; text-align: right; }
  td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; font-weight: 600; text-align: left; text-transform: uppercase; }
  td:first-child { justify-content: flex-start; text-align: left; }
  td:first-child::before, td.row-action::before { display: none; }
  td.row-action form, td.row-action .button { width: 100%; }
  td.row-action .button { min-height: 44px; }
  .auth-header { padding: 18px 16px; }
  .auth-main { align-items: start; padding: 16px 12px 40px; }
  .auth-panel { padding: 20px 16px; }
  .field input, .field select { min-height: 44px; }
  .button.wide { min-height: 44px; }
}
