/* ============================================================================
   rooms-help.css — "Need Help?" pill + guided tutorial modal for the Rooms tab
   Glass / dark-cosmic aesthetic, violet/cyan accents. Baseline 1440px.
   ========================================================================== */

/* ── Trigger pill (lives in the Rooms table toolbar) ──────────────────────── */
.rooms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rooms-help-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d8d3ff;
  background: linear-gradient(135deg, rgba(124,58,237,0.26), rgba(56,189,248,0.18));
  border: 1px solid rgba(167,139,250,0.5);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.rooms-help-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,0.85);
  box-shadow: 0 4px 18px rgba(124,58,237,0.32);
  color: #fff;
}
.rooms-help-pill svg { color: #c4b5fd; }

/* ── Overlay + modal ──────────────────────────────────────────────────────── */
.rh-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 16, 0.74);
  backdrop-filter: blur(10px) saturate(1.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.rh-overlay.active { opacity: 1; pointer-events: all; }

.rh-modal {
  width: min(940px, calc(100vw - 40px));
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(167,139,250,0.22);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(124,58,237,0.12), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(56,189,248,0.10), transparent 55%),
    rgba(10, 14, 28, 0.97);
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03) inset;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.rh-overlay.active .rh-modal { transform: translateY(0) scale(1); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.rh-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.rh-header-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  color: #c4b5fd;
  background: rgba(167,139,250,0.14);
  border: 1px solid rgba(167,139,250,0.4);
}
.rh-header-txt { flex: 1 1 auto; min-width: 0; }
.rh-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(167,139,250,0.85);
}
.rh-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px; font-weight: 600; color: #f1f5fb; margin: 2px 0 0;
}
.rh-close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  color: rgba(203,213,225,0.8);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}
.rh-close:hover { background: rgba(248,113,113,0.16); border-color: rgba(248,113,113,0.5); color: #fca5a5; }

/* ── Body: nav | content ──────────────────────────────────────────────────── */
.rh-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
}
.rh-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 10px;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
}
.rh-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: rgba(203,213,225,0.78);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rh-nav-btn:hover { background: rgba(255,255,255,0.05); color: #e9e3ff; }
.rh-nav-btn.is-active {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(56,189,248,0.14));
  border-color: rgba(167,139,250,0.5);
  color: #fff;
}
.rh-nav-ic { flex-shrink: 0; opacity: 0.85; }

.rh-content {
  padding: 22px 26px 28px;
  overflow-y: auto;
  min-height: 0;
}

/* ── Content typography ───────────────────────────────────────────────────── */
.rh-h {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 18px; font-weight: 600; color: #f1f5fb; margin: 0 0 12px;
}
.rh-p { font-size: 13.5px; line-height: 1.6; color: rgba(203,213,225,0.86); margin: 0 0 14px; }
.rh-p b { color: #f1f5fb; font-weight: 600; }
.rh-muted { color: rgba(148,163,184,0.72); font-size: 12.5px; }

.rh-fn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700; font-style: italic;
  color: #c4b5fd; background: rgba(167,139,250,0.16); border: 1px solid rgba(167,139,250,0.45);
  vertical-align: -3px;
}

/* Callout box */
.rh-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px; margin: 4px 0 16px;
  border-radius: 12px;
  background: rgba(56,189,248,0.07);
  border: 1px solid rgba(56,189,248,0.22);
  font-size: 13px; line-height: 1.55; color: rgba(203,213,225,0.9);
}
.rh-callout-ic { color: #7dd3fc; flex-shrink: 0; margin-top: 1px; }
.rh-callout b { color: #f1f5fb; }
.rh-flash-chip {
  background: rgba(56,189,248,0.2); border-radius: 5px; padding: 1px 6px;
  color: #bae6fd; font-weight: 600; animation: rh-flash 1.6s ease-in-out infinite;
}
@keyframes rh-flash { 0%,100% { background: rgba(56,189,248,0.1); } 50% { background: rgba(56,189,248,0.32); } }

/* Anatomy list (overview) */
.rh-anat { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rh-anat-row {
  display: flex; align-items: center; gap: 11px;
  font-size: 13px; color: rgba(203,213,225,0.85);
  padding: 9px 13px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
}
.rh-anat-row b { color: #f1f5fb; }
.rh-anat-tag {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #c4b5fd;
  background: rgba(167,139,250,0.16); border: 1px solid rgba(167,139,250,0.4);
}

/* The 3 views */
.rh-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.rh-view-card {
  border-radius: 12px; padding: 13px 14px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-top: 3px solid var(--vc, rgba(148,163,184,0.5));
}
.rh-view-raw     { --vc: #94a3b8; }
.rh-view-initial { --vc: #38bdf8; }
.rh-view-final   { --vc: #34d399; }
.rh-view-hd { font-size: 13.5px; font-weight: 700; color: #f1f5fb; margin-bottom: 6px; }
.rh-view-bd { font-size: 12px; line-height: 1.5; color: rgba(203,213,225,0.78); }

/* System demo */
.rh-sysdemo { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.rh-sys {
  font-size: 12px; font-weight: 500; padding: 6px 13px; border-radius: 999px;
  color: rgba(203,213,225,0.82); background: rgba(30,41,59,0.55);
  border: 1px solid rgba(148,163,184,0.22);
}
.rh-sys.is-on {
  background: linear-gradient(135deg, rgba(124,58,237,0.4), rgba(56,189,248,0.24));
  border-color: rgba(167,139,250,0.7); color: #fff;
}
.rh-sys-off { opacity: 0.5; display: inline-flex; align-items: center; gap: 6px; }
.rh-sys-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(148,163,184,0.7); }
.rh-mini { padding: 3px 9px; font-size: 11px; vertical-align: middle; }
.rh-legend-line {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; color: rgba(203,213,225,0.85); margin-bottom: 9px;
}
.rh-legend-line b { color: #f1f5fb; }

/* Colors & badges legend grid */
.rh-legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rh-legend-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.rh-legend-vis {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; border-radius: 9px;
  background: rgba(8,12,26,0.6); border: 1px solid rgba(255,255,255,0.05);
}
.rh-legend-txt { font-size: 12.5px; line-height: 1.5; color: rgba(203,213,225,0.82); }
.rh-legend-txt b { color: #f1f5fb; }
.rh-th-demo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: #c4b5fd;
  padding: 6px 12px; border-radius: 6px;
  box-shadow: inset 0 -2px 0 rgba(167,139,250,0.55);
  background: rgba(167,139,250,0.06);
}
.rh-cell-demo {
  font-family: 'Space Grotesk', monospace; font-size: 16px; font-weight: 600;
  padding: 6px 16px; border-radius: 6px;
}
.rh-cell-demo.rh-oor { color: #fb7185; background: rgba(251,113,133,0.1); }
.rh-cell-demo.rh-blank { color: rgba(148,163,184,0.55); background: rgba(148,163,184,0.06); }
.rh-window-demo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #7dd3fc;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.32);
}

/* Input flow */
.rh-flow { display: flex; align-items: stretch; gap: 12px; margin-bottom: 12px; }
.rh-flow-sec { margin-top: 4px; }
.rh-flow-step {
  flex: 1 1 0; min-width: 0;
  padding: 13px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid color-mix(in srgb, var(--fc) 38%, transparent);
  border-top: 3px solid var(--fc);
}
.rh-flow-num {
  width: 24px; height: 24px; border-radius: 7px; margin-bottom: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #0b1020;
  background: var(--fc);
}
.rh-flow-title { font-size: 13.5px; font-weight: 700; color: #f1f5fb; margin-bottom: 4px; }
.rh-flow-body { font-size: 12px; line-height: 1.5; color: rgba(203,213,225,0.78); }
.rh-flow-arrow { display: flex; align-items: center; color: rgba(148,163,184,0.6); flex-shrink: 0; }

/* pH analytics definitions */
.rh-defs { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.rh-def {
  display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 14px; align-items: start;
  padding: 11px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
}
.rh-def-term {
  font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  color: #c4b5fd;
}
.rh-def-body { font-size: 12.5px; line-height: 1.5; color: rgba(203,213,225,0.82); }
.rh-def-body b { color: #f1f5fb; }

/* ── "The math" section ───────────────────────────────────────────────────── */
.rh-h-sub { font-size: 15px; margin: 22px 0 10px; }
.rh-mathblock {
  padding: 14px; margin-bottom: 12px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.rh-math-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px; font-weight: 700; color: #c4b5fd; margin-bottom: 11px;
}
.rh-math-from { font-weight: 500; color: rgba(148,163,184,0.7); font-size: 12px; }
.rh-formula {
  display: flex; align-items: stretch; gap: 9px; flex-wrap: wrap; margin-bottom: 10px;
}
.rh-op {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 13px; border-radius: 9px; min-width: 78px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  color: rgba(203,213,225,0.78);
  background: rgba(8,12,26,0.55); border: 1px solid rgba(255,255,255,0.08);
}
.rh-op i {
  font-style: normal; font-family: 'Space Grotesk', monospace;
  font-size: 18px; font-weight: 700; color: #f1f5fb;
}
.rh-op-a { border-left: 2px solid #38bdf8; }
.rh-op-b { border-left: 2px solid #94a3b8; }
.rh-opx {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: rgba(148,163,184,0.85); min-width: 18px;
}
.rh-eq {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 9px; min-width: 64px;
  font-family: 'Space Grotesk', monospace; font-size: 20px; font-weight: 700;
}
.rh-eq-pos { color: #fca5a5; background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.35); }
.rh-eq-neg { color: #fca5a5; background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.35); }
.rh-math-plain { font-size: 12.5px; line-height: 1.5; color: rgba(203,213,225,0.78); }

/* Trend three-cell */
.rh-trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.rh-trend-cell {
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  padding: 10px 8px; border-radius: 10px; text-align: center;
  background: rgba(8,12,26,0.5); border: 1px solid rgba(255,255,255,0.07);
}
.rh-trend-cell b { font-size: 13px; color: #f1f5fb; }
.rh-trend-cell span { font-size: 11px; color: rgba(148,163,184,0.78); font-variant-numeric: tabular-nums; }
.rh-trend-rise { border-top: 2px solid #34d399; }
.rh-trend-flat { border-top: 2px solid #94a3b8; }
.rh-trend-fall { border-top: 2px solid #fb7185; }

/* Crash test cards */
.rh-tests { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.rh-test {
  padding: 12px 14px; border-radius: 11px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.rh-test-hd { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: #f1f5fb; margin-bottom: 7px; }
.rh-test-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: #fca5a5;
  background: rgba(251,113,133,0.14); border: 1px solid rgba(251,113,133,0.4);
}
.rh-test-rule {
  font-family: 'Space Grotesk', monospace; font-size: 12.5px; font-weight: 600; color: #fcd34d;
  background: rgba(251,191,36,0.08); border-radius: 6px; padding: 5px 9px; margin-bottom: 7px;
}
.rh-test-plain { font-size: 11.5px; line-height: 1.5; color: rgba(203,213,225,0.74); }

/* Severity chips */
.rh-sev { display: flex; flex-direction: column; gap: 8px; }
.rh-sev-chip {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px; border-radius: 10px; font-size: 12.5px;
}
.rh-sev-chip b { font-size: 13.5px; flex-shrink: 0; min-width: 64px; }
.rh-sev-chip span { color: rgba(203,213,225,0.82); }
.rh-sev-minor    { background: rgba(56,189,248,0.08);  border: 1px solid rgba(56,189,248,0.3); }
.rh-sev-minor b    { color: #7dd3fc; }
.rh-sev-major    { background: rgba(251,191,36,0.09);  border: 1px solid rgba(251,191,36,0.36); }
.rh-sev-major b    { color: #fcd34d; }
.rh-sev-critical { background: rgba(251,113,133,0.1);  border: 1px solid rgba(251,113,133,0.4); }
.rh-sev-critical b { color: #fca5a5; }

.rh-cell-demo.rh-inline { font-size: 12px; padding: 1px 8px; vertical-align: middle; }

/* ── FAQ accordion ────────────────────────────────────────────────────────── */
.rh-faq { display: flex; flex-direction: column; gap: 9px; }
.rh-faq-item {
  border-radius: 11px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.rh-faq-item[open] { border-color: rgba(167,139,250,0.4); background: rgba(167,139,250,0.05); }
.rh-faq-q {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  font-size: 13.5px; font-weight: 600; color: #e9eef7;
  cursor: pointer; list-style: none; user-select: none;
}
.rh-faq-q::-webkit-details-marker { display: none; }
.rh-faq-q > span { flex: 1 1 auto; }
.rh-faq-q:hover { color: #fff; }
.rh-faq-chev { flex-shrink: 0; color: rgba(167,139,250,0.9); transition: transform 0.2s ease; }
.rh-faq-item[open] .rh-faq-chev { transform: rotate(180deg); }
.rh-faq-a {
  padding: 0 15px 14px;
  font-size: 13px; line-height: 1.6; color: rgba(203,213,225,0.85);
}
.rh-faq-a p { margin: 0 0 9px; }
.rh-faq-a p:last-child { margin-bottom: 0; }
.rh-faq-a b { color: #f1f5fb; font-weight: 600; }
.rh-faq-checks { margin: 0 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.rh-faq-checks li {
  position: relative; padding-left: 24px; font-size: 12.5px; line-height: 1.5;
}
.rh-faq-checks li::before {
  content: ''; position: absolute; left: 4px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5 5-5.5' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat,
    rgba(52,211,153,0.14);
  border: 1px solid rgba(52,211,153,0.4);
}

/* Mini Initial→Final flow */
.rh-mini-flow { display: inline-flex; align-items: center; gap: 9px; margin-top: 4px; }
.rh-mini-step {
  font-size: 12px; font-weight: 700; color: #f1f5fb;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(8,12,26,0.5); border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--fc);
}
.rh-mini-arrow { color: rgba(148,163,184,0.7); font-size: 16px; }

/* Clock chip */
.rh-clock-chip {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  font-size: 12px; font-weight: 600; color: #c4b5fd;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.35);
}

/* ── Reflows ──────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .rh-body { grid-template-columns: 1fr; }
  .rh-nav {
    flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .rh-nav-btn { width: auto; }
  .rh-views, .rh-legend-grid, .rh-tests { grid-template-columns: 1fr; }
  .rh-flow { flex-direction: column; }
  .rh-flow-arrow { transform: rotate(90deg); align-self: center; }
  .rh-def { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .rh-flash-chip { animation: none; }
  .rh-modal { transition: none; }
}
