@media screen {
  .preview-badge {font:600 13px/1.4 Arial,sans-serif;color:#bfafdf;border-bottom:1px solid #56617d;padding:9px 0}
  .annual-overview {margin:28px 0 42px}
  .summary-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:20px 24px;border:1px solid #66718b;border-radius:16px;background:#182339}
  .summary-metrics>div {min-width:0;display:flex;flex-direction:column;gap:10px}
  .summary-metrics span {font-size:15px;line-height:1.4;font-weight:700;color:#c8cfe4}
  .summary-metrics strong {font:700 clamp(25px,3.2vw,36px)/1.2 Georgia,serif;color:#f0effa;overflow-wrap:anywhere}
  .period-partial {color:#ffc17b;font-weight:700}
  .history-panel {grid-column:1/-1}
  .history-controls {display:flex;flex-wrap:wrap;gap:14px;align-items:end}
  .history-controls label {min-width:0;max-width:100%}
  .history-controls select {max-width:100%;text-overflow:ellipsis}
  .history-scroll {overflow-x:auto;padding:12px 0 8px}
  .history-bars {display:grid;grid-template-columns:repeat(12,minmax(95px,1fr));min-width:1140px;gap:9px;padding:4px 12px 0}
  .history-column {text-align:center;border-radius:8px;padding:0 5px 10px;font:13px Arial,sans-serif}
  .history-chosen {background:#7191be24;box-shadow:inset 0 0 0 1px #9bbbd0}
  .history-track {height:250px;display:flex;align-items:end;justify-content:center;border-bottom:1px solid #7885a0;margin-bottom:12px;background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#afc4e71a 50px)}
  .history-track button {width:52px;min-height:3px;background:#75bbae;border:0;position:relative;border-radius:5px 5px 0 0;cursor:pointer}
  .history-track button[aria-pressed=true] {background:#bca1e3}
  .history-track b {position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);font:700 13px Arial,sans-serif;color:#edf2ff;white-space:nowrap}
  .history-missing {align-self:center;color:#b9c5da;font-size:25px}
  .history-missing small {display:block;font:11px Arial,sans-serif}
  .history-table-scroll {overflow-x:auto}
  .history-table {border-collapse:collapse;width:100%;font:14px Arial,sans-serif}
  .history-table th,.history-table td {padding:10px;text-align:left;border-bottom:1px solid #46516a}
  .weekly-comparison {border-top:1px solid #46516a;padding-top:16px;margin-top:20px}
  .expand-graph,.graph-close {border:1px solid #8f91ae;padding:9px 13px;border-radius:8px;background:#243149;color:#f5f3ff;cursor:pointer;font:600 13px Arial,sans-serif}
  .expand-graph {margin-left:auto;align-self:start}
  .panel-head {flex-wrap:wrap;gap:12px}
  .graph-dialog {color:#f1f4ff;background:#0e172b;border:1px solid #9d8bb8;border-radius:16px;width:min(1400px,96vw);max-width:96vw;max-height:94dvh;padding:0;overflow:auto}
  .graph-dialog::backdrop {background:#030817cc}
  .graph-dialog-head {display:flex;justify-content:space-between;align-items:center;gap:20px;position:sticky;top:0;z-index:20;background:#131d32;border-bottom:1px solid #56617d;padding:14px 22px}
  .graph-dialog-head h2 {font-size:22px;margin:0;letter-spacing:normal;line-height:1.25;min-width:0;overflow-wrap:anywhere}
  .graph-dialog-body {padding:16px}
  .graph-dialog .expanded-card {transform:none!important;margin:0!important;width:100%;box-shadow:none}
  .graph-dialog .chart-controls {position:sticky;top:69px;z-index:10;background:#172338;padding:12px;border:1px solid #4b5874;border-radius:10px}
  .graph-dialog .history-controls {top:69px}
  .graph-dialog .expanded-card>.panel-head .expand-graph {display:none}
  @media(max-width:640px) {
    .summary-metrics {grid-template-columns:1fr;padding:18px}
    .summary-metrics>div {padding-bottom:12px;border-bottom:1px solid #4b5874}
    .summary-metrics>div:last-child {border-bottom:0;padding-bottom:0}
    .history-controls {flex-direction:column;align-items:stretch}
    .history-controls select {width:100%}
    .graph-dialog-head {padding:12px;gap:10px;align-items:start}
    .graph-dialog-head h2 {font-size:18px}
    .graph-close {max-width:130px;flex-shrink:0}
    .graph-dialog-body {padding:8px}
    .graph-dialog .chart-controls {top:75px;gap:8px}
    .graph-dialog .expanded-card {padding:14px}
  }
}
@media print {
  .review-addition,.graph-dialog {display:none!important}
}
@media screen{.partial-attendance{padding:18px 22px;border:1px solid #66718b;border-radius:14px;margin:0 0 30px;background:#182339}.partial-attendance h3{margin-top:0}.partial-attendance p{line-height:1.6}}

/* Walk-in timeline follows service dates on screen; the established rows remain on paper. */
@media screen {
 #market-chart{min-width:0}
 .market-print-rows{display:none}
 .market-date-control{margin:20px 0 12px}
 .market-date-control label{display:flex;flex-direction:column;gap:6px;max-width:280px;font-size:13px}
 .market-date-control select{width:100%;min-height:44px;padding:9px 12px;border:1px solid #62738f;border-radius:8px;background:#1c2c43;color:#f1f4ff}
 .market-section .market-selected{font-size:15px;color:#ade8dc;margin:8px 0 12px;font-variant-numeric:tabular-nums}
 .market-section .market-scale,.market-section .market-scroll-hint{font-size:13px;line-height:1.5;color:#c5d2e6;margin:10px 0}
 .market-scroll{overflow-x:auto;overflow-y:hidden;max-width:100%;padding-bottom:12px;scrollbar-width:auto;scrollbar-color:#8ca4bd #1c2c43}
 .market-bars{display:flex;width:max-content;gap:12px;align-items:flex-end;padding:28px 4px 4px}
 .market-column{flex:0 0 68px;width:68px;padding:4px 8px;border:1px solid transparent;border-radius:8px;text-align:center}
 .market-column.is-selected{background:#79639830;border-color:#a58ece}
 .market-bar-area{height:190px;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid #8ca4bd}
 .market-bar{position:relative;flex:0 0 34px;min-height:1px;border:0;border-radius:4px 4px 0 0;padding:0;background:#79cbb7;color:#f1f4ff;cursor:pointer}
 .market-bar:hover,.market-bar[aria-pressed="true"]{background:#a6edda}
 .market-bar strong{position:absolute;bottom:calc(100% + 7px);left:50%;transform:translateX(-50%);font-size:13px;line-height:1.4;font-weight:700;font-variant-numeric:tabular-nums;color:#f1f4ff}
 .market-column>span{display:block;margin-top:8px;font-size:12px;line-height:1.4;color:#e1e9f6;white-space:nowrap}
 .market-column small{display:block;font-size:11px;color:#c5d2e6}
}
@media print {.market-timeline{display:none!important}}

/* Use the section width for a compact walk-in timeline. Paper keeps its existing rows. */
@media screen {
 .market-section{display:block}
 .market-section>div:first-child{margin-bottom:20px}
 .market-section h2{margin-bottom:12px}
 .market-section>div:first-child p:not(.eyebrow){max-width:80ch;margin-bottom:10px}
 #market-chart{width:100%;padding:20px 24px}
 #market-chart h3{margin-bottom:12px}
 .market-timeline{display:grid;grid-template-columns:230px minmax(0,1fr);column-gap:24px}
 .market-date-control{margin:0 0 8px}
 .market-section .market-selected{align-self:end;margin:0 0 18px}
 .market-section .market-scale{grid-column:1/-1;margin:0}
 .market-scroll,.market-scroll-hint{grid-column:1/-1}
 .market-bar-area{height:120px}
 .market-section .market-scroll-hint{margin:4px 0}
 #market-chart>.caption{font-size:12px;line-height:1.45;margin:8px 0 0;max-width:100ch}
}
@media screen and (max-width:560px){
 #market-chart{padding:16px}
 .market-timeline{grid-template-columns:minmax(0,1fr)}
 .market-date-control label{max-width:none}
 .market-section .market-selected{margin:0 0 8px}
 .market-bar-area{height:110px}
}
