:root {
  --ink: #eaf2ef;
  --muted: #8ea39d;
  --quiet: #657a74;
  --page: #07100e;
  --sidebar: #081512;
  --panel: #0d1b18;
  --panel-2: #10221e;
  --line: rgba(179, 218, 204, 0.12);
  --green: #84c93f;
  --green-soft: rgba(132, 201, 63, 0.13);
  --cyan: #36c3cf;
  --cyan-soft: rgba(54, 195, 207, 0.12);
  --amber: #e9b34b;
  --amber-soft: rgba(233, 179, 75, 0.12);
  --red: #ef6a65;
  --red-soft: rgba(239, 106, 101, 0.12);
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(54, 195, 207, 0.5);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Sign in */

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(54, 195, 207, 0.12), transparent 31rem),
    radial-gradient(circle at 88% 82%, rgba(132, 201, 63, 0.1), transparent 34rem),
    #06100d;
}

.login-body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(100%, 490px);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(11, 27, 22, 0.93);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  letter-spacing: -0.045em;
}

.login-intro {
  margin: 28px 0 24px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #bdd0ca;
  font-size: 0.82rem;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(178, 221, 207, 0.19);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(3, 11, 9, 0.7);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
  border-color: rgba(54, 195, 207, 0.65);
  box-shadow: 0 0 0 4px rgba(54, 195, 207, 0.08);
}

.login-form button {
  margin-top: 4px;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  color: #07100e;
  background: linear-gradient(135deg, #98dc51, #6fbf39);
  box-shadow: 0 12px 28px rgba(132, 201, 63, 0.16);
  cursor: pointer;
  font-weight: 850;
}

.form-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 106, 101, 0.35);
  border-radius: 11px;
  color: #ffc1bd;
  background: var(--red-soft);
  font-size: 0.85rem;
  line-height: 1.5;
}

.login-boundary {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  padding: 15px;
  border: 1px solid rgba(54, 195, 207, 0.17);
  border-radius: 12px;
  background: var(--cyan-soft);
}

.login-boundary strong {
  color: #a6ebf0;
  font-size: 0.82rem;
}

.login-boundary span,
.quiet {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.other-system-link {
  display: block;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-decoration: none;
}

.other-system-link:hover {
  color: var(--ink);
}

.setup-card > p {
  color: var(--muted);
  line-height: 1.65;
}

/* Application shell */

.portal-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 250px;
  flex-direction: column;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 0 0, rgba(54, 195, 207, 0.08), transparent 24rem),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 43px;
  height: 43px;
  border-radius: 12px;
  object-fit: cover;
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 1.06rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.68rem;
}

.sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 54px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  text-decoration: none;
  transition: 150ms ease;
}

.sidebar nav a span {
  color: var(--quiet);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.sidebar nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
}

.sidebar nav a.active {
  border-color: rgba(132, 201, 63, 0.18);
  color: #c8eea2;
  background: var(--green-soft);
}

.sidebar nav a.active span {
  color: var(--green);
}

.sidebar-boundary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(54, 195, 207, 0.14);
  border-radius: 12px;
  background: rgba(54, 195, 207, 0.055);
}

.boundary-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #b7f3f6;
  background: rgba(54, 195, 207, 0.17);
  font-size: 0.66rem;
  font-weight: 900;
}

.sidebar-boundary div {
  display: grid;
  gap: 3px;
}

.sidebar-boundary strong {
  color: #b8d9d2;
  font-size: 0.72rem;
}

.sidebar-boundary small {
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.35;
}

.egg-link {
  display: grid;
  gap: 3px;
  margin-top: 13px;
  padding: 12px 13px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
}

.egg-link:hover {
  background: rgba(255, 255, 255, 0.025);
}

.egg-link span {
  color: var(--quiet);
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.egg-link strong {
  font-size: 0.72rem;
}

.main-shell {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 16px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 14, 0.9);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.topbar .eyebrow {
  margin-bottom: 4px;
  font-size: 0.59rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-chip {
  display: flex;
  min-width: 142px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.connection-chip > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--quiet);
  box-shadow: 0 0 0 5px rgba(101, 122, 116, 0.09);
}

.connection-chip.online > span {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(132, 201, 63, 0.1), 0 0 18px rgba(132, 201, 63, 0.3);
}

.connection-chip.offline > span {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 106, 101, 0.09);
}

.connection-chip div {
  display: grid;
  gap: 1px;
}

.connection-chip small {
  color: var(--quiet);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.connection-chip strong {
  font-size: 0.75rem;
}

.signout,
.menu-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.signout {
  padding: 11px 13px;
  font-size: 0.72rem;
  font-weight: 750;
}

.signout:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.menu-button {
  display: none;
  width: 43px;
  height: 43px;
  padding: 10px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--ink);
}

.content {
  width: min(100%, 1500px);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 38px 34px 70px;
}

.global-alert {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(239, 106, 101, 0.32);
  border-radius: 12px;
  color: #ffc1bd;
  background: var(--red-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: section-in 220ms ease both;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-lead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.section-lead h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.045em;
}

.section-lead > div:first-child > p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.freshness-block {
  display: grid;
  min-width: 185px;
  gap: 3px;
  text-align: right;
}

.freshness-block span,
.freshness-block small {
  color: var(--quiet);
  font-size: 0.65rem;
}

.freshness-block strong {
  color: #c9e4dd;
  font-size: 0.9rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.hero-card {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.hero-card::after {
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  content: "";
  filter: blur(4px);
  opacity: 0.16;
}

.hero-card.water::after { background: var(--cyan); }
.hero-card.ph::after { background: var(--green); }
.hero-card.ec::after { background: #8d7cef; }
.hero-card.vpd::after { background: var(--amber); }

.hero-card > span {
  display: block;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
}

.hero-card em {
  position: relative;
  z-index: 1;
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.hero-card small {
  position: absolute;
  z-index: 1;
  bottom: 20px;
  left: 22px;
  color: var(--quiet);
  font-size: 0.64rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.lower-grid {
  grid-template-columns: 1.35fr 0.65fr;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 13px 40px rgba(0, 0, 0, 0.09);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.panel-heading h3,
.identity-panel h3,
.integrity-panel h3,
.request-panel h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.panel-heading .eyebrow,
.identity-panel .eyebrow,
.integrity-panel .eyebrow,
.request-panel .eyebrow,
.weather-card .eyebrow {
  margin-bottom: 5px;
  font-size: 0.57rem;
}

.panel-pill,
.advisory-badge {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.panel-pill.good {
  border-color: rgba(132, 201, 63, 0.24);
  color: #bde995;
  background: var(--green-soft);
}

.panel-pill.warning {
  border-color: rgba(233, 179, 75, 0.28);
  color: #f4d493;
  background: var(--amber-soft);
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.metric-list > div {
  position: relative;
  min-height: 84px;
  padding: 16px;
  background: #0b1815;
}

.metric-list span {
  display: block;
  margin-bottom: 10px;
  color: var(--quiet);
  font-size: 0.65rem;
}

.metric-list strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.metric-list strong.text-value {
  font-size: 0.82rem;
}

.metric-list em {
  margin-left: 5px;
  color: var(--quiet);
  font-size: 0.62rem;
  font-style: normal;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.equipment-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
}

.equipment-item .dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #52615d;
}

.equipment-item.on .dot {
  background: var(--green);
  box-shadow: 0 0 14px rgba(132, 201, 63, 0.45);
}

.equipment-item div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.equipment-item strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-item small {
  color: var(--quiet);
  font-size: 0.6rem;
}

.equipment-item em {
  margin-left: auto;
  color: var(--quiet);
  font-size: 0.61rem;
  font-style: normal;
  font-weight: 850;
}

.equipment-item.on em {
  color: var(--green);
}

.panel-footnote {
  margin: 16px 0 0;
  color: var(--quiet);
  font-size: 0.64rem;
  line-height: 1.5;
}

.notice-list {
  display: grid;
  gap: 9px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
}

.notice > span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--quiet);
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
}

.notice.good > span { background: var(--green); }
.notice.warning > span { background: var(--amber); }
.notice.danger > span { background: var(--red); }
.notice.good p { color: #b8d9b0; }
.notice.warning p { color: #dfc48a; }
.notice.danger p { color: #f2aaa6; }

/* Trends */

.secondary-button,
.request-actions button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #cfe1dc;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.secondary-button:hover,
.request-actions button:hover {
  border-color: rgba(54, 195, 207, 0.34);
  background: rgba(54, 195, 207, 0.08);
}

.chart-panel {
  padding-bottom: 16px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.65rem;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 15px;
  height: 3px;
  border-radius: 2px;
}

.air-line { background: var(--amber); }
.water-line { background: var(--cyan); }
.ph-line { background: var(--green); }
.ec-line { background: #a590ff; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: min(48vh, 430px);
  min-height: 300px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  display: none;
  padding: 100px 20px;
  color: var(--quiet);
  text-align: center;
  font-size: 0.8rem;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.62rem;
}

/* Weather */

.advisory-badge {
  border-color: rgba(54, 195, 207, 0.25);
  color: #a7e8ec;
  background: var(--cyan-soft);
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.weather-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(54, 195, 207, 0.08), transparent 62%), var(--panel);
}

.weather-card.primary-weather {
  background: linear-gradient(155deg, rgba(132, 201, 63, 0.11), transparent 62%), var(--panel);
}

.weather-card.pressure-weather {
  background: linear-gradient(155deg, rgba(141, 124, 239, 0.1), transparent 62%), var(--panel);
}

.weather-card h3 {
  min-height: 48px;
  margin: 0 0 22px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.weather-card > div {
  margin-bottom: 28px;
}

.weather-card > div strong {
  font-size: 3.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
}

.weather-card > div span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.weather-card dl,
.identity-panel dl,
.integrity-panel dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  margin: 0;
}

.weather-card dt,
.identity-panel dt,
.integrity-panel dt {
  color: var(--quiet);
  font-size: 0.67rem;
}

.weather-card dd,
.identity-panel dd,
.integrity-panel dd {
  margin: 0;
  color: #c8d9d5;
  font-size: 0.69rem;
  font-weight: 700;
  text-align: right;
}

.weather-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 14px;
}

.weather-context strong {
  font-size: 0.8rem;
}

.weather-context p {
  max-width: 850px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.weather-context > span {
  color: var(--quiet);
  font-size: 0.65rem;
  white-space: nowrap;
}

/* System */

.system-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr;
  gap: 14px;
}

.pathway {
  display: flex;
  align-items: center;
  gap: 13px;
}

.pathway > div {
  display: grid;
  min-width: 120px;
  grid-template-columns: 12px 1fr;
  gap: 3px 8px;
}

.pathway > div > span {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--quiet);
  grid-row: 1 / 3;
}

.pathway > div > span.good {
  background: var(--green);
  box-shadow: 0 0 13px rgba(132, 201, 63, 0.4);
}

.pathway > div > span.bad {
  background: var(--red);
}

.pathway strong {
  font-size: 0.72rem;
}

.pathway small {
  color: var(--quiet);
  font-size: 0.59rem;
}

.pathway > i {
  width: 30px;
  height: 1px;
  flex: 1;
  background: var(--line);
}

.identity-panel h3,
.integrity-panel h3 {
  margin-bottom: 21px;
}

.safe-text {
  color: #bce596 !important;
}

.request-panel {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1fr);
  gap: 24px;
  margin-top: 14px;
}

.request-panel p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.request-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.request-result {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.65rem;
  grid-column: 1 / -1;
}

.request-result.success { color: #bce596; }
.request-result.error { color: #f2aaa6; }

.separation-card {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 24px;
  margin-top: 14px;
  padding: 20px 22px;
  border: 1px dashed rgba(179, 218, 204, 0.17);
  border-radius: var(--radius);
}

.separation-card div {
  display: grid;
  gap: 4px;
}

.separation-card span {
  color: var(--green);
  font-size: 0.53rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.separation-card strong {
  font-size: 0.72rem;
}

.separation-card small {
  color: var(--quiet);
  font-size: 0.6rem;
  line-height: 1.4;
}

.separation-card i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(54, 195, 207, 0.08);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 22px 34px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.59rem;
}

.sidebar-overlay {
  display: none;
}

/* Expanded local-style operating views */

.sidebar {
  overflow-y: auto;
}

.sidebar nav {
  gap: 4px;
  margin-top: 34px;
}

.sidebar nav a {
  padding-block: 9px;
}

.live-badge,
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(54, 195, 207, 0.24);
  border-radius: 999px;
  color: #a7e8ec;
  background: var(--cyan-soft);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(132, 201, 63, 0.55);
}

.profile-badge {
  border-color: rgba(132, 201, 63, 0.22);
  color: #c3e99f;
  background: var(--green-soft);
}

.watch-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.watch-card {
  display: grid;
  min-height: 142px;
  align-content: start;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 105% 110%, rgba(54, 195, 207, 0.1), transparent 46%),
    var(--panel);
}

.watch-card > span {
  color: var(--quiet);
  font-size: 0.66rem;
  font-weight: 750;
}

.watch-card strong {
  margin-top: 18px;
  font-size: 1.38rem;
  letter-spacing: -0.035em;
}

.watch-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.5;
}

.overwatch-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.status-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.status-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 46px;
  padding: 12px 14px;
  background: #0b1815;
}

.status-list span {
  color: var(--quiet);
  font-size: 0.66rem;
}

.status-list strong {
  color: #c8d9d5;
  font-size: 0.7rem;
  text-align: right;
}

.watch-equipment-panel {
  margin-top: 14px;
}

.graph-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.graph-heading h3 {
  margin: 0;
  font-size: 1.08rem;
}

.graph-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 0.57rem;
}

.multi-chart-panel + .multi-chart-panel {
  margin-top: 14px;
}

.multi-chart-panel .chart-wrap {
  height: min(39vh, 360px);
  min-height: 270px;
}

.humidity-line { background: var(--cyan); }
.vpd-line { background: var(--green); }
.level-line { background: var(--amber); }
.flow-one-line { background: var(--cyan); }
.flow-two-line { background: var(--green); }

.synoptic-board {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 80px minmax(220px, 1fr) 80px minmax(220px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.process-node {
  display: grid;
  min-width: 0;
  min-height: 270px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(54, 195, 207, 0.04), transparent 58%),
    var(--panel);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.process-node.active {
  border-color: rgba(132, 201, 63, 0.28);
  background:
    linear-gradient(145deg, rgba(132, 201, 63, 0.09), transparent 58%),
    var(--panel);
  box-shadow: 0 0 38px rgba(132, 201, 63, 0.05);
}

.process-node.attention {
  border-color: rgba(233, 179, 75, 0.38);
  background:
    linear-gradient(145deg, rgba(233, 179, 75, 0.1), transparent 58%),
    var(--panel);
}

.process-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(54, 195, 207, 0.22);
  border-radius: 14px;
  color: #b8edf0;
  background: rgba(54, 195, 207, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
}

.process-node.active .process-icon {
  border-color: rgba(132, 201, 63, 0.3);
  color: #c8efa3;
  background: rgba(132, 201, 63, 0.13);
}

.process-node h3 {
  margin: 0 0 22px;
  font-size: 1.05rem;
}

.process-node .eyebrow {
  margin-bottom: 5px;
  font-size: 0.55rem;
}

.process-node dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  margin: 0;
}

.process-node dt {
  color: var(--quiet);
  font-size: 0.65rem;
}

.process-node dd {
  margin: 0;
  color: #cadbd6;
  font-size: 0.68rem;
  font-weight: 750;
  text-align: right;
}

.process-flow {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 11px;
  color: var(--quiet);
  font-size: 0.55rem;
  text-align: center;
}

.process-flow i {
  position: relative;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(54, 195, 207, 0.18), var(--cyan));
}

.process-flow i::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.return-flow i {
  background: linear-gradient(90deg, rgba(132, 201, 63, 0.18), var(--green));
}

.return-flow i::after {
  border-color: var(--green);
}

.treatment-node {
  grid-column: 1;
  grid-row: 3;
}

.treatment-flow {
  grid-column: 2;
  grid-row: 3;
}

.cooling-node {
  grid-column: 3;
  grid-row: 3;
}

.synoptic-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
}

.synoptic-status h3 {
  margin: 0;
  font-size: 1.03rem;
}

.synoptic-status p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  min-width: 0;
}

.status-list.roomy > div {
  min-height: 55px;
}

.settings-refresh-panel {
  margin-top: 14px;
}

.manual-lead {
  margin-bottom: 24px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.guide-card > span,
.architecture-step > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(132, 201, 63, 0.24);
  border-radius: 12px;
  color: #c4eca0;
  background: var(--green-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.guide-card h3,
.technical-card h3 {
  margin: 0 0 7px;
  font-size: 0.92rem;
}

.guide-card p,
.technical-card p:not(.eyebrow),
.panel-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.62;
}

.info-panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-panels h3 {
  margin: 0 0 9px;
  font-size: 0.96rem;
}

.technical-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.technical-card {
  min-height: 205px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(54, 195, 207, 0.055), transparent 56%),
    var(--panel);
}

.technical-card .eyebrow {
  margin-bottom: 13px;
  font-size: 0.55rem;
}

.architecture-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 14px;
}

.architecture-step {
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 3px 13px;
}

.architecture-step > span {
  grid-row: 1 / 3;
}

.architecture-step strong {
  align-self: end;
  font-size: 0.78rem;
}

.architecture-step small {
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.4;
}

.architecture-panel > i {
  width: 34px;
  height: 1px;
  background: var(--line);
}

@media (max-width: 1180px) {
  .watch-summary,
  .technical-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid,
  .info-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calibration-card {
    grid-column: 1 / -1;
  }

  .synoptic-board {
    grid-template-columns: minmax(220px, 1fr) 60px minmax(220px, 1fr);
  }

  .canopy-node {
    grid-column: 1;
    grid-row: 3;
  }

  .return-flow {
    grid-column: 2;
    grid-row: 3;
  }

  .treatment-node {
    grid-column: 3;
    grid-row: 3;
  }

  .treatment-flow {
    grid-column: 2;
    grid-row: 5;
  }

  .cooling-node {
    grid-column: 3;
    grid-row: 5;
  }
}

@media (max-width: 760px) {
  .watch-summary,
  .overwatch-grid,
  .settings-grid,
  .guide-grid,
  .info-panels,
  .technical-grid {
    grid-template-columns: 1fr;
  }

  .calibration-card {
    grid-column: auto;
  }

  .synoptic-board {
    grid-template-columns: 1fr;
  }

  .process-node,
  .canopy-node,
  .treatment-node,
  .cooling-node {
    grid-column: 1;
    grid-row: auto;
  }

  .process-flow,
  .return-flow,
  .treatment-flow {
    min-height: 48px;
    grid-column: 1;
    grid-row: auto;
  }

  .process-flow i {
    width: 2px;
    height: 28px;
    background: linear-gradient(rgba(54, 195, 207, 0.18), var(--cyan));
  }

  .process-flow i::after {
    top: auto;
    right: 50%;
    bottom: -1px;
    transform: translateX(50%) rotate(135deg);
  }

  .architecture-panel {
    grid-template-columns: 1fr;
  }

  .architecture-panel > i {
    width: 1px;
    height: 18px;
    margin-left: 20px;
  }

  .synoptic-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 1180px) {
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-grid {
    grid-template-columns: 1fr 1fr;
  }

  .status-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    display: block;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-shell {
    width: 100%;
  }

  .menu-button {
    display: block;
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 15;
    inset: 0;
    display: none;
    width: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .weather-grid {
    grid-template-columns: 1fr;
  }

  .weather-card {
    min-height: 0;
  }

  .lower-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .login-shell {
    align-items: start;
    padding: 18px;
  }

  .login-card {
    margin-top: 5vh;
    padding: 28px 22px;
  }

  .login-logo {
    width: 58px;
    height: 58px;
  }

  .topbar {
    min-height: 76px;
    padding: 12px 16px;
  }

  .topbar > div:nth-child(2) {
    display: none;
  }

  .connection-chip {
    min-width: 124px;
    padding: 8px 10px;
  }

  .signout {
    padding: 9px 10px;
  }

  .content {
    padding: 26px 16px 55px;
  }

  .section-lead {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .freshness-block {
    min-width: 0;
    text-align: left;
  }

  .hero-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .hero-card {
    min-height: 145px;
    padding: 17px;
    border-radius: 16px;
  }

  .hero-card > span {
    margin-bottom: 18px;
    font-size: 0.66rem;
  }

  .hero-card strong {
    font-size: 2rem;
  }

  .hero-card small {
    bottom: 16px;
    left: 17px;
  }

  .panel {
    padding: 18px;
    border-radius: 16px;
  }

  .metric-list,
  .equipment-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .status-panel {
    grid-column: auto;
  }

  .pathway {
    align-items: flex-start;
    flex-direction: column;
  }

  .pathway > i {
    width: 1px;
    height: 17px;
    margin-left: 4px;
  }

  .request-panel {
    grid-template-columns: 1fr;
  }

  .request-actions {
    justify-content: flex-start;
  }

  .separation-card {
    grid-template-columns: 1fr;
  }

  .separation-card i {
    margin: 1px 0;
  }

  .weather-context,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    padding: 20px 16px;
  }
}

/* 0.3 live presentation */

.readout-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aabdb7;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.readout-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(132, 201, 63, 0.35);
  content: "";
}

.readout-status.running {
  color: #c7ef9f;
}

.readout-status.warning {
  color: #f2aaa6;
}

.readout-status.warning::before {
  background: var(--red);
  box-shadow: 0 0 12px rgba(239, 106, 101, 0.35);
}

.readout-status.unknown::before {
  background: var(--quiet);
  box-shadow: none;
}

.dosing-panel,
.system-dosing-panel {
  margin-top: 14px;
}

.dosing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dosing-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent), #0b1815;
}

.dosing-item::after {
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green);
  filter: blur(18px);
  opacity: 0;
  content: "";
}

.dosing-item.on::after {
  opacity: 0.18;
}

.dosing-marker {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #52615d;
}

.dosing-item.on .dosing-marker {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(132, 201, 63, 0.09), 0 0 17px rgba(132, 201, 63, 0.42);
}

.dosing-item.unknown .dosing-marker {
  background: var(--amber);
}

.dosing-item > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.dosing-item strong {
  font-size: 0.84rem;
}

.dosing-item small {
  color: var(--quiet);
  font-size: 0.62rem;
}

.dosing-item em {
  position: relative;
  z-index: 1;
  margin-left: auto;
  color: var(--quiet);
  font-size: 0.63rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.dosing-item.on em {
  color: #bde995;
}

.dosing-item.unknown em {
  color: #e8ca8c;
}

.panel-refresh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.panel-refresh-row p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.66rem;
  line-height: 1.5;
}

.compact-result {
  margin-top: 12px;
}

.watch-card {
  min-height: 184px;
  align-content: stretch;
  padding: 22px;
}

.watch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watch-label > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.watch-label > small {
  color: var(--green);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.watch-reading {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 26px;
}

.watch-card .watch-reading strong {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.watch-reading em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.watch-reading.text-reading strong {
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  line-height: 1;
}

.watch-card > p {
  align-self: end;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.5;
}

.climate-watch {
  background: radial-gradient(circle at 105% 110%, rgba(233, 179, 75, 0.16), transparent 48%), var(--panel);
}

.reservoir-watch {
  background: radial-gradient(circle at 105% 110%, rgba(54, 195, 207, 0.16), transparent 48%), var(--panel);
}

.equipment-watch {
  background: radial-gradient(circle at 105% 110%, rgba(141, 124, 239, 0.16), transparent 48%), var(--panel);
}

.protection-watch {
  background: radial-gradient(circle at 105% 110%, rgba(132, 201, 63, 0.16), transparent 48%), var(--panel);
}

.protection-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 110px;
}

.protection-head > span {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--quiet);
}

.protection-head.clear > span {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(132, 201, 63, 0.08), 0 0 18px rgba(132, 201, 63, 0.36);
}

.protection-head.attention > span {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(239, 106, 101, 0.08);
}

.protection-head > div {
  display: grid;
  gap: 2px;
}

.protection-head small {
  color: var(--quiet);
  font-size: 0.5rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.protection-head strong {
  font-size: 0.75rem;
}

.protection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.protection-row {
  display: grid;
  min-height: 82px;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1815;
}

.protection-row > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--quiet);
}

.protection-row.good > span { background: var(--green); }
.protection-row.info > span { background: var(--cyan); }
.protection-row.warning > span { background: var(--amber); }
.protection-row.danger > span { background: var(--red); }

.protection-row > div {
  display: grid;
  gap: 4px;
}

.protection-row strong {
  font-size: 0.72rem;
}

.protection-row small {
  color: var(--quiet);
  font-size: 0.6rem;
  line-height: 1.4;
}

.protection-row em {
  color: var(--muted);
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.protection-row.good em { color: #bde995; }
.protection-row.info em { color: #a7e8ec; }
.protection-row.warning em { color: #f4d493; }
.protection-row.danger em { color: #f2aaa6; }

.weather-forecast-panel {
  margin-top: 14px;
  padding-bottom: 18px;
}

.weather-periods {
  display: grid;
  grid-template-columns: repeat(8, minmax(132px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-color: rgba(132, 201, 63, 0.45) transparent;
}

.weather-periods article {
  display: grid;
  min-height: 205px;
  align-content: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(54, 195, 207, 0.05), transparent), #0b1815;
}

.weather-periods article > small {
  color: var(--quiet);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weather-periods article > b {
  min-height: 36px;
  margin-top: 15px;
  font-size: 1.55rem;
  font-weight: 500;
}

.weather-periods article > strong {
  margin-top: 4px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.weather-periods article > span {
  min-height: 34px;
  margin-top: 7px;
  color: #c8d9d5;
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1.35;
}

.weather-periods article > div {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.weather-periods article em {
  color: var(--quiet);
  font-size: 0.57rem;
  font-style: normal;
}

.weather-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  color: var(--quiet);
  text-align: center;
  font-size: 0.75rem;
}

@media (max-width: 1180px) {
  .dosing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .dosing-grid {
    grid-template-columns: 1fr;
  }

  .panel-refresh-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .watch-card {
    min-height: 165px;
  }

  .watch-card .watch-reading strong {
    font-size: 3rem;
  }

  .protection-row {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .protection-row em {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 0.4.0 — shared view aligned with the DB6 control-room hierarchy */

.lower-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.equipment-item.unknown .dot {
  background: var(--amber);
}

.equipment-item.unknown em {
  color: #e8ca8c;
}

.dosing-compact {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compact-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.compact-heading .eyebrow {
  margin-bottom: 4px;
  font-size: 0.52rem;
}

.compact-heading h4 {
  margin: 0;
  font-size: 0.78rem;
}

.dosing-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dosing-strip .dosing-item {
  min-height: 48px;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
}

.dosing-strip .dosing-item::after {
  display: none;
}

.dosing-strip .dosing-marker {
  width: 7px;
  height: 7px;
}

.dosing-strip .dosing-item strong {
  overflow: hidden;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dosing-strip .dosing-item em {
  font-size: 0.5rem;
}

.watch-list {
  display: grid;
  gap: 9px;
}

.watch-item {
  display: grid;
  min-height: 76px;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--quiet);
  border-radius: 11px;
  background: #0b1815;
}

.watch-item.fault { border-left-color: var(--red); }
.watch-item.warning { border-left-color: var(--amber); }
.watch-item.info { border-left-color: var(--cyan); }
.watch-item.healthy { border-left-color: var(--green); }

.watch-severity {
  display: inline-flex;
  width: fit-content;
  padding: 5px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--quiet);
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.watch-item.fault .watch-severity { color: #f2aaa6; }
.watch-item.warning .watch-severity { color: #f4d493; }
.watch-item.info .watch-severity { color: #a7e8ec; }
.watch-item.healthy .watch-severity { color: #bde995; }

.watch-item > div {
  display: grid;
  gap: 6px;
}

.watch-item strong {
  font-size: 0.77rem;
}

.watch-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.5;
}

.attention-badge,
.readout-status.danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.attention-badge.danger,
.readout-status.danger {
  border-color: rgba(239, 106, 101, 0.3);
  color: #f2aaa6;
  background: rgba(239, 106, 101, 0.08);
}

.attention-badge.warning {
  border-color: rgba(233, 179, 75, 0.3);
  color: #f4d493;
  background: rgba(233, 179, 75, 0.08);
}

.attention-badge.good {
  border-color: rgba(132, 201, 63, 0.26);
  color: #bde995;
  background: var(--green-soft);
}

.panel-pill.danger {
  border-color: rgba(239, 106, 101, 0.3);
  color: #f2aaa6;
  background: rgba(239, 106, 101, 0.08);
}

#overwatch .attention-panel {
  margin-top: 14px;
}

.watch-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.watch-summary .watch-card {
  min-height: 108px;
  padding: 15px;
  border-radius: 13px;
  background: var(--panel);
}

.watch-summary .watch-card > span {
  font-size: 0.6rem;
}

.watch-summary .watch-card > strong {
  margin-top: 13px;
  font-size: 1.65rem;
}

.watch-summary .watch-card > small {
  margin-top: 6px;
  font-size: 0.56rem;
}

.readiness-panel,
.watch-equipment-panel {
  margin-top: 14px;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.readiness-grid > div {
  display: grid;
  min-height: 104px;
  align-content: start;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--quiet);
  border-radius: 11px;
  background: #0b1815;
}

.readiness-grid > div.healthy { border-top-color: var(--green); }
.readiness-grid > div.warning { border-top-color: var(--amber); }
.readiness-grid > div.fault { border-top-color: var(--red); }

.readiness-grid span {
  color: var(--quiet);
  font-size: 0.57rem;
}

.readiness-grid strong {
  font-size: 0.75rem;
}

.readiness-grid small {
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.42;
}

.request-panel {
  grid-template-columns: minmax(300px, 1fr) auto;
}

@media (max-width: 1280px) {
  .watch-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .readiness-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .readiness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .watch-summary,
  .readiness-grid,
  .dosing-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-item {
    grid-template-columns: 1fr;
  }

  .request-panel {
    grid-template-columns: 1fr;
  }

  .request-actions {
    justify-content: flex-start;
  }
}

/* 0.5.0: STA parity for Home, Overwatch and System */

.dashboard-body .topbar {
  display: none;
}

.dashboard-body .content {
  width: 100%;
  max-width: none;
  padding: 34px 34px 54px;
}

.sidebar-signout {
  margin: 8px 14px 18px;
}

.sidebar-signout button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.sidebar-signout button:hover {
  color: var(--ink);
  border-color: rgba(132, 201, 63, 0.35);
}

.sta-page {
  --sta-panel: #0d1b18;
  --sta-panel-soft: #10211e;
}

.sta-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.sta-page-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.sta-page-header p:not(.eyebrow) {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.sta-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.system-state,
.clock-block {
  min-width: 170px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--sta-panel);
}

.system-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--quiet);
  box-shadow: 0 0 0 5px rgba(101, 122, 116, 0.12);
}

.system-state.healthy .state-light { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.system-state.warning .state-light { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.system-state.fault .state-light { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }

.system-state span:last-child,
.clock-block {
  display: grid;
  gap: 3px;
}

.system-state small,
.clock-block small {
  color: var(--quiet);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-state strong,
.clock-block strong {
  font-size: 0.78rem;
}

.clock-block {
  text-align: right;
}

.clock-block strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.sta-freshness {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 9px;
  margin: -12px 2px 14px;
  color: var(--quiet);
  font-size: 0.69rem;
}

.sta-freshness strong { color: var(--ink); }

.gauge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.gauge-card {
  position: relative;
  min-width: 0;
  padding: 17px 18px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(16, 34, 30, 0.96), rgba(10, 24, 21, 0.96));
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #b9cbc5;
  font-size: 0.74rem;
  font-weight: 750;
}

.sensor-state {
  color: var(--green);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gauge-wrap {
  position: relative;
  height: 126px;
}

.gauge-wrap canvas {
  display: block;
  width: 100%;
  height: 138px;
  margin: -4px auto 0;
}

.gauge-reading {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;

  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;

  pointer-events: none;
}

.gauge-reading strong {
  font-size: clamp(28px, 2.4vw, 38px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.gauge-reading span,
.gauge-scale {
  color: var(--quiet);
  font-size: 0.62rem;
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
}

.sta-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sta-metric-grid > article {
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--sta-panel);
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.66rem;
  font-weight: 900;
}

.metric-icon.blue-tint { color: var(--cyan); background: var(--cyan-soft); }

.sta-metric-grid article > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.sta-metric-grid small { color: var(--quiet); font-size: 0.62rem; }
.sta-metric-grid strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.sta-metric-grid em { color: var(--quiet); font-size: 0.58rem; font-style: normal; }

.sta-home-grid,
.sta-detail-grid,
.overwatch-watch-grid,
.overwatch-detail-grid,
.system-detail-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.sta-home-grid { grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr); }
.sta-detail-grid,
.overwatch-watch-grid,
.overwatch-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.system-detail-grid { grid-template-columns: minmax(390px, 0.95fr) minmax(390px, 1fr) minmax(380px, 1fr); }

.sta-page .panel {
  padding: 20px;
  border-radius: 17px;
}

.sta-page .panel-heading h3 {
  margin: 0;
  font-size: 1.08rem;
}

.sta-page .equipment-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sta-page .equipment-item {
  min-height: 64px;
  padding: 11px 12px;
}

.dosing-compact {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.compact-heading h4 { margin: 0; font-size: 0.9rem; }

.dosing-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dosing-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 15, 12, 0.35);
}

.dosing-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quiet);
}

.dosing-item.on .dosing-marker { background: var(--green); box-shadow: 0 0 12px rgba(132, 201, 63, 0.6); }
.dosing-item strong { font-size: 0.64rem; }
.dosing-item em { color: var(--quiet); font-size: 0.55rem; font-style: normal; }

.level-state,
.panel-badge {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.level-state.good,
.panel-badge.healthy,
.panel-badge.good { color: #bbed8b; border-color: rgba(132, 201, 63, 0.32); background: var(--green-soft); }
.level-state.fault,
.panel-badge.fault,
.panel-badge.danger { color: #ffb2ae; border-color: rgba(239, 106, 101, 0.34); background: var(--red-soft); }
.panel-badge.warning { color: #ffd58b; border-color: rgba(233, 179, 75, 0.34); background: var(--amber-soft); }

.sta-page .status-list {
  display: grid;
  margin: 12px 0 0;
}

.sta-page .status-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.sta-page .status-list > div:last-child { border-bottom: 0; }
.sta-page .status-list dt { color: var(--quiet); font-size: 0.66rem; }
.sta-page .status-list dd { margin: 0; color: #c4d5cf; font-size: 0.68rem; font-weight: 750; text-align: right; }

.overwatch-summary,
.system-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.overwatch-summary > article,
.system-summary > article {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sta-panel);
}

.overwatch-summary article { display: grid; align-content: start; gap: 7px; }
.overwatch-summary small { color: var(--quiet); font-size: 0.62rem; }
.overwatch-summary strong { font-size: 1.8rem; line-height: 1; }
.overwatch-summary span { color: var(--muted); font-size: 0.58rem; line-height: 1.35; }

.overwatch-watch-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr); }
.interpretation-note { margin: 12px 0 0; color: var(--quiet); font-size: 0.62rem; line-height: 1.5; }

.sta-page .readiness-panel,
.sta-page .timeline-panel { margin-top: 14px; }

.sta-page .readiness-grid > div {
  min-height: 110px;
}

.timeline-axis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 18px 10px 8px 256px;
  color: var(--quiet);
  font-size: 0.55rem;
}

.timeline-axis span { text-align: center; }
.timeline-axis span:first-child { text-align: left; }
.timeline-axis span:last-child { text-align: right; }

.schedule-timeline {
  display: grid;
  gap: 8px;
}

.timeline-loading {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.schedule-row {
  display: grid;
  grid-template-columns: 205px 92px minmax(320px, 1fr) 112px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 16, 13, 0.44);
}

.schedule-row.running { border-color: rgba(132, 201, 63, 0.3); }
.schedule-row.blocked { border-color: rgba(239, 106, 101, 0.38); }

.relay-identity {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
}

.relay-identity > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.62rem;
  font-weight: 900;
}

.relay-identity p,
.relay-live-state,
.relay-mode-readout { display: grid; gap: 3px; margin: 0; }
.relay-identity strong { font-size: 0.7rem; }
.relay-identity small,
.relay-live-state small,
.relay-mode-readout small { color: var(--quiet); font-size: 0.53rem; line-height: 1.35; }

.relay-live-state strong { color: var(--muted); font-size: 0.8rem; }
.relay-live-state.on strong { color: var(--green); }

.relay-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #07110f;
}

.relay-track > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: rgba(179, 218, 204, 0.08);
}

.timeline-segment {
  position: absolute;
  top: 2px;
  height: 2px;
  min-width: 2px;
  border-radius: 999px;
  background: var(--green);
  opacity: 0.72;
}

.timeline-segment.window-2 {
  top: 5px;
  background: var(--cyan);
}

.timeline-segment.window-3 {
  top: 8px;
  background: #9bcf57;
}

.timeline-segment.window-4 {
  top: 11px;
  background: #72c7e8;
}

.timeline-segment.window-5 {
  top: 14px;
  background: #b8dc86;
}

.timeline-segment.window-6 {
  top: 17px;
  background: #9bd9ef;
}

.timeline-segment.overnight {
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.18) 0 8px,
    transparent 8px 12px
  );
}

.timeline-segment.active-window {
  height: 3px;
  opacity: 1;
  box-shadow: 0 0 5px rgba(241, 247, 248, 0.65);
}

.timeline-now {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.65);
}

.relay-timing-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  margin-top: 6px;
}

.relay-timing-copy span { grid-column: 1 / -1; color: #bfd0ca; font-size: 0.58rem; }
.relay-timing-copy small,
.relay-timing-copy em { color: var(--quiet); font-size: 0.52rem; font-style: normal; }

.relay-mode-readout {
  justify-items: end;
  text-align: right;
}

.relay-mode-readout strong {
  color: var(--green);
  font-size: 0.6rem;
}

.relay-mode-readout.override strong { color: var(--amber); }

.priority-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.priority-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
}

.priority-list li > strong {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.6rem;
}

.priority-list span { display: grid; gap: 3px; }
.priority-list b { font-size: 0.7rem; }
.priority-list small { color: var(--muted); font-size: 0.62rem; line-height: 1.45; }

.system-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.system-summary > article { display: flex; align-items: center; gap: 12px; }
.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 900;
}
.summary-icon.motion { color: var(--cyan); background: var(--cyan-soft); }
.summary-icon.safety { color: var(--amber); background: var(--amber-soft); }
.system-summary p { display: grid; gap: 3px; margin: 0; }
.system-summary small { color: var(--quiet); font-size: 0.58rem; }
.system-summary strong { font-size: 1.05rem; }
.system-summary em { color: var(--muted); font-size: 0.55rem; font-style: normal; }

.control-room-panel { margin-top: 14px; }
.system-panel-heading { align-items: center; }
.system-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.system-legend span { padding: 5px 7px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,0.03); font-size: 0.52rem; }
.system-legend .running { color: var(--green); }
.system-legend .warning { color: var(--amber); }
.system-legend .fault { color: var(--red); }

.control-map {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 58px minmax(250px, 1.22fr) 58px minmax(190px, 1fr);
  align-items: stretch;
  gap: 11px 7px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(rgba(54, 195, 207, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 195, 207, 0.018) 1px, transparent 1px),
    rgba(3, 9, 11, 0.23);
  background-size: 22px 22px;
}

.map-zone {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 16, 13, 0.4);
}
.map-zone.running { border-color: rgba(132, 201, 63, 0.34); }
.map-zone.warning { border-color: rgba(233, 179, 75, 0.34); }
.map-zone.fault { border-color: rgba(239, 106, 101, 0.4); }
.climate-zone,
.controller-zone,
.grow-zone,
.dosing-zone,
.reservoir-zone,
.data-zone { grid-column: auto; }

.map-connector {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--quiet);
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.map-connector i {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #2d4248, var(--cyan), #2d4248);
  opacity: 0.6;
}

.map-connector i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--cyan);
  border-right: 1px solid var(--cyan);
  content: '';
  transform: rotate(45deg);
}

.dosing-link i { background: linear-gradient(90deg, #2d4248, var(--green), #2d4248); }
.dosing-link i::after { border-color: var(--green); }
.system-dose-rates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 7px;
  margin-top: 7px;
  color: var(--cyan);
  font-size: 0.5rem;
  font-weight: 800;
}
.zone-note { margin: 8px 0 0; color: var(--quiet); font-size: 0.51rem; line-height: 1.4; }

.zone-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
}
.zone-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--cyan);
  background: var(--cyan-soft);
  font-size: 0.58rem;
  font-weight: 900;
}
.zone-heading div { display: grid; gap: 2px; }
.zone-heading small { color: var(--quiet); font-size: 0.5rem; letter-spacing: 0.08em; }
.zone-heading strong { font-size: 0.73rem; }
.node-state { color: var(--muted); font-size: 0.52rem; font-style: normal; text-transform: uppercase; }
.map-zone.running .node-state,
.map-zone.healthy .node-state { color: var(--green); }
.map-zone.warning .node-state { color: var(--amber); }
.map-zone.fault .node-state { color: var(--red); }

.zone-metrics,
.controller-grid,
.reservoir-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.zone-metrics span,
.controller-grid span,
.reservoir-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.zone-metrics small,
.controller-grid small,
.reservoir-metrics small { color: var(--quiet); font-size: 0.5rem; }
.zone-metrics strong,
.controller-grid strong,
.reservoir-metrics strong { font-size: 0.67rem; }

.mini-status-row,
.output-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.mini-status-row span,
.output-chip-grid > span,
.service-list > span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.55rem;
}
.output-chip-grid > span,
.service-list > span { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; }
.output-chip-grid i,
.service-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); }
.output-chip-grid .running i,
.service-list .healthy i { background: var(--green); }
.output-chip-grid b,
.service-list b { font-size: 0.57rem; }
.output-chip-grid em,
.service-list em { color: var(--quiet); font-size: 0.5rem; font-style: normal; }
.controller-build { margin-top: 10px; color: var(--green); font-size: 0.62rem; font-weight: 750; }

.reservoir-zone { display: grid; grid-template-columns: 90px 1fr; gap: 14px; }
.reservoir-visual {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border: 2px solid rgba(54, 195, 207, 0.34);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(54, 195, 207, 0.04);
}
.reservoir-visual > span { position: absolute; inset: auto 0 0; background: linear-gradient(rgba(54,195,207,.26), rgba(54,195,207,.55)); transition: height 400ms ease; }
.reservoir-visual strong { position: absolute; z-index: 2; inset: 50% 0 auto; text-align: center; font-size: 1rem; }
.reservoir-visual b { position: relative; z-index: 2; display: block; margin: 14px 8px; color: var(--quiet); font-size: 0.52rem; }
.service-list { display: grid; gap: 7px; margin-top: 12px; }

.water-circuits { display: grid; gap: 9px; margin-top: 10px; }
.circuit-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 13px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; }
.circuit-row.running { border-color: rgba(132, 201, 63, 0.3); }
.circuit-row.fault { border-color: rgba(239, 106, 101, 0.4); }
.circuit-title { display: flex; align-items: center; gap: 9px; }
.circuit-title > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); font-size: 0.55rem; font-weight: 900; }
.circuit-title p { display: grid; gap: 2px; margin: 0; }
.circuit-title small { color: var(--quiet); font-size: 0.48rem; }
.circuit-title strong { font-size: 0.63rem; }
.circuit-path { display: flex; align-items: stretch; min-width: 0; }
.circuit-node { display: grid; min-width: 118px; grid-template-columns: auto 1fr; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.circuit-node > span { color: var(--cyan); font-size: 0.52rem; font-weight: 850; }
.circuit-node p { display: grid; gap: 2px; margin: 0; }
.circuit-node small { color: var(--quiet); font-size: 0.45rem; }
.circuit-node strong { font-size: 0.55rem; }
.circuit-node em { grid-column: 1 / -1; color: var(--muted); font-size: 0.48rem; font-style: normal; }
.circuit-node.running em,
.circuit-node.healthy em { color: var(--green); }
.circuit-node.fault em { color: var(--red); }
.flow-arrow { position: relative; flex: 1 1 26px; min-width: 18px; }
.flow-arrow::before { position: absolute; top: 50%; right: 3px; left: 3px; height: 1px; background: rgba(54,195,207,.3); content: ''; }
.flow-arrow::after { position: absolute; top: calc(50% - 3px); right: 2px; width: 6px; height: 6px; border-top: 1px solid var(--cyan); border-right: 1px solid var(--cyan); content: ''; transform: rotate(45deg); }
.return-arrow { margin: auto 0 auto 6px; color: var(--quiet); font-size: 0.48rem; font-style: normal; font-weight: 850; letter-spacing: 0.08em; }

.interlock-stack { display: grid; margin-top: 14px; }
.interlock-stack > div { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.interlock-stack > i { width: 1px; height: 7px; margin: 0 0 0 25px; background: var(--line); }
.interlock-stack div > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--cyan); background: var(--cyan-soft); font-size: 0.52rem; font-weight: 900; }
.interlock-stack p { display: grid; gap: 3px; margin: 0; }
.interlock-stack strong { font-size: 0.65rem; }
.interlock-stack small { color: var(--muted); font-size: 0.54rem; line-height: 1.35; }
.interlock-stack em { color: var(--muted); font-size: 0.53rem; font-style: normal; font-weight: 850; }
.interlock-stack .healthy em { color: var(--green); }
.interlock-stack .fault em { color: var(--red); }
.interlock-stack .warning em { color: var(--amber); }

.system-events-panel { grid-column: 1 / -1; }
.system-status-list dd { overflow-wrap: anywhere; }

@media (max-width: 1450px) {
  .system-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-events-panel { grid-column: 1 / -1; }
  .schedule-row { grid-template-columns: 185px 78px minmax(280px, 1fr); }
  .relay-mode-readout { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
}

@media (max-width: 1180px) {
  .gauge-grid,
  .sta-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sta-home-grid,
  .sta-detail-grid,
  .overwatch-watch-grid,
  .overwatch-detail-grid,
  .system-detail-grid { grid-template-columns: 1fr; }
  .system-events-panel { grid-column: auto; }
  .control-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-connector { display: none; }
  .climate-zone,
  .controller-zone,
  .grow-zone,
  .dosing-zone,
  .reservoir-zone,
  .data-zone { grid-column: auto; }
  .reservoir-zone { grid-column: 1 / -1; }
  .circuit-row { grid-template-columns: 1fr; }
  .timeline-axis { margin-left: 0; }
}

@media (max-width: 820px) {
  .dashboard-body .content { padding: 24px 16px 44px; }
  .sta-page-header { display: grid; }
  .sta-header-meta { flex-wrap: wrap; }
  .overwatch-summary,
  .system-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sta-page .equipment-grid,
  .dosing-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-row { grid-template-columns: 1fr; }
  .relay-mode-readout { justify-content: flex-start; justify-items: start; text-align: left; }
  .circuit-path { overflow-x: auto; padding-bottom: 5px; }
}

@media (max-width: 560px) {
  .gauge-grid,
  .sta-metric-grid,
  .control-map,
  .overwatch-summary,
  .system-summary { grid-template-columns: 1fr; }
  .reservoir-zone { grid-column: auto; }
  .sta-header-meta { display: grid; }
  .system-state,
  .clock-block { min-width: 0; width: 100%; }
  .clock-block { text-align: left; }
}

/* Mobile navigation: restore top bar so hamburger remains accessible */
@media (max-width: 900px) {
  .dashboard-body .topbar {
    display: flex;
  }
}

/* 0.5.2 — detailed Synoptic colour bridge */

#synoptic {
  --agri-green: var(--green);
  --agri-blue: var(--cyan);
  --text-main: var(--ink);
  --text-soft: var(--muted);
  --text-faint: var(--quiet);
  --danger-red: var(--red);
  --warning-amber: var(--amber);
  --good-green: var(--green);
  --panel-border: rgba(179, 218, 204, 0.12);
}

#synoptic .synoptic2-panel {
  margin-top: 14px;
}

#synoptic .synoptic2-heading h3 {
  margin: 0;
  font-size: 1rem;
}

#synoptic .synoptic2-scroll {
  -webkit-overflow-scrolling: touch;
}

#synoptic.synoptic2-stale .s2-pipe.active::after,
#synoptic.synoptic2-stale .s2-pump.running .s2-pump-rotor::before,
#synoptic.synoptic2-stale .s2-chiller.running .s2-chiller-fan,
#synoptic.synoptic2-stale .running .fan-symbol,
#synoptic.synoptic2-stale .s2-air-stone i {
  animation-play-state: paused !important;
}

#synoptic.synoptic2-stale .synoptic2-canvas {
  opacity: 0.78;
}

.synoptic-remote-note {
  margin-top: 10px;
}

.synoptic-remote-note > strong {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
}

.synoptic-remote-note > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

/* ========================================================================== */
/* Build 1S-A — retained high-detail symbolic process Synoptic                */
/* ========================================================================== */

.synoptic2-main { max-width: 1780px; }

.synoptic2-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.synoptic2-summary article {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #26383d;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(23, 37, 41, 0.94), rgba(13, 23, 26, 0.94));
  box-shadow: inset 2px 0 0 rgba(52, 179, 228, 0.54);
}

.synoptic2-summary small,
.synoptic2-summary strong,
.synoptic2-summary span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.synoptic2-summary small { color: var(--text-faint); font-size: 6px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.synoptic2-summary strong { margin-top: 5px; color: var(--text-main); font-size: 10px; }
.synoptic2-summary span { margin-top: 4px; color: var(--text-soft); font-size: 7px; }

.synoptic2-panel { padding: 14px; overflow: hidden; }
.synoptic2-heading { align-items: flex-start; }
.synoptic2-heading h2 { font-size: 13px; }

.synoptic2-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.synoptic2-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #2d4248;
  border-radius: 999px;
  background: rgba(5, 12, 14, 0.55);
  color: var(--text-soft);
  font-size: 6px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.synoptic2-legend span::before { width: 8px; height: 3px; border-radius: 99px; background: currentColor; content: ""; }
.synoptic2-legend .grow { color: #34B3E4; }
.synoptic2-legend .recirc { color: #7CB82F; }
.synoptic2-legend .cooling { color: #9B87F5; }
.synoptic2-legend .dosing { color: #E4A74C; }
.synoptic2-legend .air { color: #55D3C2; }
.synoptic2-legend .signal { color: #E4A74C; }

.synoptic2-mobile-hint {
  display: none;
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 7px;
}

.synoptic2-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid #263a3f;
  border-radius: 10px;
  background: #081113;
  scrollbar-color: #35515a #0b1518;
}

.synoptic2-canvas {
  position: relative;
  width: 1540px;
  min-width: 1540px;
  height: 1120px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(52, 179, 228, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(52, 179, 228, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 44% 55%, rgba(52, 179, 228, 0.07), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(124, 184, 47, 0.05), transparent 27%),
    #091315;
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

.synoptic2-canvas::after {
  position: absolute;
  inset: 14px;
  z-index: 0;
  border: 1px solid rgba(62, 91, 99, 0.24);
  border-radius: 8px;
  pointer-events: none;
  content: "";
}

.s2-zone-label {
  position: absolute;
  z-index: 1;
  color: rgba(156, 185, 193, 0.34);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.18em;
}
.zone-grow { left: 38px; top: 28px; }
.zone-water { left: 38px; top: 480px; }
.zone-control { left: 1040px; top: 28px; }

.s2-pipe {
  --pipe-color: #34B3E4;
  --pipe-flow: #a9e8ff;
  position: absolute;
  z-index: 2;
  height: 10px;
  border: 1px solid color-mix(in srgb, var(--pipe-color) 58%, #20343a);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pipe-color) 17%, #0a1518);
  box-shadow: inset 0 0 0 2px rgba(2, 8, 10, 0.48), 0 0 8px rgba(0, 0, 0, 0.4);
}

.s2-pipe.vertical { width: 10px; height: auto; }
.s2-pipe.grow { --pipe-color: #34B3E4; --pipe-flow: #b9efff; }
.s2-pipe.recirc { --pipe-color: #7CB82F; --pipe-flow: #d1f79e; }
.s2-pipe.cooling { --pipe-color: #9B87F5; --pipe-flow: #d8ceff; }
.s2-pipe.air { --pipe-color: #55D3C2; --pipe-flow: #c1fff5; height: 6px; border-style: dashed; }
.s2-pipe.air.vertical { width: 6px; height: auto; }
.s2-pipe.dosing { --pipe-color: #E4A74C; --pipe-flow: #ffe0a8; height: 6px; }
.s2-pipe.dosing.vertical { width: 6px; height: auto; }
.s2-pipe.chemical {
  --pipe-color: #f2c56f;
  --pipe-flow: #fff0bf;
  height: 4px;
  border-style: dashed;
  background: rgba(228, 167, 76, 0.08);
}
.s2-pipe.chemical.vertical { width: 4px; height: auto; }

.s2-pipe::after {
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: repeating-linear-gradient(90deg, transparent 0 12px, var(--pipe-flow) 12px 22px, transparent 22px 34px);
  opacity: 0;
  content: "";
}
.s2-pipe.vertical::after { background: repeating-linear-gradient(180deg, transparent 0 12px, var(--pipe-flow) 12px 22px, transparent 22px 34px); }
.s2-pipe.active { box-shadow: inset 0 0 0 2px rgba(2, 8, 10, 0.4), 0 0 12px color-mix(in srgb, var(--pipe-color) 40%, transparent); }
.s2-pipe.active::after { opacity: 0.95; animation: s2FlowHorizontal 900ms linear infinite; }
.s2-pipe.active.vertical::after { animation-name: s2FlowVertical; }
.s2-pipe.fault { --pipe-color: #e45b5b; --pipe-flow: #ffc0b9; }
.s2-pipe.fault::after { opacity: 0.62; animation: s2FaultPulse 900ms ease-in-out infinite alternate; }

.s2-pipe.arrow-right::before,
.s2-pipe.arrow-left::before,
.s2-pipe.arrow-up::before,
.s2-pipe.arrow-down::before {
  position: absolute;
  z-index: 3;
  width: 0;
  height: 0;
  content: "";
}
.s2-pipe.arrow-right::before { right: -8px; top: -4px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 10px solid var(--pipe-color); }
.s2-pipe.arrow-left::before { left: -8px; top: -4px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 10px solid var(--pipe-color); }
.s2-pipe.arrow-down::before { left: -4px; bottom: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid var(--pipe-color); }
.s2-pipe.arrow-up::before { left: -4px; top: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 10px solid var(--pipe-color); }

@keyframes s2FlowHorizontal { to { background-position: 34px 0; } }
@keyframes s2FlowVertical { to { background-position: 0 34px; } }
@keyframes s2FaultPulse { from { opacity: 0.28; } to { opacity: 0.9; } }

.pipe-grow-a { left: 542px; top: 660px; width: 10px; }
.pipe-grow-b { left: 454px; top: 522px; height: 90px; }
.pipe-grow-c { left: 454px; top: 412px; height: 20px; }
.pipe-return-a { left: 891px; top: 408px; height: 104px; }
.pipe-return-b { left: 823px; top: 520px; width: 68px; }
.pipe-return-c { left: 815px; top: 528px; height: 30px; }

.pipe-recirc-a { left: 928px; top: 666px; width: 30px; }
.pipe-recirc-b { left: 1158px; top: 666px; width: 20px; }
.pipe-recirc-c { left: 1418px; top: 666px; width: 24px; }
.pipe-recirc-d { left: 1450px; top: 674px; height: 159px; }
.pipe-recirc-e { left: 932px; top: 841px; width: 510px; }

.pipe-cooling-a { left: 646px; top: 878px; height: 34px; }
.pipe-cooling-b { left: 558px; top: 920px; width: 80px; }
.pipe-cooling-h { left: 550px; top: 928px; height: 20px; }
.pipe-cooling-c { left: 558px; top: 995px; width: 30px; }
.pipe-cooling-d { left: 793px; top: 995px; width: 75px; }
.pipe-cooling-e { left: 1188px; top: 995px; width: 179px; }
.pipe-cooling-f { left: 1375px; top: 849px; height: 138px; }
.pipe-cooling-g { left: 932px; top: 841px; width: 435px; }

.pipe-air-a { left: 298px; top: 296px; width: 24px; }
.pipe-air-b { left: 330px; top: 304px; height: 398px; }
.pipe-air-c { left: 338px; top: 710px; width: 214px; }

.pipe-dose-a { left: 532px; top: 770px; width: 20px; }
.pipe-dose-b { left: 425px; top: 818px; height: 10px; }
.pipe-dose-c { left: 523px; top: 870px; width: 25px; }

.pipe-chemical-a { left: 300px; top: 770px; height: 160px; }
.pipe-chemical-b { left: 300px; top: 938px; width: 232px; }
.pipe-chemical-c { left: 540px; top: 878px; height: 52px; }

.s2-route-label {
  position: absolute;
  z-index: 4;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(5, 12, 14, 0.9);
  color: var(--text-faint);
  font-size: 5.5px;
  font-weight: 950;
  letter-spacing: 0.09em;
}
.label-grow-supply { left: 470px; top: 535px; color: #6ecbf0; }
.label-grow-return { left: 790px; top: 492px; color: #6ecbf0; }
.label-recirc { left: 1130px; top: 812px; color: #9ad961; }
.label-cooling { left: 760px; top: 1060px; color: #b6a6ff; }
.label-dosing { left: 350px; top: 914px; color: #f0bd69; }
.label-chemical { left: 72px; top: 772px; color: #f0bd69; }

.s2-injection-junction {
  position: absolute;
  z-index: 5;
  left: 536px;
  top: 866px;
  width: 10px;
  height: 10px;
  border: 2px solid #f2c56f;
  border-radius: 50%;
  background: #091315;
  box-shadow: 0 0 8px rgba(242, 197, 111, 0.28);
}

.s2-wire {
  position: absolute;
  z-index: 1;
  border-color: rgba(228, 167, 76, 0.42);
  border-style: dashed;
  pointer-events: none;
}
.s2-wire.input { border-color: rgba(52, 179, 228, 0.34); }
.s2-wire.output { border-color: rgba(228, 167, 76, 0.34); }
.wire-env-input { left: 320px; top: 132px; width: 720px; border-top-width: 1px; }
.wire-water-input { left: 1018px; top: 132px; height: 865px; border-left-width: 1px; }
.wire-flow-input { left: 785px; top: 994px; width: 233px; border-top-width: 1px; }
.wire-output-trunk { left: 1514px; top: 245px; height: 755px; border-left-width: 1px; }
.wire-output-grow { left: 860px; top: 318px; width: 655px; border-top-width: 1px; }
.wire-output-water { left: 1150px; top: 665px; width: 365px; border-top-width: 1px; }

.s2-wire-label {
  position: absolute;
  z-index: 2;
  padding: 2px 4px;
  background: #091315;
  font-size: 5px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.wire-input-label { left: 875px; top: 123px; color: rgba(52, 179, 228, 0.64); }
.wire-output-label { left: 1415px; top: 310px; color: rgba(228, 167, 76, 0.66); }

.s2-component,
.s2-grow-bed,
.s2-dosing-rack,
.s2-pump,
.s2-flow-meter,
.s2-reservoir,
.s2-chiller,
.s2-control-cabinet {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  border: 1px solid #30464c;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(24, 40, 44, 0.98), rgba(10, 20, 23, 0.98));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), inset 2px 0 0 rgba(52, 179, 228, 0.25);
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.s2-component.running,
.s2-grow-bed.running,
.s2-dosing-rack.running,
.s2-pump.running,
.s2-flow-meter.running,
.s2-reservoir.running,
.s2-chiller.running { border-color: rgba(124, 184, 47, 0.88); box-shadow: 0 0 18px rgba(124, 184, 47, 0.16), inset 2px 0 0 var(--agri-green); }
.s2-component.fault,
.s2-dosing-rack.fault,
.s2-pump.fault,
.s2-flow-meter.fault,
.s2-reservoir.fault,
.s2-chiller.fault,
.s2-control-cabinet.fault { border-color: rgba(228, 91, 91, 0.9); box-shadow: 0 0 18px rgba(228, 91, 91, 0.18), inset 2px 0 0 #e45b5b; }
.s2-component.unavailable,
.s2-pump.unavailable,
.s2-flow-meter.unavailable,
.s2-reservoir.unavailable,
.s2-chiller.unavailable { opacity: 0.58; }

.s2-component > header,
.s2-light-bank > header,
.s2-canopy-fan > header,
.s2-air-pump > header,
.s2-uv-unit > header,
.s2-chiller > header,
.s2-control-cabinet > header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border-bottom: 1px solid rgba(65, 92, 99, 0.38);
}

.s2-component header p,
.s2-chiller header p,
.s2-control-cabinet header p { min-width: 0; flex: 1; margin: 0; }
.s2-component header small,
.s2-component header strong,
.s2-chiller header small,
.s2-chiller header strong,
.s2-control-cabinet header small,
.s2-control-cabinet header strong { display: block; }
.s2-component header small,
.s2-chiller header small,
.s2-control-cabinet header small { color: var(--text-faint); font-size: 5.5px; font-weight: 900; letter-spacing: 0.1em; }
.s2-component header strong,
.s2-chiller header strong,
.s2-control-cabinet header strong { margin-top: 2px; color: var(--text-main); font-size: 8px; }
.s2-component header em,
.s2-chiller header em,
.s2-control-cabinet header em {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid #385158;
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 6px;
  font-style: normal;
  font-weight: 950;
}
.running > header em,
.running > p em { border-color: rgba(124, 184, 47, 0.62); color: var(--agri-green); }
.fault > header em,
.fault > p em { border-color: rgba(228, 91, 91, 0.7); color: #ff8c81; }

.s2-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid #39545c;
  border-radius: 6px;
  background: rgba(52, 179, 228, 0.08);
  color: var(--agri-blue);
  font-size: 9px;
  font-weight: 950;
}
.fan-symbol { border-radius: 50%; font-size: 18px; }
.running .fan-symbol { animation: s2Rotor 1.1s linear infinite; }
.uv-symbol { color: #d179e8; }
.light-symbol { color: #e4d35a; }
@keyframes s2Rotor { to { transform: rotate(360deg); } }

.s2-environment { left: 60px; top: 56px; width: 260px; height: 155px; }
.s2-light-bank { left: 360px; top: 55px; width: 220px; height: 102px; }
.s2-canopy-fan { left: 650px; top: 55px; width: 210px; height: 112px; }
.s2-air-pump { left: 60px; top: 246px; width: 230px; height: 100px; }
.s2-uv-unit { left: 1190px; top: 615px; width: 220px; height: 102px; }

.s2-reading-grid {
  display: grid;
  gap: 5px;
  padding: 7px 9px;
}
.s2-reading-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.s2-reading-grid span,
.s2-reservoir-values span,
.s2-chiller-values span {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(55, 80, 87, 0.58);
  border-radius: 5px;
  background: rgba(4, 11, 13, 0.58);
}
.s2-reading-grid small,
.s2-reading-grid b,
.s2-reservoir-values small,
.s2-reservoir-values b,
.s2-chiller-values small,
.s2-chiller-values b { display: block; }
.s2-reading-grid small,
.s2-reservoir-values small,
.s2-chiller-values small { color: var(--text-faint); font-size: 5px; font-weight: 850; text-transform: uppercase; }
.s2-reading-grid b,
.s2-reservoir-values b,
.s2-chiller-values b { margin-top: 2px; color: #e0edf0; font-size: 11px; line-height: 1.15; }

.s2-light-bars { display: flex; gap: 7px; justify-content: center; padding: 12px; }
.s2-light-bars i { width: 35px; height: 7px; border-radius: 3px; background: #5b5831; box-shadow: 0 8px 18px rgba(228, 211, 90, 0); }
.s2-light-bank.running .s2-light-bars i { background: #e4d35a; box-shadow: 0 8px 20px rgba(228, 211, 90, 0.4); }

.s2-compact-reading { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 4px; padding: 7px 9px; }
.s2-compact-reading span { color: var(--text-faint); font-size: 5px; font-weight: 900; }
.s2-compact-reading b { color: var(--text-main); font-size: 10px; }
.s2-component-note { padding: 8px 9px; color: var(--text-soft); font-size: 6px; line-height: 1.45; }

.s2-grow-bed {
  left: 350px;
  top: 180px;
  width: 560px;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(19, 37, 40, 0.98), rgba(8, 22, 25, 0.98));
}
.s2-grow-bed header { position: relative; z-index: 3; padding: 9px 12px; border-bottom: 1px solid rgba(66, 94, 100, 0.4); }
.s2-grow-bed header small,
.s2-grow-bed header strong { display: block; }
.s2-grow-bed header small { color: var(--agri-green); font-size: 6px; font-weight: 900; letter-spacing: 0.11em; }
.s2-grow-bed header strong { margin-top: 3px; color: var(--text-main); font-size: 10px; }
.s2-plants { display: flex; align-items: end; justify-content: space-around; height: 120px; padding: 8px 18px 0; }
.s2-plants span { position: relative; width: 54px; height: 98px; }
.s2-plants span::before,
.s2-plants span::after,
.s2-plants i::before,
.s2-plants i::after { position: absolute; width: 28px; height: 14px; border-radius: 100% 0 100% 0; background: #527d2b; content: ""; }
.s2-plants span::before { left: 4px; top: 22px; transform: rotate(22deg); }
.s2-plants span::after { right: 4px; top: 38px; transform: scaleX(-1) rotate(22deg); }
.s2-plants i::before { left: 3px; top: 53px; transform: rotate(16deg); }
.s2-plants i::after { right: 3px; top: 68px; transform: scaleX(-1) rotate(16deg); }
.s2-plants i { position: absolute; left: 26px; bottom: 0; width: 3px; height: 78px; background: #739f3e; }
.s2-manifold { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 0 18px; padding: 8px 12px; border: 1px solid rgba(52, 179, 228, 0.42); border-radius: 6px; background: rgba(52, 179, 228, 0.08); }
.s2-manifold i { height: 7px; border-radius: 3px; background: #315e6d; }
.s2-grow-bed.running .s2-manifold i { background: #34B3E4; box-shadow: 0 0 8px rgba(52, 179, 228, 0.5); }
.s2-port-label { position: absolute; bottom: 7px; color: var(--text-faint); font-size: 5px; font-weight: 900; letter-spacing: 0.08em; }
.s2-port-label.inlet { left: 10px; }
.s2-port-label.outlet { right: 10px; }

.s2-dosing-rack { left: 60px; top: 510px; width: 260px; height: 252px; padding: 9px; }
.s2-dosing-rack > header { margin-bottom: 7px; }
.s2-dosing-rack > header small,
.s2-dosing-rack > header strong { display: block; }
.s2-dosing-rack > header small { color: var(--text-faint); font-size: 5.5px; font-weight: 900; letter-spacing: 0.11em; }
.s2-dosing-rack > header strong { margin-top: 3px; color: var(--text-main); font-size: 9px; }
.s2-dose-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 42px; margin-top: 5px; padding: 0 7px; border: 1px solid #2c4248; border-radius: 6px; background: rgba(4, 11, 13, 0.5); }
.s2-dose-row span { color: var(--text-faint); font-size: 5.5px; font-weight: 900; }
.s2-dose-row b { color: var(--text-main); font-size: 8px; }
.s2-dose-row b small { display: block; margin-top: 2px; color: var(--agri-blue); font-size: 5.5px; }
.s2-dose-row em { padding: 3px 5px; border-radius: 4px; background: rgba(81, 101, 107, 0.14); color: var(--text-soft); font-size: 6px; font-style: normal; font-weight: 900; }
.s2-dose-row.running { border-color: rgba(124, 184, 47, 0.68); }
.s2-dose-row.running em { background: rgba(124, 184, 47, 0.14); color: var(--agri-green); }
.s2-dose-status { margin: 7px 1px 0; color: var(--text-faint); font-size: 5.5px; line-height: 1.35; }

.s2-pump { display: flex; align-items: center; gap: 10px; width: 180px; height: 80px; padding: 9px 10px; }
.s2-pump-rotor { position: relative; display: block; flex: 0 0 48px; width: 48px; height: 48px; border: 5px solid #35515a; border-radius: 50%; background: #101e22; box-shadow: inset 0 0 0 2px #081012; }
.s2-pump-rotor::before { position: absolute; inset: 8px; border: 4px dashed #708a91; border-radius: 50%; content: ""; }
.s2-pump.running .s2-pump-rotor::before { border-color: var(--agri-green); animation: s2Rotor 1s linear infinite; }
.s2-pump p { min-width: 0; margin: 0; }
.s2-pump small,
.s2-pump strong,
.s2-pump em { display: block; }
.s2-pump small { color: var(--text-faint); font-size: 5.5px; font-weight: 950; }
.s2-pump strong { margin-top: 3px; color: var(--text-main); font-size: 8px; }
.s2-pump em { margin-top: 5px; color: var(--text-soft); font-size: 7px; font-style: normal; font-weight: 950; }
.s2-feed-pump { left: 350px; top: 620px; }
.s2-recirc-pump { left: 970px; top: 626px; }
.s2-cooling-pump { left: 360px; top: 960px; width: 190px; }
.s2-dosing-carrier { left: 340px; top: 730px; }

.s2-flow-meter { display: flex; align-items: center; gap: 9px; width: 175px; height: 70px; padding: 8px 9px; }
.s2-flow-meter > span { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 2px solid #3d626e; border-radius: 50%; color: var(--agri-blue); font-size: 9px; font-weight: 950; }
.s2-flow-meter.running > span { border-color: var(--agri-green); color: var(--agri-green); box-shadow: 0 0 10px rgba(124, 184, 47, 0.2); }
.s2-flow-meter p { min-width: 0; margin: 0; }
.s2-flow-meter small,
.s2-flow-meter strong { display: block; }
.s2-flow-meter small { color: var(--text-faint); font-size: 5px; font-weight: 900; }
.s2-flow-meter strong { margin-top: 5px; color: #e2f2f5; font-size: 12px; }
.s2-flow-one { left: 370px; top: 440px; }
.s2-flow-two { left: 600px; top: 965px; width: 185px; }
.s2-dosing-proof { left: 340px; top: 840px; }

.s2-reservoir { left: 560px; top: 570px; width: 360px; height: 300px; padding: 9px; }
.s2-reservoir > header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.s2-reservoir > header p { flex: 1; margin: 0; }
.s2-reservoir > header small,
.s2-reservoir > header strong { display: block; }
.s2-reservoir > header small { color: var(--agri-blue); font-size: 5.5px; font-weight: 950; letter-spacing: 0.11em; }
.s2-reservoir > header strong { margin-top: 3px; color: var(--text-main); font-size: 9px; }
.s2-reservoir > header em { color: var(--agri-blue); font-size: 16px; font-style: normal; font-weight: 950; }
.s2-tank-shell { position: relative; float: left; width: 132px; height: 185px; overflow: hidden; border: 2px solid #46636b; border-top: 0; border-radius: 3px 3px 9px 9px; background: rgba(5, 15, 18, 0.7); }
.s2-tank-shell::before { position: absolute; left: -3px; right: -3px; top: 0; z-index: 4; height: 5px; border: 2px solid #5a747b; border-radius: 50%; background: #122227; content: ""; }
.s2-tank-liquid { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 0; max-height: 100%; background: linear-gradient(180deg, rgba(52, 179, 228, 0.45), rgba(29, 105, 132, 0.68)); transition: height 500ms ease; }
.s2-tank-liquid::before { position: absolute; left: 0; right: 0; top: -4px; height: 8px; border-radius: 50%; background: rgba(104, 216, 252, 0.56); content: ""; }
.s2-level-marker { position: absolute; right: 4px; z-index: 4; padding: 2px 4px; border-radius: 3px; background: rgba(4, 10, 12, 0.78); color: var(--text-soft); font-size: 5px; font-weight: 900; }
.s2-level-marker.high { top: 30px; }
.s2-level-marker.low { bottom: 26px; }
.s2-air-stone { position: absolute; left: 14px; bottom: 9px; z-index: 3; width: 45px; height: 9px; border-radius: 50%; background: #6c7b7f; }
.s2-air-stone i { position: absolute; bottom: 10px; width: 4px; height: 4px; border: 1px solid #b7f8ed; border-radius: 50%; opacity: 0.4; }
.s2-air-stone i:nth-child(1) { left: 7px; }
.s2-air-stone i:nth-child(2) { left: 20px; bottom: 21px; }
.s2-air-stone i:nth-child(3) { left: 35px; bottom: 14px; }
.s2-pipe.air.active ~ .s2-reservoir .s2-air-stone i { animation: s2Bubble 1.3s ease-out infinite; }
@keyframes s2Bubble { from { transform: translateY(0); opacity: 0.25; } to { transform: translateY(-45px); opacity: 0.85; } }
.s2-reservoir-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-left: 142px; }
.s2-reservoir-values span:last-child { grid-column: 1 / -1; }
.s2-probe-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0 0 142px; }
.s2-probe-labels span { padding: 2px 4px; border: 1px solid #314950; border-radius: 3px; color: var(--text-faint); font-size: 4.8px; font-weight: 900; }

.s2-chiller { left: 880px; top: 930px; width: 300px; height: 166px; }
.s2-chiller-body { position: relative; float: left; width: 92px; height: 82px; margin: 8px; border: 1px solid #40555a; border-radius: 5px; background: #101c1f; }
.s2-chiller-coil { position: absolute; inset: 12px 38px 12px 10px; border: 4px double #9B87F5; border-top-width: 9px; border-bottom-width: 9px; }
.s2-chiller-fan { position: absolute; right: 10px; top: 18px; color: #71858a; font-size: 35px; }
.s2-chiller.running .s2-chiller-fan { color: #b6a6ff; animation: s2Rotor 900ms linear infinite; }
.s2-chiller-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 8px 8px 0 110px; }
.s2-chiller-values span:last-child { grid-column: 1 / -1; }

.s2-control-cabinet { left: 1040px; top: 50px; width: 460px; height: 540px; padding-bottom: 8px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), inset 0 0 0 2px rgba(93, 120, 127, 0.12); }
.s2-control-cabinet > header > span { display: grid; place-items: center; flex: 0 0 44px; height: 34px; border: 1px solid rgba(52, 179, 228, 0.6); border-radius: 5px; color: var(--agri-blue); font-size: 11px; font-weight: 950; }
.s2-io-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 8px; }
.s2-io-grid section { min-width: 0; padding: 6px; border: 1px solid #2b4046; border-radius: 6px; background: rgba(3, 9, 11, 0.48); }
.s2-io-grid h3 { margin: 0 0 5px; color: var(--agri-blue); font-size: 6px; letter-spacing: 0.14em; }
.s2-io-grid section:last-child h3 { color: #E4A74C; }
.s2-io-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 4px; min-height: 21px; border-top: 1px solid rgba(54, 76, 82, 0.32); }
.s2-io-row:first-of-type { border-top: 0; }
.s2-io-row span { color: var(--text-faint); font-size: 5px; font-weight: 950; }
.s2-io-row b { overflow: hidden; color: var(--text-soft); font-size: 5.5px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.s2-io-row em { padding: 2px 3px; border-radius: 3px; color: var(--text-faint); font-size: 5px; font-style: normal; font-weight: 950; }
.s2-io-row em.healthy { background: rgba(52, 179, 228, 0.09); color: var(--agri-blue); }
.s2-io-row em.running { background: rgba(124, 184, 47, 0.12); color: var(--agri-green); }
.s2-io-row em.fault { background: rgba(228, 91, 91, 0.12); color: #ff8b80; }
.s2-control-cabinet > footer { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px; }
.s2-control-cabinet > footer span { padding: 3px 5px; border: 1px solid #31494f; border-radius: 4px; color: var(--text-soft); font-size: 5px; font-weight: 850; }

.synoptic2-safety {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(124, 184, 47, 0.34);
  border-radius: 8px;
  background: rgba(124, 184, 47, 0.045);
}
.synoptic2-safety > span { color: var(--agri-green); font-size: 6px; font-weight: 950; letter-spacing: 0.12em; }
.synoptic2-safety ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.synoptic2-safety li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; min-width: 0; padding: 6px; border: 1px solid #2d444a; border-radius: 6px; background: rgba(4, 11, 13, 0.5); }
.synoptic2-safety li > b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #253a40; color: var(--text-soft); font-size: 6px; }
.synoptic2-safety li p { min-width: 0; margin: 0; }
.synoptic2-safety li p,
.synoptic2-safety li strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.synoptic2-safety li p { color: var(--text-faint); font-size: 5px; }
.synoptic2-safety li strong { margin-top: 2px; color: var(--text-soft); font-size: 6px; }
.synoptic2-safety li.healthy { border-color: rgba(52, 179, 228, 0.38); }
.synoptic2-safety li.healthy > b { background: rgba(52, 179, 228, 0.14); color: var(--agri-blue); }
.synoptic2-safety li.running { border-color: rgba(124, 184, 47, 0.58); }
.synoptic2-safety li.running > b { background: rgba(124, 184, 47, 0.16); color: var(--agri-green); }
.synoptic2-safety li.fault { border-color: rgba(228, 91, 91, 0.62); }
.synoptic2-safety li.fault > b { background: rgba(228, 91, 91, 0.15); color: #ff8c81; }
.synoptic2-safety > p { margin: 8px 0 0; color: var(--text-soft); font-size: 7px; line-height: 1.5; }
.synoptic2-safety.fault { border-color: rgba(228, 91, 91, 0.65); background: rgba(228, 91, 91, 0.055); }
.synoptic2-safety.warning { border-color: rgba(228, 167, 76, 0.55); background: rgba(228, 167, 76, 0.045); }
.synoptic2-safety.dosing-safety { border-color: rgba(228, 167, 76, 0.38); background: rgba(228, 167, 76, 0.04); }
.synoptic2-safety.dosing-safety > span { color: #E4A74C; }
.synoptic2-safety.dosing-safety li.healthy { border-color: rgba(228, 167, 76, 0.38); }
.synoptic2-safety.dosing-safety li.healthy > b { background: rgba(228, 167, 76, 0.13); color: #f0bd69; }
.synoptic2-safety.dosing-safety li.running { border-color: rgba(124, 184, 47, 0.58); }
.synoptic2-safety.dosing-safety li.running > b { background: rgba(124, 184, 47, 0.16); color: var(--agri-green); }

.synoptic2-circuit-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.synoptic2-circuit-cards article { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; min-width: 0; padding: 11px; }
.synoptic2-circuit-cards article > span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 6px; font-size: 7px; font-weight: 950; }
.synoptic2-circuit-cards p { min-width: 0; margin: 0; }
.synoptic2-circuit-cards small,
.synoptic2-circuit-cards strong,
.synoptic2-circuit-cards em { display: block; }
.synoptic2-circuit-cards small { font-size: 6px; font-weight: 950; letter-spacing: 0.11em; }
.synoptic2-circuit-cards strong { margin-top: 5px; color: var(--text-main); font-size: 8px; line-height: 1.4; }
.synoptic2-circuit-cards em { margin-top: 4px; color: var(--text-soft); font-size: 7px; font-style: normal; line-height: 1.45; }
.synoptic2-circuit-cards .grow { color: #34B3E4; }
.synoptic2-circuit-cards .recirc { color: #7CB82F; }
.synoptic2-circuit-cards .cooling { color: #9B87F5; }
.synoptic2-circuit-cards .dosing { color: #E4A74C; }

@media (max-width: 1280px) {
  .synoptic2-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .synoptic2-circuit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .synoptic2-mobile-hint { display: block; }
  .synoptic2-circuit-cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .synoptic2-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .synoptic2-heading { align-items: flex-start; flex-direction: column; }
  .synoptic2-legend { justify-content: flex-start; }
  .synoptic2-safety ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .synoptic2-summary { grid-template-columns: 1fr; }
  .synoptic2-safety ol { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .s2-pipe.active::after,
  .s2-pump.running .s2-pump-rotor::before,
  .s2-chiller.running .s2-chiller-fan,
  .running .fan-symbol,
  .s2-pipe.air.active ~ .s2-reservoir .s2-air-stone i { animation: none; }
}

/* ==========================================================================
   0.5.4 — Remote history / graph enrichment
   ========================================================================== */

.history-page .section-lead {
  margin-bottom: 14px;
}

.history-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
}

.history-range-copy {
  min-width: 130px;
}

.history-range-copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--quiet);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.history-range-copy strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.history-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-range-buttons button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(179, 218, 204, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.history-range-buttons button:hover {
  border-color: rgba(52, 179, 228, 0.38);
  color: var(--ink);
}

.history-range-buttons button.active {
  border-color: rgba(52, 179, 228, 0.62);
  background: rgba(52, 179, 228, 0.10);
  color: var(--ink);
}

.history-range-buttons button:disabled {
  cursor: default;
  opacity: 0.55;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.history-summary article {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(179, 218, 204, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: inset 2px 0 0 rgba(52, 179, 228, 0.50);
}

.history-summary small,
.history-summary strong,
.history-summary span {
  display: block;
}

.history-summary small {
  margin-bottom: 5px;
  color: var(--quiet);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.history-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.history-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.history-page .chart-panel {
  margin-bottom: 14px;
}

.history-chart-large .chart-wrap {
  height: 390px;
  min-height: 390px;
}

.history-chart-compact .chart-wrap {
  height: 300px;
  min-height: 300px;
}

.history-page .chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.history-insight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 184, 47, 0.22);
  border-radius: 8px;
  background: rgba(124, 184, 47, 0.045);
}

.history-insight > span {
  padding: 3px 6px;
  border: 1px solid rgba(124, 184, 47, 0.30);
  border-radius: 4px;
  color: var(--green);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.history-insight > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.chart-legend .leaf-line {
  background: #84c93f;
}

.chart-legend .pressure-line {
  background: #a590ff;
}

@media (max-width: 1100px) {
  .history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .history-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-range-buttons {
    width: 100%;
  }

  .history-range-buttons button {
    flex: 1 1 90px;
  }

  .history-chart-large .chart-wrap {
    height: 340px;
    min-height: 340px;
  }

  .history-chart-compact .chart-wrap {
    height: 290px;
    min-height: 290px;
  }
}

@media (max-width: 560px) {
  .history-summary {
    grid-template-columns: 1fr;
  }

  .history-range-buttons button {
    flex-basis: calc(33.333% - 6px);
    padding-inline: 7px;
  }

  .history-chart-large .chart-wrap,
  .history-chart-compact .chart-wrap {
    height: 310px;
    min-height: 310px;
  }

  .history-insight {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dashboard-body .topbar {
    display: flex;
  }
}

/* 0.5.5 — give history graph bands more breathing room */

.history-chart-large .chart-wrap {
  height: 520px;
  min-height: 520px;
}

.history-chart-compact .chart-wrap {
  height: 360px;
  min-height: 360px;
}

@media (max-width: 900px) {
  .history-chart-large .chart-wrap {
    height: 500px;
    min-height: 500px;
  }

  .history-chart-compact .chart-wrap {
    height: 350px;
    min-height: 350px;
  }
}

@media (max-width: 560px) {
  .history-chart-large .chart-wrap {
    height: 470px;
    min-height: 470px;
  }

  .history-chart-compact .chart-wrap {
    height: 340px;
    min-height: 340px;
  }
}

/* ==========================================================================
   0.5.6 — secure remote relay controls
   ========================================================================== */

.relay-mode-readout {
  min-width: 205px;
}

.relay-remote-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.relay-remote-action {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid rgba(179, 218, 204, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

.relay-remote-action:hover:not(:disabled) {
  border-color: rgba(52, 179, 228, 0.48);
  color: var(--ink);
}

.relay-remote-action.active {
  border-color: rgba(124, 184, 47, 0.58);
  background: rgba(124, 184, 47, 0.11);
  color: var(--ink);
}

.relay-mode-readout.override
.relay-remote-action.active {
  border-color: rgba(233, 179, 75, 0.64);
  background: rgba(233, 179, 75, 0.10);
}

.relay-remote-action:disabled {
  cursor: default;
  opacity: 0.42;
}

.relay-command-result {
  display: block;
  margin-top: 7px;
  color: var(--quiet);
  font-size: 0.56rem;
  font-style: normal;
  line-height: 1.35;
}

.relay-command-result.working {
  color: #34b3e4;
}

.relay-command-result.success {
  color: #84c93f;
}

.relay-command-result.error {
  color: #e9b34b;
}

.schedule-row.blocked
.relay-command-result {
  color: #e9b34b;
}

@media (max-width: 900px) {
  .relay-mode-readout {
    min-width: 0;
  }

  .relay-remote-actions {
    grid-template-columns:
      repeat(3, minmax(80px, 1fr));
  }
}

@media (max-width: 560px) {
  .relay-remote-actions {
    grid-template-columns: 1fr;
  }

  .relay-remote-action {
    min-height: 34px;
    font-size: 0.64rem;
  }
}

/* Preserve mobile navigation precedence */
@media (max-width: 900px) {
  .dashboard-body .topbar {
    display: flex;
  }
}

/* ==========================================================================
   0.5.7 — power-output control layout
   ========================================================================== */

.schedule-timeline {
  width: 100%;
  min-width: 0;
}

.schedule-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 190px)
    minmax(90px, 110px)
    minmax(280px, 1fr)
    minmax(270px, 300px);
  grid-template-areas:
    "identity state timing mode";
  gap: 14px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.schedule-row > * {
  min-width: 0;
}

.relay-identity {
  grid-area: identity;
}

.relay-live-state {
  grid-area: state;
}

.relay-timing {
  grid-area: timing;
  min-width: 0;
}

.relay-track {
  width: 100%;
  min-width: 0;
}

.relay-mode-readout {
  grid-area: mode;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.relay-remote-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  margin-top: 8px;
}

.relay-remote-action {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: nowrap;
}

.relay-command-result {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 7px;
  white-space: normal;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

/*
 * On narrower displays, give the timeline its own row and put
 * the power-output controls underneath. Nothing can escape the panel.
 */
@media (max-width: 1350px) {
  .schedule-row {
    grid-template-columns:
      minmax(170px, 1fr)
      minmax(100px, 120px);
    grid-template-areas:
      "identity state"
      "timing timing"
      "mode mode";
    gap: 10px 14px;
  }

  .relay-mode-readout {
    margin-top: 2px;
  }

  .relay-remote-actions {
    max-width: 480px;
  }
}

@media (max-width: 600px) {
  .schedule-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "state"
      "timing"
      "mode";
  }

  .relay-remote-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }
}

/* Preserve mobile navigation precedence */
@media (max-width: 900px) {
  .dashboard-body .topbar {
    display: flex;
  }
}

/* ==========================================================================
   Remote Settings profile - v0.5.8
   ========================================================================== */

.settings-page {
  --settings-good: var(--green);
  --settings-warning: var(--amber);
  --settings-fault: var(--red);
}

.settings-lead {
  margin-bottom: 24px;
}

.settings-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 32px 0 14px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
}

.settings-section-heading:first-of-type {
  margin-top: 4px;
}

.settings-section-heading h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.settings-section-heading > div > p:last-child {
  max-width: 850px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.settings-service-heading {
  margin-top: 38px;
}

.settings-operations-grid,
.settings-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-control-card {
  min-width: 0;
}

.settings-wide {
  grid-column: 1 / -1;
}

.settings-card-copy {
  max-width: 920px;
  margin: 3px 0 15px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.settings-card-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.55;
}

.settings-state-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(179, 218, 204, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.51rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.settings-state-pill.good {
  border-color: rgba(132, 201, 63, 0.27);
  color: #c7eea3;
  background: var(--green-soft);
}

.settings-state-pill.warning {
  border-color: rgba(233, 179, 75, 0.3);
  color: #f2ca7d;
  background: var(--amber-soft);
}

.settings-state-pill.fault {
  border-color: rgba(239, 106, 101, 0.3);
  color: #ffaaa6;
  background: var(--red-soft);
}

.settings-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-value-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-value-grid > div {
  display: grid;
  min-width: 0;
  min-height: 60px;
  align-content: center;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.settings-value-grid > div.settings-value-full {
  grid-column: 1 / -1;
}

.settings-value-grid span {
  color: var(--quiet);
  font-size: 0.55rem;
  line-height: 1.3;
}

.settings-value-grid strong {
  overflow-wrap: anywhere;
  color: #d7e6e1;
  font-size: 0.69rem;
  line-height: 1.4;
}

.settings-schedule-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.settings-schedule-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(54, 195, 207, 0.025);
}

.settings-schedule-summary span {
  color: var(--quiet);
  font-size: 0.54rem;
}

.settings-schedule-summary strong {
  color: #cce4dd;
  font-size: 0.68rem;
}

.settings-schedule-list {
  display: grid;
  gap: 7px;
}

.settings-schedule-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.8fr) minmax(140px, 0.6fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.012);
}

.settings-schedule-row.running {
  border-color: rgba(132, 201, 63, 0.27);
  background: rgba(132, 201, 63, 0.035);
}

.settings-schedule-row.override {
  border-color: rgba(233, 179, 75, 0.27);
}

.settings-schedule-row.blocked {
  border-color: rgba(239, 106, 101, 0.32);
}

.settings-schedule-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-schedule-heading strong {
  font-size: 0.67rem;
}

.settings-schedule-heading em {
  color: var(--muted);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-schedule-row > small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.5;
}

.settings-schedule-row > span {
  color: var(--quiet);
  font-size: 0.53rem;
  line-height: 1.4;
  text-align: right;
}

.settings-empty {
  padding: 12px;
  border: 1px dashed rgba(179, 218, 204, 0.15);
  border-radius: 10px;
  color: var(--quiet);
  font-size: 0.61rem;
  text-align: center;
}

.settings-mini-list {
  display: grid;
  gap: 7px;
}

.settings-pump-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.014);
}

.settings-mini-row.good {
  border-color: rgba(132, 201, 63, 0.2);
}

.settings-mini-row.warning {
  border-color: rgba(233, 179, 75, 0.25);
}

.settings-mini-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.settings-mini-row strong {
  font-size: 0.66rem;
}

.settings-mini-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.45;
}

.settings-mini-row em {
  color: var(--quiet);
  font-size: 0.51rem;
  font-style: normal;
  font-weight: 900;
}

.settings-mini-row.good em {
  color: var(--green);
}

.settings-mini-row.warning em {
  color: var(--amber);
}

.settings-refresh-panel {
  margin-top: 18px;
}


@media (max-width: 1180px) {
  .settings-value-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-schedule-row {
    grid-template-columns: minmax(160px, 0.75fr) minmax(240px, 1.5fr);
  }

  .settings-schedule-row > span {
    grid-column: 1 / -1;
    text-align: left;
  }
}


@media (max-width: 820px) {
  .settings-operations-grid,
  .settings-service-grid {
    grid-template-columns: 1fr;
  }

  .settings-wide {
    grid-column: auto;
  }

  .settings-pump-list {
    grid-template-columns: 1fr;
  }

  .settings-schedule-row {
    grid-template-columns: 1fr;
  }

  .settings-schedule-row > span {
    grid-column: auto;
  }
}


@media (max-width: 560px) {
  .settings-value-grid,
  .settings-value-grid-wide,
  .settings-schedule-summary {
    grid-template-columns: 1fr;
  }

  .settings-value-grid > div.settings-value-full {
    grid-column: auto;
  }

  .settings-section-heading {
    display: block;
  }
}

/* ============================================================
   Remote leaf-temperature adjustment
   ============================================================ */

.settings-leaf-editor {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.settings-leaf-editor-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-leaf-editor-row {
  display: grid;
  grid-template-columns:
    minmax(100px, 150px)
    auto
    minmax(120px, 160px);
  gap: 8px;
  align-items: center;
}

.settings-leaf-editor input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel-2);
}

.settings-leaf-editor input:disabled {
  cursor: default;
  opacity: 0.5;
}

.settings-leaf-unit {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .settings-leaf-editor-row {
    grid-template-columns: 1fr auto;
  }

  .settings-leaf-editor-row
  .relay-remote-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ============================================================
   Remote reservoir cooling adjustment
   ============================================================ */

.cooler-toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.settings-leaf-editor
.cooler-toggle-row
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

/* =========================================================
   Remote nutrient / pH control
   ========================================================= */

#settingsDosingModeControls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

#settingsDosingModeControls .relay-remote-action {
  flex: 0 0 auto;
  width: auto;
  min-width: 105px;
  padding-left: 18px;
  padding-right: 18px;
}

.dosing-manual-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.dosing-manual-row input[type="number"] {
  flex: 0 0 120px;
  width: 120px;
}

.dosing-manual-row .settings-leaf-unit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dosing-manual-row .relay-remote-action {
  flex: 0 0 auto;
  width: auto;
  min-width: 105px;
  padding-left: 16px;
  padding-right: 16px;
}

/* =========================================================
   Nutrient / pH compact control layout
   ========================================================= */

#settingsDosingModeControls {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
}

#settingsDosingModeControls .relay-remote-action {
  flex: 0 0 120px !important;
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
}

/* Manual correction layout */

.dosing-manual-row {
  display: grid !important;
  grid-template-columns: 140px 140px !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: start !important;
}

.dosing-manual-row input[type="number"] {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 140px !important;
  min-width: 140px !important;
}

.dosing-manual-row .settings-leaf-unit {
  grid-column: 2 !important;
  grid-row: 1 !important;
  white-space: nowrap !important;
  justify-self: start !important;
}

.dosing-manual-row .relay-remote-action {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
}

/* pH Up */
#settingsPhManualUp {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

/* pH Down */
#settingsPhManualDown {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

/* EC A + B */
#settingsEcManualDose {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

/* ==========================================================================
   Remote Settings — Power Output Schedule Editor
   Mirrors the proven DB6 Local Control Console layout
   ========================================================================== */

.settings-schedule-list {
  display: grid;
  gap: 8px;
}


/* --------------------------------------------------------------------------
   One collapsible Power Output
   -------------------------------------------------------------------------- */

.schedule-relay-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(179, 218, 204, 0.14);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.08);
}

.schedule-relay-editor > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.schedule-relay-editor > summary::-webkit-details-marker {
  display: none;
}

.schedule-relay-editor[open] > summary {
  border-bottom: 1px solid rgba(179, 218, 204, 0.14);
  background: rgba(54, 195, 207, 0.025);
}

.schedule-relay-editor > summary > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(54, 195, 207, 0.28);
  border-radius: 9px;
  color: var(--cyan);
  font-size: 0.58rem;
  font-weight: 900;
}

.schedule-relay-editor summary p,
.schedule-relay-editor summary strong,
.schedule-relay-editor summary small {
  display: block;
  min-width: 0;
  margin: 0;
}

.schedule-relay-editor summary strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.schedule-relay-editor summary small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--quiet);
  font-size: 0.54rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-relay-editor summary em {
  padding: 5px 8px;
  border: 1px solid rgba(179, 218, 204, 0.18);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.schedule-relay-editor summary em.on {
  border-color: rgba(132, 201, 63, 0.35);
  color: var(--green);
}


/* --------------------------------------------------------------------------
   LOOP + six schedule spans
   -------------------------------------------------------------------------- */

.schedule-window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
}

.schedule-window-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(179, 218, 204, 0.12);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.09);
  opacity: 0.72;
}

.schedule-window-card.enabled {
  border-color: rgba(54, 195, 207, 0.25);
  background: rgba(54, 195, 207, 0.025);
  opacity: 1;
}


/* --------------------------------------------------------------------------
   Card heading
   -------------------------------------------------------------------------- */

.schedule-window-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.schedule-window-heading p,
.schedule-window-heading strong,
.schedule-window-heading small {
  display: block;
  margin: 0;
}

.schedule-window-heading strong {
  color: var(--ink);
  font-size: 0.64rem;
}

.schedule-window-heading small {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 0.48rem;
}

.schedule-window-heading em {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid rgba(179, 218, 204, 0.18);
  border-radius: 999px;
  color: var(--quiet);
  font-size: 0.46rem;
  font-style: normal;
  font-weight: 850;
}

.schedule-window-heading em.enabled {
  border-color: rgba(54, 195, 207, 0.32);
  color: var(--cyan);
}

.schedule-window-heading em.active {
  border-color: rgba(132, 201, 63, 0.40);
  background: rgba(132, 201, 63, 0.07);
  color: var(--green);
}


/* --------------------------------------------------------------------------
   Enable / 24-hour switches
   -------------------------------------------------------------------------- */

.schedule-editor-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}

.schedule-editor-switches label,
.schedule-editor-days label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}

.schedule-editor-switches input,
.schedule-editor-days input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.schedule-editor-switches span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
}


/* --------------------------------------------------------------------------
   ON/OFF minute and Start/Stop inputs
   -------------------------------------------------------------------------- */

.schedule-editor-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.schedule-editor-times label {
  display: block;
  margin: 0;
}

.schedule-editor-times label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--quiet);
  font-size: 0.50rem;
  font-weight: 700;
}

.schedule-editor-times input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(179, 218, 204, 0.17);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(3, 11, 9, 0.72);
  color-scheme: dark;
  font-size: 0.68rem;
}

.schedule-editor-times input:focus {
  border-color: rgba(54, 195, 207, 0.5);
  outline: none;
}

.schedule-editor-times input:disabled {
  opacity: 0.36;
}


/* --------------------------------------------------------------------------
   Seven weekday selectors
   -------------------------------------------------------------------------- */

.schedule-editor-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
}

.schedule-editor-days label {
  position: relative;
  display: block;
}

.schedule-editor-days input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.schedule-editor-days span {
  display: block;
  padding: 6px 2px;
  border: 1px solid rgba(179, 218, 204, 0.18);
  border-radius: 7px;
  color: var(--quiet);
  background: rgba(255, 255, 255, 0.01);
  font-size: 0.46rem;
  font-weight: 800;
  text-align: center;
}

.schedule-editor-days input:checked + span {
  border-color: rgba(54, 195, 207, 0.38);
  background: rgba(54, 195, 207, 0.08);
  color: var(--cyan);
}


/* --------------------------------------------------------------------------
   Card footer and Save button
   -------------------------------------------------------------------------- */

.schedule-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.schedule-editor-footer > span {
  color: var(--quiet);
  font-size: 0.50rem;
  line-height: 1.35;
}

.schedule-editor-footer button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(132, 201, 63, 0.34);
  border-radius: 8px;
  color: var(--green);
  background: rgba(132, 201, 63, 0.09);
  cursor: pointer;
  font-size: 0.50rem;
  font-weight: 850;
}

.schedule-editor-footer button:hover:not(:disabled) {
  border-color: rgba(132, 201, 63, 0.58);
  background: rgba(132, 201, 63, 0.14);
  color: #c8eea2;
}

.schedule-editor-footer button:disabled {
  cursor: wait;
  opacity: 0.45;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1050px) {
  .schedule-window-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .schedule-relay-editor > summary {
    padding: 11px;
  }

  .schedule-window-grid {
    padding: 7px;
  }

  .schedule-window-card {
    padding: 10px;
  }

  .schedule-editor-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-editor-footer button {
    width: 100%;
  }
}


/* ZETA Weather ----------------------------------------------------------- */
.weather-zeta-lead{align-items:center}.weather-zeta-actions{display:flex;align-items:center;gap:8px}.weather-zeta-refresh{min-height:30px;padding:5px 9px;border:1px solid rgba(179,218,204,.16);border-radius:6px;background:rgba(255,255,255,.025);color:#72d4f2;cursor:pointer;font-size:.58rem;font-weight:800}.weather-zeta-refresh:hover:not(:disabled){border-color:rgba(54,195,207,.48);background:rgba(54,195,207,.055);color:#bcecfb}.weather-zeta-refresh:disabled{opacity:.42}
.weather-zeta-boundary{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:10px;margin-bottom:10px;padding:9px 12px!important;border-color:rgba(132,201,63,.20)!important;background:rgba(132,201,63,.035)!important}.weather-zeta-boundary-dot{width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px rgba(132,201,63,.08)}.weather-zeta-boundary strong{font-size:.64rem}.weather-zeta-boundary>span:not(.weather-zeta-boundary-dot){color:var(--muted);font-size:.58rem}.weather-zeta-boundary b{color:var(--green);font-size:.50rem;letter-spacing:.08em;text-transform:uppercase}
.weather-zeta-warning{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:10px;padding:12px 14px;border:1px solid rgba(233,179,75,.42);border-radius:12px;background:rgba(233,179,75,.07)}.weather-zeta-warning.hidden{display:none!important}.weather-zeta-warning strong{font-size:.72rem}.weather-zeta-warning p:not(.eyebrow){margin:4px 0 0;color:#c7d1cf;font-size:.58rem;line-height:1.45}.weather-zeta-warning>span{color:#f0d08d;font-size:.55rem;white-space:nowrap}
.weather-zeta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.weather-zeta-card{min-width:0;min-height:210px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}.weather-zeta-card.primary{background:linear-gradient(155deg,rgba(132,201,63,.07),transparent 62%),var(--panel)}.weather-zeta-card.coastal{background:linear-gradient(155deg,rgba(54,195,207,.06),transparent 62%),var(--panel)}.weather-zeta-card.pressure{background:linear-gradient(155deg,rgba(141,124,239,.07),transparent 62%),var(--panel)}.weather-zeta-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.weather-zeta-head h3{margin:2px 0;font-size:.82rem}.weather-zeta-head small{display:block;color:var(--quiet);font-size:.50rem}.weather-zeta-head>span{padding:4px 6px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:.46rem;white-space:nowrap}
.weather-zeta-condition{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:8px;margin:13px 0 11px}.weather-zeta-condition>span{font-size:1.45rem}.weather-zeta-condition div{min-width:0}.weather-zeta-condition div strong,.weather-zeta-condition div small{display:block}.weather-zeta-condition div strong{overflow:hidden;font-size:.62rem;text-overflow:ellipsis;white-space:nowrap}.weather-zeta-condition div small{margin-top:3px;color:var(--quiet);font-size:.46rem}.weather-zeta-condition>b{font-size:1.35rem;letter-spacing:-.04em;white-space:nowrap}.weather-zeta-condition>b span{font-size:inherit}.weather-zeta-card.coastal .weather-zeta-condition{grid-template-columns:32px minmax(0,1fr)}.weather-zeta-card dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 10px;margin:0;padding-top:10px;border-top:1px solid var(--line)}.weather-zeta-card dt{color:var(--quiet);font-size:.50rem}.weather-zeta-card dd{margin:0;color:#d6e2df;font-size:.52rem;font-weight:750;text-align:right}.weather-zeta-pressure dd strong{font-size:.68rem}
.weather-zeta-forecast{margin-top:10px!important;padding:14px!important}.weather-zeta-forecast .panel-heading{margin-bottom:10px}.weather-zeta-periods{grid-template-columns:repeat(8,minmax(110px,1fr));gap:7px}.weather-zeta-periods article{min-height:150px;padding:11px}.weather-zeta-periods article>small{font-size:.46rem}.weather-zeta-periods article>b{min-height:25px;margin-top:8px;font-size:1.15rem}.weather-zeta-periods article>strong{font-size:1.28rem}.weather-zeta-periods article>span{min-height:26px;margin-top:4px;font-size:.52rem}.weather-zeta-periods article>div{gap:2px;margin-top:6px}.weather-zeta-periods article em{font-size:.46rem}.weather-zeta-periods article em.rain{color:#78d5ef}.weather-zeta-periods article em.attention{color:var(--amber)}
.weather-zeta-outlook{margin-top:10px!important;padding:12px 14px!important}.weather-zeta-outlook p{max-width:1050px;font-size:.58rem}.weather-zeta-outlook>span{font-size:.50rem}
.weather-zeta-source-strip{display:flex;align-items:center;gap:16px;margin-top:8px;padding:8px 12px!important}.weather-zeta-source-strip>span{display:flex;align-items:center;gap:5px;min-width:0}.weather-zeta-source-strip i{width:6px;height:6px;border-radius:50%;background:var(--quiet)}.weather-zeta-source-strip i.healthy{background:var(--green)}.weather-zeta-source-strip i.stale{background:var(--amber)}.weather-zeta-source-strip i.fault{background:var(--red)}.weather-zeta-source-strip b{font-size:.50rem}.weather-zeta-source-strip small{color:var(--quiet);font-size:.45rem}
@media(max-width:1200px){.weather-zeta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.weather-zeta-lead,.weather-zeta-actions{align-items:flex-start;flex-direction:column}.weather-zeta-boundary{grid-template-columns:auto 1fr}.weather-zeta-boundary>span:not(.weather-zeta-boundary-dot),.weather-zeta-boundary>b{grid-column:2}.weather-zeta-warning,.weather-zeta-outlook{align-items:flex-start;flex-direction:column}.weather-zeta-grid{grid-template-columns:1fr}.weather-zeta-source-strip{align-items:flex-start;flex-direction:column}}


/* ZETA Weather 0.3.2 — compact Benete marine context */
.weather-zeta-marine-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;margin:0;padding-top:10px;border-top:1px solid var(--line)}.weather-zeta-marine-grid>span{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.weather-zeta-marine-grid small{overflow:hidden;color:var(--quiet);font-size:.46rem;text-overflow:ellipsis;white-space:nowrap}.weather-zeta-marine-grid strong{color:#d6e2df;font-size:.52rem;font-weight:750;text-align:right;white-space:nowrap}.weather-zeta-marine-grid>span.hidden{display:none!important}
@media(max-width:430px){.weather-zeta-marine-grid{grid-template-columns:1fr}}

/* =========================================================
   ZETA ALPHA — REMOTE HOME PARITY
   Matches the proven local Zeta Alpha Home presentation
   ========================================================= */


/* Brand identity */

.brand strong {
  color:
    var(--green);
}

.brand strong em {
  color:
    var(--cyan);

  font-style:
    normal;
}

.brand small {
  letter-spacing:
    .12em;

  text-transform:
    uppercase;
}


/* ZETA ALPHA — consistent page-title / RTC colour */

.sta-page-header h2,
.section-lead h2 {
  color:
    var(--cyan);
}


.clock-block strong {
  color:
    var(--cyan);
}


/* Environmental metric cards:
   heading above, value + unit together below */

.sta-metric-grid
> article {
  grid-template-columns:
    max-content
    max-content
    1fr;

  grid-template-rows:
    auto
    auto;

  column-gap:
    6px;

  row-gap:
    2px;

  align-items:
    baseline;
}


.sta-metric-grid
article
> span {
  display:
    contents;
}


.sta-metric-grid
article
> span
> small {
  grid-column:
    1 / 3;

  grid-row:
    1;
}


.sta-metric-grid
article
> span
> strong {
  grid-column:
    1;

  grid-row:
    2;

  margin-top:
    2px;

  align-self:
    baseline;
}


.sta-metric-grid
article
> em {
  grid-column:
    2;

  grid-row:
    2;

  margin:
    0 0 0 2px;

  align-self:
    baseline;

  justify-self:
    start;

  color:
    var(--cyan) !important;

  font-size:
    .58rem;

  font-style:
    normal;

  font-weight:
    700;

  white-space:
    nowrap;
}


/* Power Channel 1 etc. */

.sta-page
.equipment-item
small {
  color:
    var(--cyan) !important;

  opacity:
    .82;
}


/* Local-style Home notices */

#home
.notice-list {
  display:
    grid;

  gap:
    8px;
}


#home
.notice-item {
  display:
    flex;

  align-items:
    flex-start;

  gap:
    10px;

  padding:
    9px 0;

  border-bottom:
    1px solid
    var(--line);
}


#home
.notice-item:last-child {
  border-bottom:
    0;
}


#home
.notice-item
> span {
  width:
    7px;

  height:
    7px;

  flex:
    0 0 auto;

  margin-top:
    4px;

  border-radius:
    50%;

  background:
    var(--quiet);
}


#home
.notice-item
p,
#home
.notice-item
strong,
#home
.notice-item
small {
  display:
    block;

  margin:
    0;
}


#home
.notice-item
strong {
  font-size:
    .68rem;
}


#home
.notice-item
small {
  margin-top:
    3px;

  color:
    var(--muted);

  font-size:
    .56rem;

  line-height:
    1.35;
}


#home
.notice-item.good
> span {
  background:
    var(--green);
}


#home
.notice-item.info
> span {
  background:
    var(--cyan);
}


#home
.notice-item.warning
> span {
  background:
    var(--amber);
}


#home
.notice-item.danger {
  padding:
    10px 11px;

  border:
    1px solid
    rgba(228,91,91,.30);

  border-radius:
    8px;

  background:
    rgba(228,91,91,.055);
}


#home
.notice-item.danger
> span {
  background:
    var(--red);

  box-shadow:
    0 0 0 3px
    rgba(228,91,91,.08);
}


#home
.notice-item.danger
strong {
  color:
    #f3f7f6;

  font-weight:
    800;
}


#home
.notice-item.danger
small {
  color:
    #b8c5c2;

  opacity:
    1;
}

/* =========================================================
   ZETA ALPHA — SYSTEM LIVE OPERATING NOTES
   ========================================================= */

.system-events-panel .notice-list {
  display: grid;
  gap: 0;
  margin-top: 4px;
}


.system-events-panel .notice-item {
  display: grid;

  grid-template-columns:
    8px
    minmax(0, 1fr);

  align-items: start;

  column-gap: 11px;

  padding:
    13px
    0;

  border-bottom:
    1px solid
    rgba(120, 155, 160, .12);
}


.system-events-panel .notice-item:last-child {
  border-bottom: 0;
}


.system-events-panel .notice-item > span {
  width: 7px;
  height: 7px;

  margin-top: 6px;

  border-radius: 50%;

  background:
    var(--quiet);
}


.system-events-panel .notice-item p {
  margin: 0;

  color:
    var(--muted);

  font-size:
    .69rem;

  line-height:
    1.55;
}


.system-events-panel .notice-item strong {
  display: inline;

  color:
    var(--cyan);

  font-size:
    .74rem;

  font-weight:
    800;
}


.system-events-panel .notice-item strong::after {
  content: "  —  ";

  color:
    rgba(150, 180, 185, .48);

  font-weight:
    400;
}


.system-events-panel .notice-item small {
  display: inline;

  color:
    rgba(193, 208, 211, .78);

  font-size:
    .67rem;

  line-height:
    inherit;
}


/* State colour */

.system-events-panel .notice-item.good > span {
  background:
    var(--green);
}

.system-events-panel .notice-item.good strong {
  color:
    var(--green);
}


.system-events-panel .notice-item.info > span {
  background:
    var(--cyan);
}

.system-events-panel .notice-item.info strong {
  color:
    var(--cyan);
}


.system-events-panel .notice-item.warning > span {
  background:
    var(--amber);
}

.system-events-panel .notice-item.warning strong {
  color:
    #e9b34b;
}


.system-events-panel .notice-item.danger > span {
  background:
    var(--red);

  box-shadow:
    0 0 0 3px
    rgba(239, 106, 101, .08);
}

.system-events-panel .notice-item.danger strong {
  color:
    #ef7772;
}


/* ==========================================================================
   0.5.41 — Remote Web Push notification settings
   ========================================================================== */

.push-settings-card {
  overflow: hidden;
}

.push-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.push-settings-actions .relay-remote-action {
  width: auto;
  min-width: 170px;
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 620px) {
  .push-settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .push-settings-actions .relay-remote-action {
    width: 100%;
    min-width: 0;
  }
}

/* ==========================================================
   Push-notification alarm view
   ========================================================== */

.alarm-page {
  max-width: 980px;
  margin: 0 auto;
}

.alarm-shell {
  display: grid;
  gap: 22px;
}

.alarm-event-card,
.alarm-live-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.alarm-event-card {
  padding: 28px;
  border-left: 5px solid var(--cyan);
}

.alarm-event-card.critical {
  border-left-color: var(--red);
  background:
    linear-gradient(
      135deg,
      var(--red-soft),
      transparent 55%
    ),
    var(--panel);
}

.alarm-event-card.warning {
  border-left-color: var(--amber);
  background:
    linear-gradient(
      135deg,
      var(--amber-soft),
      transparent 55%
    ),
    var(--panel);
}

.alarm-event-card.clear {
  border-left-color: var(--green);
  background:
    linear-gradient(
      135deg,
      var(--green-soft),
      transparent 55%
    ),
    var(--panel);
}

.alarm-event-heading,
.alarm-live-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.alarm-event-heading h2,
.alarm-live-heading h3 {
  margin: 0;
  color: var(--ink);
}

.alarm-event-heading h2 {
  font-size: clamp(
    1.7rem,
    4vw,
    2.6rem
  );
}

.alarm-event-heading p {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.alarm-event-badge,
.alarm-current-state {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.alarm-event-badge.critical,
.alarm-current-state.critical {
  color: var(--red);
  border-color:
    rgba(239, 106, 101, 0.34);
  background: var(--red-soft);
}

.alarm-event-badge.warning,
.alarm-current-state.warning {
  color: var(--amber);
  border-color:
    rgba(233, 179, 75, 0.34);
  background: var(--amber-soft);
}

.alarm-event-badge.clear,
.alarm-current-state.clear {
  color: var(--green);
  border-color:
    rgba(132, 201, 63, 0.34);
  background: var(--green-soft);
}

.alarm-current-state.checking {
  color: var(--cyan);
  background: var(--cyan-soft);
}

.alarm-live-card {
  padding: 28px;
}

.alarm-current-summary {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--panel-2);
  line-height: 1.55;
}

.alarm-status-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.alarm-status-grid > div {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

.alarm-status-grid dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.alarm-status-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.alarm-status-grid
.alarm-status-wide {
  grid-column: 1 / -1;
}

.alarm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.alarm-actions button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.alarm-primary-action {
  border: 1px solid
    rgba(132, 201, 63, 0.42);
  color: #07100e;
  background: var(--green);
}

.alarm-secondary-action {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-2);
}

@media (max-width: 680px) {
  .alarm-event-card,
  .alarm-live-card {
    padding: 20px;
  }

  .alarm-event-heading,
  .alarm-live-heading {
    flex-direction: column;
  }

  .alarm-status-grid {
    grid-template-columns: 1fr;
  }

  .alarm-status-grid
  .alarm-status-wide {
    grid-column: auto;
  }

  .alarm-actions {
    flex-direction: column;
  }

  .alarm-actions button {
    width: 100%;
  }
}

/* ========================================================================== */
/* Lighting / TCS3472 family                                                */
/* ========================================================================== */
.lighting-page{--light-blue:#40b4e0;--light-green:#84c93f;--light-red:#ef6a67;--light-violet:#c589db}.lighting-lead{align-items:flex-start}.lighting-head-badges{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.lighting-badge{padding:7px 9px;border:1px solid var(--line);border-radius:999px;font-size:8px;font-weight:900;letter-spacing:.08em}.lighting-badge.measured{color:var(--light-blue);background:rgba(64,180,224,.08)}.lighting-badge.model{color:#e9b34b;background:rgba(233,179,75,.08)}
.lighting-boundary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:12px 14px!important;margin-bottom:10px}.lighting-boundary>div{display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center}.lighting-boundary small{grid-column:2;color:var(--text-faint);font-size:8px;line-height:1.45}.lighting-boundary strong{font-size:9px}.lighting-key{width:8px;height:8px;border-radius:50%}.lighting-key.measured{background:var(--light-blue)}.lighting-key.derived{background:#b7d49d}.lighting-key.model{background:#e9b34b}.lighting-key.unavailable{background:#89938f}
.lighting-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:10px}.lighting-kpi{padding:12px 14px!important;min-height:92px}.lighting-kpi>small{display:block;color:var(--text-faint);font-size:7px;font-weight:900;letter-spacing:.1em}.lighting-kpi>strong{display:block;margin-top:7px;color:var(--ink);font-size:22px;line-height:1}.lighting-kpi>strong i{font-size:8px;font-style:normal;color:var(--text-soft);font-weight:700}.lighting-kpi>em{display:block;margin-top:8px;color:var(--text-faint);font-size:8px;font-style:normal}.lighting-kpi.model{box-shadow:inset 0 2px 0 rgba(233,179,75,.35)}
.lighting-two-column{display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:10px;margin-bottom:10px}.lighting-rgb-panel,.lighting-spectrum-panel,.lighting-calibration-panel,.lighting-capability-panel,.lighting-history-panel,.lighting-photobiology-panel,.lighting-upgrade-panel{padding:14px!important}.lighting-channel-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:12px}.lighting-channel{padding:10px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.018)}.lighting-channel>span{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:6px;font-size:9px;font-weight:900}.lighting-channel.red>span{background:rgba(239,106,103,.16);color:#ff918d}.lighting-channel.green>span{background:rgba(132,201,63,.14);color:#aee16d}.lighting-channel.blue>span{background:rgba(64,180,224,.14);color:#72d2f4}.lighting-channel.clear>span{background:rgba(220,226,223,.1);color:#dce2df}.lighting-channel strong{display:block;margin-top:8px;font-size:17px}.lighting-channel small{display:block;margin-top:3px;color:var(--text-faint);font-size:8px}.lighting-channel>i{display:block;height:5px;margin-top:8px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.06)}.lighting-channel>i b{display:block;height:100%;width:0;border-radius:999px}.lighting-channel.red>i b{background:#ef6a67}.lighting-channel.green>i b{background:#84c93f}.lighting-channel.blue>i b{background:#40b4e0}.lighting-channel.clear>i b{background:#dce2df}.lighting-detail-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;margin:12px 0 0}.lighting-detail-list>div{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-top:1px solid var(--line)}.lighting-detail-list dt{color:var(--text-faint);font-size:8px}.lighting-detail-list dd{margin:0;color:var(--ink);font-size:8px;font-weight:800}
.lighting-spectrum-panel canvas,.lighting-history-panel canvas{display:block;width:100%;height:280px;margin-top:8px;border-radius:10px;background:rgba(2,10,8,.28)}.lighting-spectrum-legend{display:flex;gap:18px;flex-wrap:wrap;margin-top:9px;color:var(--text-soft);font-size:8px}.lighting-spectrum-legend span{display:flex;align-items:center;gap:6px}.lighting-spectrum-legend i{width:20px;height:2px}.spectrum-estimate{background:#40b4e0}.spectrum-action{background:#84c93f}.lighting-caveat{margin:9px 0 0;color:var(--text-faint);font-size:8px;line-height:1.5}.lighting-caveat strong{color:#e9b34b}
.lighting-history-grid{display:grid;grid-template-columns:1.35fr .65fr;gap:10px;margin-bottom:10px}.lighting-refresh{padding:7px 10px;border:1px solid var(--line);border-radius:8px;color:var(--agri-blue);background:var(--panel-2);font-size:8px;font-weight:800}.lighting-history-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.lighting-history-stats span{padding:8px;border:1px solid var(--line);border-radius:8px}.lighting-history-stats small{display:block;color:var(--text-faint);font-size:7px}.lighting-history-stats strong{display:block;margin-top:5px;font-size:9px}
.lighting-cal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.lighting-cal-grid label span{display:block;margin-bottom:5px;color:var(--text-soft);font-size:8px}.lighting-cal-grid input{width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--panel-2)}.lighting-cal-actions{display:flex;align-items:center;gap:10px;margin-top:10px}.lighting-cal-actions button{padding:8px 10px;border:1px solid rgba(132,201,63,.4);border-radius:8px;background:rgba(132,201,63,.1);color:#b7e77f;font-size:8px;font-weight:900}.lighting-cal-actions span{color:var(--text-faint);font-size:8px}.lighting-notes{margin:12px 0 0;padding-left:17px;color:var(--text-soft);font-size:8px;line-height:1.55}.lighting-notes li+li{margin-top:5px}
.lighting-capability-list{display:grid;gap:6px;margin-top:10px}.lighting-capability-list>div{display:grid;grid-template-columns:72px 1fr;gap:4px 9px;padding:7px 0;border-top:1px solid var(--line)}.lighting-capability-list>div:first-child{border-top:0}.lighting-capability-list small{grid-column:2;color:var(--text-faint);font-size:8px;line-height:1.4}.lighting-capability-list strong{font-size:9px}.cap{align-self:start;padding:4px 5px;border-radius:5px;font-size:6px;font-weight:900;text-align:center;letter-spacing:.06em}.cap.measured{color:#72d2f4;background:rgba(64,180,224,.12)}.cap.derived{color:#b7e77f;background:rgba(132,201,63,.1)}.cap.model{color:#f3c65d;background:rgba(233,179,75,.1)}.cap.unavailable{color:#aeb8b4;background:rgba(174,184,180,.08)}
.lighting-photobiology-panel{margin-bottom:10px}.lighting-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.lighting-photo-grid article{padding:10px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.015)}.lighting-photo-grid b{display:block;font-size:9px}.lighting-photo-grid span{display:block;margin-top:3px;color:#72d2f4;font-size:7px;font-weight:800}.lighting-photo-grid p{margin:6px 0 0;color:var(--text-faint);font-size:8px;line-height:1.45}.lighting-photo-grid p strong{color:#e9b34b}.lighting-upgrade-panel{display:flex;align-items:center;justify-content:space-between;gap:18px}.lighting-upgrade-panel h3{margin:2px 0 4px}.lighting-upgrade-panel p{max-width:760px;margin:0;color:var(--text-soft);font-size:8px;line-height:1.5}.lighting-upgrade-tags{display:flex;justify-content:flex-end;gap:5px;flex-wrap:wrap}.lighting-upgrade-tags span{padding:5px 7px;border:1px solid var(--line);border-radius:999px;color:var(--text-soft);font-size:7px}
@media(max-width:1200px){.lighting-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.lighting-two-column,.lighting-history-grid{grid-template-columns:1fr}.lighting-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.lighting-boundary{grid-template-columns:1fr}.lighting-kpi-grid{grid-template-columns:1fr}.lighting-channel-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.lighting-detail-list,.lighting-cal-grid{grid-template-columns:1fr}.lighting-history-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.lighting-photo-grid{grid-template-columns:1fr}.lighting-upgrade-panel{align-items:flex-start;flex-direction:column}.lighting-upgrade-tags{justify-content:flex-start}.lighting-spectrum-panel canvas,.lighting-history-panel canvas{height:240px}}


/* Zeta-Delta Lighting v2: spectrum usefulness, band PPFD and terminology */
.spectral-analysis-panel{position:relative;overflow:hidden}.spectral-analysis-panel:before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 82% 8%,rgba(52,179,228,.055),transparent 34%),radial-gradient(circle at 18% 92%,rgba(132,201,63,.045),transparent 30%)}.spectral-analysis-panel>*{position:relative}.spectral-analysis-panel canvas{height:350px!important}
.spectrum-useful{background:#f3c65d}.spectrum-chla{background:#b995ff}.spectrum-chlb{background:#72df9a}.spectrum-carot{background:#f1a64a}
.lighting-band-panel{padding:14px!important;margin-bottom:10px}.lighting-band-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:10px}.lighting-band-card{padding:10px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.015)}.lighting-band-card small{display:block;color:var(--text-faint);font-size:7px;font-weight:800;letter-spacing:.06em}.lighting-band-card strong{display:block;margin-top:5px;font-size:15px}.lighting-band-card em{display:block;margin-top:4px;color:var(--text-faint);font-size:7px;font-style:normal}.lighting-band-card.blue{box-shadow:inset 0 2px 0 rgba(64,180,224,.55)}.lighting-band-card.green{box-shadow:inset 0 2px 0 rgba(132,201,63,.55)}.lighting-band-card.red{box-shadow:inset 0 2px 0 rgba(239,106,103,.55)}.lighting-band-card.yield{box-shadow:inset 0 2px 0 rgba(243,198,93,.55)}
.lighting-band-stack{display:flex;height:9px;margin-top:12px;border-radius:999px;overflow:hidden;background:rgba(255,255,255,.05)}.lighting-band-stack span{height:100%;display:block}.lighting-band-stack .b{background:#40b4e0}.lighting-band-stack .g{background:#84c93f}.lighting-band-stack .r{background:#ef6a67}.lighting-band-caption{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:6px;color:var(--text-faint);font-size:8px}.lighting-band-caption strong{color:var(--ink)}
.lighting-terminology-panel{padding:14px!important;margin-bottom:10px}.lighting-term-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.lighting-term-grid article{padding:10px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.015)}.lighting-term-grid b{display:block;font-size:9px}.lighting-term-grid span{display:block;margin-top:4px;color:var(--text-faint);font-size:8px;line-height:1.45}.lighting-term-grid i{font-style:normal;color:#72d2f4;font-weight:800}
@media(max-width:1200px){.lighting-band-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.lighting-term-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.lighting-band-grid,.lighting-term-grid{grid-template-columns:1fr}.spectral-analysis-panel canvas{height:300px!important}}

/* Leak protection radio alignment */
.leak-protection-radio-row {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  margin: 10px 0 0;
}

.leak-protection-radio-row > input[type="radio"] {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 16px;
}

.leak-protection-radio-row > span {
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  white-space: nowrap;
}
