/* UI 20260309-6D3A mobile action hierarchy */

@media (max-width: 820px) {
  .page-shell {
    gap: 10px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 12px;
    gap: 10px;
    backdrop-filter: blur(12px);
  }

  .brand-block {
    gap: 10px;
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 1rem;
  }

  .brand-block h1 {
    font-size: 1rem;
    line-height: 1.1;
  }

  .brand-block .subline {
    display: none;
  }

  .topbar-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .topbar-meta .pill,
  .topbar-meta button {
    min-height: 32px;
    font-size: .76rem;
    justify-content: center;
    width: 100%;
  }

  .command-bar {
    padding: 10px 10px 8px;
    gap: 10px;
  }

  .command-bar .command-section-title {
    margin-bottom: 6px;
    font-size: .76rem;
    letter-spacing: .04em;
  }

  .command-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .command-actions button {
    min-height: 38px;
    font-size: .84rem;
    padding: 0 10px;
  }

  /* Priority actions first, lower-value actions softened */
  .command-actions [data-shell-action="goto-runs"],
  .command-actions [data-shell-action="goto-orders"],
  .command-actions [data-shell-action="goto-portfolio"],
  .command-actions [data-shell-action="goto-reports"] {
    order: 1;
  }

  .command-actions [data-shell-action="goto-strategies"],
  .command-actions [data-shell-action="goto-broker"],
  .command-actions [data-shell-action="goto-overview"],
  .command-actions [data-shell-action="goto-maintenance"] {
    order: 2;
  }

  .command-actions [data-shell-action="refresh"],
  .command-actions [data-shell-action="logout"] {
    order: 3;
    opacity: .82;
  }

  .command-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .command-chip {
    min-height: 0;
    padding: 9px 10px;
  }

  .command-chip span {
    font-size: .7rem;
  }

  .command-chip strong {
    font-size: .82rem;
    line-height: 1.15;
  }

  .utility-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .utility-caption {
    display: none;
  }

  .utility-left,
  .utility-right {
    gap: 6px;
    flex-wrap: wrap;
  }

  .utility-inline {
    font-size: .78rem;
  }

  /* Reduce first-fold noise inside dashboard-style modules */
  .dashboard-panel {
    gap: 12px;
  }

  .dashboard-card {
    border-radius: 16px;
  }

  details.dashboard-card > summary {
    min-height: 22px;
  }

  /* Make tables less punishing on mobile */
  .dashboard-card table {
    min-width: 640px !important;
  }

  /* Give mobile tab bar more breathing room */
  #mobileTabBar {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 9px 10px;
  }

  .topbar-meta {
    grid-template-columns: 1fr 1fr;
  }

  .command-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .command-actions button {
    min-height: 36px;
    font-size: .82rem;
  }

  .command-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .command-chip:last-child {
    grid-column: 1 / -1;
  }
}
