/* Shared Brew Atlas appearance. Layout and measurement colours are retained. */
@media(max-width:760px) {
 body #mirror .page-home .latest-card #latest-result { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto auto auto auto; gap:12px; text-align:left; }
 body #mirror .page-home .latest-card #latest-result .home-score { grid-column:1; grid-row:1; justify-self:start; align-self:center; }
 body #mirror .page-home .latest-card #latest-result .home-score-stars { grid-column:2; grid-row:1; justify-self:end; align-self:center; }
 body #mirror .page-home .latest-card #latest-result>b { grid-column:1/-1; grid-row:2; text-align:left; }
 body #mirror .page-home .latest-card #latest-result .external-latest-flow-slot { grid-column:1/-1; grid-row:3; }
 body #mirror .page-home .latest-card #latest-result>p.cyan { grid-column:1/-1; grid-row:4; }
 body #mirror .page-home .latest-card #latest-result .external-home-flavor { grid-column:1/-1; grid-row:5; width:100%; margin-inline:0; padding-inline:0; }
 body #mirror .page-home .latest-card .home-flavor-heading { align-self:stretch; text-align:left; margin-inline:0; padding-inline:0; }
 body #mirror .page-home .latest-card :is(.latest-session-heading>.eyebrow,.home-flavor-heading) { font-size:11px; font-weight:700; line-height:1.4; letter-spacing:.06em; text-transform:uppercase; color:var(--cream); }
 body #mirror .page-home .latest-card .home-flavor-heading small { font-size:inherit; }
}
/* Axis/badge margins reveal their containing column in either theme. The SVG
   plot rectangle still owns the unchanged plotting-area background. */
body :is(#app,#mirror) :is(.chart-wrap,.chart-svg,.mini-chart) { background:transparent !important; }
:root { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; --bg:#f5f3ee; --surface:#fff; --card:#fff; --raised:#edf1f5; --stroke:#d6dde5; --text:#1e2c3e; --secondary:#526379; --muted:#526379; --cream:#72582f; --cyan:#007c9f; --pink:#993bb2; --orange:#b85314; --green:#087a58; background:#f5f3ee; color:#1e2c3e; }
html[data-theme="light"] body { background:#f5f3ee; color:var(--text); }
html[data-theme="light"] .touch-app { background:var(--bg); color:var(--text); }
html[data-theme="light"] #station-pairing-panel { background:var(--bg) !important; }
html[data-theme="light"] .card { background:var(--surface); border-color:var(--stroke); }
html[data-theme="light"] :is(.button,.units button.selected,.pin-keypad .selected) { background:#8b6837; color:#fff; }
html[data-theme="light"] .touch-app .units button.selected { color:#fff !important; }
html[data-theme="light"] #settings-button .ui-icon { filter:brightness(.35); }
html[data-theme="light"] :is(input,select,textarea) { color:var(--text); }
html[data-theme="light"] :is(.header-copy small,.eyebrow,.gold) { color:#72582f; }
html[data-theme="light"] :is(.chart-svg,.mini-chart,.flavor-plot,.external-home-flavor) text:not([fill="#36cfff"]):not([fill="#ff8a3d"]):not([fill="#d75bff"]) { fill:#42546b; }
html[data-theme="light"] .external-home-flavor g[fill="#c9d3e3"] { fill:#42546b; }
html[data-theme="light"] .chart-svg :is(line,polygon)[stroke="#3a506b"] { stroke:#9bacbf; }
html[data-theme="light"] .chart-svg rect[fill="#091423"] { fill:#f6f8fa; }
html[data-theme="light"] .chart-svg rect:is([fill="#17253b"],[fill="#102236"],[fill="#263f6b"]) { fill:#c5d6e7; }
html[data-theme="light"] :is(.app-dialog,.app-dialog-panel) { background:var(--surface); color:var(--text); }
.ba-theme-toggle { flex:none; display:inline-grid; place-items:center; width:44px; height:44px; min-height:44px; padding:9px; border:1px solid var(--stroke,#1b2a42); border-radius:12px; background:var(--surface,#0c1627); color:var(--cream,#e8decf); cursor:pointer; touch-action:manipulation; }
.ba-theme-toggle svg { display:block; width:22px; height:22px; pointer-events:none; }
.ba-theme-toggle:focus-visible { outline:2px solid var(--gold,#ab8855); outline-offset:3px; }
.ba-theme-floating { position:fixed; z-index:100; top:max(12px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); }
/* Local appearance remains available in the read-only presentation toolbar. */
body.presenting #display-tools .ba-theme-toggle { visibility:visible; pointer-events:auto; }
@media(max-width:560px) { .touch-app .head-right { gap:6px; } .touch-app .head-right .ba-theme-toggle { width:40px; min-width:40px; padding:8px; } }
/* Approved warm palette shared by every Brew Atlas viewer. */
html[data-theme="light"] {
  --bg:#fcfbf8; --surface:#f9f6f1; --card:#f9f6f1;
  --raised:#f4eee5; --stroke:#e4dbcf; background:#fcfbf8;
}
html[data-theme="light"] body,
html[data-theme="light"] body .touch-app { background:#fcfbf8; }
html[data-theme="light"] body .card { background:#f9f6f1 !important; border-color:#e4dbcf !important; }
html[data-theme="light"] body :is(.scale-value,.scale-timer) { background:#f7f2eb !important; border-color:#e4dbcf !important; }
html[data-theme="light"] body :is(.ghost,.language,.icon-btn,.app-dialog,.app-dialog-panel) { background:#f9f6f1; border-color:#e4dbcf; }
/* Warm control surfaces, including units and full-screen scale controls.
   Preserve semantic connected/error colours and chart series colours. */
html[data-theme="light"] body :is(.icon-btn,.language,.units button,#scale-expand,#scale-collapse,.fullscreen-controls button,#display-tools button) {
  background:#f4eee5 !important; border-color:#dfd3c3 !important; color:#72582f;
}
html[data-theme="light"] body :is(#app,#mirror) .units button.selected,
html[data-theme="light"] body #display-tools button[aria-pressed="true"],
html[data-theme="light"] body :is(#app,#mirror) :is(button,a[role="tab"],label.mode-option,.history-item):is(.selected,.active,[aria-pressed="true"],[aria-selected="true"],[aria-checked="true"]) {
  background:#8b6837 !important; border-color:#8b6837 !important; color:#fff !important;
}
html[data-theme="light"] body :is(button,a[role="tab"],label.mode-option,.history-item):is(.selected,.active,[aria-pressed="true"],[aria-selected="true"],[aria-checked="true"]) :is(span,small,strong,b) { color:#fff !important; }
html[data-theme="light"] body :is(.bluetooth-button,#station-pairing).is-connected { color:#087a58 !important; }
html[data-theme="light"] body #display-tools { background:#f9f6f1ed; border-color:#e4dbcf; }
html[data-theme="light"] :is(#app,#mirror) :is(.signin-submit,.signin-users button.selected,.pin-keypad button.selected,.signin-keypad button:active) { background:#8b6837 !important; color:#fff !important; border-color:#8b6837 !important; }
html[data-theme="light"] .signin-screen { background:#fcfbf8 !important; }
html[data-theme="light"] :is(.signin-brewers,.signin-pin-panel) { background:#f9f6f1 !important; border-color:#e4dbcf !important; }
html[data-theme="light"] :is(.signin-info,.signin-keypad button,.signin-slots span) { background:#f4eee5 !important; border-color:#dfd3c3 !important; }
html[data-theme="light"] .signin-logo { filter:brightness(.5); }
/* Score colours are semantic data, not neutral theme text. Preserve the
   configured level colour instead of the legacy white-to-navy override. */
html[data-theme="light"] body :is(#app,#mirror) .touch-app :is(.page-home,.page-history) .score-display .score-value,
html[data-theme="light"] body :is(#app,#mirror) .touch-app :is(.page-home,.page-history) .score-display .score-label,
html[data-theme="light"] body :is(#app,#mirror) .score-display .score-value,
html[data-theme="light"] body :is(#app,#mirror) .score-display .score-label { color:var(--level-color) !important; }
html[data-theme="light"] body :is(#app,#mirror) .score-display .score-value small { color:var(--text,#1e2c3e) !important; }
html[data-theme="light"] body :is(#app,#mirror) .score-card .score-ring strong { color:var(--level-color,var(--text)) !important; }
/* History selection stays quiet so profile names, dates and score colours
   remain readable. The checkbox carries the strong selected-state accent. */
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-item.selected {
  background:var(--bg,#fcfbf8) !important; border-color:#dfd3c3 !important;
  color:var(--text,#1e2c3e) !important; box-shadow:none !important;
}
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-item.selected :is(span,b,small,strong) { color:var(--text,#1e2c3e) !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-item.selected .history-item-details small { color:var(--secondary,#526379) !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-history .score-display :is(.score-value,.score-label),
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-item.selected .score-display :is(.score-value,.score-label) { color:var(--level-color) !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-history .score-display .score-value small,
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-item.selected .score-display .score-value small { color:var(--text,#1e2c3e) !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-tools .chip { background:#f4eee5 !important; color:#72582f !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-compare-check input[type="checkbox"] {
  appearance:none; -webkit-appearance:none; box-sizing:border-box;
  width:18px !important; height:18px !important; min-width:18px !important;
  min-height:18px !important; padding:0 !important; flex:none;
  border:1px solid #dfd3c3; border-radius:4px; background:#f4eee5;
  background-position:center; background-repeat:no-repeat; cursor:pointer;
}
html[data-theme="light"] body :is(#app,#mirror) .page-history .history-compare-check input[type="checkbox"]:checked {
  background-color:#8b6837; border-color:#8b6837;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4 9 3 3 7-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="light"] .history-compare-check input:focus-visible { outline:2px solid #8b6837; outline-offset:3px; }
/* Separate live weight from the timer on Light dashboard scale cards,
   including the read-only computer presentation. Dark layout is untouched. */
html[data-theme="light"] body :is(#app,#mirror) .page-home .scale-card .scale-timer {
  position:relative; padding-top:12px !important;
}
html[data-theme="light"] body :is(#app,#mirror) .page-home .scale-card .scale-timer::before {
  content:''; position:absolute; top:0; left:14px; right:14px;
  height:1px; background:#b6a18a !important; pointer-events:none;
}
/* Footer navigation marks the current page with text only in Light Theme. */
/* Progress uses the session's measured elapsed time, not a CSS animation. */
@media(min-width:761px) and (min-height:700px) {
 body :is(#app,#mirror) .touch-app.page-active { height:100svh; min-height:0; max-height:100svh; }
 body :is(#app,#mirror) .page-active>main { min-height:0; overflow:hidden; }
 body :is(#app,#mirror) .page-active .brew-grid { min-height:0; grid-template-rows:minmax(0,1fr) minmax(0,1fr); }
 body :is(#app,#mirror) .page-active .brew-grid>.card { min-height:0; overflow:hidden; }
 body :is(#app,#mirror) .page-active .ring { width:min(41svh,480px); height:min(41svh,480px); }
 body :is(#app,#mirror) .page-active .ring::before { inset:34px; }
 body :is(#app,#mirror) .page-active .ring-time { font-size:clamp(48px,6svh,76px); }
 body :is(#app,#mirror) .page-active .ring-note { font-size:18px; color:var(--cream); }
 body :is(#app,#mirror) .page-active .ring-card>.metric-heading { font-size:18px; font-weight:700; }
 body :is(#app,#mirror) .page-active .ring-card>.pill { font-size:15px; padding:8px 14px; }
 body :is(#app,#mirror) .page-active .meter-tick { font-size:14px; font-weight:600; }
 body :is(#app,#mirror) .page-active .vessel-meter { width:60px; left:-48px; }
 body :is(#app,#mirror) .page-active .vessel-frame { width:min(19svh,210px); height:min(19svh,210px); min-height:0; }
 body :is(#app,#mirror) .page-active :is(.metrics,.bottom-grid,.footer) { flex:none; }
}
body :is(#app,#mirror) .page-active #stages { flex:none; min-height:62px; overflow:visible; }
body :is(#app,#mirror) .page-active #stages .stage-bar { flex:none; min-height:30px; }
body :is(#app,#mirror) .page-active #stages .stage-fill { position:relative; transition:none; }
body :is(#app,#mirror) .page-active #stages .stage.current .stage-fill::after {
  content:''; position:absolute; right:0; top:0; bottom:0; width:3px;
  background:currentColor; box-shadow:0 0 0 1px #ffffff80;
}
html[data-theme="light"] body :is(#app,#mirror) .page-active #stages .stage-label { color:#526379 !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-active #stages .stage-label strong { color:#72582f !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-active #stages .stage-bar { background:#e4dbcf !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-active #stages .stage-fill { background:linear-gradient(90deg,var(--start),var(--end)) !important; color:#5c4023; }
html[data-theme="light"] body :is(#app,#mirror) .page-active .vessel-status { background:#f0e7da !important; color:#72582f !important; border:1px solid #dfd3c3; }
html[data-theme="light"] body :is(#app,#mirror) .page-active .vessel-status.is-over { background:#f8e9de !important; color:#9c4215 !important; }
html[data-theme="light"] body :is(#app,#mirror) .page-active #weight-display { color:#72582f !important; }
/* Readable filled-timeline labels and light status messages on every viewer. */
html[data-theme="light"] body :is(#app,#mirror) .page-active #stages .stage-number {
 color:#fff !important; text-shadow:0 1px 2px #3f2c1dcc !important; font-weight:700;
}
html[data-theme="light"] body :is(#app,#mirror) :is(.alert,.alert.good,.alert.cool,.alert.hot) {
 background:#f0e7da !important; border-color:#dfd3c3 !important;
 color:#513719 !important;
}
html[data-theme="light"] body :is(#app,#mirror) .alert :is(span,strong,b,p,small) { color:#513719 !important; }
html[data-theme="light"] body :is(#app,#mirror) .footer .footer-nav button:is(.selected,.active,[aria-current="page"],[aria-pressed="true"],[aria-selected="true"]) {
  background:transparent !important; border-color:transparent !important;
  color:#8b6837 !important; box-shadow:none !important;
}
html[data-theme="light"] body :is(#app,#mirror) .footer .footer-nav button:is(.selected,.active,[aria-current="page"],[aria-pressed="true"],[aria-selected="true"]) :is(span,small,strong,b) {
  color:#8b6837 !important;
}
