:root {
  color-scheme: light;
  --forest: #173f35;
  --forest-dark: #12352c;
  --sage: #e4ebdb;
  --ivory: #f6f3e9;
  --paper: #fdfbf5;
  --ink: #1d3027;
  --muted: #526457;
  --line: #d2d9c9;
  --line-strong: #7a8d7e;
  --gold: #f0d7a8;
  --gold-text: #614517;
  --focus: #95600d;
  --radius: 20px;
  --gutter: clamp(16px, 3.8vw, 48px);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--ivory);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; overflow-wrap: anywhere; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { color: var(--forest-dark); font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.06em; }
h2 { font-size: clamp(1.1rem, 2vw, 1.28rem); letter-spacing: -.035em; }
h3 { font-size: 1rem; }
img { display: block; max-width: 100%; }
button, select, input, textarea { font: inherit; }
button, .skip-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-width: 44px; min-height: 44px; max-width: 100%; padding: 8px 15px;
  border: 1px solid transparent; border-radius: 10px;
  color: var(--paper); background: var(--forest); font-weight: 700; line-height: 1.32;
  text-align: center; text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .58; cursor: not-allowed; }
button:not(:disabled):hover { background: var(--forest-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.action-panel :focus-visible { outline-color: #f7d087; }
.icon { display: inline-block; flex: none; width: 20px; height: 20px; }
.button-outline { color: var(--forest); border-color: var(--line-strong); background: var(--paper); }
.button-quiet, .refresh { color: var(--forest); background: transparent; }
.button-outline:not(:disabled):hover, .button-quiet:not(:disabled):hover, .refresh:not(:disabled):hover { background: var(--sage); }
.skip-link { position: absolute; z-index: 1; top: 8px; left: var(--gutter); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner, .workspace, .footer-inner { max-width: 1312px; margin: auto; padding-inline: var(--gutter); }
.header-inner { min-height: 76px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-lockup { display: inline-flex; align-items: center; color: #173f35; font: 700 clamp(1rem, 2vw, 1.42rem)/1 Arial, sans-serif; white-space: nowrap; }
.brand-lockup img { flex: none; width: 1.6em; height: 1.6em; margin-right: .25em; }
.brand-lockup > span { color: #326c5d; }
.brand-note { border-left: 1px solid var(--line); padding-left: 10px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.view-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; align-items: stretch; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); }
.nav-button { min-width: 70px; padding-inline: 12px; color: var(--muted); background: transparent; }
.nav-button:not(:disabled):hover { color: var(--forest); background: var(--sage); }
.nav-button[aria-current='page'], .nav-button[aria-pressed='true'], .nav-button.is-active { color: var(--paper); background: var(--forest); }
.nav-button[aria-current='page']:hover, .nav-button[aria-pressed='true']:hover, .nav-button.is-active:hover { color: var(--paper); background: var(--forest-dark); }
.refresh { justify-self: end; }
.workspace { padding-block: clamp(23px, 3.4vw, 42px) 34px; }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.view-heading > * { min-width: 0; }
.view-heading > button { flex: none; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .075em; }
.view-intro { margin-top: 8px; color: var(--muted); }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading > * { min-width: 0; }
.muted { color: var(--muted); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 18px; }
.plant-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; overflow: hidden; border: 1px solid #c7d2bb; border-radius: var(--radius); background: #e6ead9; }
.plant-visual { display: grid; place-items: center; min-height: 0; }
.plant-visual img { grid-area: 1 / 1; width: 100%; height: 100%; max-height: 440px; min-width: 0; object-fit: contain; }
#plant-photo { object-fit: contain; background: #e4e9db; }
.plant-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 13px 18px; border-top: 1px solid #c7d2bb; background: #edf0e1; }
.plant-caption-text { display: flex; align-items: baseline; flex-wrap: wrap; min-width: 0; gap: 3px 10px; }
.plant-caption strong { color: var(--forest); }
#photo-caption, .plant-latin { color: var(--muted); font-size: .8rem; }
.plant-latin { font-family: Georgia, serif; font-size: .95rem; font-style: italic; }
.today-details { display: grid; grid-template-rows: 1fr auto auto; gap: 13px; min-width: 0; }
.action-panel { display: flex; flex-direction: column; justify-content: space-between; align-items: start; gap: 17px; padding: 21px 23px; border: 1px solid var(--forest); border-radius: var(--radius); background: var(--forest); color: var(--paper); }
.action-panel .eyebrow { color: #d3e3cc; }
.action-panel h2 { font-size: clamp(1.45rem, 2.9vw, 2rem); letter-spacing: -.055em; }
#next-action-desc { margin-top: 6px; color: #e1ebda; }
.button-primary-action { background: var(--gold); color: var(--forest-dark); }
.button-primary-action:not(:disabled):hover { background: #f6e2bc; }
.measurement-panel { padding: 13px 16px 12px; }
.source-label, .topic-label, .device-state { display: inline-block; max-width: 100%; border: 1px solid #e4d4b4; border-radius: 999px; padding: 3px 9px; color: var(--gold-text); background: #faf0d8; font-size: .78rem; font-weight: 700; }
.metrics, .counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics { align-items: stretch; margin-block: 10px 8px; }
.metric, .counts > div { min-width: 0; padding-inline: 11px; border-left: 1px solid var(--line); }
.metric:first-child, .counts > div:first-child { padding-left: 0; border-left: 0; }
.metric:last-child, .counts > div:last-child { padding-right: 0; }
.metric dt { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; }
.metric dt, .counts dt { color: var(--muted); font-size: .82rem; font-weight: 650; }
.metric dt .icon { width: 17px; height: 17px; }
.metric dd, .counts dd { margin-top: 3px; color: var(--forest-dark); font-size: clamp(1.22rem, 2.25vw, 1.75rem); font-weight: 780; line-height: 1.18; font-variant-numeric: tabular-nums; }
.metric dd.unknown-value { font-size: .98rem; line-height: 1.42; }
.moisture-track { display: block; max-width: 100%; margin-top: 5px; }
.moisture-base { fill: #e4e9dd; }
#moisture-level { fill: #527f88; }
.measurement-note { color: var(--muted); font-size: .79rem; }
.measurement-note + .measurement-note { margin-top: 2px; }
.count-panel { padding: 10px 16px 12px; }
.counts dd { font-size: 1.35rem; }

.below-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin-top: 16px; }
.below-grid > section { padding: 13px 17px 16px; }
#today-tasks { margin-top: 8px; }
#today-tasks ul { margin-block: 6px 0; padding-inline-start: 20px; }
#today-tasks li + li { margin-top: 6px; }
#today-tasks > li { margin-inline-start: 20px; }
#today-tasks p, #today-tasks li { overflow-wrap: anywhere; }
.season-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-block: 10px; }
.season-button { padding-inline: 4px; color: var(--forest); background: var(--ivory); border-color: var(--line); }
.season-button:not(:disabled):hover { background: var(--sage); }
.season-button[aria-pressed='true'] { border-color: var(--forest); color: var(--paper); background: var(--forest); }
.season-button[aria-pressed='true']:hover { background: var(--forest-dark); }
.season-scene { --season-plate: #e3ebee; --season-line: #43626a; --season-leaf: #789960; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 11px; }
.season-scene[data-season='spring'] { --season-plate: #e9efdb; --season-line: #426747; --season-leaf: #8aab61; }
.season-scene[data-season='summer'] { --season-plate: #dfead9; --season-line: #395d42; --season-leaf: #5a8155; }
.season-scene[data-season='autumn'] { --season-plate: #f3e9d3; --season-line: #775536; --season-leaf: #b9834c; }
.season-icon { display: block; width: 48px; }
.season-plate { fill: var(--season-plate); }
.season-branch, .season-snow { fill: none; stroke: var(--season-line); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.season-leaf { fill: var(--season-leaf); }
.season-scene:not([data-season='winter']) .season-snow, .season-scene[data-season='winter'] .season-leaf { display: none; }
#season-guide-copy { margin-top: 3px; color: var(--muted); font-size: .89rem; }
.flow-panel { grid-column: 1 / -1; }
.care-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 8px 0 9px; padding: 0; list-style: none; }
.flow-step { display: flex; align-items: center; gap: 9px; min-height: 55px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ivory); }
.flow-index { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: var(--paper); font-size: .76rem; font-weight: 750; }
#flow-caption { font-size: .84rem; }
#care-flow.flow-playing .flow-step { animation: explain-step 1.4s ease-in-out 1; }
#care-flow.flow-playing .flow-step:nth-child(2) { animation-delay: 1.35s; }
#care-flow.flow-playing .flow-step:nth-child(3) { animation-delay: 2.7s; }
@keyframes explain-step {
  0%, 100% { border-color: var(--line); background: var(--ivory); }
  24%, 76% { border-color: #56734f; background: #e0ecd7; }
}

.record-layout, .history-layout, .admin-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.record-side { display: grid; gap: 16px; min-width: 0; }
.form-card, .topology-panel { padding: clamp(15px, 2.3vw, 23px); }
.form-card h2 + p, .form-card h2 + div { margin-top: 8px; }
.form-card label { display: block; margin-top: 13px; font-weight: 650; }
input:not([type='checkbox']), select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 4px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fffefa; color: var(--ink); }
input:is([type='datetime-local'], [type='file']) { max-width: 100%; }
input[type='file'] { padding: 0 6px 0 0; }
input[type='file']::file-selector-button { min-height: 44px; margin-right: 8px; border: 0; padding-inline: 10px; background: var(--sage); color: var(--forest); font: inherit; cursor: pointer; }
input[type='checkbox'] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
textarea { min-height: 76px; resize: vertical; }
fieldset { min-width: 0; margin: 13px 0 0; padding: 3px 9px 8px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding-inline: 4px; font-weight: 650; }
.risk-options { display: flex; flex-wrap: wrap; gap: 5px; }
.risk-options label { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; margin: 0; padding: 3px 8px; border-radius: 8px; background: var(--ivory); font-weight: 550; cursor: pointer; }
.risk-options label:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.form-card form > button { margin-top: 14px; }
output { display: block; margin-top: 8px; color: var(--forest-dark); }
output:empty { margin-top: 0; }
.warning { margin-top: 12px; padding: 11px 12px; border-left: 3px solid #b48b43; border-radius: 4px; color: var(--gold-text); background: #faf0d8; }
#history { display: grid; gap: 12px; }
.empty-card, .entry { padding: 16px 18px; }
.entry h3 { margin-bottom: 7px; }
.entry p + p { margin-top: 6px; }
.entry input + button { margin-top: 8px; }
.entry p, .entry form { margin-block: 6px; }
.tag { display: inline-block; margin: 3px 4px 3px 0; padding: 2px 8px; border-radius: 999px; background: var(--sage); color: var(--forest-dark); font-size: .82rem; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 9px; }
.photos img, .entry > img { width: min(140px, 100%); height: 105px; object-fit: cover; border-radius: 8px; }
.entry > img { display: inline-block; margin: 8px 8px 0 0; }

.admin-grid { margin-top: 14px; }
.device-path { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.28fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px 32px; margin: 14px 0 0; padding: 0; list-style: none; }
.device { position: relative; display: grid; align-content: center; justify-items: center; min-width: 0; padding: 9px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); text-align: center; }
.device-hmi, .device-board { grid-row: span 2; }
.device-hmi::after, .device-board::after { position: absolute; top: 50%; left: calc(100% + 1px); width: 32px; border-top: 2px dashed var(--line-strong); content: ''; }
.device-board::after { width: 16px; }
.device-sensor, .device-pump { grid-template-columns: minmax(70px, 95px) minmax(0, 1fr); column-gap: 9px; align-items: center; justify-items: start; text-align: left; }
.device-sensor::before, .device-pump::before { position: absolute; right: calc(100% + 1px); width: 17px; height: calc(50% + 8px); border-left: 2px dashed var(--line-strong); content: ''; }
.device-sensor::before { top: 50%; border-top: 2px dashed var(--line-strong); }
.device-pump::before { bottom: 50%; border-bottom: 2px dashed var(--line-strong); }
.device img { width: min(100%, 144px); height: auto; margin-inline: auto; }
.device-sensor img, .device-pump img { grid-row: span 3; }
.device p { margin-top: 2px; color: var(--muted); font-size: .86rem; }
.device-state { margin-top: 6px; }
.panel-footnote { margin-top: 12px; font-size: .86rem; }
#status, #hardware { overflow-wrap: anywhere; }
#status + p, #hardware p + p { margin-top: 8px; }
#admin-telemetry { max-width: 100%; margin: 10px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); color: var(--forest-dark); font-size: .83rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 56px; gap: 2px 12px; font-size: .82rem; }

@media (max-width: 980px) {
  .brand-note { display: none; }
}
@media (max-width: 720px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding-top: 5px; padding-bottom: 8px; }
  .brand { min-height: 44px; }
  .view-nav { grid-column: 1 / -1; grid-row: 2; }
  .nav-button { min-width: min(100%, 44px); padding-inline: 2px; }
  .refresh { grid-column: 2; grid-row: 1; }
  .today-grid, .below-grid, .record-layout, .history-layout, .admin-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .today-details { gap: 10px; }
  .plant-visual { aspect-ratio: 660 / 415; }
  .plant-caption { padding: 9px 11px; }
  .action-panel { gap: 11px; padding: 15px; }
  .device-path { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: 21px 10px; }
  .device-hmi, .device-board { grid-row: auto; grid-column: 1 / -1; grid-template-columns: minmax(70px, 90px) minmax(0, 1fr); column-gap: 10px; align-items: center; justify-items: start; text-align: left; }
  .device-hmi img, .device-board img { grid-row: span 3; }
  .device-hmi::after, .device-board::after { top: calc(100% + 1px); left: 50%; width: 0; height: 21px; border: 0; border-left: 2px dashed var(--line-strong); }
  .device-board::after { height: 10px; }
  .device-sensor, .device-pump { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .device-sensor img, .device-pump img { grid-row: auto; width: min(100%, 90px); }
  .device-sensor::before, .device-pump::before { top: auto; right: auto; bottom: calc(100% + 1px); height: 12px; width: calc(50% + 7px); border: 0; border-top: 2px dashed var(--line-strong); }
  .device-sensor::before { left: 50%; border-left: 2px dashed var(--line-strong); }
  .device-pump::before { right: 50%; border-right: 2px dashed var(--line-strong); }
}
@media (max-width: 410px) {
  .plant-latin { display: none; }
  .view-heading { margin-bottom: 14px; }
  .button-quiet { padding-inline: 8px; }
  .metric, .counts > div { padding-inline: 7px; }
  .moisture-explanation { display: block; }
  .metric-note-divider { display: none; }
  .flow-step { flex-direction: column; justify-content: center; gap: 5px; padding-inline: 5px; text-align: center; font-size: .82rem; }
  .topology-panel .panel-heading { align-items: start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep source provenance readable without compressing the metric title. */
.measurement-panel .panel-heading { flex-wrap: wrap; align-items: flex-start; }
.measurement-panel .panel-heading h2 { white-space: nowrap; }

.global-notice { margin: 0 0 16px; padding: 12px 16px; font-size: .9rem; overflow-wrap: anywhere; }

/* Instrument graphics are informational. No healthy/dry/watering thresholds. */
.metrics { margin-top: 16px; }
.metric { display: flex; flex-direction: column; align-items: center; text-align: center; }
.metric dt { justify-content: center; }
.metric dd { font-size: clamp(1rem,1.7vw,1.5rem); white-space: nowrap; }
.gauge-shell { width: 100%; max-width: 132px; margin-top: 8px; }
.gauge-shell > svg { display: block; width: 100%; height: 132px; overflow: visible; }
.instrument-outline, .instrument-ticks, .droplet-outline, .pump-outline { fill: none; stroke: #81958a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.instrument-track { fill: #e1e8df; }
.instrument-fill { fill: #527f88; }
.instrument-ring { fill: none; stroke: #e1e8df; stroke-width: 9; }
.instrument-arc { fill: none; stroke: #527f88; stroke-width: 9; stroke-linecap: butt; }
.instrument-number { fill: #526457; font: 10px system-ui,sans-serif; }
.instrument-question { fill: #526457; font: 600 30px system-ui,sans-serif; text-anchor: middle; }
.small-question { font-size: 24px; }
.question-disc { fill: #f6f3e9; stroke: #81958a; stroke-width: 1.5; }
.visual-state { display: block; margin: 2px 0 4px; font-size: .75rem; font-weight: 650; color: var(--muted); }
[data-state='stale'] .instrument-outline, [data-state='invalid'] .instrument-outline { stroke-dasharray: 4 4; }
.moisture-track { display: none; }
.measurement-details { margin-top: 10px; border-top: 1px solid var(--line); font-size: .8rem; }
.measurement-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
.action-pictogram { width: 58px; height: 58px; margin-bottom: 9px; color: #d3e3cc; }
.action-pictogram svg { width: 100%; height: 100%; }
.action-panel { padding: 18px 23px; }
.action-panel h2 { font-size: clamp(1.25rem,2.3vw,1.8rem); }
#next-action-desc { font-size: .82rem; max-width: 34em; }
.count-pictogram { display: block; width: 30px; height: 30px; margin-bottom: 5px; color: var(--forest); }
.count-pictogram svg { width: 100%; height: 100%; }
.counts > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.counts dt { font-size: .73rem; }
.plant-visual { position: relative; }
.plant-hotspot { position: absolute; display: grid; place-items: center; gap: 1px; min-width: 58px; min-height: 58px; padding: 6px; border: 1px solid #7a8d7e; border-radius: 12px; background: #fdfbf5; color: var(--forest); font-size: .76rem; }
.plant-hotspot svg { width: 23px; height: 23px; }
.plant-hotspot:not(:disabled):hover { background: var(--sage); }
.hotspot-leaf { top: 13%; right: 11%; }
.hotspot-soil { bottom: 8%; left: 14%; }
.hotspot-around { top: 46%; right: 5%; }
.visual-journey { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 14px !important; }
.journey-tile { flex-direction: column; gap: 8px; min-height: 116px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); color: var(--forest); }
.journey-tile svg { width: 36px; height: 36px; }
.journey-tile strong { font-size: .9rem; }
.journey-tile span { font-size: .73rem; color: var(--muted); font-weight: 500; }
.journey-tile[data-current='true'] { border: 2px solid var(--forest); background: var(--sage); }
.journey-tile:not(:disabled):hover { background: var(--sage); }
.visual-records { grid-column: 1 / -1; }
.photo-timeline { position: relative; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-top: 14px; }
.photo-timeline::before { content: ''; position: absolute; left: 12%; right: 12%; top: 54px; border-top: 2px dashed var(--line-strong); }
.photo-milestone { position: relative; z-index: 0; flex-direction: column; gap: 8px; min-height: 114px; background: var(--paper); color: var(--forest); border: 1px solid var(--line); }
.photo-milestone:not(:disabled):hover { background: var(--sage); }
.photo-milestone img { width: 100%; height: 90px; object-fit: cover; border-radius: 7px; }
.timeline-camera, .empty-milestone > svg { display: block; width: 42px; height: 42px; }
.timeline-camera svg { width: 100%; height: 100%; }
.photo-milestone time { font-size: .8rem; font-variant-numeric: tabular-nums; }
.empty-milestone { grid-column: 1 / -1; min-height: 120px; border-style: dashed; font-size: .85rem; }
.photo-timeline:has(.empty-milestone)::before { display: none; }
@media (min-width: 721px) { .plant-visual img { max-height: 600px; } .today-details { grid-template-rows: auto auto auto; } }
@media (max-width: 720px) { .photo-timeline { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .gauge-shell > svg { height: 116px; } .action-panel { flex-direction: row; align-items: center; flex-wrap: wrap; } .action-content { flex: 1; min-width: 190px; } .action-pictogram { width: 44px; height: 44px; float: left; margin-right: 14px; } .visual-journey { gap: 5px; } }
.workspace { padding-top: 26px; }
.action-content { display: grid; grid-template-columns: 48px minmax(0,1fr); column-gap: 12px; }
.action-content .action-pictogram { grid-row: 1 / span 3; width: 48px; height: 48px; margin: 0; }
.action-content > :not(.action-pictogram) { grid-column: 2; }
.gauge-shell > svg { height: 112px; }
.metric dd { white-space: normal; overflow-wrap: anywhere; }
.gauge-received { color: var(--muted); font-size: .73rem; margin-top: 5px; font-variant-numeric: tabular-nums; }
.reading-outside { color: var(--gold-text) !important; text-decoration: underline dotted; text-underline-offset: 4px; }
.visual-image-kind { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: .73rem; }
.today-heading h1 { font-size: clamp(2rem,3.4vw,2.5rem); }
.action-panel { gap: 9px; padding-block: 14px; }
@media (min-width: 721px) {
  .counts > div { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 0 7px; text-align: left; }
  .count-pictogram { grid-row: 1 / span 2; width: 26px; height: 26px; margin: 0; }
  .counts dt, .counts dd { grid-column: 2; }
  .gauge-shell > svg { height: 100px; }
}

/* Receipt-history charts are historical reports, not current-state gauges. */
.sensor-history-panel { margin-bottom: 1.5rem; }
.sensor-extra-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0 10px; }
.sensor-extra { grid-column: span 2; min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.sensor-extra.chemical-reading { grid-column: span 3; }
.sensor-extra dt { color: var(--muted); font-size: .8rem; font-weight: 650; }
.sensor-extra dd { margin: 5px 0 0; color: var(--forest-dark); font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sensor-extra small, .sensor-extra dd.raw-unit { font-size: .72rem; font-weight: 500; color: var(--muted); }
.sensor-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sensor-chart { margin: 0; min-width: 0; padding: .8rem; border: 1px solid var(--line, #d8ddd1); border-radius: 12px; }
.sensor-chart figcaption { font-weight: 650; }
.sensor-chart svg { display: block; width: 100%; height: auto; }
.sensor-chart-axis { fill: none; stroke: #879081; stroke-width: 1; }
.sensor-chart-line { fill: none; stroke: #316b54; stroke-width: 2; }
.sensor-chart-dot { fill: #316b54; }
.sensor-chart-label { font-size: 11px; fill: #566052; }
.sensor-history-table { overflow-x: auto; }
.sensor-history-table table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.sensor-history-table th, .sensor-history-table td { padding: .6rem; text-align: left; border-bottom: 1px solid #d8ddd1; }
@media (max-width: 640px) { .sensor-history-grid { grid-template-columns: 1fr; } }

/* Short presentation cues; current numbers and unavailable states remain immediate. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes dashboard-enter {
    from { opacity: .35; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .view:not([hidden]) .card,
  .view:not([hidden]) .plant-panel,
  .view:not([hidden]) .action-panel { animation: dashboard-enter 340ms ease-out both; }
  .view:not([hidden]) .today-details > :nth-child(2) { animation-delay: 45ms; }
  .view:not([hidden]) .today-details > :nth-child(3) { animation-delay: 90ms; }
  #temperature-graphic[data-state='reported'] #temperature-column { transition: height 650ms ease-out, y 650ms ease-out; }
  #moisture-graphic[data-state='reported'] #moisture-arc { transition: stroke-dasharray 650ms ease-out; }
  .journey-tile, .plant-hotspot, .photo-milestone { transition: transform 160ms ease-out, background-color 160ms ease-out; }
  .journey-tile:hover, .plant-hotspot:hover, .photo-milestone:hover { transform: translateY(-2px); }
}

/* Operational dashboard: device, soil, then observation and history. */
#view-today > .measurement-panel { margin-block: 16px; padding: 18px 22px; }
.measurement-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: center; }
.measurement-layout .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
.measurement-layout .sensor-extra-grid { margin-block: 12px; }
#view-today .today-grid { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
#view-today .today-details { grid-template-rows: auto auto; align-content: start; }
#view-today .plant-visual { height: 220px; }
#view-today .plant-visual img { max-height: 220px; }
#view-today .plant-hotspot { transform: scale(.8); }
#view-today .action-panel { min-height: 142px; }
.today-trend { grid-column: 1 / -1; padding: 18px 20px; }
.today-trend > .measurement-note { margin-block: 8px; }
.today-trend > .muted { font-size: .8rem; margin-bottom: 10px; }
@media(max-width:720px) {
  .measurement-layout { grid-template-columns: 1fr; gap: 2px; }
  #view-today .today-grid { grid-template-columns: 1fr; }
  #view-today .plant-visual, #view-today .plant-visual img { height: 190px; max-height: 190px; }
  #view-today > .measurement-panel { padding: 16px; }
}

/* Animated explanatory scene. All physical feedback stays separate. */
.motion-dashboard { display:grid; grid-template-columns:minmax(0, 2.55fr) minmax(290px, 1fr); gap:18px; align-items:stretch; margin-bottom:14px; }
.motion-stage { overflow:hidden; border-radius:24px; background:#0b2e34; color:#e4f0dc; border:1px solid #356269; box-shadow:0 18px 45px #123c3520; }
.motion-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:20px 22px 10px; }
.scene-kicker { color:#8ebbb3; font-size:.64rem; letter-spacing:.19em; font-weight:700; }
.motion-heading h2 { color:#eaf4df; font-size:1.5rem; margin-top:3px; }
.demo-badge { border:1px solid #729a88; background:#284b43; color:#e1e7ac; border-radius:999px; font-size:.69rem; padding:6px 10px; white-space:nowrap; }
.scene-tabs { display:flex; gap:6px; padding:4px 22px 0; flex-wrap:wrap; }
.scene-tabs button, .scene-controls button { min-height:38px; padding:6px 12px; font-size:.76rem; border:1px solid #426c6d; background:#163d45; color:#c0dbd4; }
.scene-tabs button[aria-pressed='true'] { color:#163f3e; background:#d2e4ac; border-color:#d2e4ac; }
.scene-tabs button:hover, .scene-controls button:hover { background:#37605d; }
.scene-tabs button[aria-pressed='true']:hover { background:#dfedc1; }
.scene-canvas { position:relative; }
#watering-scene { display:block; width:100%; height:auto; }
.scene-label { fill:#abc4b9; font:500 15px system-ui,sans-serif; letter-spacing:1px; }
.scene-pipe { fill:none; stroke:#688e90; stroke-width:18; stroke-linecap:round; stroke-linejoin:round; }
.scene-pipe-flow { fill:none; stroke:#b1f2e0; stroke-width:6; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:8 17; }
.scene-signal-base { fill:none; stroke:#66938f; stroke-width:2; stroke-dasharray:4 8; opacity:.35; }
.scene-signal-flow { fill:none; stroke:#d4e8a1; stroke-width:5; stroke-linecap:round; stroke-dasharray:2 32; opacity:.3; }
.scene-actual-status, .scene-sensor-status { position:absolute; font-size:.68rem; padding:7px 10px; border:1px solid #45656a; border-radius:10px; background:#092a32e8; color:#bad1ca; }
.scene-actual-status { left:18px; bottom:15px; }
.scene-actual-status strong { color:#ead69f; margin-left:6px; }
.scene-sensor-status { right:18px; bottom:15px; }
.unknown-dot { display:inline-block; border:2px solid #d9cb9c; width:8px; height:8px; border-radius:50%; margin-right:5px; }
.scene-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid #294e50; padding:16px 22px; background:#0a272e; }
.scene-footer strong { display:block; font-size:.88rem; color:#d5e8bc; }
.scene-footer span { display:block; margin-top:3px; font-size:.71rem; color:#96b6af; }
.scene-controls { display:flex; gap:7px; flex-wrap:wrap; }
.scene-controls button { white-space:nowrap; }
.scene-water-part, .scene-root-flow, .scene-signal-flow { transition:opacity .5s; }
.motion-stage[data-mode='sensing'] .scene-water-part, .motion-stage[data-mode='roots'] .scene-water-part { opacity:0; }
.motion-stage[data-mode='sensing'] .scene-signal-flow { opacity:1; }
.motion-stage[data-mode='sensing'] .scene-probe { filter:drop-shadow(0 0 12px #bbe7c488); }
.scene-root-flow, .scene-root-motes { opacity:.15; }
.motion-stage[data-mode='roots'] .scene-root-flow, .motion-stage[data-mode='roots'] .scene-root-motes { opacity:1; }
.motion-stage[data-mode='roots'] .scene-root-system { filter:drop-shadow(0 0 7px #e4e3ab99); }
.motion-dashboard > .measurement-panel { padding:18px 16px; border-radius:24px; align-self:stretch; }
.motion-dashboard .measurement-layout { display:block; }
.motion-dashboard .measurement-panel .panel-heading { gap:6px; }
.motion-dashboard .measurement-panel h2 { font-size:1rem; }
.motion-dashboard .source-label { font-size:.65rem; }
.motion-dashboard .metrics { margin-block:14px; }
.motion-dashboard .gauge-shell > svg { height:88px; }
.motion-dashboard .metric dd { font-size:1.35rem; }
.motion-dashboard .sensor-extra { padding:12px 5px; background:#edf1e6; border-color:#d8e0cd; }
.motion-dashboard .sensor-extra dt { font-size:.72rem; }
.motion-dashboard .sensor-extra dd { font-size:1.3rem; }
.motion-dashboard .sensor-extra dd.raw-unit { font-size:.64rem; }
.motion-dashboard .measurement-note { font-size:.67rem; line-height:1.5; }
.motion-dashboard .measurement-details summary { font-size:.72rem; }
.actual-device-details { border:1px solid var(--line); border-radius:14px; background:var(--paper); margin-bottom:18px; }
.actual-device-details > summary { padding:13px 18px; color:var(--muted); font-size:.8rem; cursor:pointer; }
.actual-device-details #watering-summary { border:0; border-top:1px solid var(--line); border-radius:0 0 14px 14px; }
.motion-dashboard.is-expanded { grid-template-columns:1fr; }
.motion-dashboard.is-expanded > .measurement-panel { display:none; }
.motion-dashboard.is-expanded .scene-canvas { max-width:1100px; margin:auto; }
@media(prefers-reduced-motion:no-preference) {
  @keyframes scene-flow { to { stroke-dashoffset:-100; } }
  @keyframes scene-fan { to { transform:rotate(360deg); } }
  @keyframes scene-drift { 50% { transform:translateX(22px); } }
  @keyframes scene-sway { 0%,100% { transform:rotate(-1.5deg); } 50% { transform:rotate(2deg); } }
  @keyframes scene-breathe { 50% { opacity:.6; transform:scale(1.05); } }
  @keyframes scene-drop { 0% { transform:translateY(0); opacity:0; } 20% { opacity:1; } 100% { transform:translateY(27px); opacity:0; } }
  @keyframes scene-bubble { 0% { transform:translateY(0); opacity:0; } 30% { opacity:.7; } 100% { transform:translateY(-91px); opacity:0; } }
  @keyframes scene-wave { 50% { transform:translateY(3px); } }
  @keyframes scene-mote { 50% { transform:translate(-9px,-12px); opacity:.75; } }
  .scene-pipe-flow { animation:scene-flow 2s linear infinite; }
  .scene-signal-flow { animation:scene-flow 2.8s linear infinite; }
  .scene-root-flow { animation:scene-flow 5s linear infinite reverse; }
  .scene-pump-fan { transform-box:fill-box; transform-origin:center; animation:scene-fan 3s linear infinite; }
  .scene-cloud { animation:scene-drift 16s ease-in-out infinite; }
  .scene-leaves { transform-box:fill-box; transform-origin:50% 100%; animation:scene-sway 5s ease-in-out infinite; }
  .scene-sun-ring { transform-box:fill-box; transform-origin:center; animation:scene-fan 70s linear infinite; }
  .scene-aura, .scene-soil-wet { transform-box:fill-box; transform-origin:center; animation:scene-breathe 6s ease-in-out infinite; }
  .scene-drop { animation:scene-drop 1.4s linear infinite; }
  .scene-drop-2 { animation-delay:-.5s; }
  .scene-drop-3 { animation-delay:-1s; }
  .scene-bubble { animation:scene-bubble 4s linear infinite; }
  .scene-bubble-2 { animation-delay:-2.4s; }
  .scene-water-wave { animation:scene-wave 3s ease-in-out infinite; }
  .scene-root-motes { animation:scene-mote 4s ease-in-out infinite; }
}
.motion-stage[data-paused='true'] *, .motion-stage[data-inactive='true'] * { animation-play-state:paused !important; }
html[data-motion-paused='true'] #view-today :not(.motion-stage *) { animation:none !important; transition:none !important; }
@media(max-width:1000px) { .motion-dashboard { grid-template-columns:minmax(0,1.8fr) minmax(270px,1fr); gap:12px; } .motion-heading { padding:16px 14px 8px; flex-wrap:wrap; } .scene-footer { flex-wrap:wrap; padding:14px; } .scene-tabs { padding-inline:14px; } }
@media(max-width:760px) { .motion-dashboard { grid-template-columns:1fr; } .scene-canvas { min-height:0; } .scene-actual-status,.scene-sensor-status { font-size:.6rem; padding:5px 7px; bottom:7px; } .scene-actual-status { left:7px; } .scene-sensor-status { right:7px; } .motion-dashboard .measurement-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:14px; } .motion-dashboard .gauge-shell > svg { height:70px; } }
@media(max-width:440px) { .motion-dashboard .measurement-layout { display:block; } .scene-controls button { font-size:.68rem; padding-inline:8px; } .scene-tabs button { font-size:.68rem; padding-inline:8px; } .scene-footer { gap:8px; } .scene-footer strong { font-size:.75rem; } .scene-sensor-status { position:static; margin:0 7px 7px; width:fit-content; } }
@media(prefers-reduced-motion:reduce) { .motion-stage * { animation:none!important; transition:none!important; } }

.scene-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 22px 8px; flex-wrap:wrap; }
.scene-toolbar .scene-tabs { padding:0; }
.scene-toolbar .scene-controls button { min-height:38px; }
.scene-footer { min-height:64px; }
@media(max-width:1000px) { .scene-toolbar { padding-inline:14px; } }
