/* NeuroVital — Design System Dark Neural Premium */
:root {
  --bg: #070b14;
  --bg-elev: #0d1424;
  --bg-card: #111a2e;
  --bg-input: #0a1020;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(56, 189, 248, 0.35);
  --text: #eef4ff;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --cyan-strong: #0ea5e9;
  --emerald: #34d399;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --rose: #fb7185;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 12% 8%, #101c38 0%, var(--bg) 52%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.92rem; }
code {
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.86em;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- AUTH SCREEN ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.auth-brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-brand p { margin: 2px 0 0; color: var(--cyan); font-size: 0.88rem; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form h2 { margin: 0; font-size: 1.2rem; }

.form-error {
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* ---------- LAYOUT SHELL ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(11, 17, 32, 0.92);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}
.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand span { font-size: 0.78rem; color: var(--cyan); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.16s ease;
}
.nav-item:hover {
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(167, 139, 250, 0.14));
  border-color: var(--border-strong);
  color: #fff;
}
.nav-icon { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.live-clock-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.live-clock {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}
.live-date { font-size: 0.78rem; color: var(--muted); }

/* ---------- MAIN CONTENT ---------- */
.main-content {
  padding: 26px 32px 60px;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; flex-direction: column; gap: 22px; }
.view.active { display: flex; }

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.view-header h1 { margin: 0 0 4px; font-size: 1.65rem; letter-spacing: -0.02em; }

.header-actions, .date-picker-box, .btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- CARDS & FORMS ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-header-row h2, .card-header-row h3 { margin: 0; }
.card-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 8px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
}

.checkbox-card {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}
.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  cursor: pointer;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
  color: #fff;
  text-decoration: none !important;
}
.btn:hover { opacity: 0.92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 12px; font-size: 0.84rem; border-radius: 8px; }
.btn-full { width: 100%; }

.btn-primary { background: linear-gradient(135deg, var(--cyan-strong), #2563eb); }
.btn-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.btn-violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.btn-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: #0f172a; font-weight: 800; }
.btn-danger { background: linear-gradient(135deg, #e11d48, #be123c); }
.btn-outline {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--border-strong);
  color: var(--cyan);
}
.btn-ghost {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
}
.badge-cyan { background: rgba(56, 189, 248, 0.18); color: var(--cyan); }
.badge-emerald { background: rgba(52, 211, 153, 0.18); color: var(--emerald); }
.badge-amber { background: rgba(251, 191, 36, 0.18); color: var(--amber); }
.badge-violet { background: rgba(167, 139, 250, 0.18); color: var(--violet); }
.badge-rose { background: rgba(251, 113, 133, 0.18); color: var(--rose); }

/* ---------- DASHBOARD HERO ---------- */
.grid-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}

.score-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  align-items: center;
}

.score-ring-wrap {
  position: relative;
  width: 164px;
  height: 164px;
  margin: 0 auto;
}
.score-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(148, 163, 184, 0.16); stroke-width: 11; }
.ring-fg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}
.score-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-big { font-size: 2.3rem; font-weight: 800; line-height: 1; }
.score-max { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }

.pillars-breakdown { display: flex; flex-direction: column; gap: 12px; }
.pillar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill { height: 100%; width: 0%; border-radius: 999px; transition: width 0.4s ease; }
.c-cyan { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.c-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.c-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.c-violet { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

.next-activity-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.next-activity-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.next-act-time {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 6px;
}
.next-act-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

.mini-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.mini-stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.mini-stat span { display: block; font-size: 0.72rem; color: var(--muted); }
.mini-stat strong { font-size: 1.05rem; color: #fff; }

/* ---------- DAILY FORM ---------- */
.form-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.form-group-box {
  background: rgba(10, 16, 32, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.form-group-box h3 { margin: 0 0 12px; font-size: 1rem; color: var(--cyan); }
.fields-grid { display: flex; flex-direction: column; gap: 10px; }
.notes-field { margin-top: 16px; }

/* ---------- SLEEP CYCLES ---------- */
.sleep-cycles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.sleep-pill {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.sleep-pill.recommended {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
}
.sleep-pill strong { display: block; font-size: 1.35rem; color: #fff; }
.sleep-pill span { font-size: 0.8rem; color: var(--muted); }

/* ---------- TIMERS & AGENDA ---------- */
.timers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.timer-card { text-align: center; }
.timer-display {
  font-size: 3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin: 6px 0;
  color: #fff;
}
.timer-sub { color: var(--muted); margin-bottom: 14px; font-size: 0.92rem; }
.timer-controls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.schedule-groups { display: flex; flex-direction: column; gap: 18px; }
.period-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 0 0 10px;
}
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-row {
  display: grid;
  grid-template-columns: auto 105px 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color 0.15s ease;
}
.schedule-row.done {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.07);
}
.schedule-row.done .sch-title { text-decoration: line-through; color: var(--muted); }
.sch-check {
  width: 22px;
  height: 22px;
  accent-color: var(--emerald);
  cursor: pointer;
}
.sch-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  font-size: 0.92rem;
}
.sch-title { font-weight: 700; font-size: 0.98rem; }
.sch-meta { font-size: 0.84rem; color: var(--muted); margin-top: 2px; }
.sch-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- FRACTALS PLAYER & GALLERY ---------- */
.fractal-player-card { display: flex; flex-direction: column; gap: 16px; }
.fractal-stage-wrap {
  position: relative;
  width: 100%;
  height: 440px;
  background: #020308;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fractal-stage-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.8s linear, transform 1s ease;
}
.breath-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.breath-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(7, 11, 20, 0.62);
  border: 3px solid rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 3.8s ease-in-out, border-color 0.4s ease;
}
.breath-circle.inhale { transform: scale(1.38); border-color: #38bdf8; }
.breath-circle.hold { transform: scale(1.38); border-color: #a78bfa; }
.breath-circle.exhale { transform: scale(0.82); border-color: #34d399; }
.breath-circle span { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.breath-circle strong { font-size: 2.2rem; }

.stage-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.control-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

.fractals-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.fractal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fractal-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
}
.fractal-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.fractal-card-body h4 { margin: 0; font-size: 0.98rem; }
.fractal-card-body p { margin: 0; font-size: 0.84rem; color: var(--muted); flex: 1; }

/* ---------- COGNITIVE TESTS ---------- */
.test-cards-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}
.test-option-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}
.test-option-card.featured {
  border-color: var(--border-strong);
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.14), rgba(10, 16, 32, 0.9));
}
.test-option-card h3 { margin: 0; font-size: 1.06rem; }

.test-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.test-dynamic-area {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 12px;
  text-align: center;
}
.nback-stimulus {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), rgba(15, 23, 42, 0.95));
  border: 2px solid var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.28);
}
.nback-feedback { min-height: 24px; font-weight: 700; font-size: 1rem; }
.nback-match-btn {
  padding: 16px 40px;
  font-size: 1.15rem;
  border-radius: 14px;
}

.recall-words-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.recall-word-chip {
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.5);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 700;
}

.stroop-word {
  font-size: 3.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.stroop-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.stroop-btn {
  min-width: 120px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
}

/* ---------- ANALYTICS ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.period-presets, .custom-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.custom-dates label { flex-direction: row; align-items: center; gap: 6px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.kpi-card span { display: block; font-size: 0.8rem; color: var(--muted); }
.kpi-card strong { display: block; font-size: 1.6rem; margin-top: 4px; }
.kpi-card small { font-size: 0.78rem; color: var(--cyan); }

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.insight-card {
  background: var(--bg-card);
  border-left: 4px solid var(--cyan);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.insight-card.action { border-left-color: var(--amber); }
.insight-card.success { border-left-color: var(--emerald); }
.insight-card h4 { margin: 0 0 6px; font-size: 0.96rem; }
.insight-card p { margin: 0; font-size: 0.86rem; color: var(--muted); }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.chart-card h3 { margin: 0 0 12px; font-size: 1rem; }
.chart-card canvas { width: 100%; height: auto; display: block; }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.data-table tr:hover td { background: rgba(56, 189, 248, 0.05); }

/* ---------- SETTINGS & GOOGLE ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
}
.settings-grid > * { min-width: 0; }
.stack-col, .stack-form { display: flex; flex-direction: column; gap: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.two-col > * { min-width: 0; }
.two-col input, .two-col select, .two-col textarea { width: 100%; max-width: 100%; box-sizing: border-box; }

.callout-box {
  background: rgba(14, 165, 233, 0.09);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}
.setup-accordion {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.setup-accordion summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.setup-steps {
  padding-left: 20px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sync-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sync-panel h4 { margin: 0; }
.google-events-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.g-ev-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

/* ---------- REMINDER BANNER, MODAL & TOAST ---------- */
.reminder-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.26), rgba(16, 185, 129, 0.18));
  border: 1px solid var(--cyan);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.reminder-banner p { margin: 3px 0 0; font-size: 0.88rem; color: var(--text); }
.reminder-banner-actions { display: flex; gap: 8px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 24px;
  max-height: 92vh;
  overflow-y: auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0f172a;
  border: 1px solid var(--cyan);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 200;
  font-size: 0.92rem;
  font-weight: 600;
}

.inline-select { flex-direction: row; align-items: center; gap: 8px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1120px) {
  .grid-hero, .form-sections, .charts-grid, .settings-grid, .test-cards-grid {
    grid-template-columns: 1fr;
  }
  .sleep-cycles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { white-space: nowrap; width: auto; }
  .sidebar-footer { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .main-content { padding: 18px 16px 40px; }
  .score-card { grid-template-columns: 1fr; }
  .timers-grid, .two-col { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: auto 1fr; }
}


/* ==================== V2 ADDITIONS ==================== */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-input);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.auth-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--cyan-strong), #2563eb);
  color: #fff;
}

input[type="email"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
}
input[type="email"]:focus { border-color: var(--cyan); }

/* Sidebar User Button + Avatar */
.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 13px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease;
}
.sidebar-user-btn:hover { background: rgba(56, 189, 248, 0.15); }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info strong {
  display: block;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info span {
  display: block;
  font-size: 0.76rem;
  color: var(--cyan);
}

.avatar-circle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  border: 2px solid var(--border-strong);
  overflow: hidden;
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg {
  width: 96px;
  height: 96px;
  min-width: 96px;
  font-size: 2.2rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--rose);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Barra do Assistente de Voz */
.voice-bar {
  background: linear-gradient(135deg, rgba(17, 26, 46, 0.95), rgba(30, 27, 75, 0.8));
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.voice-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.voice-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.voice-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}
.voice-dot.speaking {
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
  animation: pulseVoice 0.9s infinite ease-in-out;
}
@keyframes pulseVoice {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.55); opacity: 0.55; }
}

/* Sintetizador Neural nos Fractais */
.neural-wave-canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46px;
  width: 100%;
  height: 68px;
  pointer-events: none;
  opacity: 0.85;
}
.neural-audio-panel {
  margin-top: 12px;
  background: rgba(10, 16, 32, 0.85);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.neural-audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.volume-control {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}
.freq-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.freq-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}
.freq-btn:hover { border-color: var(--cyan); }
.freq-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(139, 92, 246, 0.2));
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}
.freq-btn strong { display: block; font-size: 0.92rem; }
.freq-btn span { display: block; font-size: 0.76rem; color: var(--muted); }

.freq-info-card {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
}
.freq-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.freq-info-card p { margin: 4px 0 10px; font-size: 0.9rem; color: #dbeafe; }
.freq-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.freq-info-grid strong { color: var(--emerald); }

/* WhatsApp QR Code */
.wa-qr-box {
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin: 12px 0;
}
.wa-qr-box img {
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 8px;
}
.wa-qr-box p { color: #334155 !important; margin: 10px 0 0; }

/* Mensagens */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.msg-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.msg-item.unread {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
}
.msg-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.msg-item p { margin: 0; font-size: 0.9rem; color: #cbd5e1; }

/* Avatar Presets */
.avatar-editor-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.avatar-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.avatar-preset-btn {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 0.78rem;
  transition: all 0.15s ease;
}
.avatar-preset-btn:hover, .avatar-preset-btn.active {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
}

@media (max-width: 820px) {
  .freq-info-grid, .avatar-presets-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ==================== V3: AVALIAÇÃO FÍSICA, MAPA ANATÔMICO, DIETAS & LAUDO PDF ==================== */
.subtabs-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.subtab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.subtab-btn.active {
  background: linear-gradient(135deg, rgba(14,165,233,0.28), rgba(16,185,129,0.2));
  border-color: var(--cyan);
  color: #fff;
}

.report-banner-card {
  background: linear-gradient(145deg, #0d1d3a, #111a2e 60%, #171535);
  border-color: var(--border-strong);
}
.report-banner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.report-banner-top h2 { margin: 4px 0; }

/* 3 Grandes Esferas Hero (Estilo Laudo Clínico) */
.hero-circles-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  text-align: center;
  padding-top: 8px;
}
.hero-circle-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero-orb {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  padding: 10px;
  text-align: center;
  line-height: 1.15;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.orb-lg { width: 130px; height: 130px; font-size: 2.5rem; }
.orb-coral { background: radial-gradient(circle at 30% 30%, #fb923c, #ea580c); }
.orb-cyan { background: radial-gradient(circle at 30% 30%, #2dd4bf, #0284c7); }
.orb-slate {
  background: radial-gradient(circle at 30% 30%, #64748b, #334155);
  font-size: 0.92rem;
}

/* Barras Tricoloridas Baixo | Normal | Alto */
.tri-header {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 1fr;
  gap: 4px;
  background: rgba(14, 165, 233, 0.16);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: var(--cyan);
  margin-bottom: 10px;
}
.tri-header span:first-child { text-align: left; }

.tri-bars-list { display: flex; flex-direction: column; gap: 11px; }
.tri-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}
.tri-label strong { display: block; font-size: 0.86rem; }
.tri-label small { display: block; font-size: 0.72rem; color: var(--muted); }
.tri-track {
  position: relative;
  height: 12px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
}
.tri-fill { height: 100%; border-radius: 999px; }
.tri-fill.low { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.tri-fill.normal { background: linear-gradient(90deg, #10b981, #34d399); }
.tri-fill.high { background: linear-gradient(90deg, #f59e0b, #fb7185); }
.tri-val-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 3px;
  color: var(--muted);
}
.tri-val-line strong { color: #fff; font-size: 0.84rem; }

.weight-control-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.wc-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 8px;
  text-align: center;
}
.wc-box strong { display: block; font-size: 1.35rem; color: var(--cyan); }
.wc-box span { font-size: 0.76rem; color: var(--muted); }

/* Mapa Anatômico SVG + Análise Segmental */
.segmental-layout {
  display: grid;
  grid-template-columns: 1fr 195px 1fr;
  gap: 12px;
  align-items: center;
}
.seg-col { display: flex; flex-direction: column; gap: 10px; }
.seg-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
}
.seg-card strong { display: block; color: var(--cyan); margin-bottom: 4px; font-size: 0.84rem; }
.seg-line { display: flex; justify-content: space-between; color: #cbd5e1; }

.anatomy-svg-wrap { display: flex; justify-content: center; }
.anatomy-svg { width: 185px; height: auto; filter: drop-shadow(0 0 18px rgba(56,189,248,0.18)); }
.body-zone {
  stroke: rgba(255,255,255,0.45);
  stroke-width: 1.6;
  cursor: pointer;
  transition: opacity 0.16s ease, filter 0.16s ease;
}
.body-zone:hover { opacity: 0.88; filter: brightness(1.25); }
.zone-otimo { fill: rgba(16, 185, 129, 0.72); }
.zone-bom { fill: rgba(56, 189, 248, 0.65); }
.zone-atencao { fill: rgba(245, 158, 11, 0.72); }
.zone-prioridade { fill: rgba(244, 63, 94, 0.78); }

/* Postura com Grade Sobreposta */
.posture-photo-wrap {
  position: relative;
  min-height: 180px;
  max-height: 310px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.posture-photo-wrap img {
  max-height: 310px;
  max-width: 100%;
  object-fit: contain;
}
.posture-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(56,189,248,0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56,189,248,0.28) 1px, transparent 1px);
  background-size: 50% 25%;
  background-position: center;
}
.posture-plumb-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(52, 211, 153, 0.85);
  pointer-events: none;
}

/* Câmera & Galeria de Fotos Corporais */
.cam-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--cyan);
}
.cam-box video { width: 100%; display: block; }
.cam-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(56,189,248,0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56,189,248,0.35) 1px, transparent 1px);
  background-size: 33.33% 25%;
}

.body-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.body-photo-thumb {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  font-size: 0.74rem;
}
.body-photo-thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.body-photo-thumb .thumb-foot {
  padding: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Comparador Antes x Depois (Cortina) */
.compare-stage {
  position: relative;
  width: 100%;
  height: 390px;
  background: #020612;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.cmp-before-clip {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 3px solid var(--cyan);
}
.cmp-before-clip img {
  width: 200%;
  max-width: none;
}
.cmp-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
}

@media (max-width: 960px) {
  .segmental-layout { grid-template-columns: 1fr; }
  .hero-circles-row { grid-template-columns: 1fr; }
  .weight-control-grid { grid-template-columns: repeat(2, 1fr); }
}

/* IMPRESSÃO DE LAUDO CLÍNICO EM PDF */
@media print {
  body { background: #ffffff !important; color: #0f172a !important; }
  .sidebar, .voice-bar, .view-header, .subtabs-bar, .no-print, .reminder-banner, .toast { display: none !important; }
  .app-shell { display: block !important; }
  .main-content { padding: 0 !important; max-width: 100% !important; }
  .card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 14px;
  }
  .muted, .tri-label small, .tri-val-line { color: #475569 !important; }
  .tri-val-line strong, .seg-line, .wc-box strong { color: #0f172a !important; }
  .wc-box, .seg-card, .callout-box { background: #f8fafc !important; border-color: #cbd5e1 !important; }
}


/* ==================== V3.1: ESTÚDIO FOTOGRÁFICO CORPORAL (TIMER, AUTO-FOCO & FUNDO) ==================== */
.body-focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.focus-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.focus-chip:hover {
  border-color: var(--cyan);
  color: #fff;
}
.focus-chip.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(16, 185, 129, 0.22));
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
}

.cam-focus-frame {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 6%;
  bottom: 6%;
  border: 2px dashed rgba(52, 211, 153, 0.9);
  border-radius: 14px;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.cam-focus-frame span {
  background: rgba(7, 11, 20, 0.82);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.cam-countdown {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 36px rgba(56, 189, 248, 0.95);
  z-index: 6;
  animation: countdownPop 0.9s infinite ease-out;
}
@keyframes countdownPop {
  0% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.cam-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 9;
  pointer-events: none;
}

.photo-preview-box {
  margin-top: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.photo-preview-box img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 10px;
  background-image:
    linear-gradient(45deg, #1e293b 25%, transparent 25%),
    linear-gradient(-45deg, #1e293b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e293b 75%),
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}


/* ==================== V3.3: MANUAL INTERATIVO POR ÍNDICE & PESQUISA ==================== */
.manual-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.manual-search-bar input {
  flex: 1;
  min-width: 240px;
}
.manual-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}
.manual-toc-card {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.manual-toc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.manual-toc-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.manual-toc-btn:hover, .manual-toc-btn.active {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.14);
  color: #fff;
}
.toc-num {
  background: rgba(56, 189, 248, 0.2);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}
.manual-chapter-card { display: flex; flex-direction: column; gap: 12px; }
.manual-sec {
  background: rgba(10, 16, 32, 0.6);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
}
.manual-sec h4 { margin: 0 0 8px; color: var(--cyan); font-size: 0.96rem; }
.manual-sec p { margin: 0 0 8px; color: #dbeafe; font-size: 0.9rem; }
.manual-sec ul { margin: 4px 0 0; padding-left: 18px; color: #cbd5e1; font-size: 0.88rem; }
.manual-sec li { margin-bottom: 6px; }
.manual-hl {
  background: rgba(251, 191, 36, 0.35);
  color: #fff;
  padding: 0 3px;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc-card { position: static; max-height: none; }
}


/* ==================== V4: CLÍNICA, ANAMNESE, WHATSAPP PRO & MODO TOTEM ==================== */
.wapro-chat-log {
  background: #060b16;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  height: 290px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.4;
}
.wa-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(14, 165, 233, 0.22));
  border: 1px solid rgba(52, 211, 153, 0.45);
}
.wa-bubble.in {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.wa-bubble-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}

.totem-active .sidebar { display: none !important; }
.totem-active .app-shell { grid-template-columns: 1fr !important; }
.totem-active .main-content { max-width: 100% !important; padding: 14px 22px !important; }
.totem-hud-bar {
  background: linear-gradient(135deg, #064e3b, #0c4a6e);
  border: 2px solid #34d399;
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- CENTRAL DE EXERCÍCIOS & TREINOS GUIADOS (V5) ---------- */
.wk-modalities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.wk-mod-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.wk-mod-card:hover {
  transform: translateY(-2px);
  border-color: var(--mod-accent, var(--cyan));
}
.wk-mod-card.active {
  border-color: var(--mod-accent, var(--cyan));
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25), 0 12px 26px rgba(0, 0, 0, 0.35);
}
.wk-mod-img-wrap {
  position: relative;
  height: 126px;
  overflow: hidden;
  background: #070d1a;
}
.wk-mod-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.wk-mod-card:hover .wk-mod-img-wrap img { transform: scale(1.04); }
.wk-mod-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(6, 12, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.wk-mod-body {
  padding: 12px 14px;
}
.wk-mod-body strong { display: block; font-size: 0.98rem; margin-bottom: 4px; }
.wk-mod-body p { margin: 0; font-size: 0.8rem; line-height: 1.38; }

.wk-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.wk-toolbar input[type="text"] {
  flex: 1;
  min-width: 240px;
}
.wk-level-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wk-muscle-index {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.wk-exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}
.wk-ex-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wk-ex-thumb {
  position: relative;
  height: 148px;
  cursor: pointer;
  overflow: hidden;
  background: #070d1a;
}
.wk-ex-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.wk-ex-thumb:hover img { transform: scale(1.04); opacity: 1; }
.wk-ex-play-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(14, 165, 233, 0.92);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.wk-ex-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.wk-ex-lvl-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: 9px;
  margin-top: auto;
  color: #e2e8f0;
}

/* Guided Workout Player */
.wk-progress-wrap { margin-top: 12px; }
.wk-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 5px;
}
.wk-guided-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(300px, 1fr);
  gap: 16px;
}
.wk-video-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #050a14;
  aspect-ratio: 16 / 10;
}
.wk-stage-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  filter: blur(1px);
}
.wk-anim-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}
.wk-video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(6, 12, 26, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}
.wk-video-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.wk-rest-box {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.55);
}
.wk-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.wk-metrics-strip > div {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.wk-metrics-strip span { display: block; font-size: 0.72rem; color: var(--muted); }
.wk-metrics-strip strong { font-size: 0.96rem; color: var(--cyan); }

.wk-steps-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.wk-step-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 11px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.wk-step-pill > span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.18);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.wk-step-pill.active {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
}
.wk-step-pill.done {
  border-color: var(--emerald);
}
.wk-step-pill.done > span {
  background: var(--emerald);
  color: #022c22;
}
.wk-step-pill strong { display: block; font-size: 0.84rem; }
.wk-step-pill small { color: var(--muted); font-size: 0.74rem; }

/* Modal Wide & Report AI Workout Mini-Grid */
.modal-card-wide {
  max-width: 940px !important;
  width: 96% !important;
  max-height: 92vh;
  overflow-y: auto;
}
.wk-modal-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
}
.wk-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.wk-mini-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

@media (max-width: 860px) {
  .wk-guided-grid,
  .wk-modal-grid {
    grid-template-columns: 1fr;
  }
  .wk-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- SCANNER DE DISTÂNCIA & POSTURA 33 PONTOS + IMPORTADOR BIOIMPEDÂNCIA ---------- */
.scan-pose-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.scan-distance-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
}
.scan-distance-hud.ok {
  background: rgba(6, 78, 59, 0.92);
  border-color: #34d399;
  color: #ecfdf5;
}
.scan-distance-hud.warn {
  background: rgba(120, 53, 15, 0.92);
  border-color: #fbbf24;
  color: #fffbeb;
}
.scan-distance-hud.bad {
  background: rgba(136, 19, 55, 0.92);
  border-color: #fb7185;
  color: #fff1f2;
}
.scan-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.scan-metric-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.scan-metric-chip span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.scan-metric-chip strong {
  font-size: 0.96rem;
  color: var(--emerald);
}

/* ---------- OCULTAR MENU LATERAL + ESTÚDIO EM ABAS + CÂMERA GRANDE ALINHADA ---------- */
.app-shell.sidebar-collapsed {
  grid-template-columns: 1fr;
}
.app-shell.sidebar-collapsed .sidebar {
  display: none;
}

.studio-split-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.15fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.cam-box-large {
  aspect-ratio: 16 / 10;
  min-height: 320px;
  max-height: 540px;
  background: #050a14;
}
.cam-box-large video {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  display: block;
}
@media (max-width: 980px) {
  .studio-split-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- PLAYER DE CÂMERA ESTILO YOUTUBE (POPUP TEATRO / MINI PIP / TELA CHEIA) ---------- */
.cam-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1180;
}

.cam-box.cam-mode-theater {
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1360px);
  height: min(86vh, 840px);
  max-height: 86vh !important;
  aspect-ratio: auto !important;
  z-index: 1200;
  border-radius: 18px;
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
  background: #020617;
}

.cam-box.cam-mode-mini {
  position: fixed !important;
  right: 18px;
  bottom: 18px;
  width: 380px;
  max-width: 92vw;
  height: 238px;
  min-height: 220px !important;
  max-height: 260px !important;
  z-index: 1200;
  border-radius: 14px;
  border: 1.5px solid rgba(52, 211, 153, 0.6);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
  background: #020617;
}
.cam-box.cam-mode-mini .cam-yt-ptz,
.cam-box.cam-mode-mini #yt-btn-autoscan,
.cam-box.cam-mode-mini #yt-btn-scanner,
.cam-box.cam-mode-mini #cam-focus-label {
  display: none;
}

.cam-box:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000;
}

.cam-rec-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(159, 18, 57, 0.92);
  border: 1px solid rgba(251, 113, 133, 0.8);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: recPulse 1s infinite ease-in-out;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.cam-yt-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 12px 10px;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.78) 65%, rgba(2, 6, 23, 0) 100%);
  backdrop-filter: blur(4px);
}
.cam-yt-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.yt-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.76);
  color: #f1f5f9;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}
.yt-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}
.yt-btn.yt-icon {
  padding: 6px 8px;
  min-width: 30px;
  text-align: center;
}
.yt-btn.active {
  background: rgba(14, 165, 233, 0.88);
  border-color: #38bdf8;
  color: #fff;
}
.yt-btn-primary {
  background: rgba(14, 165, 233, 0.85);
  border-color: #38bdf8;
  color: #fff;
}
.yt-btn-emerald {
  background: rgba(16, 185, 129, 0.85);
  border-color: #34d399;
  color: #022c22;
}
.yt-btn-rec {
  background: rgba(190, 18, 60, 0.75);
  border-color: rgba(251, 113, 133, 0.75);
  color: #fff;
}
.yt-btn-rec.recording {
  background: #e11d48;
  border-color: #fda4af;
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.75);
}
.yt-btn-danger {
  background: rgba(153, 27, 27, 0.78);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fff;
}

/* Mantém o rótulo de foco acima da barra inferior YouTube */
.cam-box .cam-focus-frame {
  bottom: 58px !important;
}

/* ---------- LIGHTBOX POPUP UNIFICADO (FOTOS + VÍDEOS + NAVEGAÇÃO) ---------- */
.lb-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lb-modal.hidden { display: none !important; }

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.lb-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-filter-tabs {
  display: flex;
  gap: 6px;
}

.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 64px;
  overflow: hidden;
}
.lb-media-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.lb-img {
  max-width: 86vw;
  max-height: 70vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  transition: transform 0.2s ease;
  cursor: zoom-in;
}
.lb-img.zoomed {
  transform: scale(1.75);
  transform-origin: center center;
  cursor: zoom-out;
}
.lb-video {
  max-width: 86vw;
  max-height: 70vh;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}
.lb-posture-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 12px;
  background-image:
    linear-gradient(to right, rgba(52, 211, 153, 0.9) 2px, transparent 2px),
    linear-gradient(to right, rgba(56, 189, 248, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.28) 1px, transparent 1px);
  background-position: center center, 0 0, 0 0;
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-repeat: no-repeat, repeat, repeat;
}
.lb-posture-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.lb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 46px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lb-nav-arrow:hover {
  background: rgba(14, 165, 233, 0.85);
  transform: translateY(-50%) scale(1.06);
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  align-items: center;
}
.lb-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 78px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0b1220;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.lb-thumb.active {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
}
.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lb-thumb-vid {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e0f2fe;
  font-size: 0.68rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e1b4b, #0c4a6e);
}
.body-photo-thumb img {
  cursor: zoom-in;
}
