/* Graphs shares the map workspace equally with one comparison chart. */
body.weekly-view.graphs-active [data-responsive-shell] > .map-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "canvas" "graphs";
}
body.weekly-view.graphs-active:is([data-responsive-layout="tablet"], [data-responsive-layout="compact"]) [data-responsive-shell] > .map-view {
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "navigation" "canvas" "graphs";
}
body.weekly-view.graphs-active [data-responsive-shell] #map {
  grid-area: canvas;
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.graphs-surface {
  --graphs-bg: #ffffff;
  --graphs-soft: #f7f9fd;
  --graphs-text: #20354d;
  --graphs-muted: #63758d;
  --graphs-border: #e7edf5;
  --graphs-accent: #3879ed;
  --graphs-shadow: 0 16px 60px rgba(23, 48, 84, .16), 0 2px 8px rgba(23, 48, 84, .04);
  color: var(--graphs-text); font-family: var(--font-family); font-size: 14px; line-height: 1.5;
}
/* Switching themes must change text and surfaces together. The global colour
   transitions otherwise pass through unreadable midtones between dark/light. */
.graphs-surface, .graphs-surface * { transition: none; }
@media (prefers-color-scheme: dark) {
  .graphs-surface[data-graphs-theme="auto"] {
    --graphs-bg: #11243b; --graphs-soft: #152b45; --graphs-text: #e7f0fc; --graphs-muted: #91a7c2;
    --graphs-border: #263e59; --graphs-accent: #82aefb; --graphs-shadow: 0 16px 60px rgba(0, 9, 23, .36);
  }
}
.graphs-surface[data-graphs-theme="dark"] {
  --graphs-bg: #11243b; --graphs-soft: #152b45; --graphs-text: #e7f0fc; --graphs-muted: #91a7c2;
  --graphs-border: #263e59; --graphs-accent: #82aefb; --graphs-shadow: 0 16px 60px rgba(0, 9, 23, .36);
}
.weekly-graphs-panel {
  position: relative; grid-area: graphs; z-index: 850; width: 100%; height: 100%;
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--graphs-bg); border: 0; border-top: 1px solid var(--graphs-border); border-radius: 0; box-shadow: 0 -3px 18px rgba(23, 48, 84, .06);
  outline: none;
}
.weekly-graphs-panel[hidden], .graphs-controls[hidden], .graphs-aoi-toolbar[hidden], .graphs-chart-card[hidden] { display: none !important; }
.graphs-header { position: relative; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 6px; }
.graphs-title-group, .graphs-header-actions, .graphs-scope-actions, .graphs-chart-actions, .graphs-controls-title { display: flex; align-items: center; gap: 10px; }
.graphs-app-mark { width: 29px; height: 29px; flex: 0 0 auto; padding: 5px; display: inline-flex; border-radius: 11px; background: #edf3ff; color: #3879ed; }
.graphs-app-mark svg { width: 100%; height: 100%; }
.graphs-eyebrow { color: var(--graphs-muted); font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .13em; margin: 0 0 3px; }
.graphs-header h2 { margin: 0; color: var(--graphs-text); font-size: clamp(16px, 1.5vw, 20px); font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
.graphs-period-badge { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; border: 1px solid var(--graphs-border); border-radius: 20px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.graphs-period-badge span { color: var(--graphs-muted); }
.graphs-surface button, .graphs-aoi-toolbar button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.graphs-surface button:disabled { opacity: .45; cursor: default; }
.graphs-surface :is(button, input, select, summary):focus-visible, .graphs-aoi-toolbar :is(button, input, summary):focus-visible { outline: 3px solid var(--graphs-accent, var(--focus-ring)); outline-offset: 3px; }
.graphs-button, .graphs-icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--graphs-border); background: var(--graphs-bg); color: var(--graphs-text); border-radius: 8px; min-height: 38px; padding: 8px 12px; font-size: 13px !important; font-weight: 600 !important; gap: 5px; transition: background .15s, border-color .15s; }
.graphs-button:hover, .graphs-icon-button:hover { background: var(--graphs-soft); border-color: var(--graphs-accent); }
.graphs-button-primary { background: #3879ed; border-color: #3879ed; color: #fff; box-shadow: 0 3px 7px rgba(56,121,237,.14); }
.graphs-button-primary:hover { background: #2768d8; color: #fff; border-color: #2768d8; }
.graphs-icon-button { width: 34px; min-height: 34px; padding: 4px; font-size: 20px !important; line-height: 1; }
.graphs-text-button { min-height: 32px; background: none; border: 0; color: var(--graphs-accent); padding: 5px 7px; border-radius: 6px; font-size: 12px !important; font-weight: 600 !important; }
.graphs-text-button:hover { background: var(--graphs-soft); }
.graphs-text-button[aria-pressed="true"] { background: #e7efff; color: #245dba; }
.graphs-scope-bar {
  --graphs-bg: var(--panel-bg); --graphs-soft: var(--control-surface-bg);
  --graphs-text: var(--text); --graphs-muted: var(--muted);
  --graphs-border: var(--border); --graphs-accent: var(--primary);
  display: none; font: 14px/1.4 var(--font-family);
}
.graphs-scope-bar button { font: inherit; cursor: pointer; }
body.graphs-active .graphs-scope-bar {
  grid-area: canvas; align-self: end; position: relative; z-index: 850;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px; padding: 9px 12px; min-width: 0;
  color: var(--text); background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: 11px; box-shadow: 0 3px 18px rgba(23, 48, 84, .12);
}
body.graphs-area-editing .graphs-scope-bar { visibility: hidden; }
.graphs-scope-bar .graphs-button { color: var(--control-surface-text); background: var(--control-surface-bg); border-color: var(--border); }
.graphs-scope-bar .graphs-button-primary { color: #fff; background: #3879ed; border-color: #3879ed; }
.graphs-scope-bar .graphs-text-button { color: var(--primary); }
.graphs-scope-copy { min-width: 0; display: flex; align-items: center; gap: 9px; }
.graphs-scope-icon { color: var(--graphs-accent); font-size: 23px; line-height: 1; }
.graphs-scope-copy strong { display: block; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.graphs-scope-copy span:not(.graphs-scope-icon) { display: block; color: var(--graphs-muted); font-size: 12px; margin-top: 1px; }
.graphs-scope-actions { flex: 0 0 auto; gap: 5px; }
.graphs-scroll-area { display: flex; flex-direction: column; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 0 16px; scrollbar-width: thin; scrollbar-color: #bdcbe0 transparent; }
.graphs-series-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; margin-right: 0; }
.graphs-dot-blue { background: #3879ed; }.graphs-dot-coral { background: #ed7466; }.graphs-dot-amber { background: #c58b25; }
.graphs-status { display: flex; align-items: center; gap: 8px; min-height: 22px; color: var(--graphs-muted); font-size: 12px; line-height: 1.4; padding: 2px 0 5px; }
.graphs-status[data-state="error"] { color: #b64a47; }
.graphs-status[data-state="ready"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.graphs-status[data-state="ready"] .graphs-loading-dot { background: #26a38a; animation: none; }
.graphs-status[data-state="partial"] .graphs-loading-dot { background: #c58b25; }
.graphs-status[data-state="error"] .graphs-loading-dot { background: #d86262; animation: none; }
.graphs-quality-note { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--graphs-border); border-radius: 8px; background: var(--graphs-soft); color: var(--graphs-muted); font-size: 12px; line-height: 1.6; }
.graphs-loading-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #3879ed; animation: graphs-breathe 1.4s ease-in-out infinite; }
.graphs-chart-host { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; padding-bottom: 3px; }
.graphs-chart-card { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; padding: 0; background: var(--graphs-bg); }
.graphs-chart-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 2px; }
.graphs-chart-heading .graphs-eyebrow { font-size: 11px; letter-spacing: .1em; }
.graphs-chart-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; color: var(--graphs-text); font-weight: 650; letter-spacing: -.015em; }
.graphs-unit { color: var(--graphs-muted); font-size: 12px; }
.graphs-chart-actions { gap: 8px; }
.graphs-chart-actions .graphs-icon-button { border: 0; width: 28px; min-height: 28px; font-size: 16px !important; color: var(--graphs-muted); }
.graphs-chart-canvas { flex: 1 0 160px; width: 100%; min-height: 160px; }
.graphs-chart-description { color: var(--graphs-muted); font-size: 11px; line-height: 1.4; margin: 0 2px 2px; }
.graphs-scale-compact { display: none; }
.graphs-chart-legend { display: flex; flex-wrap: wrap; list-style: none; gap: 3px 14px; min-height: 22px; max-height: 42px; overflow-y: auto; margin: 0; padding: 0 0 2px; scrollbar-width: thin; }
.graphs-chart-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--graphs-text); font-size: 11px; line-height: 1.6; }
.graphs-chart-legend-item .graphs-series-dot { width: 7px; height: 7px; }
.graphs-empty-selection { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 190px; padding: 24px; background: var(--graphs-soft); border-radius: 12px; }
.graphs-empty-selection strong { font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.graphs-empty-selection p { max-width: 280px; color: var(--graphs-muted); font-size: 14px; }
.graphs-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; flex: 0 0 auto; border-top: 1px solid var(--graphs-border); padding: 3px 16px 5px; background: var(--graphs-bg); }
.graphs-timeline-heading { grid-column: 1 / -1; }
.graphs-timeline-heading .graphs-text-button { min-height: 24px; padding-block: 2px; }
.graphs-timeline-heading, .graphs-footer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--graphs-muted); font-size: 12px; }
.graphs-timeline-heading > div, .graphs-footer-meta > div { display: flex; gap: 2px; }
.graphs-navigator { grid-column: 1 / -1; height: 28px; width: 100%; }
.graphs-readout-bar { grid-column: 1 / -1; grid-row: 3; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 12px; min-height: 25px; }
.graphs-readout-bar label { flex: 0 0 auto; color: var(--graphs-muted); }
.graphs-readout-bar input { width: 85px; min-width: 40px; height: 30px; accent-color: #3879ed; margin: 0; cursor: pointer; }
.graphs-readout-bar output { font-variant-numeric: tabular-nums; font-weight: 600; }
.graphs-readout { grid-column: 1 / -1; grid-row: 4; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 14px; min-height: 19px; max-height: 38px; overflow-y: auto; font-size: 11px; padding-bottom: 2px; }
.graphs-readout-item { display: inline-flex; gap: 5px; align-items: center; color: var(--graphs-muted); }
.graphs-readout-item strong { color: var(--graphs-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.graphs-footer-meta { grid-column: 2; grid-row: 3; border: 0; padding: 0; font-size: 11px; }
.graphs-footer-meta #graphs-updated { display: none; }
.graphs-footer-meta button { min-height: 25px; font-size: 12px !important; }
.graphs-data-disclosure { flex: 0 0 auto; margin: 0; color: var(--graphs-muted); font-size: 12px; }
.graphs-data-disclosure summary { cursor: pointer; min-height: 32px; padding: 6px 9px; border: 1px solid var(--graphs-border); border-radius: 8px; font-size: 12px; font-weight: 600; }
.graphs-data-disclosure[open] .graphs-data-menu { position: absolute; z-index: 1000; top: 100%; left: 10px; right: 10px; max-height: min(350px, calc(50vh - 100px)); overflow: auto; background: var(--graphs-bg); border: 1px solid var(--graphs-border); border-radius: 8px; box-shadow: var(--graphs-shadow); }
.graphs-data-menu .graphs-footer-meta { justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; padding: 5px 10px; border-bottom: 1px solid var(--graphs-border); }
.graphs-data-menu #graphs-updated { display: inline; }
.graphs-data-menu .graphs-footer-meta button { min-height: 36px; }
.graphs-data-menu .graphs-table-wrap { border: 0; border-radius: 0; max-height: none; overflow: visible; }
.graphs-table-wrap { overflow-x: auto; max-height: 350px; border: 1px solid var(--graphs-border); border-radius: 8px; }
.graphs-table-wrap table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
.graphs-table-wrap th { position: sticky; top: 0; background: var(--graphs-soft); text-align: left; font-weight: 600; }
.graphs-table-wrap :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--graphs-border); }
.graphs-table-wrap tbody td:not(:first-child) { font-variant-numeric: tabular-nums; text-align: right; }
.graphs-skeleton { flex: 1; min-height: 220px; border: 1px solid var(--graphs-border); border-radius: 12px; background: linear-gradient(110deg, var(--graphs-soft) 25%, var(--graphs-bg) 45%, var(--graphs-soft) 65%); background-size: 300% 100%; animation: graphs-shimmer 2.5s linear infinite; padding: 20px; }
.graphs-skeleton span { display: block; height: 1px; background: var(--graphs-border); margin-top: 45px; }
.graphs-controls { background: var(--graphs-bg); padding: 18px 0 24px; }
#weekly-graphs-controls :is(h3, h4, label, summary) { color: var(--graphs-text); }
#weekly-graphs-controls :is(input[type="text"], select) { color: var(--graphs-text); background: var(--graphs-bg); border-color: var(--graphs-border); }
#weekly-graphs-controls .graphs-field { color: var(--graphs-muted); }
#weekly-graphs-controls .graphs-field :is(input, select) { color: var(--graphs-text); }
.weekly-view .weekly-view-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.weekly-view .weekly-view-switch button { padding-inline: 6px; min-width: 0; }
.graphs-controls-title { justify-content: space-between; padding-bottom: 14px; }
.graphs-controls-title h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.graphs-controls .graphs-eyebrow { font-size: 11px; }
.graphs-control-section { padding: 17px 0; border-bottom: 1px solid var(--graphs-border); }
.graphs-control-section h4 { margin: 0 0 10px; font-size: 13px; font-weight: 650; }
.graphs-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.graphs-section-heading h4 { margin: 0; }
.graphs-section-heading > span { font-size: 12px; color: var(--graphs-muted); }
.graphs-control-note { color: var(--graphs-muted); font-size: 12px; line-height: 1.6; margin: 5px 0 10px; }
.graphs-series-option { display: flex; align-items: center; gap: 9px; min-height: 47px; padding: 4px 6px; border-radius: 8px; }
.graphs-series-option:hover { background: var(--graphs-soft); }
.graphs-series-option label { cursor: pointer; display: flex; flex: 1; align-items: center; gap: 9px; min-width: 0; font-size: 13px; }
.graphs-series-option label > span:not(.graphs-series-dot) { flex: 1; }
.graphs-series-option input { accent-color: var(--graphs-accent); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.graphs-series-option small { color: var(--graphs-muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.graphs-series-order { display: flex; flex-direction: column; }
.graphs-series-order button { border: 0; padding: 0; width: 21px; min-height: 19px; font-size: 12px; line-height: 1; color: var(--graphs-muted); background: none; border-radius: 3px; }
.graphs-series-order button:hover { background: var(--graphs-soft); color: var(--graphs-accent); }
.graphs-field { display: block; color: var(--graphs-muted); font-size: 12px; margin: 10px 0; }
.graphs-field :is(select, input) { display: block; width: 100%; margin-top: 5px; min-height: 39px; border: 1px solid var(--graphs-border); border-radius: 7px; background: var(--graphs-bg); color: var(--graphs-text); padding: 8px 9px; font: inherit; font-size: 13px; }
.graphs-check-field { display: flex; align-items: center; gap: 8px; min-height: 35px; font-size: 13px; }
.graphs-check-field input { accent-color: var(--graphs-accent); width: 15px; height: 15px; }
.graphs-control-section summary { font-size: 13px; font-weight: 650; cursor: pointer; min-height: 27px; }
.graphs-methodology p { color: var(--graphs-muted); font-size: 12px; line-height: 1.6; }
.graphs-controls-toggle { display: none; }
body.graphs-active .map-reference { display: none; }
body.graphs-active .rp-filters :is(#stats-date-range, #weekly-data-status) { display: none; }
.graphs-aoi-toolbar {
  grid-area: canvas; align-self: end; position: relative; z-index: 1000;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 14px;
  width: auto; max-height: 30%; margin: 12px; padding: 9px 12px; overflow-y: auto;
  color: var(--text); background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: 11px; box-shadow: var(--shadow-md); font-size: 13px;
}
.graphs-aoi-heading { font-size: 13px; font-weight: 650; margin: 0; }
.graphs-aoi-heading span { display: none; }
.graphs-aoi-toolbar p { color: var(--muted); font-size: 11px; margin: 0; }
.graphs-aoi-actions { position: sticky; top: 0; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; margin: 0; background: var(--panel-bg); }
.graphs-aoi-actions button { min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); background: var(--control-surface-bg); color: var(--control-surface-text); border-radius: 7px; font-size: 13px; font-weight: 600; }
.graphs-aoi-actions [data-aoi-action="apply"] { color: #fff; background: #3879ed; border-color: #3879ed; }
.graphs-aoi-actions button:disabled { opacity: .5; cursor: default; }
.graphs-aoi-coordinates { font-size: 11px; color: var(--muted); margin: 0; }
.graphs-aoi-coordinates summary { cursor: pointer; min-height: 28px; }
.graphs-aoi-coordinates form, .graphs-aoi-coordinates > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.graphs-aoi-coordinates label { display: flex; flex-direction: column; gap: 4px; }
.graphs-aoi-coordinates input { width: 100%; min-width: 0; min-height: 37px; border: 1px solid var(--border); background: var(--control-surface-bg); color: var(--text); border-radius: 6px; padding: 5px; font: inherit; }
.graphs-aoi-status { min-height: 18px; font-size: 12px; }
.weekly-graphs-aoi-editing { cursor: crosshair !important; }
.weekly-graphs-aoi-handle { display: grid !important; place-items: center; width: 48px !important; height: 48px !important; margin-left: -24px !important; margin-top: -24px !important; background: transparent !important; border: none !important; cursor: nwse-resize; }
.weekly-graphs-aoi-dot { width: 15px; height: 15px; border: 3px solid #fff; border-radius: 5px; background: #3879ed; box-shadow: 0 1px 8px rgba(20,50,100,.4); }
.weekly-graphs-aoi-handle:focus-visible .weekly-graphs-aoi-dot { outline: 3px solid #142c4b; outline-offset: 4px; }
@keyframes graphs-breathe { 50% { opacity: .3; } }
@keyframes graphs-shimmer { to { background-position: -150% 0; } }
@media (max-width: 1199px) {
  .graphs-period-badge { display: none; }
  .graphs-scope-actions .graphs-button { padding-inline: 9px; }
  .graphs-scope-copy strong { font-size: 12px; }
  .graphs-scope-copy span:not(.graphs-scope-icon) { font-size: 11px; }
  .graphs-aoi-toolbar { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .graphs-aoi-heading { display: none; }
  .graphs-aoi-actions { order: -1; }
}
@media (max-width: 767px) {
  .graphs-scale-detail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .graphs-scale-compact { display: inline; }
  .graphs-header { padding: 2px 10px; gap: 6px; }
  .graphs-header :is(button, summary):focus-visible { outline-offset: -3px; }
  .graphs-header h2 { font-size: 16px; white-space: nowrap; }
  .graphs-app-mark { display: none; }
  .graphs-title-group { gap: 0; }
  .graphs-header-actions { gap: 6px; }
  .graphs-controls-toggle { display: inline-flex; }
  .graphs-header-actions .graphs-button { min-height: 44px; padding: 7px 9px; font-size: 12px !important; }
  body.graphs-active .graphs-scope-bar { flex-wrap: wrap; gap: 5px; padding: 7px 9px; margin: 8px; }
  .graphs-scope-copy { flex: 1 1 100%; }
  .graphs-scope-copy span:not(.graphs-scope-icon) { display: none; }
  .graphs-scope-icon { font-size: 18px; }
  .graphs-scope-actions { width: 100%; }
  .graphs-scope-actions .graphs-button { min-height: 44px; flex: 1; padding: 7px; font-size: 12px !important; }
  .graphs-scroll-area { padding: 0 10px; }
  /* Quality shares the scale caption on compact screens; a second metadata
     row would take space from the plot. Full wording remains in its title,
     the accessible chart description and the hourly data table. */
  #graphs-quality-summary { display: none; }
  .graphs-chart-card > .graphs-chart-description { flex: 0 0 auto; min-width: 0; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
  .graphs-status { flex: 0 0 auto; min-height: 0; padding-block: 0; line-height: 1; }
  #graphs-status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .graphs-scroll-area:has(.graphs-status:not([data-state="ready"])) .graphs-chart-card > .graphs-chart-description { display: none; }
  .graphs-chart-host { flex-basis: 0; }
  .graphs-chart-canvas { flex-basis: 150px; min-height: 150px; }
  .graphs-chart-heading h3 { font-size: 13px; }
  .graphs-chart-legend { flex-wrap: nowrap; gap: 0 12px; min-height: 24px; max-height: 27px; overflow-x: auto; overflow-y: hidden; padding-bottom: 3px; }
  .graphs-chart-legend::-webkit-scrollbar { height: 3px; }
  .graphs-chart-legend-item { flex: 0 0 auto; white-space: nowrap; line-height: 1; }
  .graphs-chart-description, .graphs-chart-legend-item { font-size: 11px; }
  .graphs-footer { padding: 2px 10px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .graphs-navigator { height: 28px; }
  .graphs-timeline-heading { font-size: 11px; }
  .graphs-timeline-heading .graphs-text-button { min-height: 32px; }
  .graphs-readout-bar { grid-column: 1 / -1; flex-wrap: nowrap; gap: 0 6px; }
  .graphs-readout-bar label { font-size: 11px; }
  .graphs-readout-bar input { flex: 1; width: auto; min-height: 32px; }
  .graphs-readout-bar output { font-size: 11px; white-space: nowrap; }
  .graphs-readout { flex-wrap: nowrap; gap: 0 12px; min-height: 22px; max-height: 24px; overflow-x: auto; overflow-y: hidden; font-size: 11px; padding-bottom: 3px; }
  .graphs-readout::-webkit-scrollbar { height: 3px; }
  .graphs-readout-item { flex: 0 0 auto; white-space: nowrap; }
  .graphs-footer-meta { grid-column: 1 / -1; grid-row: 5; justify-content: flex-end; font-size: 10px; }
  .graphs-data-menu .graphs-footer-meta button { font-size: 12px !important; min-height: 44px; padding-block: 5px; }
  .graphs-data-disclosure summary { min-height: 44px; padding: 10px 7px; font-size: 11px; white-space: nowrap; }
  body.graphs-active [data-responsive-shell] .responsive-panel-switcher { display: none !important; }
  body.graphs-controls-open #right-panel { z-index: 1800 !important; }
  body.graphs-active #weekly-graphs-controls { padding: 14px 0 28px; }
  .graphs-controls-title h3 { font-size: 21px; }
  .graphs-controls .graphs-controls-toggle { width: 44px; min-height: 44px; }
  .graphs-series-option { min-height: 49px; }
  .graphs-series-option label { min-height: 44px; }
  .graphs-series-order { flex-direction: row; }
  .graphs-series-order button { width: 44px; min-height: 44px; }
  .graphs-field :is(input,select), .graphs-check-field { min-height: 44px; }
  .graphs-aoi-toolbar { margin: 8px; padding: 6px 8px; gap: 2px; }
  .graphs-aoi-actions { gap: 4px; flex-wrap: nowrap; }
  .graphs-aoi-actions button { flex: 1; min-height: 48px; padding: 5px; font-size: 11px; white-space: nowrap; }
  .graphs-aoi-toolbar p { line-height: 1.3; }
  .graphs-aoi-coordinates summary { min-height: 28px; }
  .graphs-aoi-coordinates form, .graphs-aoi-coordinates > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graphs-aoi-coordinates input { min-height: 44px; }
}
@media (min-height: 900px) and (min-width: 768px) { .graphs-chart-canvas { flex-basis: 200px; min-height: 200px; } }
@media (max-height: 820px) and (max-width: 767px) { .graphs-chart-canvas { flex-basis: 140px; min-height: 140px; } }
@media (max-width: 379px) {
  .graphs-header .graphs-app-mark { display: inline-flex; }
  .graphs-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .graphs-chart-canvas { flex-basis: 140px; min-height: 140px; }
}
/* Short landscape windows keep a usable plot in the lower half by scrolling
   the chart and its tools together, with the map remaining above. */
@media (max-height: 600px) {
  .weekly-graphs-panel { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .graphs-scroll-area { display: block; overflow: visible; }
  .graphs-chart-host { min-height: 260px; }
  .graphs-chart-canvas { flex-basis: 200px; min-height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .weekly-graphs-panel *, .graphs-controls *, .graphs-aoi-toolbar * { animation: none !important; transition: none !important; } }

/* Keep the series controls comfortable to tap without inflating the chart footer. */
@media (max-width: 767px) {
  .graphs-controls :is(button, select, input[type="text"]) { min-height: 44px; }
  .graphs-series-order button { width: 44px; min-width: 44px; min-height: 44px; }
}
