/* Reef — sump-bottom water-level vessel */
.reef-sump {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 16px;
  min-height: 168px;
}
.reef-sump-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
  align-self: flex-start;
}
.reef-sump-vessel {
  position: relative;
  width: 100%;
  max-width: 160px;
  height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.reef-sump-glass {
  position: relative;
  width: 86px;
  height: 118px;
  border-radius: 10px 10px 14px 14px;
  border: 1.5px solid rgba(237,244,250,.28);
  background:
    linear-gradient(90deg, rgba(237,244,250,.08), rgba(237,244,250,.02) 18%, transparent 40%, rgba(237,244,250,.04) 80%, rgba(237,244,250,.10)),
    linear-gradient(180deg, rgba(18,26,37,.2), rgba(8,12,18,.55));
  box-shadow:
    inset 0 1px 0 rgba(237,244,250,.22),
    inset 0 0 0 1px rgba(8,12,18,.35),
    0 10px 18px rgba(0,0,0,.28);
  overflow: hidden;
}
.reef-sump-glass::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 12px;
  width: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(237,244,250,.28), rgba(237,244,250,0));
  pointer-events: none;
  z-index: 3;
}
.reef-sump-water {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--reef-fill, 0) * 100%);
  background:
    linear-gradient(180deg, rgba(150,240,255,.95) 0%, rgba(70,200,235,.90) 28%, rgba(30,130,190,.92) 70%, rgba(12,70,130,.96) 100%);
  box-shadow: inset 0 2px 0 rgba(230,255,255,.75), 0 0 18px rgba(80,210,240,.28);
  transition: height .9s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.reef-sump-water::before {
  content: "";
  position: absolute;
  left: -20%; right: -20%;
  top: -8px;
  height: 16px;
  background: radial-gradient(ellipse at 50% 100%, rgba(180,240,255,.7), rgba(80,196,230,.15) 70%, transparent);
  animation: reef-wave 3.2s ease-in-out infinite;
}
.reef-sump-water::after {
  content: "";
  position: absolute;
  left: -30%;
  width: 160%;
  height: 18px;
  top: -6px;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(237,244,250,.18) 18px 28px, transparent 28px 46px);
  border-radius: 50%;
  animation: reef-ripple 4.4s linear infinite;
  opacity: .55;
}
@keyframes reef-wave {
  0%,100% { transform: translateY(0) scaleX(1); opacity: .85; }
  50% { transform: translateY(3px) scaleX(1.05); opacity: 1; }
}
@keyframes reef-ripple {
  0% { transform: translateX(0); }
  100% { transform: translateX(-46px); }
}
.reef-sump.empty .reef-sump-water { height: 0; opacity: 0; }
.reef-sump.placeholder .reef-sump-glass {
  border-style: dashed;
  border-color: rgba(237,244,250,.18);
}
.reef-sump.placeholder .reef-sump-water {
  height: 18%;
  opacity: .28;
  filter: grayscale(.4);
}
.reef-sump-readout {
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  color: var(--text, #edf4fa);
  line-height: 1;
}
.reef-sump-readout span {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
  margin-left: 4px;
}
.reef-sump-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #99a8b8);
  text-align: center;
  min-height: 14px;
}
.reef-sump.alert .reef-sump-water {
  background: linear-gradient(180deg, rgba(255,140,120,.6), rgba(180,40,50,.85));
}
.reef-sump.alert .reef-sump-readout { color: #ff8b9a; }

@media (prefers-reduced-motion: reduce) {
  .reef-sump-water, .reef-sump-water::before, .reef-sump-water::after {
    animation: none !important;
    transition: none !important;
  }
}

.reef-hero.reef-hero-with-sump { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.reef-hero.reef-hero-with-sump.reef-hero-with-topoff { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .reef-hero.reef-hero-with-sump.reef-hero-with-topoff { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px), (orientation: portrait) {
  .reef-hero.reef-hero-with-sump,
  .reef-hero.reef-hero-with-sump.reef-hero-with-topoff { grid-template-columns: 1fr 1fr; }
}
.panel.entering .reef-hero > .card:nth-child(5) { animation-delay: 200ms; }
.panel.entering .reef-hero > .card:nth-child(6) { animation-delay: 240ms; }


/* Press-and-hold affordance on the tank thumbnail */
.reef-sump, .reef-hero, [data-reef-hold] {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.reef-sump { cursor: pointer; }
.reef-hold-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reef-hold-ring[hidden] { display: none !important; }
.reef-hold-ring svg { width: 92px; height: 92px; display: block; }
.reef-hold-ring .bg { stroke: rgba(237,244,250,.18); }
.reef-hold-ring .fg {
  stroke: #72d9f8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-dasharray: 0 100;
}
.reef-hold-count {
  position: absolute;
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #edf4fa;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.reef-sump.reef-holding, .reef-hero.reef-holding, [data-reef-hold].reef-holding {
  outline: 1.5px solid rgba(114,217,248,.45);
  outline-offset: 2px;
}
.chip.reef.reef-holding { outline-offset: 0; border-radius: 999px; }

/* 24h trend sheet */
.reef-trend-sheet { width: min(820px, calc(100% - 24px)); }
.reef-trend-sub {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #99a8b8);
}
.reef-trend-empty {
  margin: 18px 4px;
  color: var(--muted, #99a8b8);
  font-weight: 650;
}
.reef-trend-empty.err { color: #ff8b9a; }
.reef-trend-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}
.reef-trend-kpi {
  background: rgba(11,16,24,.65);
  border: 1px solid var(--line, rgba(237,244,250,.10));
  border-radius: 14px;
  padding: 10px 10px 8px;
  min-width: 0;
}
.reef-trend-kpi .k {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
  margin-bottom: 4px;
}
.reef-trend-kpi strong {
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--text, #edf4fa);
}
.reef-trend-kpi small {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
}
.reef-trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.reef-trend-grid section {
  background: rgba(11,16,24,.45);
  border: 1px solid var(--line, rgba(237,244,250,.10));
  border-radius: 16px;
  padding: 10px 12px 8px;
  min-width: 0;
}
.reef-trend-grid section.span-all { grid-column: 1 / -1; }
.reef-trend-grid h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
}
.reef-trend-svg { width: 100%; height: 88px; display: block; }
.reef-trend-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted, #99a8b8);
  font-variant-numeric: tabular-nums;
}
.reef-trend-chart.empty { opacity: .7; }

@media (max-width: 700px), (orientation: portrait) {
  .reef-trend-kpis { grid-template-columns: 1fr 1fr 1fr; }
  .reef-trend-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .reef-hold-ring .fg { transition: none !important; }
}


/* Daily water-added + calibration */
.reef-sump-daily {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  text-align: center;
  color: var(--muted, #99a8b8);
  line-height: 1.35;
  max-width: 16rem;
}
.reef-sump-daily .k {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7ee0c8;
  margin-bottom: 2px;
}
.reef-sump-daily .v { color: var(--text, #edf4fa); }
.reef-water-panel {
  margin-top: 10px;
  padding: 12px 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--line, rgba(237,244,250,.10));
  background: rgba(11,16,24,.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reef-water-panel.in-sheet { margin-top: 14px; }
.reef-water-daily {
  font-size: 13px;
  font-weight: 650;
  color: var(--text, #edf4fa);
}
.reef-water-daily .k {
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7ee0c8;
}
.reef-water-cal {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}
.reef-water-cal-copy {
  flex: 1 1 220px;
  min-width: 0;
}
.reef-water-cal-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
  margin-bottom: 4px;
}
.reef-water-cal-copy p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text, #edf4fa);
}
.reef-water-cal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.reef-water-oz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
}
.reef-water-oz input {
  width: 72px;
  border-radius: 10px;
  border: 1px solid rgba(237,244,250,.18);
  background: rgba(8,12,18,.7);
  color: var(--text, #edf4fa);
  font: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  padding: 8px 8px;
}
.reef-trend-kpis { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
.reef-trend-kpi-water strong { color: #7ee0c8; }

@media (max-width: 700px), (orientation: portrait) {
  .reef-trend-kpis { grid-template-columns: 1fr 1fr 1fr; }
}


/* Top Off H₂O — ATO reservoir bin that drains with daily top-off */
.reef-topoff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 16px;
  min-height: 168px;
  cursor: pointer;
}
.reef-topoff-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7ee0c8;
  align-self: flex-start;
}
.reef-topoff-vessel {
  position: relative;
  width: 100%;
  max-width: 160px;
  height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.reef-topoff-glass {
  position: relative;
  width: 92px;
  height: 118px;
  border-radius: 8px 8px 14px 14px;
  border: 1.5px solid rgba(237,244,250,.28);
  background:
    linear-gradient(90deg, rgba(237,244,250,.08), rgba(237,244,250,.02) 18%, transparent 40%, rgba(237,244,250,.04) 80%, rgba(237,244,250,.10)),
    linear-gradient(180deg, rgba(18,26,37,.2), rgba(8,12,18,.55));
  box-shadow:
    inset 0 1px 0 rgba(237,244,250,.22),
    inset 0 0 0 1px rgba(8,12,18,.35),
    0 10px 18px rgba(0,0,0,.28);
  overflow: hidden;
}
.reef-topoff-glass::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 12px;
  width: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(237,244,250,.28), rgba(237,244,250,0));
  pointer-events: none;
  z-index: 3;
}
.reef-topoff-water {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--reef-fill, 1) * 100%);
  background:
    linear-gradient(180deg, rgba(150,240,255,.95) 0%, rgba(70,200,235,.90) 28%, rgba(30,130,190,.92) 70%, rgba(12,70,130,.96) 100%);
  box-shadow: inset 0 2px 0 rgba(230,255,255,.75), 0 0 18px rgba(80,210,240,.28);
  transition: height .9s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.reef-topoff-water::before {
  content: "";
  position: absolute;
  left: -20%; right: -20%;
  top: -8px;
  height: 16px;
  background: radial-gradient(ellipse at 50% 100%, rgba(180,240,255,.7), rgba(80,196,230,.15) 70%, transparent);
  animation: reef-wave 3.2s ease-in-out infinite;
}
.reef-topoff-water::after {
  content: "";
  position: absolute;
  left: -30%;
  width: 160%;
  height: 18px;
  top: -6px;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(237,244,250,.18) 18px 28px, transparent 28px 46px);
  border-radius: 50%;
  animation: reef-ripple 4.4s linear infinite;
  opacity: .55;
}
.reef-topoff-mark {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 1px dashed rgba(255, 180, 120, .75);
  z-index: 4;
  pointer-events: none;
}
.reef-topoff-mark::after {
  content: "LOW";
  position: absolute;
  right: 5px;
  top: -9px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  color: rgba(255, 196, 140, .9);
}
.reef-topoff.pending .reef-topoff-water { opacity: .85; }
.reef-topoff.low .reef-topoff-water {
  background: linear-gradient(180deg, rgba(255,140,120,.6), rgba(180,40,50,.85));
  box-shadow: inset 0 2px 0 rgba(255,210,210,.45), 0 0 18px rgba(255,80,90,.28);
}
.reef-topoff.low .reef-topoff-readout { color: #ff8b9a; }
.reef-topoff.low .reef-topoff-label { color: #ff8b9a; }
.reef-topoff.empty .reef-topoff-water { height: 0; opacity: 0; }
.reef-topoff-readout {
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  color: var(--text, #edf4fa);
  line-height: 1;
}
.reef-topoff-readout span {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #99a8b8);
  margin-left: 4px;
}
.reef-topoff-note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  color: var(--muted, #99a8b8);
  line-height: 1.35;
  max-width: 16rem;
}
.reef-refill-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 10px;
}
.reef-refill-btn.confirming {
  border-color: #7ee0c8;
  color: #081018;
  background: #7ee0c8;
}
.reef-trend-kpi-water.low strong { color: #ff8b9a; }
@media (prefers-reduced-motion: reduce) {
  .reef-topoff-water, .reef-topoff-water::before, .reef-topoff-water::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Sump setpoint marker */
.reef-sump-setpoint {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 2px dashed rgba(52,211,153,.95);
  box-shadow: 0 0 8px rgba(52,211,153,.55);
  z-index: 4; pointer-events: none;
  transition: bottom .9s cubic-bezier(.2,.8,.2,1);
}
.reef-sump-setpoint span {
  position: absolute; right: 4px; bottom: 2px;
  font: 700 9px/1 -apple-system, system-ui, sans-serif; letter-spacing: .06em;
  color: #34d399; text-shadow: 0 1px 2px rgba(0,0,0,.7);
}

/* Days Left tile */
.reef-hero.reef-hero-with-sump.reef-hero-with-topoff.reef-hero-with-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .reef-hero.reef-hero-with-sump.reef-hero-with-topoff.reef-hero-with-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px), (orientation: portrait) {
  .reef-hero.reef-hero-with-sump.reef-hero-with-topoff.reef-hero-with-days { grid-template-columns: 1fr 1fr; }
}
.panel.entering .reef-hero > .card:nth-child(7) { animation-delay: 280ms; }
.reef-days { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 14px 16px; min-height: 168px; }
.reef-days-label { font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: #7ee0c8; align-self: flex-start; }
.reef-days-ring { position: relative; width: 118px; height: 118px; }
.reef-days-ring svg { width: 100%; height: 100%; }
.reef-days-ring .bg { stroke: rgba(237,244,250,.10); }
.reef-days-ring .fg { stroke: #34d399; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(52,211,153,.45)); transition: stroke-dasharray .9s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.reef-days-num { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font-family: "Oswald", "Montserrat", sans-serif; font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text, #edf4fa); }
.reef-days-unit { position: absolute; left: 0; right: 0; top: 72px; text-align: center; font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #99a8b8); }
.reef-days-note { font-size: 11px; font-weight: 600; text-align: center; color: var(--muted, #99a8b8); line-height: 1.35; max-width: 16rem; }
.reef-days.warn .reef-days-ring .fg { stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.45)); }
.reef-days.low .reef-days-ring .fg { stroke: #ff5d73; filter: drop-shadow(0 0 6px rgba(255,93,115,.5)); }
.reef-days.low .reef-days-label, .reef-days.low .reef-days-num { color: #ff8b9a; }

/* Top Off H₂O — 14-day gallons-per-day bar chart */
.reef-galbar-svg { width: 100%; height: 210px; display: block; }
.reef-galbar rect { fill: rgba(126,224,200,.55); }
.reef-galbar.has rect { fill: #4eb89e; }
.reef-galbar.zero rect { fill: rgba(126,224,200,.14); }
.reef-galbar.today rect {
  fill: #7ee0c8;
  stroke: #edf4fa;
  stroke-width: 1.2;
  stroke-dasharray: 4 2.5;
  filter: drop-shadow(0 0 5px rgba(126,224,200,.45));
}
.reef-galbar text {
  fill: var(--muted, #99a8b8);
  font-size: 9px;
  font-weight: 700;
  font-family: "Montserrat", "Helvetica Neue", sans-serif;
}
.reef-galbar .bar-v { fill: #edf4fa; font-size: 10px; font-weight: 800; }
.reef-galbar.zero .bar-v { fill: var(--muted, #99a8b8); font-weight: 650; }
.reef-galbar .bar-wd { font-size: 8.5px; letter-spacing: .02em; }
.reef-galbar .bar-md { font-size: 8.5px; }
.reef-galbar .bar-prog {
  fill: #7ee0c8;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
@media (max-width: 700px), (orientation: portrait) {
  .reef-galbar-svg { height: 190px; }
  .reef-galbar .bar-v { font-size: 8.5px; }
}


/* Reef Tank dashboard (Animals submenu, 2026-11-19) */
#reefDashOverlay > #reefDashSheet,
.reef-dash-sheet { width: min(1120px, calc(100% - 36px)); min-height: min(860px, calc(100dvh - 60px)); }
.reef-dash-body { display: grid; gap: 12px; }
.reef-dash-body > .span-all,
.reef-dash-body > .reef-hero,
.reef-dash-body > .reef-water-panel { grid-column: 1 / -1; }
.reef-dash-alerts { display: grid; gap: 8px; margin: 0 0 12px; }
.reef-dash-alert { padding: 10px 14px; border-radius: 12px; background: rgba(255, 61, 79, 0.12); border: 1px solid rgba(255, 61, 79, 0.35); color: #ffb4ba; font-weight: 650; }
.reef-dash-trend h3 { margin: 0 0 8px; }
@media (max-width: 760px) {
  #reefDashOverlay > #reefDashSheet, .reef-dash-sheet { width: calc(100% - 16px); min-height: 0; }
}
