/* Mobile behavior lives here; desktop keeps dense tables and the left rail. */
.mobile-only { display: none; }
.page-actions { display: flex; gap: 8px; }
.source-toggle { margin: 0 16px 16px; }
@media (max-width: 900px) {
  :root { font-size: 16px; }
  body { -webkit-text-size-adjust: 100%; }
  button, a, input, select { -webkit-tap-highlight-color: transparent; }
  button { min-height: 44px; font-size: 14px; }
  input, select, .filters input, .filters label input, .filters select { min-height: 48px; font-size: 16px; }
  .muted { font-size: 14px; }
  label { font-size: 14px; }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .login { display: block; min-height: 100dvh; }
  .login-card { width: auto; max-width: 430px; margin: auto; padding: 54px 24px 30px; }
  .login h1 { font-size: 32px; }
  .login-art { display: none; }
  .login form { margin-top: 32px; }
  .login-foot { font-size: 12px; }
  .sidebar { position: relative; width: 100%; min-height: 68px; padding: 18px 16px; border-right: 0; }
  .sidebar .brand { margin: 0; font-size: 24px; }
  .sidebar .brand span { font-size: 10px; }
  .sidebar > .eyebrow, .sidebar-foot > .dot, .sidebar-foot p { display: none; }
  .sidebar-foot { position: absolute; right: 14px; top: 11px; padding: 0; font-size: 0; }
  .sidebar-foot button { min-height: 44px; font-size: 13px; padding: 8px 12px; }
  .sidebar nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fdfef9; border-top: 1px solid var(--border); box-shadow: 0 -5px 20px #1b382909; }
  .sidebar nav button { display: flex; flex-direction: column; gap: 4px; justify-content: center; align-items: center; min-height: 54px; padding: 7px 2px; border-radius: 9px; }
  .sidebar nav button:not(.active) { background: transparent; }
  .sidebar nav button span { font-size: 12px; }
  .sidebar nav svg { width: 20px; height: 20px; }
  .workspace { margin: 0; width: 100%; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { display: none; }
  .page-heading { margin: 24px 0 20px; gap: 12px; align-items: flex-start; }
  .page-heading h1 { font-size: 27px; margin: 0; }
  .page-heading .eyebrow, .page-heading .muted { display: none; }
  .page-heading button { min-height: 44px; font-size: 13px; padding: 9px 11px; }
  .page-actions { flex-shrink: 0; }
  .filters { display: none; padding: 16px; margin-bottom: 16px; }
  .filters.expanded { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
  .filters label { min-width: 0; width: 100%; }
  .filters input, .filters select { width: 100%; max-width: 100%; }
  .filters button { min-height: 48px; font-size: 16px; }
  .notice { font-size: 13px; line-height: 1.7; margin-bottom: 18px; padding: 12px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
  .metric { padding: 18px 15px; }
  .metric .muted, .metric > span { font-size: 12px; }
  .metric strong { font-size: 32px; }
  .overview-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .panel { margin-bottom: 18px; }
  .panel-head { padding: 18px 16px; }
  .panel-head h2 { font-size: 17px; }
  .panel-head p { font-size: 13px; }
  .panel .table-scroll { max-height: none; overflow: visible; }
  .panel th { position: static; }
  .run-summary { padding: 20px 16px; gap: 12px; }
  .run-summary .muted { font-size: 14px; }
  .overview-grid .panel > p { padding: 0 16px; font-size: 14px; }
  .compact-table { table-layout: fixed; }
  .compact-table td, .compact-table th { padding: 12px 9px; font-size: 12px; }
  .pill { font-size: 12px; padding: 5px 8px; white-space: normal; width: fit-content; }
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table td { display: grid; grid-template-columns: 88px minmax(0,1fr); align-items: start; gap: 12px; width: 100%; max-width: none; border: 0; padding: 7px 0; font-size: 15px; line-height: 1.65; }
  .responsive-table td::before { content: attr(data-label); color: #8a9689; font-size: 13px; }
  .responsive-table td strong { font-size: 16px; }
  .responsive-table td small { max-width: none; font-size: 13px; }
  .document-links { gap: 5px; }
  .document-links .text-button { min-height: 44px; font-size: 14px; line-height: 1.6; padding: 8px 0; }
  .pagination { align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
  .pagination .muted { font-size: 13px; }
  .pagination button { min-height: 44px; font-size: 14px; padding: 9px 14px; }
  .empty-state { padding: 35px 20px; font-size: 15px; }
  details summary { min-height: 44px; padding: 10px 0; font-size: 14px; }
  .page-footer { font-size: 11px; line-height: 1.7; }
  .panel svg { padding: 12px 8px; }
  .panel svg text { font-size: 12px; }
  .reading { overflow: hidden; }
  dialog#reader { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; overflow: hidden; }
  dialog#reader[open] { display: flex; flex-direction: column; }
  .reader-head { flex-shrink: 0; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; gap: 12px; }
  .reader-head > div { min-width: 0; }
  .reader-head h2 { font-size: 16px; line-height: 1.5; margin: 0; }
  .reader-head .eyebrow { display: none; }
  .reader-head button { min-height: 44px; font-size: 14px; }
  .document-meta { flex-shrink: 0; padding: 10px 16px; max-height: 96px; overflow: auto; font-size: 12px; gap: 8px 12px; }
  .document-meta .hash { display: none; }
  .reader-tabs { flex-shrink: 0; padding: 6px 12px 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .reader-tabs button { min-height: 44px; font-size: 14px; padding: 9px 4px; }
  .reader-tabs .secondary { grid-column: 1 / -1; margin: 0; font-size: 13px; }
  .document-content { flex: 1; min-height: 0; max-height: none; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); overflow: auto; overscroll-behavior: contain; }
  .markdown { font-size: 16px; line-height: 1.9; }
  .markdown li { margin-bottom: 18px; }
  .original, .markdown pre, details pre { font-size: 13px; line-height: 1.8; }
  .markdown .md-table { white-space: pre; overflow-x: auto; }
}
@media (max-width:900px) {
  .ticker-link { min-height:44px; font-size:16px; }
  .stock-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stock-metrics .metric:last-child { grid-column:1 / -1; }
  .stock-health { grid-template-columns:minmax(0,1fr); gap:0; }
  .stock-state { padding:16px; }
  .stock-context { font-size:14px; }
  .stock-coverage { align-items:flex-start; flex-wrap:wrap; }
  .stock-actions { display:grid; grid-template-columns:1fr; }
  [data-current-view="stock"] .page-heading { flex-wrap:wrap; }
  [data-current-view="stock"] .page-actions { margin-left:auto; }
}
@media (max-width:900px) {
 .chart-toolbar { padding:14px 14px 0; flex-wrap:wrap; }
 .chart-toolbar>.muted { font-size:12px; }
 .chart-modes button { min-height:44px; font-size:14px; padding:8px 16px; }
 .chart-readout { font-size:14px; padding:10px 14px; gap:4px; }
 .chart-readout>* { flex-basis:100%; }
 .chart-note { font-size:12px; padding:4px 14px 16px; }
 .raw-data>summary { min-height:48px; padding:14px 16px; font-size:15px; }
}
@media (max-width:900px) {
 .sec-document { font-size:16px; }
 .document-table table { font-size:14px; }
 .document-table td,.document-table th { padding:10px; }
}
