/* The dense data matrix follows the supplied reference; the app shell is preserved. */
.app:has(#page-trends:not([hidden])) { width:100%; max-width:none; }
.main:has(#page-trends:not([hidden])) { width:100%; min-width:0; max-width:none; box-sizing:border-box; }
#page-trends { min-width:0; max-width:100%; }
.trend-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; margin:16px 0; }
.trend-windows { display:flex; flex-wrap:wrap; gap:7px; }
.trend-windows button, .trend-tools button { min-height:40px; padding:8px 12px; border:1px solid var(--line); border-radius:7px; background:var(--surf-1); color:var(--fg); font:inherit; cursor:pointer; }
.trend-windows button[aria-pressed="true"] { color:#a52c42; border-color:#d44058; background:#fff1f3; font-weight:700; }
.trend-tools-options { display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.trend-tools label { display:flex; align-items:center; gap:6px; }
.trend-tools input[type="checkbox"] { width:18px; height:18px; margin:0; }
.trend-tools select { width:auto; padding:8px; min-height:40px; }
.trend-summary { font-size:14px; line-height:1.7; color:var(--fg-2); }
.trend-warning { background:#fff6df; color:#735417; border-left:3px solid #bf8c31; padding:12px; margin:12px 0; font-size:14px; }
.trend-status { min-height:24px; color:var(--fg-2); }
.trend-scroll { width:100%; max-height:70vh; overflow:auto; overscroll-behavior:contain; border:1px solid #d8dde3; background:white; position:relative; scrollbar-gutter:stable; }
.trend-table { width:1682px; min-width:1682px; table-layout:fixed; border-collapse:separate; border-spacing:0; font-family:var(--mono); font-size:12px; line-height:1; color:#243242; }
.trend-table caption { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
.trend-table th,.trend-table td { height:29px; box-sizing:border-box; padding:0; text-align:center; border-right:1px solid #e0e4e8; border-bottom:1px solid #e0e4e8; white-space:nowrap; font-weight:400; }
.trend-table thead th { position:sticky; top:0; background:#f0e5c8; z-index:3; font-weight:600; height:28px; color:#3c3830; }
.trend-table thead tr:nth-child(2) th { top:28px; }
.trend-table .trend-issue { position:sticky; left:0; width:82px; min-width:82px; background:#f8fafb; z-index:2; font-weight:600; }
.trend-table .trend-week { position:sticky; left:82px; width:36px; min-width:36px; background:#f8fafb; z-index:2; }
.trend-table thead .trend-issue,.trend-table thead .trend-week { z-index:5; background:#f0e5c8; }
.trend-table .trend-zone-start { border-left:2px solid #c6cfd9; }
.trend-table .trend-front { background:#fff5f6; }
.trend-table .region-1 { background:#f0f6fc; }
.trend-table .trend-back { background:#f3f7fd; }
.trend-hit { display:inline-flex; width:23px; height:23px; align-items:center; justify-content:center; border-radius:50%; background:#d44058; color:#fff; font-weight:700; }
.trend-back .trend-hit { background:#346bc6; }
.trend-miss { color:#a35f6a; font-size:11px; }
.trend-back .trend-miss,.region-1 .trend-miss { color:#577694; }
.trend-hide-misses .trend-miss { visibility:hidden; }
.trend-table .trend-gap>* { border-top:3px dashed #b93646; }
.trend-table tfoot th,.trend-table tfoot td { background:#eef4f9; color:#344e69; height:30px; }
.trend-table .trend-stat-label { position:sticky; left:0; z-index:2; font-size:11px; font-weight:600; }
.trend-mark-row td,.trend-mark-row th { background:#f4f4f4!important; }
.trend-mark-row button { background:none; border:0; color:#616d78; padding:0; width:100%; height:28px; font:inherit; cursor:pointer; }
.trend-mark-row button[aria-pressed="true"] { background:#d44058; color:white; font-weight:700; }
.trend-mark-row .trend-back button[aria-pressed="true"] { background:#346bc6; }
.trend-mark-row td[colspan] button { width:auto; padding:0 10px; color:#176f67; text-decoration:underline; }
.trend-help { margin-top:18px; color:var(--fg-2); font-size:13px; line-height:1.8; }
.trend-help summary { cursor:pointer; font-weight:600; color:var(--fg); }
.trend-help p { margin:8px 0; }
.trend-tools button:focus-visible,.trend-mark-row button:focus-visible { outline:3px solid #176f67; outline-offset:-3px; }
@media(max-width:599px) {
  .trend-tools { gap:10px; }
  .trend-windows { width:100%; gap:5px; }
  .trend-windows button { flex:1 0 auto; padding:8px; font-size:13px; }
  .trend-scroll { max-height:65vh; }
  .trend-tools-options { gap:10px; font-size:13px; }
  .trend-mark-row button { min-height:32px; }
}
