/* =========================================================
   Aquarium Care Suite — App stylesheet
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100dvh; line-height: 1.5; font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background: var(--color-bg); }
img, svg, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 6px; }

:root {
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --max-w: 720px;
}

/* === LIGHT (Freshwater) === */
:root, [data-theme="light"] {
  --color-bg: #f4f1ea;
  --color-surface: #ffffff;
  --color-surface-2: #faf7f0;
  --color-divider: #d8d2c4;
  --color-border: #c9c2b1;
  --color-text: #1a2a2c;
  --color-text-muted: #5a6669;
  --color-text-faint: #9aa3a4;
  --color-text-inverse: #faf7f0;
  --color-primary: #0e6a72;
  --color-primary-hover: #084e54;
  --color-primary-soft: #cce0e1;
  --color-success: #4a7a2c;
  --color-success-bg: #e0eed1;
  --color-caution: #b58a00;
  --color-caution-bg: #fdf3c4;
  --color-warning: #b9551c;
  --color-warning-bg: #f5dac6;
  --color-danger: #b3261e;
  --color-danger-bg: #fadcd9;
  --color-error: #a52e3d;
  --shadow-sm: 0 1px 2px rgb(14 106 114 / 0.06);
  --shadow-md: 0 4px 12px rgb(14 106 114 / 0.10);
  --shadow-lg: 0 12px 32px rgb(14 106 114 / 0.14);
}
[data-theme="dark"] {
  --color-bg: #0c1719;
  --color-surface: #16282a;
  --color-surface-2: #11201f;
  --color-divider: #24383a;
  --color-border: #2e4346;
  --color-text: #e1eced;
  --color-text-muted: #8a9c9e;
  --color-text-faint: #5b6e70;
  --color-text-inverse: #0c1719;
  --color-primary: #5cc1c0;
  --color-primary-hover: #7fd4d3;
  --color-primary-soft: #1e3f3f;
  --color-success: #87b85d;
  --color-success-bg: #2a3b1f;
  --color-caution: #e0c050;
  --color-caution-bg: #3d3618;
  --color-warning: #d4814c;
  --color-warning-bg: #3e2a1c;
  --color-danger: #e07173;
  --color-danger-bg: #3d1a1c;
  --color-error: #d56a78;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0c1719;
    --color-surface: #16282a;
    --color-surface-2: #11201f;
    --color-divider: #24383a;
    --color-border: #2e4346;
    --color-text: #e1eced;
    --color-text-muted: #8a9c9e;
    --color-text-faint: #5b6e70;
    --color-text-inverse: #0c1719;
    --color-primary: #5cc1c0;
    --color-primary-hover: #7fd4d3;
    --color-primary-soft: #1e3f3f;
    --color-success: #87b85d;
    --color-success-bg: #2a3b1f;
    --color-caution: #e0c050;
    --color-caution-bg: #3d3618;
    --color-warning: #d4814c;
    --color-warning-bg: #3e2a1c;
    --color-danger: #e07173;
    --color-danger-bg: #3d1a1c;
    --color-error: #d56a78;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.4);
  }
}

/* === HEADER === */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding-top: env(safe-area-inset-top);
}
.app-header__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
}
.brand span { color: var(--color-text); }
/* v119: real wordmark lockup image. Sized to match the prior header height
   (~26–30px tall). Width is intrinsic via the natural lockup aspect ratio. */
.brand-lockup {
  height: 30px;
  width: auto;
  display: block;
}
/* In dark mode, the colored lockup may look heavy on a near-black background.
   Soften with a subtle drop-shadow so the gradient text doesn't burn the eye. */
[data-theme="dark"] .brand-lockup {
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.4));
}
.header-actions { display: flex; gap: var(--space-2); }
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { color: var(--color-text); background: var(--color-surface-2); }

/* === MAIN === */
.app-main {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-6);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
}
.empty-art { color: var(--color-primary); opacity: 0.7; }
.empty-state h1 { font-size: var(--text-2xl); max-width: 22ch; }
.empty-state p { color: var(--color-text-muted); max-width: 36ch; }
.empty-state .btn { margin-top: var(--space-4); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-text); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }

/* === VIEW HEAD === */
.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.view-head h1 { font-size: var(--text-2xl); }
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
}
.back-btn:hover { color: var(--color-text); background: var(--color-surface-2); }
.tank-meta { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: 2px; }
.tank-detail .view-head { gap: var(--space-3); align-items: flex-start; }
.tank-detail .view-head > div { flex: 1; min-width: 0; }
.tank-detail .view-head h1 { font-size: var(--text-xl); }

/* === TANK LIST === */
.tank-list { display: flex; flex-direction: column; gap: var(--space-3); }
.tank-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex; align-items: center; gap: var(--space-4);
  cursor: pointer;
  transition: all var(--transition);
}
.tank-card:hover { border-color: var(--color-primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tank-card-info { flex: 1; min-width: 0; }
.tank-card-info h3 { font-size: var(--text-lg); margin-bottom: 2px; }
.tank-card-info p { font-size: var(--text-xs); color: var(--color-text-muted); }
.tank-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-text-faint);
}
.tank-status-dot.ok { background: var(--color-success); }
.tank-status-dot.alert { background: var(--color-warning); }
.tank-card-arrow { color: var(--color-text-faint); }

/* === LATEST READING GRID === */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: var(--space-5);
}
@media (max-width: 720px) {
  .latest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.latest-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  text-align: left;
  min-height: 0;
  min-width: 0;
}
.latest-tile .label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-text-muted); margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.latest-tile .value {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.latest-tile .unit { font-size: 9px; color: var(--color-text-muted); font-weight: 400; margin-left: 2px; }
/* Red/yellow/green conditional formatting for water-chemistry readings */
.latest-tile.good,
.latest-tile.ok {
  background: var(--color-success-bg);
  border-color: color-mix(in oklab, var(--color-success) 50%, transparent);
}
.latest-tile.good .value,
.latest-tile.ok .value { color: var(--color-success); }
.latest-tile.caution {
  background: var(--color-caution-bg);
  border-color: var(--color-caution);
}
.latest-tile.caution .value { color: var(--color-caution); }
.latest-tile.alert {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}
.latest-tile.alert .value { color: var(--color-danger); font-weight: 700; }
.latest-tile.unknown .value { color: var(--color-text-faint); }

/* === CARD === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.card h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-head h2 { margin: 0; }
.btn-link {
  background: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition);
}
.btn-link:hover { background: var(--color-primary-soft); }

/* === Setup notes (dimensions advisor) === */
.tank-specs {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}
.tank-specs strong { color: var(--color-text); font-weight: 600; }
.advisor-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.advisor-chip {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-divider);
  background: var(--color-bg);
}
.advisor-chip--info     { border-left-color: var(--color-primary); }
.advisor-chip--caution  { border-left-color: var(--color-warning); background: var(--color-warning-bg); }
.advisor-chip--warning  { border-left-color: var(--color-error); background: color-mix(in oklab, var(--color-error) 8%, var(--color-bg)); }
.advisor-chip__head {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.advisor-chip__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-divider);
  flex-shrink: 0;
}
.advisor-chip--info    .advisor-chip__dot { background: var(--color-primary); }
.advisor-chip--caution .advisor-chip__dot { background: var(--color-warning); }
.advisor-chip--warning .advisor-chip__dot { background: var(--color-error); }
.advisor-chip__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.advisor-chip__detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.equip-strip {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.equip-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.equip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.equip-item {
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  text-align: left;
}
.equip-item__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.equip-item__value {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 2px;
}
.equip-item__note {
  font-size: 10px;
  color: var(--color-text-faint);
}
@media (max-width: 480px) {
  .equip-row { grid-template-columns: 1fr; }
}

/* === Tank form: dimensions & shape === */
.modal--tank { max-width: 460px; }
.dim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.dim-grid label { margin-bottom: 0; }
.vol-readout {
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}
.vol-readout__row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 2px;
}
.vol-readout__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.vol-readout__value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.vol-readout__hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.override-toggle {
  flex-direction: row !important;
  align-items: center !important;
  gap: var(--space-2);
  margin-bottom: var(--space-3) !important;
  cursor: pointer;
}
.override-toggle input { width: auto !important; margin: 0; }
.override-toggle span {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: var(--text-sm) !important;
  color: var(--color-text-muted) !important;
}

/* === TASKS === */
.task-list {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.task-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-left: 3px solid var(--color-divider);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
}
.task-row--ok { border-left-color: var(--color-divider); }
.task-row--soon { border-left-color: var(--color-primary); }
.task-row--due { border-left-color: var(--color-warning); background: var(--color-warning-bg); }
.task-row--overdue { border-left-color: var(--color-error); background: color-mix(in oklab, var(--color-error) 8%, var(--color-bg)); }
.task-done-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-faint);
  transition: all var(--transition);
}
.task-done-btn:hover {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-bg);
}
.task-body { flex: 1; min-width: 0; }
.task-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}
.task-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.task-row--due .due-label,
.task-row--overdue .due-label {
  color: var(--color-warning);
  font-weight: 500;
}
.task-row--overdue .due-label { color: var(--color-error); }
.task-actions {
  display: flex; gap: var(--space-1);
  flex-shrink: 0;
}
.icon-btn-sm {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-faint);
  transition: color var(--transition), background var(--transition);
}
.icon-btn-sm:hover { color: var(--color-text); background: var(--color-surface-2); }

/* Tank card due badge */
.tank-card-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-warning);
  color: white;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tank-card-badge.overdue { background: var(--color-error); }

/* === LOG FORM === */
.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.log-grid label {
  display: flex; flex-direction: column; gap: var(--space-1);
}
.log-grid label span {
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.log-grid input,
.log-form textarea,
.modal input, .modal select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  color: var(--color-text);
  font-size: var(--text-base);
  width: 100%;
  transition: border-color var(--transition);
}
.log-grid input:focus,
.log-form textarea:focus,
.modal input:focus, .modal select:focus {
  outline: none;
  border-color: var(--color-primary);
}
.log-form textarea { resize: vertical; margin-bottom: var(--space-3); }
.log-form button[type="submit"] { width: 100%; }

/* === CHART === */
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.chart-head h2 { margin: 0; }
.select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.chart-empty {
  color: var(--color-text-muted); text-align: center; padding: var(--space-6) 0;
  font-size: var(--text-sm);
}

/* === HISTORY === */
.history-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 320px; overflow-y: auto; }
.history-item {
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-1);
}
.history-item .when {
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.history-item .vals {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}
.history-item .vals span { font-variant-numeric: tabular-nums; }
.history-item .vals .alert-val { color: var(--color-danger); font-weight: 600; }
.history-item .vals .caution-val { color: var(--color-caution); font-weight: 500; }
.history-item .vals .good-val { color: var(--color-success); }
.history-item .note { font-size: var(--text-xs); color: var(--color-text-muted); font-style: italic; margin-top: 2px; }
.muted { color: var(--color-text-muted); font-size: var(--text-sm); text-align: center; padding: var(--space-4); }

/* === MODAL === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgb(0 0 0 / 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: var(--space-4);
  animation: fade-in 200ms ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: scale-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
  /* Cap height so tall modals (e.g. Add Tank with trait checkboxes) scroll instead of clipping */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal h2 { font-size: var(--text-xl); margin-bottom: var(--space-5); }
.modal label {
  display: flex; flex-direction: column; gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.modal label > span {
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
/* v109: helper text inside .muted children should NOT inherit uppercase —
   it's body copy, not a label. Scope the all-caps to the outermost span only. */
.modal label .muted,
.modal label span span.muted {
  text-transform: none;
  letter-spacing: normal;
}
/* v109: trait-check labels (the whole row clickable) — the inner content span
   wraps a <strong> title and a <span class="muted"> helper. Title stays normal
   case (it's a sentence, not a label), helper inherits the .muted exception above. */
.trait-check > span {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: var(--text-sm) !important;
  color: var(--color-text) !important;
  text-align: left !important;
}
.trait-check > span strong { font-weight: 600; }
/* v110a: keep the helper text inline (continuing the title sentence), not a centered block.
   The .modal label span { display: block } parent rule cascades to nested spans — force inline.
   Also left-align so it doesn't inherit any centered text-align from a parent. */
.trait-check > span > .muted {
  display: inline !important;
  text-align: left !important;
}
.modal-close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  font-size: 24px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-actions {
  display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6);
}

.locked-hint {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-xs);
  margin-top: calc(-1 * var(--space-2));
  margin-bottom: var(--space-4);
}
.locked-hint svg { flex-shrink: 0; }

/* Ambient room temperature fieldset (v85) */
.ambient-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--color-bg);
}
.ambient-fieldset legend {
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.ambient-fieldset .sub-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.ambient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.ambient-grid label { margin-bottom: 0; }
@media (max-width: 420px) {
  .ambient-grid { grid-template-columns: 1fr; }
}

/* v116: paywall modal styles removed — Shrimp Keeper is unconditionally available. */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* === TOAST === */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toast-in 250ms ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* === FOOTER === */
.app-footer {
  max-width: var(--max-w);
  margin: var(--space-12) auto var(--space-8);
  padding: 0 var(--space-4) env(safe-area-inset-bottom);
  text-align: center;
}
.app-footer p { font-size: var(--text-xs); color: var(--color-text-faint); }

/* Larger screens: ease padding */
@media (min-width: 720px) {
  .app-header__inner, .app-main, .app-footer { padding-inline: var(--space-6); }
}

/* =========================================================
   MODULES 3 / 4 / 5 — Stocking, Planted, Shrimp
   ========================================================= */

/* --- shared sub-header used inside multi-section cards --- */
.sub-h {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: var(--space-4) 0 var(--space-2);
}
.sub-note {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  margin-top: var(--space-2);
  line-height: 1.5;
}

/* === Stocking Planner === */
.stocking-meter { margin: var(--space-2) 0 var(--space-3); }
.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.meter-label { font-weight: 600; color: var(--color-text); }
.meter-pct { color: var(--color-text-soft); font-variant-numeric: tabular-nums; }
.meter-bar {
  height: 10px;
  background: var(--color-surface-sunken, rgba(0,0,0,0.06));
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .meter-bar { background: rgba(255,255,255,0.08); }
.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 300ms ease;
}
.meter-bar--low .meter-fill { background: var(--color-text-faint); }
.meter-bar--good .meter-fill { background: #16a34a; }
.meter-bar--high .meter-fill { background: #f59e0b; }
.meter-bar--over .meter-fill { background: #dc2626; }

.stock-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* v120a: stock rows always stack — main content (name + meta + issues) on top,
   qty/action cluster wrapping below. Prevents the species name from being
   vertically squeezed when the qty cluster eats horizontal space. The qty row
   itself wraps so move buttons (v115) flow to a second line cleanly. */
.stock-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
/* v120: avatar-driven grid layout removed with the Journal feature. */
.stock-item__main { min-width: 0; flex: 1; }
.stock-item__name { font-weight: 600; font-size: var(--text-sm); }
.stock-item__meta { font-size: var(--text-xs); margin-top: 2px; }
.stock-item__qty { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}
.qty-btn:hover { background: var(--color-surface, rgba(0,0,0,0.04)); }
.qty-btn--remove { color: #dc2626; border-color: rgba(220,38,38,0.3); }
.qty-btn--remove:hover { background: rgba(220,38,38,0.08); }
/* v107: deceased / rehomed / restore action buttons in stocking list */
.qty-btn--deceased { color: #7c3aed; border-color: rgba(124,58,237,0.3); font-size: 14px; }
.qty-btn--deceased:hover { background: rgba(124,58,237,0.08); }
.qty-btn--rehomed { color: #0284c7; border-color: rgba(2,132,199,0.3); font-size: 14px; }
.qty-btn--rehomed:hover { background: rgba(2,132,199,0.08); }
.qty-btn--restore {
  color: var(--color-accent, #0d9488);
  border-color: rgba(13,148,136,0.35);
  width: auto;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
}
.qty-btn--restore:hover { background: rgba(13,148,136,0.08); }
/* v114: "Move to display tank" button on QT stocking rows. Looks like restore (text +
   arrow) but uses teal-fill so it stands out as the primary success action for a QT run. */
.qty-btn--move {
  color: #fff;
  background: var(--color-accent, #0d9488);
  border-color: var(--color-accent, #0d9488);
  width: auto;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.qty-btn--move:hover { background: #0f766e; border-color: #0f766e; }

/* v107: deceased/rehomed entries are visually de-emphasized */
.stock-item--removed {
  opacity: 0.62;
  background: rgba(0,0,0,0.02);
  border-style: dashed;
}
.stock-item--removed .plant-item__name { text-decoration: line-through; }

/* v107: "Previously kept" collapsed section under live stocking list */
.stock-removed-section { margin-top: var(--space-3); }
.stock-removed-details {
  border-top: 1px dashed var(--color-border, rgba(0,0,0,0.12));
  padding-top: var(--space-2);
}
.stock-removed-summary {
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted, #6b7280);
  padding: var(--space-1) 0;
  list-style: revert;
  user-select: none;
}
.stock-removed-summary:hover { color: var(--color-text, #111); }
.stock-removed-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.status-pill--removed {
  background: rgba(100,116,139,0.10);
  color: #475569;
  border-color: rgba(100,116,139,0.25);
}
.qty-count {
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--text-sm);
}

/* Stocking species info card inside modal */
.species-info {
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface, rgba(0,0,0,0.03));
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
[data-theme="dark"] .species-info { background: rgba(255,255,255,0.04); }
.species-info__row { font-size: var(--text-sm); line-height: 1.5; }
.species-info__row + .species-info__row { margin-top: 2px; }

/* === Planted Tank module === */
.dropchecker-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.dropchecker-chip {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  align-items: flex-start;
}
.dropchecker-chip__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.dropchecker-chip--low .dropchecker-chip__swatch  { background: #3b82f6; }
.dropchecker-chip--ok .dropchecker-chip__swatch   { background: #16a34a; }
.dropchecker-chip--high .dropchecker-chip__swatch { background: #facc15; }
.dropchecker-chip__body { min-width: 0; flex: 1; }
.dropchecker-chip__head { font-size: var(--text-sm); margin-bottom: 2px; }
.dropchecker-chip__detail { font-size: var(--text-xs); line-height: 1.5; }

.planted-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.planted-controls label { display: flex; flex-direction: column; gap: var(--space-1); }
.planted-controls label > span { font-size: var(--text-xs); color: var(--color-text-soft); }
.planted-controls input, .planted-controls select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
}
@media (max-width: 480px) {
  .planted-controls { grid-template-columns: 1fr; }
}

.dosing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (min-width: 600px) { .dosing-grid { grid-template-columns: repeat(4, 1fr); } }
.dosing-cell {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.dosing-cell--reset { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.2); }
[data-theme="dark"] .dosing-cell--reset { background: rgba(34, 197, 94, 0.12); }
.dosing-cell__label {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.dosing-cell__value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
.dosing-cell__note { font-size: var(--text-xs); color: var(--color-text-soft); }
.dosing-disclaimer { font-style: italic; }

/* === Shrimp Keeper module === */
.shrimp-species-select { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-3); }
.shrimp-species-select > span { font-size: var(--text-xs); color: var(--color-text-soft); }
.shrimp-species-select select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
}
.shrimp-profile__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
@media (min-width: 600px) { .shrimp-profile__grid { grid-template-columns: repeat(5, 1fr); } }
.shrimp-profile__cell {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface, rgba(0,0,0,0.04));
  border-radius: var(--radius-md);
  text-align: center;
}
[data-theme="dark"] .shrimp-profile__cell { background: rgba(255,255,255,0.04); }
.shrimp-profile__cell .label { font-size: var(--text-xs); color: var(--color-text-soft); }
.shrimp-profile__cell .value { font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Drip timer */
.drip-timer {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.drip-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.drip-controls label { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 100px; }
.drip-controls label > span { font-size: var(--text-xs); color: var(--color-text-soft); }
.drip-controls input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
}
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  height: auto;
}
.drip-readout {
  margin-top: var(--space-3);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--color-surface, rgba(0,0,0,0.04));
  border-radius: var(--radius-md);
  color: var(--color-text);
}
[data-theme="dark"] .drip-readout { background: rgba(255,255,255,0.04); }

/* Shrimp row (compact form rows for molt + colony) */
.shrimp-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.shrimp-row input {
  flex: 1;
  min-width: 100px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
}
.shrimp-row .btn-sm { flex: 0 0 auto; }

/* Mini lists for molts + colonies */
.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.mini-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.mini-item > span:first-child { flex: 1; font-weight: 500; }
.mini-empty { padding: var(--space-3); font-size: var(--text-sm); text-align: center; }

/* v116: .shrimp-locked styles removed — Shrimp Keeper is unconditionally available. */

/* === Low-tech plant starter list (Planted module) === */
.lowtech-panel {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3);
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
}
[data-theme="dark"] .lowtech-panel {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
}
.lowtech-panel .sub-h { margin-top: 0; }
.lowtech-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}
@media (min-width: 600px) { .lowtech-list { grid-template-columns: 1fr 1fr; } }
.lowtech-item {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.lowtech-item__name { font-weight: 600; font-size: var(--text-sm); color: var(--color-text); }
.lowtech-item__care { font-size: var(--text-xs); line-height: 1.5; margin-top: 2px; }

/* === Shrimp Health Check panel === */
.health-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.health-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  overflow: hidden;
}
.health-item__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  transition: background 120ms ease;
}
.health-item__head:hover { background: var(--color-surface, rgba(0,0,0,0.03)); }
[data-theme="dark"] .health-item__head:hover { background: rgba(255,255,255,0.04); }
.health-item__name { flex: 1; font-weight: 600; min-width: 0; }
.health-item__chev { color: var(--color-text-soft); font-size: var(--text-xs); transition: transform 200ms ease; }
.health-item__head[aria-expanded="true"] .health-item__chev { transform: rotate(180deg); }

.health-pill {
  font-size: 11px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.health-pill--cosmetic            { background: rgba(100,116,139,0.18); color: #475569; }
.health-pill--treatable           { background: rgba(34,197,94,0.18);   color: #15803d; }
.health-pill--serious             { background: rgba(245,158,11,0.20);  color: #b45309; }
.health-pill--fatal_to_individual { background: rgba(217,70,239,0.18);  color: #a21caf; }
.health-pill--tank_threat         { background: rgba(220,38,38,0.18);   color: #b91c1c; }
[data-theme="dark"] .health-pill--cosmetic            { color: #cbd5e1; }
[data-theme="dark"] .health-pill--treatable           { color: #86efac; }
[data-theme="dark"] .health-pill--serious             { color: #fbbf24; }
[data-theme="dark"] .health-pill--fatal_to_individual { color: #f0abfc; }
[data-theme="dark"] .health-pill--tank_threat         { color: #fca5a5; }

.health-item__body {
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface, rgba(0,0,0,0.02));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
[data-theme="dark"] .health-item__body { background: rgba(255,255,255,0.02); }
.health-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.5;
}
@media (max-width: 480px) {
  .health-row { grid-template-columns: 1fr; gap: 2px; }
}
.health-row__lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-top: 2px;
}
/* Preserve newlines in health-row values so multi-branch advice (e.g. biofilm cycling vs stocked) renders as readable bullets */
.health-row > span:not(.health-row__lbl) { white-space: pre-wrap; }
.health-row--sources a {
  color: var(--color-accent, #0e6a72);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* === Stocking filter row (inside Add Species modal) === */
.stock-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin: -2px 0 var(--space-2);
  font-size: var(--text-xs);
}
.stock-filter-count { color: var(--color-text-soft); }
.stock-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-text-soft);
  font-weight: 500;
}
.stock-filter-toggle input { accent-color: var(--color-accent, #0e6a72); }

/* Warning row inside species info */
.species-info__warn {
  color: #b45309;
  font-size: var(--text-xs);
  padding-top: 4px;
  border-top: 1px dashed rgba(180, 83, 9, 0.3);
  margin-top: 4px;
}
[data-theme="dark"] .species-info__warn { color: #fbbf24; border-top-color: rgba(251, 191, 36, 0.25); }

/* === Fish & Invert Health Check card === */
.fishhealth-body { margin-top: var(--space-3); }
.fishhealth-filters {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.chip-btn {
  padding: 4px var(--space-3);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-soft);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 120ms ease;
}
.chip-btn:hover { border-color: var(--color-text-soft); color: var(--color-text); }
.chip-btn--active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
[data-theme="dark"] .chip-btn--active { background: var(--color-text); color: var(--color-bg); }

.health-species-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-1);
}
.species-tag {
  font-size: 11px;
  padding: 2px var(--space-2);
  background: var(--color-surface, rgba(0,0,0,0.05));
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
[data-theme="dark"] .species-tag { background: rgba(255,255,255,0.07); color: var(--color-text); }

/* === v0.8 Opus-refreshed UI surfaces === */
.evidence-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 4px;
  white-space: nowrap;
}
.evidence-badge--strong { background: rgba(34,197,94,0.18);  color: #15803d; }
.evidence-badge--medium { background: rgba(245,158,11,0.18); color: #b45309; }
.evidence-badge--weak   { background: rgba(220,38,38,0.16);  color: #b91c1c; }
[data-theme="dark"] .evidence-badge--strong { color: #86efac; }
[data-theme="dark"] .evidence-badge--medium { color: #fbbf24; }
[data-theme="dark"] .evidence-badge--weak   { color: #fca5a5; }

.species-info__controversy {
  color: #b45309;
  font-size: var(--text-xs);
  padding-top: 4px;
  font-style: italic;
}
[data-theme="dark"] .species-info__controversy { color: #fbbf24; }
.species-info__legal {
  color: #b91c1c;
  font-size: var(--text-xs);
  padding-top: 4px;
  font-weight: 500;
}
[data-theme="dark"] .species-info__legal { color: #fca5a5; }
.species-info__sources {
  font-size: 11px;
  color: var(--color-text-soft);
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-1);
}
.species-info__sources a {
  color: var(--color-accent, #0e6a72);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.health-row--controversy {
  background: rgba(245,158,11,0.08);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-style: italic;
}
[data-theme="dark"] .health-row--controversy { background: rgba(245,158,11,0.12); }

/* === Symptom search === */
.symptom-search {
  position: relative;
  margin-bottom: var(--space-3);
}
.symptom-search input[type="search"] {
  width: 100%;
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.symptom-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.symptom-search input[type="search"]:focus {
  outline: none;
  border-color: var(--color-accent, #0e6a72);
  box-shadow: 0 0 0 3px rgba(14, 106, 114, 0.15);
}
.symptom-clear {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--color-text-soft);
  color: var(--color-bg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.symptom-clear:hover { background: var(--color-text); }

/* Highlight matched terms in search results */
mark {
  background: rgba(245, 158, 11, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}
[data-theme="dark"] mark {
  background: rgba(251, 191, 36, 0.35);
}

/* === v1.0 Priority surfacing === */
.priority-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #b91c1c;
  color: white;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 4px;
}
[data-theme="dark"] .priority-badge { background: #dc2626; }

.health-item--priority {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid #dc2626;
}
[data-theme="dark"] .health-item--priority {
  background: rgba(220, 38, 38, 0.08);
}

.species-tag--stocked {
  background: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
  font-weight: 600;
}
[data-theme="dark"] .species-tag--stocked {
  background: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}

/* === v1.0 Treatments + Outcomes === */
.tx-section {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
}
.tx-section__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}
.tx-section__title--small { font-size: 10px; }
.tx-section__sources {
  font-size: 11px;
  color: var(--color-text-soft);
}
.tx-section__sources a {
  color: var(--color-accent, #0e6a72);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.treatment-card {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent, #0e6a72);
}
.treatment-card:last-child { margin-bottom: 0; }
.treatment-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.treatment-card__product { font-size: var(--text-sm); }
.treatment-card__active { font-size: var(--text-xs); margin-bottom: var(--space-2); }
.treatment-card__protocol { font-size: var(--text-sm); line-height: 1.55; margin-bottom: var(--space-2); }
.treatment-card__safety {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-2);
}
.treatment-card__notes { font-size: var(--text-xs); font-style: italic; line-height: 1.5; }

.avail-pill, .cost-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.avail-pill--common      { background: rgba(34,197,94,0.18);  color: #15803d; }
.avail-pill--specialty   { background: rgba(245,158,11,0.18); color: #b45309; }
.avail-pill--online_only { background: rgba(100,116,139,0.18); color: #475569; }
[data-theme="dark"] .avail-pill--common      { color: #86efac; }
[data-theme="dark"] .avail-pill--specialty   { color: #fbbf24; }
[data-theme="dark"] .avail-pill--online_only { color: #cbd5e1; }
.cost-pill {
  background: var(--color-surface, rgba(0,0,0,0.05));
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .cost-pill { background: rgba(255,255,255,0.06); }

.safety-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: nowrap;
}
.safety-pill--safe    { background: rgba(34,197,94,0.18);  color: #15803d; }
.safety-pill--unsafe  { background: rgba(220,38,38,0.20);  color: #b91c1c; }
.safety-pill--caution { background: rgba(245,158,11,0.18); color: #b45309; }
[data-theme="dark"] .safety-pill--safe    { color: #86efac; }
[data-theme="dark"] .safety-pill--unsafe  { color: #fca5a5; }
[data-theme="dark"] .safety-pill--caution { color: #fbbf24; }

.outcome-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: var(--text-sm);
  line-height: 1.5;
}
@media (max-width: 480px) { .outcome-row { grid-template-columns: 1fr; gap: 2px; } }
.outcome-row__lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-soft);
  padding-top: 2px;
}
.outcome-row--good { background: rgba(34,197,94,0.06); }
.outcome-row--mid  { background: rgba(245,158,11,0.06); }
.outcome-row--bad  { background: rgba(220,38,38,0.06); }
.outcome-row--recur { background: var(--color-surface, rgba(0,0,0,0.03)); }
[data-theme="dark"] .outcome-row--good { background: rgba(34,197,94,0.12); }
[data-theme="dark"] .outcome-row--mid  { background: rgba(245,158,11,0.12); }
[data-theme="dark"] .outcome-row--bad  { background: rgba(220,38,38,0.12); }
[data-theme="dark"] .outcome-row--recur { background: rgba(255,255,255,0.04); }

.recur-pill {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 4px;
}
.recur-pill--high   { background: rgba(220,38,38,0.20);  color: #b91c1c; }
.recur-pill--medium { background: rgba(245,158,11,0.20); color: #b45309; }
.recur-pill--low    { background: rgba(34,197,94,0.18);  color: #15803d; }
[data-theme="dark"] .recur-pill--high   { color: #fca5a5; }
[data-theme="dark"] .recur-pill--medium { color: #fbbf24; }
[data-theme="dark"] .recur-pill--low    { color: #86efac; }

/* === Symptom checker quiz === */
.quiz-launcher {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.quiz-launcher__hint { font-size: var(--text-xs); }

.quiz-panel {
  background: var(--color-surface, rgba(0,0,0,0.03));
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent, #0e6a72);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
[data-theme="dark"] .quiz-panel { background: rgba(255,255,255,0.04); }
.quiz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.quiz-step {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent, #0e6a72);
}
.quiz-close {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--color-text-soft);
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.quiz-close:hover { background: var(--color-border); color: var(--color-text); }
.quiz-question {
  font-size: var(--text-base);
  margin: 0 0 var(--space-3);
  color: var(--color-text);
  font-weight: 600;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.quiz-option {
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 120ms ease;
}
.quiz-option:hover {
  border-color: var(--color-accent, #0e6a72);
  background: rgba(14, 106, 114, 0.05);
}
[data-theme="dark"] .quiz-option:hover { background: rgba(14, 106, 114, 0.15); }
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* === Jumper / cover info === */
.species-info__cover {
  font-size: var(--text-xs);
  padding: 4px var(--space-2);
  margin-top: 4px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.10);
  color: #b45309;
  font-weight: 500;
}
[data-theme="dark"] .species-info__cover { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.species-info__cover--required {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  font-weight: 600;
}
[data-theme="dark"] .species-info__cover--required { background: rgba(220, 38, 38, 0.20); color: #fca5a5; }
.species-info__cover--mild {
  background: var(--color-surface, rgba(0,0,0,0.04));
  color: var(--color-text-soft);
  font-weight: 400;
}
[data-theme="dark"] .species-info__cover--mild { background: rgba(255,255,255,0.05); color: var(--color-text-soft); }

/* === v1.3 Smarter quiz scoring === */
.quiz-active-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(14, 106, 114, 0.08);
  border: 1px solid rgba(14, 106, 114, 0.25);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  list-style: none;
}
[data-theme="dark"] .quiz-active-banner {
  background: rgba(14, 106, 114, 0.18);
  border-color: rgba(14, 106, 114, 0.4);
}

.quiz-match-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.quiz-match-badge--full {
  background: rgba(34, 197, 94, 0.22);
  color: #15803d;
}
.quiz-match-badge--partial {
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.quiz-match-badge--weak {
  background: rgba(100, 116, 139, 0.18);
  color: #475569;
}
[data-theme="dark"] .quiz-match-badge--full    { color: #86efac; }
[data-theme="dark"] .quiz-match-badge--partial { color: #fbbf24; }
[data-theme="dark"] .quiz-match-badge--weak    { color: #cbd5e1; }

/* === v1.4 Auto-diagnose findings panel === */
.diag-findings {
  background: rgba(14, 106, 114, 0.06);
  border: 1px solid rgba(14, 106, 114, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
[data-theme="dark"] .diag-findings {
  background: rgba(14, 106, 114, 0.15);
  border-color: rgba(14, 106, 114, 0.4);
}
.diag-findings__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.diag-close {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--color-text-soft);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.diag-close:hover { background: var(--color-border); color: var(--color-text); }
.diag-finding-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.diag-finding {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  background: var(--color-bg);
}
.diag-finding--warning { border-left-color: #dc2626; }
.diag-finding--caution { border-left-color: #f59e0b; }
.diag-finding__label { font-size: var(--text-sm); font-weight: 600; }
.diag-finding__evidence { font-size: var(--text-xs); margin-top: 2px; }
.diag-findings__note { font-size: var(--text-xs); margin: var(--space-2) 0 0; }
.diag-clear {
  padding: var(--space-2);
  background: rgba(34, 197, 94, 0.10);
  color: #15803d;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
}
[data-theme="dark"] .diag-clear { color: #86efac; background: rgba(34, 197, 94, 0.18); }

/* ===== Multi-trait tank selector ===== */
.traits-fieldset {
  border: 1px solid var(--border, rgba(0,0,0,0.12));
  border-radius: 10px;
  padding: 12px 14px 6px;
  margin: 8px 0 4px;
}
.traits-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #2b2b2b);
}
/* v110e: scope as .modal label.trait-check to beat the parent .modal label rule on specificity
   (matching 0,2,1 vs the parent's 0,1,1). Without this, flex-direction stays column. */
.modal label.trait-check,
.trait-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}
.trait-check input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.trait-check span { display: block; }
.trait-check.trait-sub {
  margin-left: 26px;
  border-top: 1px dashed var(--border, rgba(0,0,0,0.08));
  padding-top: 10px;
  margin-top: 4px;
}
.trait-check.trait-sub > span:first-of-type {
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted, #666);
}
.trait-check.trait-sub select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.18));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #2b2b2b);
  font-size: 14px;
}

/* ===== Shrimp Keeper multi-species picker ===== */
.shrimp-species-picker {
  margin-bottom: 12px;
}
.shrimp-species-picker__head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text, var(--text, #2b2b2b));
}
.shrimp-species-group {
  margin-bottom: 10px;
}
.shrimp-species-group__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, var(--text-muted, #777));
  margin: 8px 0 4px;
}
.shrimp-species-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}
.shrimp-species-check input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.shrimp-compat-warning {
  background: rgba(220, 130, 30, 0.10);
  border: 1px solid rgba(220, 130, 30, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.shrimp-compat-warning strong { display: block; margin-bottom: 4px; }
.shrimp-compat-warning p { margin: 0; line-height: 1.4; }
.shrimp-profile { display: flex; flex-direction: column; gap: 12px; }
.shrimp-profile-card {
  border: 1px solid var(--color-border, var(--border, rgba(0,0,0,0.10)));
  border-radius: 10px;
  padding: 10px 12px;
}
.shrimp-profile-card__name {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

/* ===== Tank Vibe Wizard ===== */
.stocking-head-actions { display: flex; gap: 8px; align-items: center; }
.modal--vibe { max-width: 520px; }
.vibe-intro { margin: -4px 0 12px; font-size: 13px; line-height: 1.4; }
.vibe-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.vibe-dot {
  flex: 1;
  height: 4px;
  background: var(--color-border, rgba(0,0,0,0.10));
  border-radius: 999px;
  transition: background 200ms ease;
}
.vibe-dot--active { background: var(--color-accent, #0e6a72); }
.vibe-step { min-height: 240px; }
.vibe-question__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}
.vibe-question__sub {
  font-size: 12px;
  color: var(--color-text-muted, #666);
  margin: 0 0 12px;
}
.vibe-options { display: flex; flex-direction: column; gap: 8px; }
.vibe-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.12));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.vibe-option:hover { border-color: var(--color-accent, #0e6a72); }
.vibe-option--checked {
  border-color: var(--color-accent, #0e6a72);
  background: color-mix(in srgb, var(--color-accent, #0e6a72) 8%, transparent);
}
.vibe-option input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.vibe-option__label { font-weight: 600; font-size: 14px; line-height: 1.3; }
.vibe-option__hint { font-size: 12px; color: var(--color-text-muted, #666); margin-top: 2px; line-height: 1.35; }
.vibe-actions { margin-top: 16px; }

/* Results */
.vibe-results { padding: 4px 0; }
.vibe-summary {
  font-size: 13px;
  background: color-mix(in srgb, var(--color-accent, #0e6a72) 6%, transparent);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.vibe-plan { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.vibe-plan-item {
  border: 1px solid var(--color-border, rgba(0,0,0,0.10));
  border-radius: 10px;
  padding: 10px 12px;
}
.vibe-plan-item__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.vibe-plan-item__qty {
  font-weight: 700;
  color: var(--color-accent, #0e6a72);
  font-size: 15px;
}
.vibe-plan-item__name { font-weight: 600; font-size: 14px; }
.vibe-plan-item__group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.vibe-plan-item__reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.vibe-tag {
  background: color-mix(in srgb, var(--color-accent, #0e6a72) 12%, transparent);
  color: var(--color-accent, #0e6a72);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.vibe-plan-item__notes { font-size: 12px; line-height: 1.4; margin-top: 4px; font-style: italic; }
.vibe-alts { margin-top: 14px; font-size: 13px; }
.vibe-alts summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.vibe-alts__list { padding-left: 18px; margin: 6px 0; }
.vibe-alts__list li { font-size: 13px; line-height: 1.45; padding: 3px 0; }
.vibe-results-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.vibe-empty { font-size: 13px; padding: 16px; text-align: center; color: var(--color-text-muted, #666); }

/* ===== Vibe Wizard — LFS availability pill ===== */
.vibe-avail {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
  white-space: nowrap;
}
.vibe-avail--common {
  background: rgba(46, 160, 67, 0.14);
  color: #1f7a32;
}
.vibe-avail--specialty {
  background: rgba(220, 130, 30, 0.14);
  color: #a85b14;
}
.vibe-avail--online {
  background: rgba(150, 150, 150, 0.20);
  color: #555;
}
@media (prefers-color-scheme: dark) {
  .vibe-avail--common  { background: rgba(46, 160, 67, 0.25); color: #6fd684; }
  .vibe-avail--specialty { background: rgba(220, 130, 30, 0.25); color: #f0a55a; }
  .vibe-avail--online  { background: rgba(200, 200, 200, 0.18); color: #c4c4c4; }
}

/* ===== Alternate common names ===== */
.vibe-plan-item__aliases,
.species-info__aliases {
  font-size: 12px;
  line-height: 1.4;
  margin: 2px 0 6px;
}
.vibe-plan-item__aliases em,
.species-info__aliases em {
  font-style: normal;
  color: var(--color-text, var(--text, #2b2b2b));
}
.vibe-plan-item__aliases > span:first-child,
.species-info__aliases > span:first-child {
  font-style: italic;
  margin-right: 4px;
}

/* ===== Stock search input ===== */
.stock-search-label { margin-bottom: 12px; }
.stock-search-wrap { position: relative; }
.stock-search-wrap input[type="search"] {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.18));
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.stock-search-wrap input[type="search"]:focus {
  outline: 2px solid var(--color-accent, #0e6a72);
  outline-offset: 1px;
}
.stock-search-wrap input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.stock-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted, #777);
  border-radius: 6px;
}
.stock-search-clear:hover { background: rgba(0,0,0,0.06); color: var(--color-text, #2b2b2b); }

/* Make the species select with size attr render as a list-picker (better with search) */
#stockSpeciesSelect[size] {
  height: auto;
  min-height: 200px;
  max-height: 280px;
  padding: 4px;
  font-size: 14px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.18));
  border-radius: 8px;
}
#stockSpeciesSelect[size] option {
  padding: 6px 8px;
  line-height: 1.35;
}

/* ===== Dismissable advisor chips ===== */
.advisor-chip__head {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Push the dismiss button to the right */
}
.advisor-chip__label { flex: 1; }
.advisor-chip__dismiss {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.18));
  background: transparent;
  color: var(--color-text-muted, #666);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.advisor-chip__dismiss:hover {
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
  border-color: var(--color-text-muted, #666);
}
.advisor-chip--dismissed {
  opacity: 0.55;
}
.advisor-chip--dismissed .advisor-chip__dismiss {
  background: var(--color-primary-soft, rgba(14,106,114,0.10));
  color: var(--color-primary, #0e6a72);
  border-color: var(--color-primary, #0e6a72);
}
.chip-show-dismissed {
  color: var(--color-primary, #0e6a72);
  text-decoration: underline;
  font-size: 12px;
}
.chip-show-dismissed:hover { text-decoration: none; }
.chip-footer { text-align: left; padding-left: 4px !important; }

/* ===== Log card promoted to top of tank page ===== */
.log-card--top {
  /* Make the testing form visually prominent at the top of the page */
  border-left: 3px solid var(--color-primary, #0e6a72);
  margin-top: 8px;
}
.log-card--top .card-head h2 {
  font-size: var(--text-lg);
  margin: 0;
}
.log-card--top .card-head {
  align-items: center;
}
.log-card--collapsed .log-form {
  display: none;
}
.log-card--collapsed {
  padding-bottom: var(--space-4);
}

/* ===== Subheader inline hint (reference vs status clarification) ===== */
.sub-h__hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted, #777);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
  font-style: italic;
}

/* ===== Collapsible reference sections (uses native <details>) ===== */
.reference-section {
  margin: 8px 0 12px;
  border: 1px dashed var(--color-border, rgba(0,0,0,0.18));
  border-radius: 8px;
  padding: 0;
  background: transparent;
}
.reference-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  border-radius: 8px;
}
.reference-section > summary::-webkit-details-marker { display: none; }
.reference-section > summary::before {
  content: '▸';
  font-size: 11px;
  color: var(--color-text-muted, #777);
  transition: transform 150ms;
  display: inline-block;
  width: 12px;
}
.reference-section[open] > summary::before { transform: rotate(90deg); }
.reference-section > summary:hover {
  background: color-mix(in oklab, var(--color-text, #000) 4%, transparent);
}
.reference-section[open] {
  background: color-mix(in oklab, var(--color-text, #000) 2%, transparent);
}
.reference-section[open] > summary {
  border-bottom: 1px dashed var(--color-border, rgba(0,0,0,0.18));
  border-radius: 8px 8px 0 0;
}
.reference-section .sub-h {
  margin: 0;
  display: inline;
}
.reference-section .sub-h__hint {
  margin-left: auto;
}
.reference-section > *:not(summary) {
  padding: 0 14px 12px;
}
.reference-section[open] > .dropchecker-row,
.reference-section[open] > .lowtech-list {
  padding-top: 12px;
}

/* ===== Generic module-card collapse ===== */
.card--collapsed > *:not(.card-head):not(.chart-head):not(.card-teaser) {
  display: none;
}
.card--collapsed {
  padding-bottom: var(--space-4);
}
.card-collapse-toggle {
  margin-left: auto;
  font-size: 12px;
}
/* When a card-head has multiple right-side action buttons, keep them grouped */
.card-head { display: flex; align-items: center; gap: var(--space-2); }
.card-head h2 { margin: 0; }

/* ===== Card teaser (visible only when collapsed) ===== */
/* v109: teasers now respect a global "hide tips" preference. Once dismissed they
   never reappear unless the user clears app data. They're also clamped to 2 lines
   so even visible they don't dominate the viewport. */
.card-teaser {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-muted, #666);
  margin: 0;
  padding: 0;
  display: none;
}
.card--collapsed > .card-teaser {
  display: block;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-hide-teasers="1"] .card-teaser,
body[data-hide-teasers="1"] .card--collapsed > .card-teaser {
  display: none !important;
}
.card-teaser-dismiss {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-accent, #0d9488);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.card-teaser-dismiss:hover { color: var(--color-text, #2b2b2b); }
body[data-hide-teasers="1"] .card-teaser-dismiss { display: none; }
/* Tighten the collapsed-card bottom padding now that the teaser fills the space */
.card--collapsed {
  padding-bottom: var(--space-3);
}

/* ===== Trends: small-multiple sparklines ===== */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.trend-tile {
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--color-surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trend-tile__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: baseline;
}
.trend-tile__label {
  grid-column: 1;
  grid-row: 1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #777);
}
.trend-tile__current {
  grid-column: 1;
  grid-row: 2;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.trend-tile__status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.trend-tile__status--good {
  background: var(--color-success-bg);
  color: var(--color-success);
}
/* v109: hide the GOOD pill entirely — it's redundant with the tile's green background. */
.trend-tile__status--hidden { display: none; }
.trend-tile__status--caution {
  background: var(--color-caution-bg);
  color: var(--color-caution);
}
.trend-tile__status--alert {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}
.trend-tile__status--unknown {
  background: color-mix(in oklab, var(--color-text-muted, #777) 15%, transparent);
  color: var(--color-text-muted, #777);
}
.trend-tile__canvas-wrap {
  height: 60px;
  margin: 6px 0 2px;
  position: relative;
}
.trend-tile__canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.trend-tile__range {
  font-size: 11px;
  color: var(--color-text-muted, #777);
  font-variant-numeric: tabular-nums;
}
.trend-tile__empty {
  font-size: 11px;
  color: var(--color-text-muted, #777);
  padding: 12px 0;
  text-align: center;
}

/* ===== Cycling status badge — flat modern treatment ===== */
.cycling-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 10px 2px 8px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
  cursor: help;
  background: transparent;
  border: 1px solid transparent;
  line-height: 1.5;
}
.cycling-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.cycling-badge--cycled {
  color: var(--color-success);
  border-color: color-mix(in oklab, var(--color-success) 35%, transparent);
}
.cycling-badge--cycling {
  color: var(--color-caution);
  border-color: color-mix(in oklab, var(--color-caution) 40%, transparent);
}
.cycling-badge--uncycled {
  color: var(--color-danger);
  border-color: color-mix(in oklab, var(--color-danger) 40%, transparent);
}
.cycling-badge--unknown {
  color: var(--color-text-muted, #777);
  border-color: color-mix(in oklab, var(--color-text-muted, #777) 30%, transparent);
}
/* v117: Active-QT badge on the tank list — same shape language as cycling-badge
   so the row stays visually consistent. Defaults to accent color; flips to caution
   when a dose is due today or has been missed. */
.qt-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px 2px 8px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.5;
  color: var(--color-accent, #0d9488);
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--color-accent, #0d9488) 35%, transparent);
}
.qt-card-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.qt-card-badge--alert {
  color: var(--color-caution);
  border-color: color-mix(in oklab, var(--color-caution) 45%, transparent);
  background: color-mix(in oklab, var(--color-caution) 8%, transparent);
}
/* Make tank-card h3 wrap nicely when badge is wide */
.tank-card-info h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

/* ===== Setup Timeline & Checklist ===== */
.timeline-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}
.timeline-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--color-border, rgba(0,0,0,0.10));
  border-radius: 999px;
  overflow: hidden;
}
.timeline-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary, #0e6a72);
  border-radius: 999px;
  transition: width 300ms ease;
}
.timeline-progress__label {
  font-size: 12px;
  color: var(--color-text-muted, #777);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timeline-phases {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phase {
  border: 1px solid var(--color-border, rgba(0,0,0,0.10));
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--color-surface, #fff);
  position: relative;
}
.phase--done {
  border-color: color-mix(in oklab, var(--color-success) 35%, transparent);
}
.phase--in-progress {
  border-color: color-mix(in oklab, var(--color-caution) 40%, transparent);
  background: color-mix(in oklab, var(--color-caution) 4%, var(--color-surface, #fff));
}
.phase--locked {
  opacity: 0.6;
}
.phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.phase-head__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.phase-head__name {
  font-weight: 600;
  font-size: 14px;
}
.phase-head__window {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.phase-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.phase-status--done {
  color: var(--color-success);
  border-color: color-mix(in oklab, var(--color-success) 35%, transparent);
}
.phase-status--in-progress {
  color: var(--color-caution);
  border-color: color-mix(in oklab, var(--color-caution) 40%, transparent);
}
.phase-status--locked,
.phase-status--upcoming {
  color: var(--color-text-muted, #777);
  border-color: color-mix(in oklab, var(--color-text-muted, #777) 25%, transparent);
}

.phase-warning {
  font-size: 12px;
  color: var(--color-danger);
  background: color-mix(in oklab, var(--color-danger) 8%, transparent);
  border-left: 2px solid var(--color-danger);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 0 0 8px;
}

.phase-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.phase-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
}
.phase-item__check {
  width: 14px;
  flex-shrink: 0;
  font-weight: 700;
  text-align: center;
  color: var(--color-text-muted, #777);
  margin-top: 2px;
}
.phase-item--done .phase-item__check {
  color: var(--color-success);
}
.phase-item--done .phase-item__label {
  color: var(--color-text-muted, #777);
  text-decoration: line-through;
  text-decoration-color: color-mix(in oklab, var(--color-text-muted, #777) 40%, transparent);
}
.phase-item__label {
  color: var(--color-text, #2b2b2b);
}
.phase-item__detail {
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.3;
  font-style: normal;
  text-align: left;
  padding: 0;
  color: var(--color-text-muted, #777);
}
/* Override the global .muted helper's center-align + padding when it's used
   on a phase-item detail line. */
.phase-item__detail.muted {
  text-align: left;
  padding: 0;
}

/* === Manual checkbox + mark-complete button (v44) === */
.phase-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.phase-mark-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #d0d5dd);
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.phase-mark-btn:hover {
  background: var(--color-surface-hover, #f3f4f6);
  border-color: var(--color-text-muted, #777);
}
.phase-item__check-label {
  display: flex;
  align-items: center;
  margin-top: 1px;
  flex-shrink: 0;
}
.phase-item__checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-success, #16a34a);
}
.phase-item__checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.phase-item--auto .phase-item__checkbox {
  accent-color: var(--color-text-muted, #777);
}
.phase-item__src {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  background: color-mix(in oklab, var(--color-text-muted, #777) 14%, transparent);
  color: var(--color-text-muted, #777);
  vertical-align: middle;
}
.phase-item__src--manual {
  background: color-mix(in oklab, var(--color-success, #16a34a) 16%, transparent);
  color: var(--color-success, #16a34a);
}
.phase-item--blocked .phase-item__label {
  color: var(--color-text-muted, #777);
}
.phase-item__blocked-note {
  margin-top: 4px;
  font-size: 11px;
  color: #b45309;
  font-style: italic;
}
.phase-lock-note {
  margin: 6px 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  background: color-mix(in oklab, #b45309 10%, transparent);
  color: #92400e;
  border-left: 3px solid #b45309;
  border-radius: 4px;
  line-height: 1.4;
}

/* === Tank header layout (v47) === */
.view-head__title { flex: 1; min-width: 0; }
.view-head__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tank-detail .view-head > .view-head__title { flex: 1; min-width: 0; }

/* Compact setup-summary in the tank header.
   Uses a responsive 5-column grid: 5 cells wide on desktop, 3 on tablet, 2 on small tablet, 1 on phone.
   Each cell stacks its uppercase label above the value so columns align cleanly. */
/* v109: outer summary container is now a button + collapsible grid wrapper. */
.tank-setup-summary {
  margin: -4px 0 12px;
  padding: 0;
  width: 100%;
}
.tank-setup-summary__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.3;
}
.tank-setup-summary__toggle:hover {
  color: var(--color-text, #2b2b2b);
}
.tank-setup-summary__oneline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.tank-setup-summary__chevron {
  flex: 0 0 auto;
  margin-left: 8px;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
}
.tank-setup-summary__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 16px;
  margin-top: 8px;
  padding: 0;
  font-size: 11px;
  line-height: 1.25;
}
@media (max-width: 960px) {
  .tank-setup-summary__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tank-setup-summary__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .tank-setup-summary__grid { grid-template-columns: 1fr; gap: 2px 0; }
}
.tank-setup-summary__item {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.tank-setup-summary dt {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #888);
  margin: 0;
  line-height: 1.15;
}
.tank-setup-summary dd {
  margin: 0;
  color: var(--color-text, #2b2b2b);
  font-weight: 400;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Override the old generic .view-head > div rule for the new structured header.
   The title block grows; the actions block stays compact. */
.tank-detail .view-head > .view-head__title { flex: 1 1 auto; min-width: 0; }
.tank-detail .view-head > .view-head__actions { flex: 0 0 auto; }

/* === History row: delete button (v58) === */
.history-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.history-item__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted, #777);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.history-item__delete:hover {
  background: color-mix(in oklab, var(--color-danger, #b91c1c) 12%, transparent);
  color: var(--color-danger, #b91c1c);
  border-color: color-mix(in oklab, var(--color-danger, #b91c1c) 40%, transparent);
}
.history-item__delete:focus-visible {
  outline: 2px solid var(--color-danger, #b91c1c);
  outline-offset: 1px;
}

/* === History row: edit button + edit-mode banner (v59) === */
.history-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.history-item__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted, #777);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.history-item__edit:hover {
  background: var(--color-surface-2, #f3f4f6);
  color: var(--color-text, #2b2b2b);
  border-color: var(--color-border, #d0d5dd);
}
.history-item__edit:focus-visible {
  outline: 2px solid var(--color-accent, #2b6cb0);
  outline-offset: 1px;
}

/* Edit banner inside the log card */
.log-edit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--color-accent, #2b6cb0) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-accent, #2b6cb0) 35%, transparent);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text, #2b2b2b);
}
.log-edit-banner strong { font-weight: 600; }

/* Reading-date input inside log form */
.log-takenat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.log-takenat > span {
  font-size: 12px;
  color: var(--color-text-muted, #777);
}
.log-takenat input[type="datetime-local"] {
  padding: 6px 8px;
  border: 1px solid var(--color-border, #d0d5dd);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
  max-width: 280px;
}

/* === Equipment maintenance preset row (v60) === */
.equipment-preset {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border, #e5e7eb);
  flex-wrap: wrap;
}
.equipment-preset > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 240px;
  min-width: 0;
}
.equipment-preset > label > span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #777);
}
.equipment-preset select {
  padding: 7px 9px;
  border: 1px solid var(--color-border, #d0d5dd);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
  width: 100%;
  max-width: 380px;
}
.equipment-preset .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Pest ID & treatment list (v61) === */
.pest-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.pest-item {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-surface, #fff);
}
.pest-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pest-head strong { font-size: 14px; }
.pest-aka {
  font-size: 11px;
  color: var(--color-text-muted, #777);
  font-style: italic;
}
.pest-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
}
.pest-badge--safe {
  background: color-mix(in oklab, #437A22 18%, transparent);
  color: #2f5818;
}
.pest-badge--partial {
  background: color-mix(in oklab, #b45309 18%, transparent);
  color: #92400e;
}
.pest-badge--unsafe {
  background: color-mix(in oklab, #b91c1c 18%, transparent);
  color: #7f1d1d;
}
.pest-row {
  margin: 2px 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text, #2b2b2b);
}
.pest-row--safety { color: #92400e; }
.pest-shrimp-alert {
  margin: 8px 0 0;
  padding: 6px 10px;
  font-size: 12px;
  background: color-mix(in oklab, #b91c1c 10%, transparent);
  color: #7f1d1d;
  border-left: 3px solid #b91c1c;
  border-radius: 4px;
}

/* === Light schedule card (v62) === */
.light-meta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
  color: var(--color-text-muted, #777);
  margin-bottom: 10px;
}
.light-meta__row b { color: var(--color-text, #2b2b2b); font-weight: 600; }
.light-curve-wrap {
  width: 100%;
  margin: 6px 0 10px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1726;
}
#lightCurve {
  width: 100%;
  display: block;
}
.light-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.light-table th, .light-table td {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-variant-numeric: tabular-nums;
}
.light-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #777);
  background: var(--color-surface-2, #f6f7f9);
}
.light-table th:first-child, .light-table td:first-child {
  width: 32px;
  color: var(--color-text-muted, #888);
}
.light-table td:nth-child(2) { width: 60px; }
.light-table tr.light-row--off td { color: var(--color-text-muted, #aaa); }
.light-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.1);
}

/* === Shrimp module — substrate-mismatch + molt safety (v63) === */
.shrimp-warn-block {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: color-mix(in oklab, #b45309 14%, transparent);
  border-left: 3px solid #b45309;
  color: #6b3a0c;
  font-size: 13px;
  line-height: 1.4;
}
.shrimp-warn-block strong { color: #5a2f08; }
.shrimp-warn-block:last-child { margin-bottom: 0; }
.shrimp-warn-block--substrate {
  background: color-mix(in oklab, #2b6cb0 12%, transparent);
  border-left-color: #2b6cb0;
  color: #1b3e6b;
}
.shrimp-warn-block--substrate strong { color: #102747; }

.molt-safety-note {
  margin: 8px 0 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  background: color-mix(in oklab, #b45309 8%, transparent);
  border-left: 3px solid #b45309;
  border-radius: 4px;
  color: #6b3a0c;
}
.molt-safety-note strong { color: #5a2f08; }
.molt-safety-note em { font-style: italic; color: #b45309; }

.molt-burst-warning {
  margin: 4px 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  background: color-mix(in oklab, #b91c1c 10%, transparent);
  border-left: 3px solid #b91c1c;
  border-radius: 4px;
  color: #7f1d1d;
}
.molt-burst-warning strong { color: #5a0e0e; }

/* === Plant supplements section (v64) === */
.supplements-details {
  margin-top: 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-surface, #fff);
}
.supplements-details > summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text, #2b2b2b);
  list-style: none;
}
.supplements-details > summary::marker { display: none; }
.supplements-details > summary::-webkit-details-marker { display: none; }
.supplements-details > summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  transform: translateY(-1px);
  transition: transform 120ms ease;
}
.supplements-details[open] > summary::before { transform: rotate(90deg); }
.supplements-body {
  padding: 8px 14px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.supp-intro {
  margin: 0 0 12px;
  color: var(--color-text-muted, #777);
}
.supp-section {
  margin-bottom: 14px;
}
.supp-section h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #2b2b2b);
}
.supp-section p, .supp-section ul {
  margin: 4px 0;
  color: var(--color-text, #2b2b2b);
}
.supp-section ul { padding-left: 20px; }
.supp-section li { margin-bottom: 4px; }
.supp-note { font-size: 12px; }

.supp-block {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}
.supp-block--info {
  background: color-mix(in oklab, #2b6cb0 10%, transparent);
  border-left: 3px solid #2b6cb0;
  color: #1b3e6b;
}
.supp-block--shrimp {
  background: color-mix(in oklab, #b91c1c 8%, transparent);
  border-left: 3px solid #b91c1c;
  color: #7f1d1d;
}
.supp-block strong { color: inherit; font-weight: 700; }

/* Override global .muted helper for the supplements note line */
.supp-note.muted { text-align: left; padding: 0; }

/* === Plant placement badges (v66) === */
.lowtech-item {
  list-style: none;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
}
.lowtech-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 4px;
}
.lowtech-item__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text, #2b2b2b);
}
.lowtech-item__sci {
  font-size: 11px;
  color: var(--color-text-muted, #888);
}
.lowtech-item__care {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted, #555);
  text-align: left;
  padding: 0;
}
.placement-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
  white-space: nowrap;
}
.placement--substrate { background: color-mix(in oklab, #8B5E34 22%, transparent); color: #5a3d20; }
.placement--epiphyte  { background: color-mix(in oklab, #437A22 22%, transparent); color: #2f5818; }
.placement--moss      { background: color-mix(in oklab, #20808D 22%, transparent); color: #115560; }
.placement--column    { background: color-mix(in oklab, #2b6cb0 22%, transparent); color: #1b3e6b; }
.placement--surface   { background: color-mix(in oklab, #6E522B 22%, transparent); color: #4a3818; }

/* =========================================================
   Planting Planner card (v69)
   Mirrors Stocking Planner styling but adds R/Y/G per-plant
   status and a compact summary row.
   ========================================================= */

.planting-card .card-head { align-items: center; }
.planting-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Summary row above the plant list */
.plant-summary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface, rgba(0,0,0,0.03));
  border-radius: 6px;
  font-size: var(--text-xs);
}
.plant-summary__count {
  font-weight: 600;
  font-size: var(--text-sm);
}
.plant-summary__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid transparent;
}
.plant-summary__pill--good    { background: rgba(34,197,94,0.10); color: #15803d; border-color: rgba(34,197,94,0.25); }
.plant-summary__pill--caution { background: rgba(234,179,8,0.10); color: #a16207; border-color: rgba(234,179,8,0.30); }
.plant-summary__pill--alert   { background: rgba(220,38,38,0.10); color: #b91c1c; border-color: rgba(220,38,38,0.25); }

/* Plant list (mirrors stock-list but with status border accent) */
.plant-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.plant-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  border-radius: 8px;
  background: var(--color-bg, #fff);
  border-left-width: 4px;
}
.plant-item--good    { border-left-color: #22c55e; }
.plant-item--caution { border-left-color: #eab308; }
.plant-item--alert   { border-left-color: #dc2626; }
.plant-item__main { min-width: 0; flex: 1; }
.plant-item__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.plant-item__name { font-weight: 600; font-size: var(--text-sm); }
.plant-item__sci { font-size: var(--text-xs); color: var(--color-muted); font-style: italic; }
.plant-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--text-xs);
}
.plant-item__meta > span { white-space: nowrap; }
.plant-item__issues {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plant-item__issue {
  font-size: var(--text-xs);
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.plant-item__issue--caution { background: rgba(234,179,8,0.08);  color: #854d0e; border-color: rgba(234,179,8,0.20); }
.plant-item__issue--alert   { background: rgba(220,38,38,0.08);  color: #991b1b; border-color: rgba(220,38,38,0.20); }
.plant-item__issue--info    { background: rgba(59,130,246,0.06); color: #1e40af; border-color: rgba(59,130,246,0.18); }

/* Status pill in the head */
.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-pill--good    { background: rgba(34,197,94,0.10); color: #15803d; border-color: rgba(34,197,94,0.25); }
.status-pill--caution { background: rgba(234,179,8,0.10); color: #a16207; border-color: rgba(234,179,8,0.30); }
.status-pill--alert   { background: rgba(220,38,38,0.10); color: #b91c1c; border-color: rgba(220,38,38,0.25); }

/* Plant info card (inside picker modal)
   Two-column definition-list. Each <.plant-info__row> contains <dt> + <dd>
   so the label/value pair never splits across lines. Two rows sit side by
   side on wide modals, stack on narrow ones. Right-aligned labels make the
   value column scan as a clean vertical strip. */
.plant-info__head {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.plant-info__head em { font-size: var(--text-xs); }
.plant-info__dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 16px;
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
}
.plant-info__row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: baseline;
  column-gap: 8px;
  line-height: 1.5;
  min-width: 0;
}
.plant-info__row dt {
  color: var(--color-muted);
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
}
.plant-info__row dd {
  margin: 0;
  color: var(--color-text);
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .plant-info__dl { grid-template-columns: 1fr; }
  .plant-info__row { grid-template-columns: 96px 1fr; }
}
.plant-info__care { font-size: var(--text-xs); margin: 6px 0 0; line-height: 1.5; }
.plant-info__warn {
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(234,179,8,0.08);
  color: #854d0e;
  border-radius: 4px;
  font-size: var(--text-xs);
}

/* Plant wizard reuses generic wizard styles, but add result-list styling */
.wizard-step { padding: var(--space-3) 0; }
.wizard-progress { font-size: var(--text-xs); color: var(--color-muted); margin-bottom: 6px; }
.wizard-q { font-size: var(--text-lg); margin: 0 0 var(--space-3); }
.wizard-opts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.wizard-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-3);
  border: 1px solid var(--color-border, rgba(0,0,0,0.10));
  border-radius: 6px;
  background: var(--color-bg, #fff);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.wizard-opt:hover { border-color: var(--color-accent, #0ea5e9); }
.wizard-opt--selected { border-color: var(--color-accent, #0ea5e9); background: rgba(14,165,233,0.06); }
.wizard-opt span { font-size: var(--text-xs); }
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.wizard-results { padding: var(--space-2) 0; }
.wizard-picks {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.wizard-pick {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  border-radius: 6px;
  background: var(--color-bg, #fff);
}
.wizard-pick label {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  cursor: pointer;
}
.wizard-pick input[type=checkbox] { margin-top: 4px; }
.wizard-pick__body { flex: 1; min-width: 0; }
.wizard-pick__meta { font-size: var(--text-xs); margin-top: 2px; }
.wizard-pick__reasons { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.wizard-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(14,165,233,0.08);
  color: #075985;
  border: 1px solid rgba(14,165,233,0.16);
}

/* =========================================================
   Plant Wizard — inferred-info header + goal pill switcher (v70)
   ========================================================= */

.wizard-infer {
  background: rgba(14,165,233,0.06);
  border: 1px solid rgba(14,165,233,0.18);
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wizard-infer__row {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text);
}
.wizard-goals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}
.wizard-goals__label {
  font-size: var(--text-xs);
  font-weight: 600;
}
.wizard-goals__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.goal-pill {
  padding: 4px 12px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.12));
  border-radius: 999px;
  background: var(--color-bg, #fff);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.goal-pill:hover {
  border-color: var(--color-accent, #0ea5e9);
}
.goal-pill--active {
  background: var(--color-accent, #0ea5e9);
  color: white;
  border-color: var(--color-accent, #0ea5e9);
}

/* =========================================================
   Plant picker — placement filter chip row (v71)
   ========================================================= */

.plant-placement-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--space-3);
}
.placement-chip {
  padding: 4px 10px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.12));
  border-radius: 999px;
  background: var(--color-bg, #fff);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.placement-chip:hover {
  border-color: var(--color-accent, #0ea5e9);
}
.placement-chip--active {
  background: var(--color-accent, #0ea5e9);
  color: white;
  border-color: var(--color-accent, #0ea5e9);
}

/* =========================================================
   Stocking species info — definition-list (v73)
   Mirrors .plant-info__dl: each label/value pair stays together.
   ========================================================= */

.species-info__dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 16px;
  margin: var(--space-1) 0 var(--space-2);
  font-size: var(--text-xs);
}
.species-info__pair {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: baseline;
  column-gap: 8px;
  line-height: 1.5;
  min-width: 0;
}
.species-info__pair dt {
  color: var(--color-muted);
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
}
.species-info__pair dd {
  margin: 0;
  color: var(--color-text);
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .species-info__dl { grid-template-columns: 1fr; }
  .species-info__pair { grid-template-columns: 104px 1fr; }
}

/* =========================================================
   Stocking picker — filter chip row (v74)
   Mirrors .plant-placement-filters / .placement-chip styling but with
   inline separator dots to group: [Recommended/All] | [Top/Mid/Bottom]
   | [Warm/Cool/Bold/Iridescent].
   ========================================================= */
.stock-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-3);
}
.stock-chip {
  padding: 4px 10px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.12));
  border-radius: 999px;
  background: var(--color-bg, #fff);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.stock-chip:hover { border-color: var(--color-accent, #0ea5e9); }
.stock-chip--active {
  background: var(--color-accent, #0ea5e9);
  color: white;
  border-color: var(--color-accent, #0ea5e9);
}
.stock-chip-sep {
  width: 1px;
  height: 16px;
  background: var(--color-border, rgba(0,0,0,0.16));
  margin: 0 4px;
}

/* Stock-item: reuse plant-item--good/caution/alert left-border accent so the
   per-species R/Y/G status is visually consistent with the Planting Planner.
   The base .stock-item rules already exist; we just need the addmore button. */
.qty-btn--addmore {
  font-weight: 600;
  background: rgba(234,179,8,0.10);
  color: #854d0e;
  border-color: rgba(234,179,8,0.30);
}
.qty-btn--addmore:hover { background: rgba(234,179,8,0.18); }

/* =========================================================
   Light schedule — Edit mode (v76)
   Buttons in the card head, editable meta header, table input cells,
   delete-row buttons, and the +Add row affordance below the table.
   ========================================================= */

.light-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.light-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Editable meta header */
.light-meta__row--edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.light-meta__row--edit label {
  display: flex;
  flex-direction: column;
  font-size: var(--text-xs);
  gap: 2px;
}
.light-meta__row--edit label span {
  color: var(--color-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.light-meta__row--edit input {
  font: inherit;
  font-size: var(--text-sm);
  padding: 4px 8px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.15));
  border-radius: 4px;
  background: var(--color-bg, #fff);
}

/* Edit-mode table cell inputs */
.light-table .light-time-input,
.light-table .light-val-input,
.light-table .light-channel-input {
  font: inherit;
  border: 1px solid var(--color-border, rgba(0,0,0,0.15));
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--color-bg, #fff);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.light-table .light-time-input { min-width: 92px; font-size: var(--text-xs); }
.light-table .light-val-input  { width: 56px; text-align: right; font-size: var(--text-xs); }
.light-table .light-channel-input { font-size: 11px; font-weight: 600; width: 90px; }
.light-table .light-channel-input:focus,
.light-table .light-time-input:focus,
.light-table .light-val-input:focus { outline: 2px solid var(--color-accent, #0ea5e9); outline-offset: -1px; border-color: var(--color-accent, #0ea5e9); }

.light-row-del {
  background: transparent;
  border: 1px solid transparent;
  color: #b91c1c;
  cursor: pointer;
  padding: 0 6px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
}
.light-row-del:hover { background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.25); }

.light-edit-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.light-table-wrap { overflow-x: auto; }

/* =========================================================
   KH unit toggle inside the log form label (v77)
   ========================================================= */
.kh-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.kh-unit-toggle {
  font: inherit;
  font-size: 11px;
  padding: 1px 8px;
  background: rgba(14,165,233,0.10);
  color: var(--color-accent, #0ea5e9);
  border: 1px solid rgba(14,165,233,0.25);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
}
.kh-unit-toggle:hover { background: rgba(14,165,233,0.18); }

/* =========================================================
   Trend tile — "How to fix" advice block (v80)
   Shown only when a parameter is out of range. Colored left-border
   matches the severity of the reading (yellow caution / red alert).
   ========================================================= */
.trend-tile__advice {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  border-left-width: 4px;
  font-size: var(--text-xs);
  line-height: 1.45;
}
.trend-tile__advice--caution { border-left-color: #eab308; background: rgba(234,179,8,0.05); }
.trend-tile__advice--alert   { border-left-color: #dc2626; background: rgba(220,38,38,0.05); }

.trend-tile__advice-head {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.trend-tile__advice ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.trend-tile__advice li {
  color: var(--color-text);
}

/* =========================================================
   Module-gap + pain-point features (v83)
   ========================================================= */

/* Nano-mode banner (Stocking picker) */
.nano-mode-banner {
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.25);
  border-left-width: 4px;
  border-left-color: #dc2626;
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
}
.nano-mode-banner strong { font-size: var(--text-sm); display: block; margin-bottom: 4px; color: #991b1b; }
.nano-mode-banner p { margin: 0 0 6px; }
.nano-mode-banner ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* CO2 decision block (Planted card) */
.co2-decision {
  background: rgba(14,165,233,0.05);
  border: 1px solid rgba(14,165,233,0.18);
  border-left-width: 4px;
  border-left-color: var(--color-accent, #0ea5e9);
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.co2-decision__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.co2-decision__verdict {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.co2-decision__verdict--none     { background: rgba(34,197,94,0.10);  color: #15803d; border-color: rgba(34,197,94,0.25); }
.co2-decision__verdict--optional { background: rgba(234,179,8,0.10);  color: #a16207; border-color: rgba(234,179,8,0.30); }
.co2-decision__verdict--required { background: rgba(220,38,38,0.10);  color: #b91c1c; border-color: rgba(220,38,38,0.25); }
.co2-decision__details { margin-top: 6px; font-size: var(--text-xs); }
.co2-decision__details summary { cursor: pointer; color: var(--color-muted); }
.co2-decision__rules { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* Drip stage selector (Shrimp) */
.drip-stage-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
}
.drip-stage-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-xs);
}
.drip-stage-row label span {
  color: var(--color-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.drip-stage-row select {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.15));
  border-radius: 4px;
  background: var(--color-bg, #fff);
  max-width: 240px;
}
.drip-stage-tips {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.5;
}

/* Summer heat advisor (Trends card) */
.summer-heat-advisor {
  background: rgba(234,179,8,0.06);
  border: 1px solid rgba(234,179,8,0.25);
  border-left-width: 4px;
  border-left-color: #eab308;
  border-radius: 6px;
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-xs);
}
.summer-heat-advisor__head {
  font-size: var(--text-sm);
  color: #854d0e;
  margin-bottom: 4px;
}
.summer-heat-advisor__note { margin: 0 0 6px; }
.summer-heat-advisor__steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summer-heat-advisor__steps em {
  display: block;
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.35;
}
/* Emergency cool-down block (v86) — fires when latest ≥84°F or peak ≥86°F */
.summer-heat-advisor__emergency {
  background: rgba(220, 38, 38, 0.08);
  border-left: 3px solid #dc2626;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 8px 0 10px;
}
.summer-heat-advisor__emergency strong {
  display: block;
  color: #dc2626;
  margin-bottom: 6px;
  font-size: 13px;
}
.summer-heat-advisor__emergency ol {
  margin: 0;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.4;
  list-style: decimal;
}
.summer-heat-advisor__emergency ol li { margin-bottom: 6px; }
.summer-heat-advisor__emergency ol li:last-child { margin-bottom: 0; }

/* Treatment safety reference (Fish Health card) */
.treatment-safety { margin: var(--space-2) 0; }
.treatment-safety__list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* Settings modal (v90) — backup, restore, CSV export, wipe */
.modal--settings {
  max-width: 520px;
  width: calc(100% - 24px);
  max-height: 90vh;
  overflow-y: auto;
}
.modal--settings h3 {
  font-size: var(--text-base);
  margin: 0 0 6px;
  font-weight: 600;
}
.settings-section {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}
.settings-section:first-of-type {
  border-top: none;
  padding-top: var(--space-2);
  margin-top: var(--space-2);
}
.settings-section--danger {
  background: rgba(220, 38, 38, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-5);
  border-top: none;
}
.settings-section--danger h3 { color: #dc2626; }
[data-theme="dark"] .settings-section--danger { background: rgba(220, 38, 38, 0.10); }

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
}
.settings-actions .btn { margin-bottom: 0; }
.settings-select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
}
.settings-warning {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

/* v121: Cloud backup auth UI */
.cloud-auth { display: block; }
.cloud-auth .settings-actions { margin-top: var(--space-2); }
.settings-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
}
.settings-input:focus {
  outline: 2px solid var(--color-accent, #0d9488);
  outline-offset: 1px;
  border-color: transparent;
}
.cloud-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt, var(--color-surface));
}
.cloud-user-email {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cloudStatus, #cloudAuthHint { margin-top: var(--space-2); }
.settings-version {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 11px;
  opacity: 0.7;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* Auto-pinned health alerts (v90) — driven by latest chemistry reading */
.health-pinned {
  margin: 0 0 var(--space-4);
  background: rgba(220, 38, 38, 0.06);
  border-left: 3px solid #dc2626;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.health-pinned__head { margin-bottom: 8px; }
.health-pinned__head strong { color: #dc2626; font-size: 13px; }
.health-pinned__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.health-pinned__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.health-pinned__item--critical { border-left: 3px solid #dc2626; }
.health-pinned__item--warning { border-left: 3px solid #f59e0b; }
.health-pinned__title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.health-pinned__detail { font-size: 12px; color: var(--color-text-soft); margin-bottom: 6px; line-height: 1.4; }
.health-pinned__link {
  background: none;
  border: none;
  color: var(--color-accent, #0e6a72);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.health-pinned__link:hover { color: var(--color-accent-hover, #0a4f55); }
[data-theme="dark"] .health-pinned { background: rgba(220, 38, 38, 0.10); }

/* === Module tabs (v91) === */
.module-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: var(--space-3) 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: 5;
}
.module-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.module-tab:hover { color: var(--color-text); }
.module-tab--active {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
[data-theme="dark"] .module-tab--active {
  background: rgba(255,255,255,0.06);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Module-tab card filtering: each card declares which tabs it belongs to via data-module.
   When body has data-module-tab="daily", only cards whose data-module contains "daily" stay visible.
   Cards without a data-module (e.g., gated planted/shrimp cards in their hidden state) follow their own .hidden. */
body[data-module-tab="daily"] #tankDetail > .card[data-module]:not([data-module~="daily"]) { display: none; }
body[data-module-tab="setup"] #tankDetail > .card[data-module]:not([data-module~="setup"]) { display: none; }
body[data-module-tab="reference"] #tankDetail > .card[data-module]:not([data-module~="reference"]) { display: none; }

/* === Trends sub-tabs (v91) === */
.trends-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin: 0 0 var(--space-3);
}
.trends-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-soft);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.trends-tab:hover { color: var(--color-text); }
.trends-tab--active {
  color: var(--color-accent, #0e6a72);
  border-bottom-color: var(--color-accent, #0e6a72);
}
.trends-panel { padding-top: var(--space-2); }
.trends-panel .history-list { margin: 0; }

/* === Quarantine Tank module (v94) === */
.qt-status-badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.qt-status-badge--active {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.qt-protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.qt-protocol-btn {
  text-align: left;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.qt-protocol-btn:hover { border-color: var(--color-accent, #0e6a72); }
.qt-protocol-btn--selected {
  border-color: var(--color-accent, #0e6a72);
  background: rgba(14, 106, 114, 0.05);
}
.qt-protocol-btn__name { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.qt-protocol-btn__duration { font-size: 11px; color: var(--color-text-soft); margin-bottom: 6px; }
.qt-protocol-btn__summary { font-size: 12px; color: var(--color-text-soft); line-height: 1.4; }
.qt-volume-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-3);
  align-items: center;
  margin: var(--space-3) 0;
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.qt-volume-row label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.qt-volume-row input { padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
@media (max-width: 480px) {
  .qt-volume-row { grid-template-columns: 1fr; }
}

.qt-active-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.qt-protocol-name { font-weight: 600; font-size: 14px; }
.qt-best-for {
  background: rgba(14, 106, 114, 0.06);
  border-left: 3px solid var(--color-accent, #0e6a72);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.qt-due-today {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-3);
}
.qt-due-today__head { margin-bottom: 10px; color: #b45309; font-size: 14px; }
.qt-no-action {
  background: rgba(34, 197, 94, 0.06);
  border-left: 3px solid #22c55e;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--space-3);
}
.qt-med-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.qt-med-card__name { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.qt-med-card__active { font-size: 11px; color: var(--color-text-soft); margin-bottom: 6px; }
.qt-med-card__dose { font-size: 12px; line-height: 1.5; margin-bottom: 6px; padding: 6px 8px; background: var(--color-bg); border-radius: 4px; }
.qt-med-card__warn { font-size: 12px; color: #dc2626; font-weight: 600; margin: 4px 0; }
.qt-med-card__notes { font-size: 11px; color: var(--color-text-soft); line-height: 1.4; margin: 6px 0 10px; font-style: italic; }

.qt-phases { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.qt-phase { background: var(--color-bg); border-radius: var(--radius-md); padding: 12px 14px; }
.qt-phase__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.qt-phase__days { font-size: 11px; color: var(--color-text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.qt-phase__items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.qt-check-row { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; padding: 2px 0; font-size: 13px; line-height: 1.4; }
.qt-check-row input { margin-top: 2px; }
.qt-check-row--done { text-decoration: line-through; opacity: 0.55; }

.qt-log-add { display: flex; gap: var(--space-3); margin-bottom: var(--space-2); }
.qt-log { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-direction: column; gap: 6px; }
.qt-log__entry {
  position: relative;
  background: var(--color-bg);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 12px;
  font-size: 12px;
}
.qt-log__entry--med_dose { border-left-color: #f59e0b; }
.qt-log__entry--water_test { border-left-color: #0e6a72; }
.qt-log__entry--observation { border-left-color: #6366f1; }
.qt-log__entry--session_started, .qt-log__entry--session_ended { border-left-color: #64748b; font-style: italic; }
.qt-log__when { color: var(--color-text-soft); font-size: 11px; }
.qt-log__type { font-weight: 600; margin: 2px 0; }
.qt-log__med { color: #b45309; font-weight: 500; }
.qt-log__note { color: var(--color-text); margin-top: 3px; line-height: 1.4; }
.qt-log__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
}
.qt-log__delete:hover { background: rgba(220, 38, 38, 0.1); color: #dc2626; }

.qt-graduation {
  background: rgba(34, 197, 94, 0.06);
  border-left: 3px solid #22c55e;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

/* === Compatible-with-my-stock modal (v94) === */
.modal--compat {
  max-width: 720px;
  width: calc(100% - 24px);
  max-height: 90vh;
  overflow-y: auto;
}
.compat-envelope {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-3);
  font-size: 12px;
}
.compat-envelope__head { margin-bottom: 6px; font-size: 13px; }
.compat-envelope__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.compat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.compat-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.compat-item__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.compat-item__name { font-weight: 600; font-size: 14px; }
.compat-item__group { font-size: 11px; color: var(--color-text-soft); margin-top: 2px; }
.compat-avail {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.compat-avail--common { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.compat-avail--specialty { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.compat-avail--online_only { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.compat-reasons {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.compat-reasons li::before {
  content: "✓ ";
  color: #15803d;
  font-weight: 600;
}
.compat-notes {
  font-size: 11px;
  color: var(--color-text-soft);
  line-height: 1.4;
  margin-bottom: 8px;
  font-style: italic;
}
.compat-add-btn { width: 100%; margin-top: 4px; }
.compat-empty { padding: var(--space-3); background: var(--color-bg); border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; }
.compat-empty p { margin: 0 0 8px; }
.compat-empty p:last-child { margin-bottom: 0; }
.compat-blocked-section {
  margin-top: var(--space-3);
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: 12px;
}
.compat-blocked-section summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.compat-blocked-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }

/* === Cycling Coach (v96) === */
.cycling-coach-badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--color-border);
}
.cycling-coach-badge--cycled    { background: rgba(34, 197, 94, 0.12); color: #15803d; border-color: rgba(34, 197, 94, 0.3); }
.cycling-coach-badge--cycling   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.3); }
.cycling-coach-badge--uncycled  { background: rgba(220, 38, 38, 0.12); color: #dc2626; border-color: rgba(220, 38, 38, 0.3); }
.cycling-coach-badge--unknown   { background: var(--color-bg); color: var(--color-text-soft); }

.cyc-section { margin: var(--space-3) 0; }
.cyc-section--understand { background: var(--color-bg); border-radius: var(--radius-md); padding: 10px 14px; }
.cyc-section--understand summary { cursor: pointer; user-select: none; padding: 6px 0; font-size: 13px; }
.cyc-section__body { padding: 8px 0 4px; line-height: 1.55; font-size: 13px; }
.cyc-section__body p { margin: 0 0 var(--space-2); }
.cyc-section__body ol { margin: 0; padding-left: 20px; line-height: 1.55; }

.cyc-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: var(--space-2) 0;
}
.cyc-stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 8px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
}
.cyc-stage__n {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-accent, #0e6a72);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.cyc-key-rules { margin-top: var(--space-3) !important; font-size: 13px; }

.cyc-today {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent, #0e6a72);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  line-height: 1.55;
  font-size: 13px;
}
.cyc-today--fishin  { border-left-color: #dc2626; background: rgba(220, 38, 38, 0.04); }
.cyc-today--cycled  { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.05); }
.cyc-today--start   { border-left-color: #6366f1; background: rgba(99, 102, 241, 0.05); }
[data-theme="dark"] .cyc-today--fishin { background: rgba(220, 38, 38, 0.08); }
[data-theme="dark"] .cyc-today--cycled { background: rgba(34, 197, 94, 0.08); }
[data-theme="dark"] .cyc-today--start  { background: rgba(99, 102, 241, 0.08); }
.cyc-today__head { margin-bottom: 8px; font-size: 14px; }
.cyc-today__steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.cyc-today__steps li { line-height: 1.5; }
.cyc-step--alert  { color: #dc2626; }
.cyc-step--action { color: #b45309; font-weight: 500; }

.cyc-reminders {
  margin-top: var(--space-3);
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.06);
  border-left: 3px solid #6366f1;
  border-radius: var(--radius-md);
}
.cyc-reminders__head { font-size: 13px; }
[data-theme="dark"] .cyc-reminders { background: rgba(99, 102, 241, 0.10); }

.cyc-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: var(--space-2);
}
.cyc-progress-table th, .cyc-progress-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 6px 8px;
  text-align: left;
}
.cyc-progress-table th { font-size: 11px; color: var(--color-text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.cyc-cell--alert { color: #dc2626; font-weight: 600; }
.cyc-cell--good  { color: #15803d; font-weight: 600; }
.cyc-cell--hint  { color: var(--color-text-soft); font-style: italic; }

/* Cycling Coach — Log dose button + dose-log row styling */
.cyc-log-dose-btn {
  margin-left: 8px;
  vertical-align: baseline;
}
.cyc-row--dose td {
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid #f59e0b;
}
[data-theme="dark"] .cyc-row--dose td {
  background: rgba(245, 158, 11, 0.14);
}
.cyc-cell--dose {
  font-size: 13px;
  color: #92400e;
}
[data-theme="dark"] .cyc-cell--dose { color: #fbbf24; }
.cyc-cell--actions {
  width: 28px;
  text-align: right;
  padding-right: 6px;
}
.cyc-del-dose {
  background: transparent;
  border: 0;
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.cyc-del-dose:hover { color: #dc2626; background: rgba(220, 38, 38, 0.08); }

/* Trends — ammonia-dose marker legend */
.trends-dose-legend {
  margin: 4px 0 10px;
  padding: 6px 10px;
  border-left: 3px solid #d97706;
  background: rgba(217, 119, 6, 0.06);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.45;
}
.trends-dose-marker {
  display: inline-block;
  color: #d97706;
  font-size: 13px;
  margin-right: 4px;
  transform: translateY(-1px);
}
[data-theme="dark"] .trends-dose-legend {
  background: rgba(251, 191, 36, 0.10);
  border-left-color: #fbbf24;
}
[data-theme="dark"] .trends-dose-marker { color: #fbbf24; }

/* Dose calculator modal (v99) */
.modal--dose { max-width: 480px; }
.dose-context {
  padding: 8px 10px;
  margin: 6px 0 12px;
  background: var(--color-surface-soft, rgba(0,0,0,0.04));
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
[data-theme="dark"] .dose-context { background: rgba(255,255,255,0.05); }
.dose-target-group {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}
.dose-target-group legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}
.dose-target-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.dose-preset {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--color-border, #d0d3d4);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text, inherit);
  transition: background 0.12s, border-color 0.12s;
}
.dose-preset:hover { background: rgba(217, 119, 6, 0.08); }
.dose-preset--active {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.12);
  font-weight: 600;
  color: #92400e;
}
[data-theme="dark"] .dose-preset--active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}
.dose-target-custom { display: block; }
.dose-target-custom span { font-size: 12px; color: var(--color-text-soft); }
.dose-target-custom input { width: 100%; }

.dose-recommendation { margin: 10px 0 14px; }
.dose-rec {
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.07);
  border-left: 3px solid #15803d;
  border-radius: 4px;
}
.dose-rec--skip {
  background: rgba(217, 119, 6, 0.08);
  border-left-color: #d97706;
}
[data-theme="dark"] .dose-rec { background: rgba(34, 197, 94, 0.12); }
[data-theme="dark"] .dose-rec--skip { background: rgba(251, 191, 36, 0.14); }
.dose-rec__big { font-size: 16px; line-height: 1.5; }
.dose-rec__detail { display: block; margin-top: 4px; }

.dose-actual, .dose-when, .dose-note {
  display: block;
  margin-bottom: 12px;
}
.dose-actual > span:first-child,
.dose-when > span:first-child,
.dose-note > span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}
.dose-actual input, .dose-when input, .dose-note input {
  width: 100%;
}

/* Dose-when out-of-window warning (v101) */
.dose-when-warn {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid #d97706;
  border-radius: 3px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.4;
}
[data-theme="dark"] .dose-when-warn {
  background: rgba(251, 191, 36, 0.14);
  border-left-color: #fbbf24;
  color: #fde68a;
}

/* Dose projection — live NH₃ readout (v102) */
.dose-projection {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #6b7280;
  border-radius: 4px;
  background: rgba(107, 114, 128, 0.06);
}
.dose-projection[hidden] { display: none; }
.dose-projection__head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-soft, #5a6669);
  margin-bottom: 4px;
}
.dose-projection__big {
  font-size: 17px;
  line-height: 1.35;
}
.dose-projection__cmp {
  font-size: 13px;
  color: var(--color-text-soft, #5a6669);
  font-weight: 400;
}
.dose-projection__detail { margin-top: 4px; }
.dose-projection__warn {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(220, 38, 38, 0.08);
  border-left: 3px solid #dc2626;
  border-radius: 3px;
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.4;
}
[data-theme="dark"] .dose-projection__warn {
  background: rgba(248, 113, 113, 0.14);
  border-left-color: #f87171;
  color: #fecaca;
}
.dose-projection--on {
  border-left-color: #15803d;
  background: rgba(34, 197, 94, 0.08);
}
.dose-projection--on .dose-projection__cmp { color: #15803d; font-weight: 600; }
.dose-projection--under {
  border-left-color: #6366f1;
  background: rgba(99, 102, 241, 0.07);
}
.dose-projection--warn {
  border-left-color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}
.dose-projection--warn .dose-projection__cmp { color: #92400e; font-weight: 600; }
.dose-projection--over {
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.dose-projection--over .dose-projection__cmp { color: #b91c1c; font-weight: 600; }

[data-theme="dark"] .dose-projection { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .dose-projection--on    { background: rgba(34, 197, 94, 0.14); }
[data-theme="dark"] .dose-projection--on .dose-projection__cmp { color: #4ade80; }
[data-theme="dark"] .dose-projection--under { background: rgba(99, 102, 241, 0.14); }
[data-theme="dark"] .dose-projection--warn  { background: rgba(217, 119, 6, 0.18); }
[data-theme="dark"] .dose-projection--warn .dose-projection__cmp { color: #fbbf24; }
[data-theme="dark"] .dose-projection--over  { background: rgba(220, 38, 38, 0.18); }
[data-theme="dark"] .dose-projection--over .dose-projection__cmp { color: #fca5a5; }

/* Cycling Coach — unified cycle chart (v104) */
.cyc-section--cycle-chart {
  padding: 12px 14px;
  margin: 8px 0 14px;
  background: var(--color-surface-soft, rgba(0,0,0,0.025));
  border-radius: 6px;
  border: 1px solid var(--color-border, #e6e2d8);
}
[data-theme="dark"] .cyc-section--cycle-chart {
  background: rgba(255,255,255,0.03);
  border-color: #24383a;
}
.cyc-section--cycle-chart-empty {
  padding: 10px 14px;
}
.cyc-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cyc-chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-text-soft, #5a6669);
}
.cyc-chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cyc-chart-legend__swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
}
.cyc-chart-legend__swatch--nh3 { background: #dc2626; }
.cyc-chart-legend__swatch--no2 { background: #d97706; }
.cyc-chart-legend__swatch--no3 { background: #15803d; }
.cyc-chart-legend__swatch--dose {
  background: transparent;
  width: auto;
  height: auto;
  color: #d97706;
  font-size: 13px;
  line-height: 1;
  transform: translateY(-1px);
}
[data-theme="dark"] .cyc-chart-legend__swatch--nh3 { background: #f87171; }
[data-theme="dark"] .cyc-chart-legend__swatch--no2 { background: #fbbf24; }
[data-theme="dark"] .cyc-chart-legend__swatch--no3 { background: #4ade80; }
[data-theme="dark"] .cyc-chart-legend__swatch--dose { color: #fbbf24; }
.cyc-chart-canvas-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}
.cyc-chart-foot {
  margin: 6px 0 0;
  font-size: 11px;
}

/* v105 W1 — cycle-complete hero banner */
.cyc-cycled-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 4px 0 14px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(99, 102, 241, 0.08));
  border-left: 4px solid #15803d;
  border-radius: 8px;
}
[data-theme="dark"] .cyc-cycled-hero {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.18), rgba(129, 140, 248, 0.10));
  border-left-color: #4ade80;
}
.cyc-cycled-hero__icon { font-size: 32px; line-height: 1; flex: 0 0 auto; }
.cyc-cycled-hero__body { flex: 1 1 auto; }
.cyc-cycled-hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 2px;
}
[data-theme="dark"] .cyc-cycled-hero__title { color: #4ade80; }
.cyc-cycled-hero__sub {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
}
.cyc-cycled-hero__cta { font-size: 14px; }

/* v105 W3 — pointer when N-cycle sparklines are hidden during cycling */
.trends-cycling-pointer {
  grid-column: 1 / -1;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(99, 102, 241, 0.07);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
[data-theme="dark"] .trends-cycling-pointer {
  background: rgba(129, 140, 248, 0.12);
  border-left-color: #818cf8;
}

/* v105 E7 — legend shape variants */
.cyc-chart-legend__shape {
  display: inline-block;
  margin-right: 4px;
  font-size: 12px;
  line-height: 1;
  transform: translateY(-1px);
}
.cyc-chart-legend__shape--nh3  { color: #dc2626; }
.cyc-chart-legend__shape--no2  { color: #d97706; }
.cyc-chart-legend__shape--no3  { color: #15803d; }
.cyc-chart-legend__shape--dose { color: #d97706; }
[data-theme="dark"] .cyc-chart-legend__shape--nh3  { color: #f87171; }
[data-theme="dark"] .cyc-chart-legend__shape--no2  { color: #fbbf24; }
[data-theme="dark"] .cyc-chart-legend__shape--no3  { color: #4ade80; }
[data-theme="dark"] .cyc-chart-legend__shape--dose { color: #fbbf24; }

/* v105 E8 — cycle-chart explainer chip */
.cyc-chart-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  margin: 6px 0 8px;
  background: rgba(99, 102, 241, 0.07);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.45;
}
[data-theme="dark"] .cyc-chart-intro {
  background: rgba(129, 140, 248, 0.12);
  border-left-color: #818cf8;
}
.cyc-chart-intro__body { flex: 1 1 auto; }
.cyc-chart-intro__close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text-soft, #5a6669);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
}
.cyc-chart-intro__close:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .cyc-chart-intro__close:hover { background: rgba(255,255,255,0.08); }

/* v105 E1 — disabled preset state */
.dose-preset--disabled,
.dose-preset:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent !important;
  border-style: dashed !important;
}
/* v105 E9 — WCAG touch-target minimum */
.dose-preset { min-height: 44px; }

/* v105 E3 — dose-note quick-tag chips */
.dose-note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.dose-note-chip {
  padding: 4px 9px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  color: var(--color-text, inherit);
  transition: background 0.12s;
}
.dose-note-chip:hover {
  background: rgba(99, 102, 241, 0.20);
}
[data-theme="dark"] .dose-note-chip {
  background: rgba(129, 140, 248, 0.18);
  border-color: rgba(129, 140, 248, 0.35);
}
[data-theme="dark"] .dose-note-chip:hover {
  background: rgba(129, 140, 248, 0.30);
}

/* v105 NEW — edit/delete reading buttons in Section 3 */
.cyc-cell--actions .cyc-edit-reading,
.cyc-cell--actions .cyc-del-reading {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--color-text-soft, #5a6669);
  margin-left: 2px;
}
.cyc-cell--actions .cyc-edit-reading:hover { background: rgba(99,102,241,0.10); }
.cyc-cell--actions .cyc-del-reading:hover { color: #dc2626; background: rgba(220,38,38,0.08); }

/* v105 E4 — progress toggle button */
.cyc-progress-toggle {
  margin-left: 4px;
  font-size: 12px;
}

/* v105 E5 — dose context "NH3 was X then" */
.cyc-dose-before {
  font-style: italic;
}

/* Mobile responsiveness — cycle chart */
@media (max-width: 480px) {
  .cyc-chart-canvas-wrap { height: 180px; }
  .cyc-chart-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cyc-chart-legend { font-size: 11px; }
}

/* v106 — restore-confirm modal */
.modal--restore { max-width: 540px; }
.restore-summary {
  margin: 8px 0 14px;
  padding: 10px 12px;
  background: var(--color-surface-soft, rgba(0, 0, 0, 0.04));
  border-radius: 6px;
}
[data-theme="dark"] .restore-summary {
  background: rgba(255, 255, 255, 0.04);
}
.restore-summary__row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.7;
}
.restore-summary__label {
  flex: 0 0 80px;
  color: var(--color-text-soft, #5a6669);
  font-weight: 500;
}

.restore-tank-list-wrap {
  margin: 12px 0;
}
.restore-tank-list__head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-soft, #5a6669);
  margin-bottom: 4px;
}
.restore-tank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #e6e2d8);
  border-radius: 4px;
}
[data-theme="dark"] .restore-tank-list { border-color: #24383a; }
.restore-tank-list__item {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid var(--color-border, #e6e2d8);
}
[data-theme="dark"] .restore-tank-list__item { border-bottom-color: #24383a; }
.restore-tank-list__item:last-child { border-bottom: 0; }

.restore-table-breakdown { margin: 12px 0; }
.restore-table-breakdown__head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-soft, #5a6669);
  margin-bottom: 6px;
}
.restore-table-breakdown__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.restore-table-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  font-size: 11px;
}
[data-theme="dark"] .restore-table-chip {
  background: rgba(129, 140, 248, 0.18);
  border-color: rgba(129, 140, 248, 0.35);
}
.restore-table-chip__name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}
.restore-table-chip__count {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-soft, #5a6669);
}
[data-theme="dark"] .restore-table-chip__count { color: #8a9c9e; }

.restore-skew-warning {
  margin: 12px 0;
  padding: 10px 12px;
  background: rgba(217, 119, 6, 0.10);
  border-left: 3px solid #d97706;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}
.restore-skew-warning code {
  font-size: 12px;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
}
[data-theme="dark"] .restore-skew-warning {
  background: rgba(251, 191, 36, 0.18);
  border-left-color: #fbbf24;
  color: #fde68a;
}
[data-theme="dark"] .restore-skew-warning code { background: rgba(255, 255, 255, 0.10); }

/* ============================================================
   v110: Quarantine tank — Bio-Filter Source & Hygiene cards
   ============================================================ */

.qt-biofilter-card,
.qt-hygiene-card {
  /* These cards only render on QT tanks. Use the default card chrome but
     give the body a calmer rhythm than the dashboard cards. */
}
.qt-biofilter-intro {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 var(--space-3);
  color: var(--color-text, #2b2b2b);
}
.qt-biofilter-section {
  margin: var(--space-3) 0;
}
.qt-biofilter-section + .qt-biofilter-section { margin-top: var(--space-4); }
.qt-biofilter-section .sub-h {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #6b7280);
  margin: 0 0 var(--space-2);
}
.qt-biofilter-note-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-2);
}
.qt-biofilter-note-row span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #6b7280);
}
.qt-biofilter-note-row input {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.12));
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b2b);
}
.qt-biofilter-confirmed {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.qt-biofilter-warning {
  margin: var(--space-3) 0;
  padding: 10px 12px;
  background: rgba(217, 119, 6, 0.10);
  border-left: 3px solid #d97706;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}
[data-theme="dark"] .qt-biofilter-warning {
  background: rgba(251, 191, 36, 0.18);
  border-left-color: #fbbf24;
  color: #fde68a;
}
.qt-biofilter-list,
.qt-hygiene-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text, #2b2b2b);
}
.qt-biofilter-list li,
.qt-hygiene-list li {
  margin-bottom: var(--space-2);
}
.qt-hygiene-card .sub-h {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #6b7280);
  margin: var(--space-4) 0 var(--space-2);
}
.qt-hygiene-card .sub-h:first-of-type { margin-top: var(--space-3); }
.qt-hygiene-intro {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 var(--space-2);
  color: var(--color-text, #2b2b2b);
}

/* v110c: Inherited QT volume readout (shown on isQuarantine tanks instead of an editable input). */
.qt-volume-row--inherited {
  margin: var(--space-3) 0;
}
.qt-volume-inherited {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--color-surface, rgba(0,0,0,0.03));
  border-radius: 6px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
}
.qt-volume-inherited__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #6b7280);
}
.qt-volume-inherited__value {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text, #2b2b2b);
  font-variant-numeric: tabular-nums;
}
.qt-volume-inherited__note {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
}

/* ============================================================
   v111: Maintenance task UX — summary strip, grouped sections, action toast
   ============================================================ */

/* Summary strip above task list. Hidden when nothing is overdue/due. */
.task-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  background: var(--color-surface, rgba(0,0,0,0.03));
  border-radius: 6px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  font-size: 13px;
}
.task-summary__counts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.task-summary__overdue {
  font-weight: 600;
  color: var(--color-error, #dc2626);
}
.task-summary__due {
  font-weight: 600;
  color: var(--color-caution, #b58a00);
}
.task-summary__bulk {
  flex-shrink: 0;
}

/* Sub-headers between status groups */
.task-section-head {
  list-style: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #6b7280);
  padding: var(--space-2) 0 4px;
  margin-top: var(--space-2);
  border-bottom: 1px dashed var(--color-border, rgba(0,0,0,0.10));
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.task-section-head:first-child { margin-top: 0; }
.task-section-head--overdue { color: var(--color-error, #dc2626); }
.task-section-head--due { color: var(--color-caution, #b58a00); }
.task-section-head__count {
  font-weight: 400;
  opacity: 0.7;
  font-size: 11px;
}

/* Action toast (Undo button inline with message) */
.toast.toast--action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px 10px 16px;
}
.toast__msg {
  font-size: var(--text-sm);
}
.toast__action {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 10px;
  border-radius: var(--radius-full, 999px);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toast__action:hover {
  background: rgba(255,255,255,0.12);
}

/* v120: Journal (v117a) + Stocking-row avatars (v117b) + Lightbox styles removed
   with the photo journaling feature. */

/* =========================================================
   v118: Isolate-to-QT block inside the fish-health catalog.
   Renders when a species-specific condition affects the user's
   live stock and at least one QT tank exists.
   ========================================================= */
.health-row--isolate {
  background: color-mix(in oklab, var(--color-caution, #d97706) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-caution, #d97706) 25%, transparent);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.health-isolate__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.health-isolate__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.health-isolate__fish {
  font-size: var(--text-sm);
  font-weight: 500;
}
.health-isolate__btn {
  white-space: nowrap;
  font-size: var(--text-xs);
  padding: 6px 12px;
  background: var(--color-accent, #0d9488);
  color: #fff;
  border-color: var(--color-accent, #0d9488);
}
.health-isolate__btn:hover {
  background: #0f766e;
  border-color: #0f766e;
}

/* =========================================================
   v128 — Fish-In Emergency Action Ladder
   ========================================================= */
.cyc-section--ladder {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 4px solid #dc2626;
  background: rgba(220, 38, 38, 0.05);
}
.cyc-ladder--critical { border-left-color: #b91c1c; background: rgba(185, 28, 28, 0.08); }
.cyc-ladder--high     { border-left-color: #dc2626; background: rgba(220, 38, 38, 0.06); }
.cyc-ladder--moderate { border-left-color: #d97706; background: rgba(217, 119, 6, 0.06); }
.cyc-ladder--trace    { border-left-color: #ca8a04; background: rgba(202, 138, 4, 0.05); }
[data-theme="dark"] .cyc-ladder--critical { background: rgba(185, 28, 28, 0.16); }
[data-theme="dark"] .cyc-ladder--high     { background: rgba(220, 38, 38, 0.12); }
[data-theme="dark"] .cyc-ladder--moderate { background: rgba(217, 119, 6, 0.12); }
[data-theme="dark"] .cyc-ladder--trace    { background: rgba(202, 138, 4, 0.10); }
.cyc-ladder__tier { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cyc-ladder__tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
}
.cyc-ladder__tier-badge--critical { background: #b91c1c; }
.cyc-ladder__tier-badge--high     { background: #dc2626; }
.cyc-ladder__tier-badge--moderate { background: #d97706; }
.cyc-ladder__tier-badge--trace    { background: #ca8a04; }
.cyc-ladder__list { list-style: none; margin: 0; padding: 0; }
.cyc-ladder__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 6px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  line-height: 1.5;
  transition: background 0.12s ease;
}
.cyc-ladder__item:hover { background: rgba(0, 0, 0, 0.04); }
[data-theme="dark"] .cyc-ladder__item:hover { background: rgba(255, 255, 255, 0.06); }
.cyc-ladder__bullet { color: var(--color-text-soft); font-weight: 700; line-height: 1.4; }
.cyc-ladder__text { flex: 1; }
.cyc-ladder__alt { padding: 2px 6px 8px 22px; }

/* =========================================================
   v128 — Mini-Cycle Recovery banner
   ========================================================= */
.cyc-recovery-banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(250, 204, 21, 0.14);
  border-left: 4px solid #eab308;
}
[data-theme="dark"] .cyc-recovery-banner { background: rgba(234, 179, 8, 0.16); }
.cyc-recovery-banner__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cyc-recovery-banner__title { font-size: 14px; font-weight: 600; color: #854d0e; }
[data-theme="dark"] .cyc-recovery-banner__title { color: #fde68a; }
.cyc-recovery-banner__sub { font-size: 12px; color: var(--color-text-soft); margin-top: 2px; }
.cyc-recovery-banner__pct { color: var(--color-text-soft); }
.cyc-recovery-banner__dismiss { font-size: 12px; color: var(--color-text-soft); white-space: nowrap; flex-shrink: 0; }
.cyc-recovery-banner__bullets { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.45; }

/* v128 — Log a disruption text-button */
.cyc-disruption-trigger { margin-top: var(--space-3); text-align: left; }
.cyc-log-disruption-btn { font-size: 12px; }

/* =========================================================
   v128 — Disruption modal
   ========================================================= */
.modal--disruption { max-width: 440px; }
.disruption-kinds { border: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-direction: column; gap: 4px; }
.disruption-kinds legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.disruption-opt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s ease;
}
.disruption-opt:hover { background: var(--color-primary-soft, rgba(14, 106, 114, 0.08)); }
.disruption-opt input[type="radio"] { width: auto; margin: 0; }
.disruption-opt__label { flex: 1 1 auto; }
.disruption-pct { display: inline-flex; gap: 10px; flex-basis: 100%; padding-left: 26px; }
.disruption-pct__opt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-text-soft); }
.disruption-pct__opt input[type="radio"] { width: auto; margin: 0; }
.disruption-error { color: #dc2626; font-size: 12px; margin: 0 0 8px; }
