.chart-page main{margin:12px auto;padding:16px;max-width:1080px}
.chart-page h1{font-size:clamp(22px,3vw,30px);margin:8px 0;line-height:1.35}
.chart-page .review{margin:4px 0;font-size:17px}
.chart-controls{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.chart-controls button{min-height:44px;padding:8px 16px;border:2px solid #a58c59;border-radius:8px;background:#173240;color:#f6f1e7;font:700 17px/1.4 sans-serif;cursor:pointer}
.chart-controls button[aria-pressed=true]{background:#e1c88e;color:#102b3a;text-decoration:underline;text-underline-offset:4px}
.chart-controls button:focus-visible,.chart-viewport:focus-visible{outline:3px solid #91601c;outline-offset:3px}
.chart-viewport{max-width:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.chart-page .chart-viewport .board{width:min(100%,640px,calc(100svh - 220px));min-width:0;aspect-ratio:1;height:auto;margin:0 auto 8px}
.chart-page .chart-viewport.chart-expanded .board{width:max(100%,1080px);max-width:none;margin:0 0 8px}
@media(max-width:600px){.chart-page main{padding:12px}.chart-page .chart-viewport .board{width:100%}.chart-page .chart-viewport.chart-expanded .board{width:1080px}}
@media print{.chart-controls{display:none}.chart-page .chart-viewport .board{width:100%}.chart-viewport{overflow:visible}}
/* These component rules supersede the older board width declarations. */
html body :is(#source-original .approved-chart,.chart-page) .chart-viewport.chart-fit>.board{width:min(100%,640px,max(180px,calc(100svh - 220px)))!important;max-width:100%!important;min-width:0!important;height:auto!important;aspect-ratio:1;margin:8px auto!important}
html body .chart-controls{gap:12px;margin:12px 0}
html body .chart-controls button,html body .chart-zoom-toolbar button{min-height:52px!important;min-width:44px!important;font-size:18px!important;padding:12px!important;white-space:normal;box-sizing:border-box}
html body .chart-zoom-dialog{position:fixed!important;inset:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;box-sizing:border-box!important;margin:0!important;padding:12px!important;border:0!important;background:#102735!important;color:#f6f1e7!important;overflow:hidden!important}
html body .chart-zoom-dialog[open]{display:flex!important;flex-direction:column;gap:8px}
.chart-zoom-dialog::backdrop{background:#102735}
html body .chart-zoom-toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;flex:none}
html body .chart-zoom-toolbar button{background:#dcc18a;color:#102735;border:1px solid #dcc18a;border-radius:8px;line-height:1.4}
html body .chart-zoom-toolbar output{grid-column:1/-1;text-align:center;font:17px/1.4 sans-serif;color:#f6f1e7}
html body .chart-zoom-help{font:16px/1.4 sans-serif!important;margin:0!important;color:#f6f1e7!important;flex:none}
html body .chart-zoom-viewport{flex:1 1 0;min-height:0;min-width:0;width:100%;overflow:auto;touch-action:none;overscroll-behavior:contain;cursor:grab;background:#173240}
html body .chart-zoom-viewport:active{cursor:grabbing}
html body .chart-zoom-stage{position:relative;margin:auto;flex:none}
html body :is(#source-original .approved-chart,.chart-page) .chart-zoom-stage>.board{width:100%!important;max-width:none!important;min-width:0!important;height:100%!important;aspect-ratio:1;margin:0!important;pointer-events:none;user-select:none}
html body .chart-zoom-stage .board-art{object-fit:contain!important}
@media(max-width:760px){html body .chart-zoom-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}}
