/* ── Responsive overrides (from ui-theme.css) ── */
@media (max-width: 1100px) {
  .app-shell {
    padding: 16px 10px 24px;
  }

  .wrap,
  .shell {
    padding: 14px 10px 24px;
  }

  .top-actions .btn,
  .actions .btn {
    flex: 1 1 calc(50% - 5px);
  }

  .shell .content {
    grid-template-columns: 1fr;
  }

  .shell .list-panel {
    position: static;
    max-height: 52vh;
  }
}

@media (max-width: 760px) {
  .home-brand-hero,
  .home-brand-hero.is-compact {
    align-items: flex-start;
  }

  .wrap,
  .shell {
    gap: var(--mobile-page-gap);
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .btn,
  .tab-btn,
  .dock-btn {
    min-height: var(--mobile-touch-height);
    font-size: 0.94rem;
  }

  .inline-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .top-actions,
  .actions,
  .row-actions {
    width: 100%;
    align-items: stretch;
  }

  .inline-form .btn,
  .top-actions .btn,
  .actions .btn,
  .wrap .inline-actions .btn,
  .inline-actions .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .app-shell .top-main .top-name {
    font-size: 1.5rem;
  }

  .mobile-dock {
    margin-bottom: calc(6px + env(safe-area-inset-bottom));
  }

  .shell .topbar {
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .shell .topbar .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inline-actions select,
  .top-actions select,
  .actions select,
  .row-actions select,
  .inline-actions input:not([type="checkbox"]):not([type="radio"]),
  .top-actions input:not([type="checkbox"]):not([type="radio"]),
  .actions input:not([type="checkbox"]):not([type="radio"]),
  .row-actions input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    flex: 1 1 100%;
  }

  .wrap .card,
  .app-shell .top-card,
  .shell .panel,
  .shell .table-wrap,
  .shell .list-panel,
  .shell .viewer-panel {
    border-radius: var(--mobile-card-radius);
    padding: var(--mobile-card-padding);
  }

  .app-wrap {
    max-width: 100%;
  }

  .app-wrap .module-topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 8px;
  }

  .app-wrap .module-topbar .aca-brand-inline,
  .app-wrap .module-topbar .title,
  .app-wrap .module-topbar .sub,
  .app-wrap .module-topbar .inline-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .app-wrap .module-topbar .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .app-wrap .module-topbar .inline-actions .btn {
    width: auto;
    flex: initial;
  }

  .app-wrap .form-grid {
    grid-template-columns: 1fr;
  }

  .app-wrap input:not([type="checkbox"]):not([type="radio"]),
  .app-wrap select,
  .app-wrap .btn,
  .app-wrap .inline-actions .btn,
  .app-wrap .inline-actions select,
  .app-wrap .inline-actions input:not([type="checkbox"]):not([type="radio"]) {
    min-height: var(--mobile-touch-height);
  }

  .shell .viewer-wrap {
    min-height: 68vh;
    height: 68vh;
  }

  .wrap .title {
    font-size: 1.4rem;
  }

  .wrap .sub {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .home-brand-hero,
  .home-brand-hero.is-compact {
    flex-direction: column;
    gap: 12px;
  }

  .aca-logo-badge.is-home .aca-logo {
    width: 84px;
  }

  .aca-logo-badge.is-home-compact .aca-logo {
    width: 68px;
  }

  .app-shell {
    padding: 10px 8px 20px;
  }

  .wrap,
  .shell {
    padding: 10px 8px 20px;
    gap: 8px;
  }

  .app-shell .top-main {
    padding: 14px 16px;
  }

  .app-shell .top-main .top-name {
    font-size: 1.3rem;
  }

  .wrap .title {
    font-size: 1.25rem;
  }

  .wrap .title-sm {
    font-size: 1rem;
  }

  .wrap .sub,
  .shell .sub {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .wrap .card,
  .app-shell .top-card,
  .shell .panel,
  .shell .table-wrap,
  .shell .list-panel,
  .shell .viewer-panel {
    padding: 12px;
  }

  .inline-form .btn {
    min-width: 0;
  }

  .shell .topbar h1 {
    font-size: 1.2rem;
  }

  .bg-control {
    width: 100%;
    justify-content: space-between;
  }

  .switch-inline {
    width: 100%;
  }
}
