/*
 * css/form.css — Grow Data Submission Form Modal
 * Glass / macOS minimal style.
 */

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.ftest-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.ftest-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal window ─────────────────────────────────────────────────────────── */
.ftest-modal {
  background: rgba(8, 10, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(56,189,248,0.04);
  width: min(1020px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Entry animation */
  transform: translateY(22px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity   0.22s ease;
}

.ftest-modal.active {
  transform: translateY(0) scale(1);
  opacity: 1;
}

html[data-theme="light"] .ftest-modal {
  background: rgba(246, 248, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
}

/* ── macOS title bar ──────────────────────────────────────────────────────── */
.ftest-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

html[data-theme="light"] .ftest-titlebar {
  border-bottom-color: rgba(0,0,0,0.07);
}

.ftest-lights {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.ftest-light {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  transition: filter 0.15s;
  flex-shrink: 0;
}
.ftest-light:hover { filter: brightness(1.25); }
.ftest-light.red    { background: #ff5f57; }
.ftest-light.yellow { background: #ffbd2e; cursor: default; }
.ftest-light.green  { background: #28c940; cursor: default; }

.ftest-win-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
  text-align: center;
}

.ftest-win-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-amber);
  background: rgba(251,191,36,0.10);
  border: 1px solid rgba(251,191,36,0.28);
  border-radius: 20px;
  padding: 2px 9px;
  flex-shrink: 0;
}

/* ── Beta disclaimer ──────────────────────────────────────────────────────── */
/* Sits between the title bar and the form-type selector. Amber-tinted +
   glowing so it reads as a clear "WIP — expect change" callout, not body
   copy. Hard left rule + warning icon makes the eye land here on open. */
.ftest-disclaimer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 22px;
  background:
    linear-gradient(90deg, rgba(251, 191, 36, 0.22) 0%, rgba(251, 191, 36, 0.06) 60%, rgba(251, 191, 36, 0.02) 100%);
  border-top: 1px solid rgba(251, 191, 36, 0.30);
  border-bottom: 1px solid rgba(251, 191, 36, 0.30);
  box-shadow: inset 0 0 24px rgba(251, 191, 36, 0.08);
  flex-shrink: 0;
}
.ftest-disclaimer::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 1), rgba(245, 158, 11, 0.9));
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.65);
}
.ftest-disclaimer-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: rgba(251, 191, 36, 1);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.30);
}
.ftest-disclaimer-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
.ftest-disclaimer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ftest-disclaimer-tag {
  flex-shrink: 0;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.28);
  border: 1px solid rgba(251, 191, 36, 0.70);
  color: rgba(254, 240, 138, 1);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.55);
}
.ftest-disclaimer-headline {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(254, 240, 138, 1);
}
.ftest-disclaimer-sub {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(254, 215, 170, 0.92);
}
html[data-theme="light"] .ftest-disclaimer {
  background:
    linear-gradient(90deg, rgba(180, 83, 9, 0.18) 0%, rgba(180, 83, 9, 0.05) 60%, rgba(180, 83, 9, 0.02) 100%);
  border-top-color: rgba(180, 83, 9, 0.35);
  border-bottom-color: rgba(180, 83, 9, 0.30);
  box-shadow: inset 0 0 24px rgba(180, 83, 9, 0.05);
}
html[data-theme="light"] .ftest-disclaimer::before {
  background: linear-gradient(180deg, rgba(180, 83, 9, 1), rgba(146, 64, 14, 1));
  box-shadow: 0 0 14px rgba(180, 83, 9, 0.45);
}
html[data-theme="light"] .ftest-disclaimer-icon {
  background: rgba(180, 83, 9, 0.14);
  border-color: rgba(180, 83, 9, 0.45);
  color: rgba(120, 53, 15, 1);
  box-shadow: 0 0 16px rgba(180, 83, 9, 0.18);
}
html[data-theme="light"] .ftest-disclaimer-tag {
  background: rgba(180, 83, 9, 0.20);
  border-color: rgba(180, 83, 9, 0.65);
  color: rgba(120, 53, 15, 1);
  text-shadow: none;
}
html[data-theme="light"] .ftest-disclaimer-headline { color: rgba(120, 53, 15, 1); }
html[data-theme="light"] .ftest-disclaimer-sub      { color: rgba(120, 53, 15, 0.85); }

/* ── Form type selector ───────────────────────────────────────────────────── */
.ftest-type-bar {
  display: flex;
  gap: 8px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

html[data-theme="light"] .ftest-type-bar {
  border-bottom-color: rgba(0,0,0,0.06);
}

.ftest-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}

.ftest-type-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.ftest-type-btn.active {
  background: color-mix(in srgb, var(--tc) 8%, transparent);
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--tc) 12%, transparent);
}

html[data-theme="light"] .ftest-type-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.10);
}
html[data-theme="light"] .ftest-type-btn:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.16);
}
html[data-theme="light"] .ftest-type-btn.active {
  background: color-mix(in srgb, var(--tc) 10%, transparent);
  border-color: color-mix(in srgb, var(--tc) 55%, transparent);
}

.ftest-type-icon {
  color: var(--tc);
  opacity: 0.5;
  transition: opacity 0.18s;
}
.ftest-type-btn.active .ftest-type-icon { opacity: 1; }

.ftest-type-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  transition: color 0.18s;
}
.ftest-type-btn.active .ftest-type-name { color: var(--tc); }

.ftest-type-desc {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ── Config row (room + meta chips) ───────────────────────────────────────── */
.ftest-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}

html[data-theme="light"] .ftest-config-row {
  border-bottom-color: rgba(0,0,0,0.06);
}

.ftest-config-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ftest-field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ftest-config-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Custom room dropdown ─────────────────────────────────────────────────── */
.ftest-room-dd {
  position: relative;
}

.ftest-room-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-width: 90px;
  transition: border-color 0.15s, background 0.15s;
}

.ftest-room-trigger:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.20);
}

.ftest-room-dd.open .ftest-room-trigger {
  border-color: rgba(56,189,248,0.45);
  background: rgba(56,189,248,0.06);
}

html[data-theme="light"] .ftest-room-trigger {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
}
html[data-theme="light"] .ftest-room-trigger:hover {
  background: rgba(0,0,0,0.07);
}

.ftest-dd-chevron {
  color: var(--text-dim);
  margin-left: auto;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.ftest-room-dd.open .ftest-dd-chevron { transform: rotate(180deg); }

.ftest-room-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 120px;
  background: rgba(10, 13, 30, 0.98);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 10px;
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04) inset;
  padding: 4px;
  z-index: 200;
  display: none;
}

.ftest-room-dd.open .ftest-room-panel { display: block; }

html[data-theme="light"] .ftest-room-panel {
  background: rgba(250,251,255,0.98);
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 12px 36px rgba(0,0,0,0.14);
}

.ftest-room-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.ftest-room-opt:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

.ftest-room-opt.active {
  background: rgba(56,189,248,0.12);
  color: var(--accent-cyan);
  font-weight: 600;
}

html[data-theme="light"] .ftest-room-opt:hover { background: rgba(0,0,0,0.05); }
html[data-theme="light"] .ftest-room-opt.active { background: rgba(14,165,233,0.10); }

/* Meta chips — user + timestamp (locked, read-only) */
.ftest-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ftest-meta-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

.ftest-meta-chip.locked {
  border-style: dashed;
  border-color: rgba(255,255,255,0.10);
  cursor: not-allowed;
  opacity: 0.85;
}

.ftest-meta-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ftest-meta-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.ftest-lock-icon {
  color: var(--text-dim);
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── System selector bar ──────────────────────────────────────────────────── */
.ftest-sys-bar {
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

html[data-theme="light"] .ftest-sys-bar {
  border-bottom-color: rgba(0,0,0,0.06);
}

/* System tabs — single row */
.ftest-sys-tabs-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ftest-sys-tab {
  padding: 4px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ftest-sys-tab:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.ftest-sys-tab.active {
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.36);
  color: var(--accent-cyan);
}

/* Tab with validation errors — red dot after the label */
.ftest-sys-tab.ftest-tab-err {
  border-color: rgba(251,113,133,0.40);
  color: var(--accent-rose);
}

.ftest-sys-tab.ftest-tab-err::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-rose);
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Validation error bar ─────────────────────────────────────────────────── */
.ftest-err-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: rgba(251,113,133,0.08);
  border-bottom: 1px solid rgba(251,113,133,0.22);
  color: var(--accent-rose);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  animation: ftest-bar-in 0.2s ease;
}

@keyframes ftest-bar-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form body (scrollable) ───────────────────────────────────────────────── */
.ftest-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;            /* let the body shrink so the inner area can scroll */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scroll affordance — fade + "More" pill, shown only when content sits below
   the fold (toggled by .has-more in form.js _wireScrollHint). */
.ftest-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 9px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  background: linear-gradient(to bottom, rgba(10,14,28,0) 0%, rgba(10,14,28,0.55) 55%, rgba(10,14,28,0.92) 100%);
  z-index: 4;
}
.ftest-body.has-more .ftest-scroll-hint { opacity: 1; transform: translateY(0); }
.ftest-scroll-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(226,232,240,0.9);
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ftest-scroll-btn:hover {
  border-color: rgba(56,189,248,0.65);
  color: #fff;
  transform: translateY(-1px);
}
.ftest-scroll-btn svg { animation: ftest-scroll-bounce 1.5s ease-in-out infinite; }
@keyframes ftest-scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .ftest-scroll-btn svg { animation: none; }
}
html[data-theme="light"] .ftest-scroll-hint {
  background: linear-gradient(to bottom, rgba(240,244,255,0) 0%, rgba(240,244,255,0.6) 55%, rgba(240,244,255,0.94) 100%);
}
html[data-theme="light"] .ftest-scroll-btn {
  color: #1e293b;
  background: rgba(255,255,255,0.95);
  border-color: rgba(100,116,139,0.35);
}

.ftest-form-scroll {
  flex: 1 1 auto;
  min-height: 0;           /* fill the body and overflow → scroll, adapting to
                              whatever header/footer height each form type has */
  overflow-y: auto;
  padding: 6px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.ftest-form-scroll::-webkit-scrollbar { width: 5px; }
.ftest-form-scroll::-webkit-scrollbar-track { background: transparent; }
.ftest-form-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 10px;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.ftest-section {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ftest-section:last-child { border-bottom: none; }

html[data-theme="light"] .ftest-section {
  border-bottom-color: rgba(0,0,0,0.05);
}

.ftest-section-accent {
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Live pH auto-calc panel (read-only) ─────────────────────────────────── */
.ftest-phcalc {
  padding: 12px 14px;
  background: rgba(56,189,248,0.04);
  border: 1px solid rgba(56,189,248,0.16);
  border-radius: var(--r-sm);
}
.ftest-phcalc-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--accent-cyan);
}
.ftest-phcalc-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ftest-phcalc-note {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-transform: none;
}
.ftest-phcalc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ftest-phcalc-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  cursor: help;   /* formula shows on hover (title attr) */
}
.ftest-phcalc-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ftest-phcalc-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
/* direction colours via existing semantic intent: down = subtle blue,
   up = subtle amber, flat/na = muted */
.ftest-phcalc-val.is-down { color: #60a5fa; }
.ftest-phcalc-val.is-up   { color: #fbbf24; }
.ftest-phcalc-val.is-flat { color: var(--text-muted); }
.ftest-phcalc-val.is-na   { color: var(--text-dim); }

/* ── pH crash banner (top of the sensor form) ────────────────────────────── */
.ftest-crash-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  margin-bottom: 14px;
  border-radius: var(--r-sm);
  border: 1px solid currentColor;
  font-size: 11px;
}
.ftest-crash-title {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ftest-crash-reasons { flex: 1; min-width: 0; color: var(--text-secondary); }
.ftest-crash-meta    { color: var(--text-muted); white-space: nowrap; }
/* severity → colour. minor = watch (amber), major = alert (orange), critical = red */
.ftest-crash-banner.sev-minor    { color: #fbbf24; background: rgba(251,191,36,0.08); }
.ftest-crash-banner.sev-major    { color: #fb923c; background: rgba(251,146,60,0.10); }
.ftest-crash-banner.sev-critical { color: #fb7185; background: rgba(251,113,133,0.12); }
.ftest-crash-banner.sev-critical .ftest-crash-title { animation: ftest-crash-pulse 1.1s ease-in-out infinite; }
@keyframes ftest-crash-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .ftest-crash-banner.sev-critical .ftest-crash-title { animation: none; }
}

.ftest-auto-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: rgba(52,211,153,0.04);
  border: 1px solid rgba(52,211,153,0.18);
  border-radius: var(--r-sm);
}

.ftest-auto-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-emerald);
}

.ftest-auto-text {
  flex: 1;
  min-width: 0;
}

.ftest-auto-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-emerald);
  margin-bottom: 3px;
}

.ftest-auto-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ftest-auto-chips {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.ftest-auto-chip {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--accent-emerald);
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.22);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.ftest-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.ftest-section-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-emerald);
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.28);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ── Field grid layouts ───────────────────────────────────────────────────── */
.ftest-field-row {
  display: grid;
  gap: 10px;
}

.ftest-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ftest-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ftest-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ftest-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ftest-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ≤900px (small tablets, large phones): reduce columns */
@media (max-width: 900px) {
  .ftest-cols-5, .ftest-cols-6 { grid-template-columns: repeat(3, 1fr); }
  .ftest-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .ftest-cols-3,
  .ftest-cols-4,
  .ftest-cols-5,
  .ftest-cols-6 { grid-template-columns: repeat(2, 1fr); }
  .ftest-cols-2 { grid-template-columns: 1fr; }
}

/* ── Individual fields ────────────────────────────────────────────────────── */
.ftest-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ftest-field-wide {
  grid-column: 1 / -1;
}

.ftest-field-lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.ftest-unit {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* Required-field marker — every field a form type requires shows this. */
.ftest-req {
  color: var(--accent-rose, #fb7185);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  margin-left: -1px;
}

/* ── Number inputs ────────────────────────────────────────────────────────── */
.ftest-input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -moz-appearance: textfield;
  appearance: textfield;
  box-sizing: border-box;
}

.ftest-input::-webkit-outer-spin-button,
.ftest-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ftest-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
  opacity: 0.7;
}

.ftest-input:focus {
  border-color: rgba(56,189,248,0.45);
  background: rgba(56,189,248,0.05);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

/* Error state */
.ftest-input.ftest-err,
.ftest-textarea.ftest-err {
  border-color: rgba(251,113,133,0.55);
  background: rgba(251,113,133,0.06);
  box-shadow: 0 0 0 3px rgba(251,113,133,0.10);
  animation: ftest-shake 0.3s ease;
}

.ftest-status-group.ftest-err {
  outline: 1px solid rgba(251,113,133,0.45);
  border-radius: var(--r-xs);
  animation: ftest-shake 0.3s ease;
}

@keyframes ftest-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

html[data-theme="light"] .ftest-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

html[data-theme="light"] .ftest-input:focus {
  border-color: rgba(14,165,233,0.55);
  background: rgba(14,165,233,0.06);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.10);
}

/* ── Textarea ─────────────────────────────────────────────────────────────── */
.ftest-textarea {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  min-height: 70px;
}

.ftest-textarea::placeholder { color: var(--text-dim); opacity: 0.7; }

.ftest-textarea:focus {
  border-color: rgba(56,189,248,0.45);
  background: rgba(56,189,248,0.05);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

html[data-theme="light"] .ftest-textarea {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
}

/* ── Compact section (Notes) ─────────────────────────────────────────────── */
.ftest-section-compact {
  padding-top: 8px !important;
  padding-bottom: 6px !important;
}
.ftest-section-compact .ftest-textarea {
  min-height: unset;
  resize: none;
}

/* ── pH crash toggle (Yes / No) ───────────────────────────────────────────── */
.ftest-toggle-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.10);
}

.ftest-toggle-btn {
  flex: 1;
  padding: 8px 6px;
  background: rgba(255,255,255,0.03);
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ftest-toggle-btn:not(:last-child) {
  border-right: 1.5px solid rgba(255,255,255,0.08);
}

.ftest-toggle-btn.no.active {
  background: rgba(52,211,153,0.14);
  color: var(--accent-emerald);
}

.ftest-toggle-btn.yes.active {
  background: rgba(251,113,133,0.16);
  color: var(--accent-rose);
}

/* ── Status button groups (OK / Issue / Down) ─────────────────────────────── */
.ftest-status-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.09);
}

.ftest-status-btn {
  flex: 1;
  padding: 7px 4px;
  background: rgba(255,255,255,0.03);
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ftest-status-btn:not(:last-child) {
  border-right: 1.5px solid rgba(255,255,255,0.07);
}

/* OK / active states */
.ftest-status-btn.ok.active  {
  background: rgba(52,211,153,0.14);
  color: var(--accent-emerald);
}
/* Issue / dirty / low */
.ftest-status-btn.issue.active,
.ftest-status-btn.dirty.active,
.ftest-status-btn.low.active {
  background: rgba(251,191,36,0.14);
  color: var(--accent-amber);
}
/* Down / blocked / empty / high (water level over target) */
.ftest-status-btn.down.active,
.ftest-status-btn.blocked.active,
.ftest-status-btn.empty.active,
.ftest-status-btn.high.active {
  background: rgba(251,113,133,0.14);
  color: var(--accent-rose);
}
/* Good (water level on target) */
.ftest-status-btn.good.active {
  background: rgba(52,211,153,0.14);
  color: var(--accent-emerald);
}
/* On (running) / Off — used by the Equipment Check status pills */
.ftest-status-btn.on.active {
  background: rgba(52,211,153,0.14);
  color: var(--accent-emerald);
}
.ftest-status-btn.off.active {
  background: rgba(148,163,184,0.20);
  color: #e2e8f0;
}

/* Reading Time — the native <input type="time"> popup (a white OS list) can't
   be themed, so js/timepicker.js mounts a glass hour/min/AM·PM selector. Hide
   the native indicator + spinners; our own .tp-trigger clock sits in the
   JS-injected .tp-field wrapper. Underlying input stays type="time". */
.ftest-time::-webkit-calendar-picker-indicator { display: none; }
.ftest-time::-webkit-inner-spin-button,
.ftest-time::-webkit-outer-spin-button { display: none; }

.tp-field { position: relative; }
.tp-field .ftest-time { padding-right: 36px; cursor: pointer; }

.tp-trigger {
  position: absolute;
  top: 50%; right: 7px;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  padding: 0; margin: 0;
  background: none; border: none; border-radius: 6px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.tp-trigger:hover { color: #38bdf8; background: rgba(56,189,248,0.12); }
.tp-field.tp-open .tp-trigger { color: #38bdf8; }

/* Popup — mirrors .dp-popup glass language (see cultivation/css/rooms.css). */
.tp-popup {
  position: fixed;
  z-index: 9999;
  background: #0b0e1f;
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 14px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  padding: 12px;
  font-family: var(--font-body);
  user-select: none;
}
.tp-cols { display: flex; gap: 8px; }
.tp-colwrap { display: flex; flex-direction: column; flex: 1 1 56px; min-width: 0; }
.tp-colwrap-mer { flex: 0 0 50px; }
.tp-col-lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  text-align: center; padding-bottom: 6px; min-height: 14px;
}
.tp-col {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 190px; overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,0.3) transparent;
}
.tp-col::-webkit-scrollbar { width: 5px; }
.tp-col::-webkit-scrollbar-track { background: transparent; }
.tp-col::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.25); border-radius: 3px; }
.tp-col::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,0.45); }

.tp-opt {
  flex: 0 0 auto;
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 500;
  height: 30px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  outline: none;
}
.tp-opt:hover {
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.22);
  color: #fff;
}
.tp-opt.tp-sel {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #04050f;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(56,189,248,0.45);
}

.tp-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
}
.tp-now, .tp-done {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  height: 28px; padding: 0 14px;
  border-radius: 7px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  outline: none;
}
.tp-now {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.tp-now:hover { border-color: rgba(56,189,248,0.4); color: #38bdf8; background: rgba(56,189,248,0.08); }
.tp-done {
  background: #38bdf8;
  border: 1px solid #38bdf8;
  color: #04050f;
  box-shadow: 0 2px 12px rgba(56,189,248,0.35);
}
.tp-done:hover { background: #5cc6f7; border-color: #5cc6f7; }

/* Light mode */
html[data-theme="light"] .tp-trigger { color: rgba(19,16,58,0.5); }
html[data-theme="light"] .tp-trigger:hover { color: #0284c7; background: rgba(2,132,199,0.1); }
html[data-theme="light"] .tp-field.tp-open .tp-trigger { color: #0284c7; }
html[data-theme="light"] .tp-popup {
  background: #fff;
  border-color: rgba(2,132,199,0.2);
  box-shadow: 0 20px 56px rgba(0,0,0,0.14), 0 0 0 1px rgba(130,100,200,0.08);
}
html[data-theme="light"] .tp-col-lbl { color: rgba(19,16,58,0.4); }
html[data-theme="light"] .tp-opt { color: rgba(19,16,58,0.8); }
html[data-theme="light"] .tp-opt:hover {
  background: rgba(2,132,199,0.07);
  border-color: rgba(2,132,199,0.2);
  color: #13103a;
}
html[data-theme="light"] .tp-opt.tp-sel {
  background: #0284c7; border-color: #0284c7; color: #fff;
  box-shadow: 0 2px 12px rgba(2,132,199,0.35);
}
html[data-theme="light"] .tp-now {
  border-color: rgba(19,16,58,0.15); color: rgba(19,16,58,0.7);
}
html[data-theme="light"] .tp-now:hover {
  border-color: rgba(2,132,199,0.4); color: #0284c7; background: rgba(2,132,199,0.07);
}
html[data-theme="light"] .tp-done {
  background: #0284c7; border-color: #0284c7; color: #fff;
}
html[data-theme="light"] .tp-done:hover { background: #0369a1; border-color: #0369a1; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ftest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  flex-wrap: wrap;
}

html[data-theme="light"] .ftest-footer {
  border-top-color: rgba(0,0,0,0.07);
}

.ftest-footer-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.ftest-footer-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.ftest-btn-cancel {
  padding: 8px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ftest-btn-cancel:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.ftest-btn-submit {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  background: rgba(52,211,153,0.12);
  border: 1.5px solid rgba(52,211,153,0.35);
  border-radius: 8px;
  color: var(--accent-emerald);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
}

.ftest-btn-submit:hover:not(:disabled) {
  background: rgba(52,211,153,0.20);
  border-color: rgba(52,211,153,0.55);
  box-shadow: 0 0 22px rgba(52,211,153,0.18);
  transform: translateY(-1px);
}

.ftest-btn-submit:active:not(:disabled) {
  transform: scale(0.97);
}

.ftest-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ftest-btn-submit.loading {
  background: rgba(56,189,248,0.10);
  border-color: rgba(56,189,248,0.32);
  color: var(--accent-cyan);
}

.ftest-btn-submit.success {
  background: rgba(52,211,153,0.18);
  border-color: rgba(52,211,153,0.55);
  color: var(--accent-emerald);
  box-shadow: 0 0 22px rgba(52,211,153,0.18);
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.ftest-spinner {
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(56,189,248,0.25);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: ftest-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ftest-spin {
  to { transform: rotate(360deg); }
}

/* ── Form test button in dev header ───────────────────────────────────────── */
.dv-form-test-btn {
  background: rgba(52,211,153,0.07);
  border-color: rgba(52,211,153,0.30);
  color: var(--accent-emerald);
}

.dv-form-test-btn:hover {
  background: rgba(52,211,153,0.15);
  border-color: rgba(52,211,153,0.55);
  box-shadow: 0 0 20px rgba(52,211,153,0.16);
}

/* ── Form detail modal — data grid inside ticket-modal-item ───────────────── */
.fform-detail-wrap {
  margin: 10px 0 6px;
}

.fform-sys-block {
  margin-bottom: 12px;
}

.fform-sys-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-cyan, #38bdf8);
  margin-bottom: 6px;
}

.fform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.fform-pair {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.fform-single {
  grid-column: 1 / -1;
}

.fform-lbl {
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}

.fform-val {
  color: var(--text-primary, #f1f5f9);
  font-weight: 500;
  text-align: right;
}

.fform-notes-block {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fform-notes-text {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* ── Duplicate-detection confirm overlay ─────────────────────────────────── */
.ftest-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ftest-confirm-overlay.active { opacity: 1; }

.ftest-confirm-modal {
  background: rgba(8,12,28,0.98);
  border: 1px solid rgba(251,191,36,0.22);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.05) inset;
  padding: 26px 26px 20px;
  max-width: 400px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}
.ftest-confirm-overlay.active .ftest-confirm-modal { transform: translateY(0); }

.ftest-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.28);
  flex-shrink: 0;
}

.ftest-confirm-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.ftest-confirm-text {
  font-size: 13px;
  color: rgba(203,213,225,0.85);
  line-height: 1.6;
}
.ftest-confirm-text strong { color: #fff; font-weight: 600; }
.ftest-sanity-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.ftest-sanity-list li {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(226,232,240,0.9);
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.22);
  border-left: 3px solid rgba(251,191,36,0.7);
}
.ftest-sanity-list strong { color: #fde68a; }

.ftest-confirm-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}
.ftest-confirm-no,
.ftest-confirm-yes {
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s ease;
  outline: none;
}
.ftest-confirm-no {
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: rgba(203,213,225,0.7);
}
.ftest-confirm-no:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.24);
  color: #fff;
}
.ftest-confirm-yes {
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.40);
  color: #fbbf24;
}
.ftest-confirm-yes:hover {
  background: rgba(251,191,36,0.22);
  border-color: rgba(251,191,36,0.65);
  box-shadow: 0 0 14px rgba(251,191,36,0.2);
}

/* ══════════════════════════════════════════
   LIGHT MODE — gap fills for the dark-first form
   surfaces above (chips, tabs, toggles, phcalc,
   crash banner, detail grid, confirm modal).
   Theme-aware blocks (inputs, dropdown, disclaimer,
   scroll-hint, time picker) already handle light.
══════════════════════════════════════════ */

/* System tabs + meta chips — translucent-white fills vanish on light. */
html[data-theme="light"] .ftest-sys-tab {
  background: rgba(19,16,58,0.04);
  border-color: rgba(19,16,58,0.10);
}
html[data-theme="light"] .ftest-sys-tab:hover {
  background: rgba(19,16,58,0.07);
}
html[data-theme="light"] .ftest-sys-tab.active {
  background: rgba(2,132,199,0.10);
  border-color: rgba(2,132,199,0.4);
}
html[data-theme="light"] .ftest-meta-chip {
  background: rgba(19,16,58,0.04);
  border-color: rgba(19,16,58,0.10);
}
html[data-theme="light"] .ftest-meta-chip.locked { border-color: rgba(19,16,58,0.12); }

/* Toggle + status button groups — light glass shell + buttons. */
html[data-theme="light"] .ftest-toggle-group,
html[data-theme="light"] .ftest-status-group { border-color: rgba(19,16,58,0.14); }
html[data-theme="light"] .ftest-toggle-btn,
html[data-theme="light"] .ftest-status-btn { background: rgba(19,16,58,0.03); }
html[data-theme="light"] .ftest-toggle-btn:not(:last-child) { border-right-color: rgba(19,16,58,0.10); }
html[data-theme="light"] .ftest-status-btn:not(:last-child) { border-right-color: rgba(19,16,58,0.10); }
/* Off (running) neutral state — dark slate fill/text → light slate. */
html[data-theme="light"] .ftest-status-btn.off.active {
  background: rgba(19,16,58,0.10);
  color: var(--text-primary);
}

/* Live pH auto-calc panel — inner item glass + direction colours. */
html[data-theme="light"] .ftest-phcalc-item {
  background: rgba(19,16,58,0.03);
  border-color: rgba(19,16,58,0.08);
}
html[data-theme="light"] .ftest-phcalc-val.is-down { color: #2563eb; }
html[data-theme="light"] .ftest-phcalc-val.is-up   { color: #b45309; }

/* pH crash banner — semantic sev colours darkened for AA on white
   (currentColor drives text + border, so recolour the whole banner). */
html[data-theme="light"] .ftest-crash-banner.sev-minor    { color: #b45309; background: rgba(217,119,6,0.10); }
html[data-theme="light"] .ftest-crash-banner.sev-major    { color: #c2410c; background: rgba(234,88,12,0.10); }
html[data-theme="light"] .ftest-crash-banner.sev-critical { color: #be123c; background: rgba(225,29,72,0.10); }

/* Form detail grid (ticket modal) — hairline dividers vanish on white. */
html[data-theme="light"] .ftest-input.ftest-err,
html[data-theme="light"] .ftest-textarea.ftest-err {
  border-color: rgba(225,29,72,0.55);
  background: rgba(225,29,72,0.06);
  box-shadow: 0 0 0 3px rgba(225,29,72,0.10);
}
html[data-theme="light"] .fform-pair { border-bottom-color: rgba(19,16,58,0.08); }

/* Duplicate-detection confirm modal — dark → light (scrim stays dark). */
html[data-theme="light"] .ftest-confirm-modal {
  background: rgba(252,252,255,0.98);
  border-color: rgba(217,119,6,0.24);
  box-shadow: 0 32px 80px rgba(80,90,160,0.22), 0 0 0 1px rgba(19,16,58,0.04) inset;
}
html[data-theme="light"] .ftest-confirm-icon {
  background: rgba(217,119,6,0.12);
  border-color: rgba(217,119,6,0.3);
}
html[data-theme="light"] .ftest-confirm-title { color: var(--text-primary); }
html[data-theme="light"] .ftest-confirm-text  { color: var(--text-secondary); }
html[data-theme="light"] .ftest-confirm-text strong { color: var(--text-primary); }
html[data-theme="light"] .ftest-sanity-list li {
  color: var(--text-secondary);
  background: rgba(217,119,6,0.08);
  border-color: rgba(217,119,6,0.25);
  border-left-color: rgba(217,119,6,0.7);
}
html[data-theme="light"] .ftest-sanity-list strong { color: #92400e; }
html[data-theme="light"] .ftest-confirm-no {
  border-color: rgba(19,16,58,0.16);
  color: var(--text-muted);
}
html[data-theme="light"] .ftest-confirm-no:hover {
  background: rgba(19,16,58,0.05);
  border-color: rgba(19,16,58,0.28);
  color: var(--text-primary);
}
html[data-theme="light"] .ftest-confirm-yes {
  background: rgba(217,119,6,0.12);
  border-color: rgba(217,119,6,0.4);
  color: #b45309;
}
html[data-theme="light"] .ftest-confirm-yes:hover {
  background: rgba(217,119,6,0.2);
  border-color: rgba(217,119,6,0.6);
  box-shadow: 0 0 14px rgba(217,119,6,0.2);
}
