/* Shared responsive layer. Preserve the selected font/theme and native zoom. */
@media screen {
 html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
 .main,.card,.field,.form-grid,.grid,.page-title,.section-actions,.filters { min-width:0; }
 .main { max-width:100%; }
 .card { overflow-wrap:anywhere; }
 .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .form-grid>* { min-width:0; }
 input,select,textarea { max-width:100%; min-width:0; }
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,.btn,button { min-height:44px; }
 input[type=checkbox],input[type=radio] { width:20px; height:20px; min-height:20px; flex:0 0 20px; accent-color:var(--primary); }
 label { line-height:1.6; }
 .btn,button { white-space:normal; overflow-wrap:anywhere; }
 .btn { max-width:100%; text-align:center; }
 .section-actions,.card-head { flex-wrap:wrap; gap:12px; }
 .filters { flex-wrap:wrap; max-width:100%; }
 .filters>* { min-width:0; max-width:100%; }
 .table-wrap { width:100%; max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
 .table-wrap:focus-visible { outline:3px solid var(--primary); outline-offset:2px; }
 .table-scroll-hint { margin:0 0 8px; font-size:calc(14px * var(--text-factor,1)); color:var(--muted); }
 .table-scroll-hint[hidden] { display:none; }
 .main img,.main video { max-width:100%; }
 .main pre { max-width:100%; overflow:auto; }
 .main dd { margin-left:0; overflow-wrap:anywhere; }
 .main h1,.main h2,.main h3 { line-height:1.5; overflow-wrap:anywhere; }
 .tc-kpis { grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr)); }
 .tc-nav,.report-tabs,.dashboard-tabs { flex-wrap:wrap; max-width:100%; }
 .tc-buttons>* { min-width:0; max-width:100%; }
 .tc-radio { min-height:44px; line-height:1.6; }
 .tc-coverage-map { height:clamp(240px,55vh,480px); }
 .preferences-panel { max-height:70dvh; }
 @media(max-width:1024px) {
  .sidebar { width:min(320px,90vw); transform:translateX(-100%); z-index:50; transition:transform .2s ease; }
  .sidebar.open { transform:translateX(0); }
  .sidebar-backdrop:not([hidden]) { display:block; position:fixed; inset:0; background:#102a3d80; z-index:49; }
  .main { margin-left:0; padding:0 clamp(12px,3vw,24px) 28px; }
  .menu-toggle { display:inline-flex; align-items:center; justify-content:center; min-width:44px; color:var(--primary); }
  .topbar { height:auto; min-height:90px; display:grid; grid-template-columns:44px auto minmax(0,1fr); gap:8px; padding:12px 0; }
  .topbar .menu-toggle { grid-column:1; grid-row:1; }
  .topbar-brand { grid-column:2; grid-row:1; width:48px; height:48px; margin:0; }
  .topbar-brand img { max-width:100%; max-height:100%; object-fit:contain; }
  .topbar .page-title { grid-column:3; grid-row:1; }
  .topbar .page-title h1 { font-size:calc(21px * var(--text-factor,1)); white-space:normal; overflow:visible; text-overflow:clip; }
  .topbar .page-title p { display:none; }
  .topbar-actions { grid-column:1/-1; grid-row:2; flex-wrap:wrap; justify-content:space-between; gap:8px; width:100%; }
  .preferences-panel { left:0; right:auto; }
  .grid.two-col { grid-template-columns:minmax(0,1fr); }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
 }
 @media(max-width:640px) {
  .form-grid { grid-template-columns:minmax(0,1fr)!important; gap:16px; }
  .card { padding:16px 12px; border-radius:10px; }
  .card h1 { font-size:calc(24px * var(--text-factor,1)); }
  .card h2 { font-size:calc(21px * var(--text-factor,1)); }
  .card h3 { font-size:calc(19px * var(--text-factor,1)); }
  .filters { width:100%; }
  .filters>*,.filters select { flex:1 1 100%; min-width:0; width:100%; }
  .tc-buttons,.tc-nav { display:grid; grid-template-columns:minmax(0,1fr); }
  .tc-buttons .btn,.tc-nav .btn { width:100%; }
  .tc-table td,.tc-table th { min-width:110px; padding:12px 10px; }
  .tc-table { font-size:calc(16px * var(--text-factor,1)); }
  .tc-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .tc-kpi { padding:12px; min-width:0; }
  .tc-targets { max-height:65dvh; }
  .tc-question { padding:10px; }
  .media-actions { grid-template-columns:minmax(0,1fr); }
  .chart-box { max-width:100%; }
  .portal-footer { overflow-wrap:anywhere; }
 }
 @media(max-width:380px) {
  .main .tc-kpis,.stats { grid-template-columns:minmax(0,1fr); }
  .preferences-panel { padding:12px; }
 }
 @media(prefers-reduced-motion:reduce) { .sidebar { transition:none; } }
}
@media print { .table-scroll-hint { display:none!important; } }
