@media (max-width: 1120px) {
  :root { --sidebar: 84px; }
  .sidebar { padding-inline: 16px; }
  .brand { justify-content: center; }
  .brand div,
  .nav-item > span:not(.nav-count),
  .source-status div { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .nav-count { position: absolute; top: 2px; right: 5px; }
  .source-status { justify-content: center; padding-inline: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .analysis-grid { grid-template-columns: 1fr; }
  .mix-content { grid-template-columns: 170px 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    border-right: 0;
  }
  .brand,
  .source-status { display: none; }
  .primary-nav { grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; }
  .nav-item { min-height: 50px; grid-template-columns: 1fr; grid-template-rows: 22px 16px; gap: 0; font-size: 0.65rem; }
  .nav-item > span:not(.nav-count) { display: block; }
  .nav-item.is-active { color: var(--paper-100); background: var(--ink-800); }
  .nav-item.is-active .nav-count { background: var(--risk); }
  .workspace { width: 100%; margin: 0; padding: 18px 16px 90px; }
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 1rem; }
  .mobile-brand strong { font-family: var(--font-display); font-size: 0.95rem; }
  .title-group { grid-column: 1 / -1; grid-row: 2; }
  .title-group h1 { font-size: 1.35rem; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .button-secondary { width: 44px; padding: 0; }
  .button-secondary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .filter-bar { grid-template-columns: 1fr 1fr; margin: 20px 0 32px; }
  .filter-mode { grid-column: 1 / -1; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 1.5rem; }
  .text-button { min-width: 44px; justify-content: flex-end; }
  .text-button:not(.sort-button) { font-size: 0; }
  .text-button svg { width: 18px; height: 18px; }
  .kpi { padding: 18px 14px; }
  .kpi-value { font-size: 1.75rem; }
  .kpi-meta { align-items: flex-start; flex-direction: column; margin-top: 12px; }
  .decision-strip { grid-template-columns: 40px 1fr; padding: 18px; }
  .decision-icon { width: 40px; height: 40px; }
  .decision-strip .button { grid-column: 1 / -1; width: 100%; }
  .panel { padding: 18px 14px; }
  .chart-wrap { height: 210px; }
  .mix-content { grid-template-columns: 118px 1fr; gap: 16px; min-height: 230px; }
  .donut { width: 118px; height: 118px; }
  .donut::before { width: 76px; height: 76px; }
  .donut strong { font-size: 1.1rem; }
  .detail-tools { width: 100%; }
  .search-field { width: 100%; }
  .section-heading:has(.detail-tools) { flex-direction: column; }
  .table-full table,
  .table-full tbody,
  .table-full tr,
  .table-full td { display: block; width: 100%; }
  .table-full thead { display: none; }
  .table-full tr { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .table-full td { display: flex; height: auto; min-height: 32px; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; white-space: normal; }
  .table-full td::before { color: var(--paper-500); content: attr(data-label); font-size: 0.68rem; }
  .table-full td:first-child { margin-bottom: 5px; font-size: 0.9rem; }
  .table-full td:first-child::before,
  .table-full td:last-child::before { content: none; }
  .progress-cell { width: 150px; }
  .definition-grid { grid-template-columns: 1fr; gap: 24px; }
  .definition-step { grid-template-columns: 34px 1fr; gap: 12px; }
  .definition-step div { grid-template-columns: 1fr; }
  .business-details { grid-template-columns: 1fr; }
  .workspace-footer { flex-direction: column; }
  .detail-drawer { padding: 22px 18px 96px; }
}

@media (max-width: 460px) {
  .filter-bar { grid-template-columns: 1fr; }
  .filter-mode { grid-column: auto; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--border); }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .kpi:last-child { border-bottom: 0; }
  .mix-content { grid-template-columns: 1fr; justify-items: center; }
  .mix-legend { width: 100%; }
  .detail-tools { flex-direction: column; align-items: stretch; }
  .detail-tools select { width: 100%; }
  .decision-copy h3 { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
