/* Optional shared workspace; reading forms and mobile keep their natural width. */
.layout-toggle { display:inline-flex; align-items:center; justify-content:center; gap:6px; flex-shrink:0;
  min-height:34px; padding:6px 9px; border:1px solid var(--t-line-strong); border-radius:7px;
  background:transparent; color:var(--t-ink-muted); font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
.layout-toggle svg { width:18px; height:18px; }
.layout-toggle:hover,.layout-toggle[aria-pressed="true"] { color:var(--t-accent-ink); border-color:var(--t-accent-ink); background:var(--t-surface-alt); }
.layout-toggle:focus-visible { outline:2px solid var(--t-accent-ink); outline-offset:3px; }
@media (max-width:1439px) { .layout-toggle [data-layout-label] { display:none; } }
@media (max-width:767px) { .layout-toggle { display:none; } }
@media (min-width:1024px) {
  html[data-layout="wide"] { --layout-gutter:clamp(24px,2vw,56px); }
  html[data-layout="wide"] body:not(.agents-embedded) > main.site-main:not([data-layout-fixed]),
  html[data-layout="wide"] .app-container,
  html[data-layout="wide"] .w-top-inner,
  html[data-layout="wide"] .w-sub-inner,
  html[data-layout="wide"] .w-footer-inner,
  html[data-layout="wide"] .w-wrap { max-width:none; }
  html[data-layout="wide"] body:not(.agents-embedded) > main.site-main:not([data-layout-fixed]),
  html[data-layout="wide"] .w-top-inner,
  html[data-layout="wide"] .w-sub-inner,
  html[data-layout="wide"] .w-footer-inner { padding-left:var(--layout-gutter); padding-right:var(--layout-gutter); }
}
/* Dashboard composition starts at laptop widths, not only ultra-wide monitors. */
@media (min-width:1280px) {
  html[data-layout="wide"] { --layout-gutter:24px; }
  html[data-layout="wide"] .history-wide-panels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
  html[data-layout="wide"] .history-wide-panels > * { min-width:0; grid-column:1/-1; margin-top:0; }
  html[data-layout="wide"] .history-wide-panels > [data-wide-chart],
  html[data-layout="wide"] .history-wide-panels > #techSection { grid-column:auto; }
  html[data-layout="wide"] .history-wide-panels > [data-wide-chart] { padding:16px; }
  html[data-layout="wide"] #marketsContent { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
  html[data-layout="wide"] #marketsContent > * { min-width:0; grid-column:1/-1; }
  html[data-layout="wide"] #marketsContent > .mk-section { grid-column:auto; margin-top:0; }
  html[data-layout="wide"] #marketsContent > #market-summary { grid-column:1/-1; }
  /* Inner chart pairs need a readable column inside each half-width section. */
  html[data-layout="wide"] #marketsContent > .mk-section > .grid { grid-template-columns:minmax(0,1fr); }
  html[data-layout="wide"] .mk-banner { margin-bottom:12px; }
  html[data-layout="wide"] .ms-index-scores { margin:10px 0; gap:8px; }
  html[data-layout="wide"] .ms-index-choice { padding:8px 12px; gap:2px; }
  html[data-layout="wide"] .ms-index-choice b { font-size:21px; }
  html[data-layout="wide"] .ms-main { margin:10px 0; gap:14px; }
  html[data-layout="wide"] .ms-score strong { font-size:32px; }
  html[data-layout="wide"] #debateBody { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(360px,1fr); gap:12px 20px; align-items:start; }
  html[data-layout="wide"] #debateBody > * { min-width:0; grid-column:1/-1; margin-top:0; }
  html[data-layout="wide"] #debateBody > .nt-wrap { grid-column:1; margin-bottom:0; }
  html[data-layout="wide"] #debateBody > .nt-inspector { grid-column:2; margin-bottom:0; }
  html[data-layout="wide"] .nt-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:16px; }
  html[data-layout="wide"] .nt-summary > :not(.nt-summary-part) { grid-column:1/-1; }
  html[data-layout="wide"] .nt-summary-part { margin-top:0; padding-top:12px; }
  html[data-layout="wide"] #maPage:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start; }
  html[data-layout="wide"] #maPage > * { min-width:0; margin-bottom:0; }
  html[data-layout="wide"] #maPage > :nth-child(-n+3),
  html[data-layout="wide"] #maPage > .ma-note { grid-column:1/-1; }
}
@media (min-width:1600px) {
  html[data-layout="wide"] #market-summary { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:20px; align-items:start; }
  html[data-layout="wide"] #market-summary > * { min-width:0; margin-bottom:0; }
  html[data-layout="wide"] #indexCards[data-scope="us"] { grid-template-columns:minmax(0,1fr); }
  html[data-layout="wide"] #indexCards[data-scope="us"] > button { padding:12px 16px; }
  html[data-layout="wide"] .mo-main { grid-template-columns:minmax(0,1fr) minmax(0,400px); }
  html[data-layout="wide"] #maPage > :first-child { grid-column:1; }
  html[data-layout="wide"] #maPage > :nth-child(2) { grid-column:2; }
}
@media (min-width:2000px) {
  html[data-layout="wide"] .history-wide-panels { grid-template-columns:repeat(3,minmax(0,1fr)); }
  html[data-layout="wide"] .fd-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
  html[data-layout="wide"] #marketsContent > .mk-section > .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html[data-layout="wide"] #market-summary { grid-template-columns:minmax(0,1.7fr) minmax(0,1fr); }
}
@media (min-width:2200px) {
  /* Keep the scatterplot large enough for labels while exposing its neighbours. */
  html[data-layout="wide"] .sm-chart-box { height:clamp(440px,48vh,620px); }
  html[data-layout="wide"] .sm-main { grid-template-columns:minmax(620px,1fr) minmax(820px,1.35fr) minmax(420px,.85fr); grid-template-areas:"list chart detail"; }
}
/* Agent reports: read independent analyses side by side in the wide workspace. */
@media (min-width:1280px) {
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; align-items:start;
  }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) > :is(.ag-team,.ag-preamble) {
    grid-column:1/-1; min-width:0;
  }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) > .ag-team { margin:12px 0 0; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) > .ag-turn { margin:0; min-width:0; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-report { overflow-wrap:anywhere; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) :is(table,pre) {
    display:block; max-width:100%; overflow-x:auto;
  }
  html[data-layout="wide"] body:not(.agents-embedded) #agDock { right:var(--layout-gutter); }
}
/* Denser report workspace: controls align as a toolbar; prose retains room to read. */
@media (min-width:1280px) {
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm { padding:16px 18px; margin-bottom:16px; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) {
    display:grid; grid-template-columns:minmax(140px,1fr) minmax(160px,1fr) minmax(240px,1.5fr) auto auto;
    gap:8px 14px; align-items:end;
  }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) > * { grid-column:1/-1; min-width:0; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-form-grid { display:contents; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-form-field:nth-child(1) { grid-column:1; grid-row:1; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-form-field:nth-child(2) { grid-column:2; grid-row:1; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-form-actions { grid-column:4; grid-row:1; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-form-quota { grid-column:5; grid-row:1; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm:has(.ag-run-opts) .ag-run-opts { grid-column:3; grid-row:1; margin:0; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm .ag-run-opt { min-width:0; width:100%; }
  html[data-layout="wide"] body:not(.agents-embedded) #agRunForm .ag-tier-note { margin:0; }
  html[data-layout="wide"] body:not(.agents-embedded) #agCurrent { padding:18px; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) { gap:12px 18px; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-turn { gap:8px; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-avatar { width:28px; height:28px; font-size:15px; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-bubble { padding:12px 14px; border-radius:9px; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-bubble .ag-report { font-size:13px; line-height:1.65; }
  html[data-layout="wide"] body:not(.agents-embedded) :is(#agReport,#agSampleReport) .ag-report p { margin:.55em 0; }
}
