/* ==========================================================================
   QUIET PROTECTOR v27.1 — VISUAL-FIRST DAY & NIGHT EDITORIAL MEMBER APP
   Clean consumer craft · Dual Daylight / Night OLED themes · Rich photography
   Zero side-stripes · Zero ghost-shadow+border combos · GPU-only motion
   ========================================================================== */

:root,
html[data-theme="day"] {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF1F5;
  --sidebar-bg: #FFFFFF;
  --topbar-bg: rgba(246, 247, 249, 0.88);
  --ink: #0F172A;
  --body: #334155;
  --muted: #526074;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --accent: #EA580C;
  --accent-hover: #D44B07;
  --accent-ink: #C2410C;
  --accent-soft: rgba(234, 88, 12, 0.10);
  --btn-bg: #C9480D;
  --btn-hover: #B8400A;
  --btn-ink: #FFFFFF;
  --ok: #15803D;
  --ok-bright: #16A34A;
  --ok-soft: rgba(22, 163, 74, 0.10);
  --danger: #DC2626;
  --danger-ink: #B91C1C;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --attention: #D97706;
  --ring-track: rgba(15, 23, 42, 0.10);
  --overlay: rgba(15, 23, 42, 0.56);
  --card-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  --photo-shadow: 0 4px 8px rgba(15, 23, 42, 0.10);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --z-sticky: 30;
  --z-nav: 40;
  --z-modal: 60;
  --z-toast: 70;
  --z-lantern: 80;
  color-scheme: light;
}

html[data-theme="night"] {
  --bg: #0A0D13;
  --surface: #131823;
  --surface-2: #1B2231;
  --sidebar-bg: #0D1119;
  --topbar-bg: rgba(10, 13, 19, 0.88);
  --ink: #F8FAFC;
  --body: #CBD5E1;
  --muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #F97316;
  --accent-hover: #FB923C;
  --accent-ink: #FDBA74;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --btn-bg: #F97316;
  --btn-hover: #FB923C;
  --btn-ink: #1A0C03;
  --ok: #4ADE80;
  --ok-bright: #22C55E;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --danger: #F87171;
  --danger-ink: #FCA5A5;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --attention: #FBBF24;
  --ring-track: rgba(255, 255, 255, 0.12);
  --overlay: rgba(2, 6, 14, 0.82);
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  --photo-shadow: 0 4px 8px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; }

body.mem-app {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out);
}

.page-title,
.hero-headline,
.sec-title {
  font-family: "Bricolage Grotesque", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

body.qp-night-vision {
  filter: sepia(1) hue-rotate(-52deg) saturate(2.5) brightness(0.62);
}

button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); }
.tnum { font-variant-numeric: tabular-nums; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */
@keyframes qpViewEnter {
  from { opacity: 0.01; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes qpCardRise {
  from { opacity: 0.01; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qpModalPop {
  from { opacity: 0.01; transform: translateY(16px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qpPulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.55; }
}

@keyframes qpEqBar {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(1); }
}

@keyframes qpCheckPop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes qpConfettiFall {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, 140px)) rotate(var(--rot, 240deg)) scale(0.4); opacity: 0; }
}

@keyframes qpBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes qpFadeIn {
  from { opacity: 0.01; }
  to { opacity: 1; }
}

.view-stage {
  animation: qpViewEnter 280ms var(--ease-out) both;
}

/* Soft re-render: same markup, no replayed entrance */
.view-stage.no-enter,
.view-stage.no-enter .stagger-card {
  animation: none;
}

.subview-enter {
  animation: qpFadeIn 180ms ease-out both;
}

.bump {
  animation: qpBump 260ms var(--ease-out);
}

.stagger-card {
  animation: qpCardRise 340ms var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * 38ms);
}

/* Live Audio Equalizer Bars */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}
.eq-bars i {
  display: block;
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom center;
  animation: qpEqBar 760ms ease-in-out infinite;
}
.eq-bars i:nth-child(2) { animation-delay: 140ms; }
.eq-bars i:nth-child(3) { animation-delay: 280ms; }
.eq-bars i:nth-child(4) { animation-delay: 420ms; }

/* ==========================================================================
   APP SHELL (SLIM SIDEBAR + CLEAN TOPBAR + GENEROUS CANVAS)
   ========================================================================== */
.mem-shell {
  display: flex;
  min-height: 100vh;
}

.mem-sidebar {
  display: none;
  width: 244px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  gap: 10px;
  transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}

.sidebar-brand {
  padding: 2px 6px 14px;
}

.logo-crest-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="day"] .logo-crest-pill {
  background: transparent;
  border-color: transparent;
  padding-left: 2px;
}

.sidebar-logo-svg { height: 28px; width: auto; }
.mobile-logo-svg { height: 22px; width: auto; }

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sliding active-tab pill (desktop sidebar) */
.nav-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms var(--ease-expo), opacity 160ms ease;
}

.sidebar-nav.has-indicator .nav-indicator { opacity: 1; }
.sidebar-nav.has-indicator .nav-item.active { background: transparent; }

.nav-item {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--body);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item:active { transform: scale(0.98); }

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-theme-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.sidebar-theme-row .theme-switch {
  width: 100%;
}

.sidebar-theme-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  padding-left: 2px;
}

.sidebar-blackout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease;
}

.sidebar-blackout-btn:hover { transform: translateY(-1px); }
.sidebar-blackout-btn:active { transform: scale(0.98); }

/* ==========================================================================
   PROFILE CHROME (avatar + name; never plan, tier or renewal outside Account)
   ========================================================================== */
.avatar-circle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.avatar-circle svg { width: 14px; height: 14px; }
.avatar-circle.lg { width: 36px; height: 36px; font-size: 0.98rem; }
.avatar-circle.lg svg { width: 18px; height: 18px; }
.avatar-circle.xl { width: 54px; height: 54px; font-size: 1.35rem; }
.avatar-circle.xl svg { width: 26px; height: 26px; }

.needs-attention .avatar-circle::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--attention);
  border: 2px solid var(--surface);
}

.sidebar-profile-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

.sidebar-profile-card:hover { background: var(--accent-soft); }
.sidebar-profile-card:active { transform: scale(0.985); }

.sidebar-profile-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-profile-name {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-chev {
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   SLIDING DAY / NIGHT THEME TOGGLE
   ========================================================================== */
.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  user-select: none;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
  transition: transform 240ms var(--ease-out), background-color 240ms var(--ease-out);
  pointer-events: none;
}

html[data-theme="night"] .theme-switch-thumb {
  transform: translateX(100%);
  background: #253047;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.theme-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: color 180ms ease;
}

html[data-theme="day"] .theme-opt[data-set-theme="day"],
html[data-theme="night"] .theme-opt[data-set-theme="night"] {
  color: var(--ink);
}

.theme-switch.compact .theme-opt {
  padding: 4px 9px;
  min-height: 28px;
  font-size: 0.76rem;
}

/* ==========================================================================
   TOP BAR & MAIN CANVAS
   ========================================================================== */
.mem-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mem-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.offline-pill {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 700;
}

.offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-bright);
  animation: qpPulseDot 2.8s ease-in-out infinite;
}

.offline-pill.is-offline {
  display: inline-flex;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.offline-pill.is-offline .offline-dot {
  background: var(--accent);
}

.blackout-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  min-height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 120ms ease, background-color 160ms ease;
}

.blackout-pill-btn:active { transform: scale(0.96); }

.blackout-pill-btn.live-outage {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  min-height: 36px;
  max-width: 190px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 120ms ease;
}

.profile-pill:hover { background: var(--surface-2); }
.profile-pill:active { transform: scale(0.97); }

.profile-pill-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-only { display: none; }

.mem-content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 104px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   TYPOGRAPHY & CORE CONTROLS (BREATHABLE & PLAIN-SPEAKING)
   ========================================================================== */
.page-title {
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sec-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.sec-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 4px 0 0;
  max-width: 62ch;
}

.muted { color: var(--muted); font-size: 0.94rem; margin: 0; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  min-height: 48px;
  border-radius: 12px;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, transform 120ms ease;
}

.btn-primary:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.btn-soft:hover { background: var(--surface-2); }
.btn-soft:active { transform: scale(0.97); }

.btn-sm {
  padding: 7px 13px;
  min-height: 36px;
  font-size: 0.84rem;
  border-radius: 10px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.30);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease;
}

.btn-danger:active { transform: scale(0.97); }

.btn-round-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

.btn-round-audio:hover { background: var(--surface-2); }
.btn-round-audio:active { transform: scale(0.96); }
.btn-round-audio.playing {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--body);
}
.pill-tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill-tag.ok { background: var(--ok-soft); color: var(--ok); }
.pill-tag.danger { background: var(--danger-soft); color: var(--danger-ink); }

.surface-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.notice-strip.ok { background: var(--ok-soft); border-color: rgba(22, 163, 74, 0.25); color: var(--ink); }
.notice-strip.accent { background: var(--accent-soft); border-color: rgba(234, 88, 12, 0.28); color: var(--ink); }
.notice-strip.danger { background: var(--danger-soft); border-color: rgba(220, 38, 38, 0.30); color: var(--ink); }

/* First-visit Day vs Night Chooser Banner (compact on phones) */
.theme-chooser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-shadow);
  animation: qpCardRise 260ms var(--ease-out) both;
}

.theme-chooser-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.theme-chooser-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.theme-chooser-hint { display: none; }

.theme-chooser-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-choice-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease;
}

.theme-choice-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.theme-choice-card:active { transform: scale(0.97); }

/* ==========================================================================
   TODAY — GREETING BAR + CINEMATIC HERO + 5 PHOTO PILLARS + 6 PHOTO CRISIS
   ========================================================================== */
.today-greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.today-greeting-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-ring-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.mini-ring-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.hero-stage {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.hero-stage-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #111827;
}

.hero-stage-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 520ms var(--ease-out);
}

.hero-stage:hover .hero-stage-media img {
  transform: scale(1.035);
}

.hero-media-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(10, 14, 22, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-stage-body {
  padding: 24px 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero-kicker {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-ink);
}

.hero-headline {
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lead {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* 5 Visual Photo Pillars (Apple Fitness+ / Airbnb Story Cards) */
.pillar-photo-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 44%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pillar-photo-rail::-webkit-scrollbar { display: none; }

.pillar-photo-card {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #0F172A;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: var(--photo-shadow);
  transition: transform 240ms var(--ease-out);
}

.pillar-photo-card:hover { transform: translateY(-4px); }
.pillar-photo-card:active { transform: scale(0.975); }

.pillar-photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms var(--ease-out);
}

.pillar-photo-card:hover img { transform: scale(1.06); }

.pillar-photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.08) 34%, rgba(8, 12, 20, 0.86) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  gap: 6px;
}

.pillar-photo-title {
  color: #FFFFFF;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
}

.pillar-photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
}

.pillar-bar-track {
  width: 100%;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.pillar-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: var(--r-pill);
  background: #F97316;
  transform-origin: left center;
  transition: transform 420ms var(--ease-out);
}

.pillar-bar-fill.complete { background: #22C55E; }

/* 6 Photo-Backed Offline Crisis Cards (Zero Text Walls!) */
.crisis-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crisis-photo-card {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: #0F172A;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--photo-shadow);
  transition: transform 220ms var(--ease-out);
}

.crisis-photo-card:hover { transform: translateY(-3px); }
.crisis-photo-card:active { transform: scale(0.975); }

.crisis-photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 460ms var(--ease-out);
}

.crisis-photo-card:hover img { transform: scale(1.06); }

.crisis-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.16) 20%, rgba(8, 12, 20, 0.88) 100%);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crisis-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
}

.crisis-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F97316;
}
.crisis-photo-card.sev-red .crisis-dot { background: #EF4444; }
.crisis-photo-card.sev-emerald .crisis-dot { background: #22C55E; }

.crisis-photo-title {
  color: #FFFFFF;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.24;
}

/* ==========================================================================
   30-NIGHT ROADMAP — VISUAL PHOTO SERIES (ZERO TEXT-BOX MONOTONY!)
   ========================================================================== */
.week-tab-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.week-tab-bar::-webkit-scrollbar { display: none; }

.week-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.week-tab-btn:active { transform: scale(0.97); }
.week-tab-btn.active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 13px;
  min-height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.chip:hover { border-color: var(--border-strong); color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.night-photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.night-photo-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 220ms var(--ease-out), border-color 180ms ease;
}

.night-photo-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.night-photo-card:active { transform: scale(0.985); }
.night-photo-card.current { border-color: var(--accent); }
.night-photo-card.done { border-color: rgba(22, 163, 74, 0.40); }

.night-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0F172A;
}

.night-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 460ms var(--ease-out);
}

.night-photo-card:hover .night-card-media img { transform: scale(1.05); }

.night-badge-tl {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(10, 14, 22, 0.78);
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 700;
}

.night-badge-tr {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(10, 14, 22, 0.76);
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 700;
}

.night-photo-card.current .night-badge-tr { background: #C2410C; color: #FFFFFF; }
.night-photo-card.done .night-badge-tr,
.night-badge-tr.read { background: #15803D; color: #FFFFFF; }

.night-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.night-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--ink);
}

.night-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* Seasonal Photo Audio Tracks */
.season-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.season-card {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #0F172A;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--photo-shadow);
  transition: transform 220ms var(--ease-out);
}

.season-card:hover { transform: translateY(-4px); }
.season-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms var(--ease-out);
}
.season-card:hover img { transform: scale(1.05); }

.season-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.22) 10%, rgba(8, 12, 20, 0.88) 100%);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   VAULT & TOOLS (PHOTO CARDS + FRIENDLY STEPPER CALCULATORS)
   ========================================================================== */
.seg-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.seg-btn {
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

.vault-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.vault-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 220ms var(--ease-out), border-color 160ms ease;
}

.vault-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.vault-card:active { transform: scale(0.985); }

.vault-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0F172A;
}

.vault-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 460ms var(--ease-out);
}
.vault-card:hover .vault-card-media img { transform: scale(1.05); }

.vault-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vault-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.vault-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--ink);
}

/* Visual Tool Cards & Stepper Controls */
.tools-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tool-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.tool-banner {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: #0F172A;
}

.tool-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-banner-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.18) 0%, rgba(10, 14, 22, 0.84) 100%);
  padding: 18px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stepper-box {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stepper-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.stepper-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 100ms ease, background-color 140ms ease;
}
.step-btn:active { transform: scale(0.92); }
.step-btn:disabled { opacity: 0.38; cursor: default; transform: none; }

.step-val {
  display: inline-block;
  min-width: 2ch;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calc-stat {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calc-stat.accent { background: var(--accent-soft); }
.calc-stat.ok { background: var(--ok-soft); }
.calc-stat strong { font-size: 1.32rem; font-weight: 800; color: var(--ink); }

.watt-toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.watt-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}

.watt-chip:active { transform: scale(0.985); }
.watt-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.watt-chip .watt-w { font-size: 0.86rem; color: var(--muted); transition: color 160ms ease; }
.watt-chip.on .watt-w { color: var(--accent-ink); }

.v75-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.v75-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.v75-item.checked {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.35);
}
.v75-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--ok-bright);
  flex-shrink: 0;
}

/* ==========================================================================
   EMERGENCY CARD — LIVE VISUAL FRIDGE PREVIEW + CLEAN INPUTS
   ========================================================================== */
.em-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.em-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

.em-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--body);
  margin-bottom: 6px;
}

.em-input,
.setup-select {
  width: 100%;
  padding: 12px 14px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.96rem;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.em-input::placeholder { color: var(--muted); opacity: 1; }

/* One-tap "use my drill note" chip under a blank field */
.field-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 10px;
  min-height: 28px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}
.field-hint-chip:hover { background: var(--accent-soft); }
.field-hint-chip:active { transform: scale(0.97); }
.field-hint-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Saved drill notes list */
.notes-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notes-list.collapsed .note-row:nth-child(n+5) { display: none; }
.note-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 0.86rem;
  color: var(--body);
  line-height: 1.4;
}
.note-row .pill-tag { flex-shrink: 0; margin-top: 1px; }
.note-row strong { color: var(--ink); }
.note-row-text { min-width: 0; }
.em-input:focus, .setup-select:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.fridge-preview-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.fridge-preview-photo {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.fridge-preview-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fridge-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.fridge-line:last-child { border-bottom: 0; padding-bottom: 0; }
.fridge-line span { color: var(--muted); font-weight: 600; }
.fridge-line strong { color: var(--ink); text-align: right; }

.em-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.valve-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.valve-photo-tile {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.valve-photo-tile img { width: 100%; height: 88px; object-fit: cover; }
.valve-photo-cap {
  padding: 6px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Photo manager: delete control on each tile (tap twice to confirm) */
.valve-photo-del {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 0;
  background: rgba(10, 14, 22, 0.78);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background-color 140ms ease, transform 120ms ease;
}
.valve-photo-del:active { transform: scale(0.94); }
.valve-photo-del.confirm { background: #B91C1C; }

.em-photos {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.em-photos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.em-photo-labels { margin-top: 10px; }
.em-photo-labels .chip { min-height: 32px; padding: 5px 11px; font-size: 0.78rem; }
.em-photos-empty {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ==========================================================================
   ACCOUNT & RECEIPTS (ZERO MOBILE CLIPPING)
   ========================================================================== */
.sub-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.sub-meta-box {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-meta-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.plan-switch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

.plan-switch-btn {
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 120ms ease;
}

.plan-switch-btn:active { transform: scale(0.985); }
.plan-switch-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.invoice-table-wrap { display: none; width: 100%; overflow-x: auto; margin-top: 12px; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.invoice-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.invoice-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--body);
}

.invoice-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.invoice-mobile-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Profile & Home Summary (Account) */
.profile-summary-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.profile-summary-top .sec-title { font-size: 1.15rem; }
.profile-summary-top .muted {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-name-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.profile-name-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-name-fields .em-input { flex: 1; min-width: 170px; }

/* Hardware Orders */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.order-row strong { display: block; color: var(--ink); font-size: 0.94rem; }
.order-row .pill-tag { flex-shrink: 0; }

/* Discreet collapsible Membership & Billing drawer inside Profile */
.billing-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.billing-toggle-row:hover .billing-toggle-action { color: var(--ink); }
.billing-toggle-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 150ms ease;
}
.billing-chev {
  display: inline-block;
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 200ms var(--ease-out);
}
.billing-toggle-row[aria-expanded="true"] .billing-chev { transform: rotate(90deg); }
.billing-details-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.billing-details-body[hidden] { display: none; }
.billing-receipts-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.btn-quiet-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.btn-quiet-cancel:hover {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--danger-soft);
}

/* ==========================================================================
   v28.0 HABIT RHYTHM, ACTIVE-RECALL REFLEX CHECK, MILESTONES & GAP-TO-GEAR
   ========================================================================== */
.habit-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.habit-rhythm-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.week-rhythm-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rhythm-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rhythm-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rhythm-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  transition: transform 180ms var(--ease-out), background-color 180ms ease, border-color 180ms ease;
}

.rhythm-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.rhythm-dot.grace {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.rhythm-dot.today {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.rhythm-dot.today.done {
  background: var(--ok-bright);
  border-color: var(--ok-bright);
  color: #FFFFFF;
}

.habit-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.habit-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

.habit-pill-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.habit-pill-btn:active { transform: scale(0.97); }
.habit-pill-sub { font-weight: 600; color: var(--muted); }

/* Active-Recall 10-Second Reflex Check inside Drill Player */
.reflex-q {
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 14px;
}

.reflex-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reflex-opt {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}

.reflex-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.reflex-opt:active:not(:disabled) { transform: scale(0.99); }
.reflex-opt:disabled { cursor: default; }

.reflex-opt-key {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
}

.reflex-opt.correct {
  border-color: var(--ok-bright);
  background: var(--ok-soft);
}
.reflex-opt.correct .reflex-opt-key {
  background: var(--ok-bright);
  border-color: var(--ok-bright);
  color: #FFFFFF;
}

.reflex-opt.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.reflex-opt.wrong .reflex-opt-key {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.reflex-feedback {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  animation: qpFadeIn 180ms ease-out both;
}
.reflex-feedback.ok { background: var(--ok-soft); color: var(--ink); border: 1px solid rgba(22, 163, 74, 0.35); }
.reflex-feedback.warn { background: var(--accent-soft); color: var(--ink); border: 1px solid rgba(234, 88, 12, 0.32); }

/* Milestones & Family Readiness Certificate Modal (Rich, Colorful, Tactile) */
.ms-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.ms-stat-tile {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-stat-tile.warm { background: var(--accent-soft); border-color: rgba(234, 88, 12, 0.25); }
.ms-stat-tile.fresh { background: var(--ok-soft); border-color: rgba(22, 163, 74, 0.28); }
.ms-stat-val {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.ms-stat-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.milestone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.milestone-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.milestone-tile.unlocked {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.40);
}

.milestone-medal {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(234, 88, 12, 0.20);
  font-size: 1.32rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
}
.milestone-tile.unlocked .milestone-medal {
  background: #15803D;
  border-color: #15803D;
  color: #FFFFFF;
}
.milestone-mini-track {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--ring-track);
  overflow: hidden;
  margin-top: 6px;
}
.milestone-mini-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transform-origin: left center;
}
.milestone-tile.unlocked .milestone-mini-fill { background: var(--ok-bright); }

.seal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.seal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}
.seal-chip.unlocked {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.42);
  color: var(--ok);
}

.cert-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid rgba(234, 88, 12, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.complete-stat-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.complete-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
}

/* Contextual Gap-to-Gear (Quiet, Non-Pushy, Auto-Hides When Owned) */
.v75-row-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.v75-row-wrap.checked {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.35);
}
.v75-row-label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink);
}
.v75-row-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--ok-bright);
  flex-shrink: 0;
}

.gear-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.gear-inline-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.v75-row-wrap.checked .gear-inline-link { display: none; }

.gear-opt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 160ms ease, transform 140ms var(--ease-out);
}
.gear-opt-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.gear-opt-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #FFFFFF;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.gear-opt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gear-opt-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.gear-opt-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.gear-opt-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.gear-shelf-box {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.gear-shelf-box[hidden] { display: none; }

.gear-shelf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.calc-gear-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--body);
}
.calc-gear-strip[hidden] { display: none; }

.profile-xp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

@media (min-width: 640px) {
  .milestone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gear-shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   MODALS, DRILL TIMER RING, BLACKOUT CONSOLE & CELEBRATION CONFETTI
   ========================================================================== */
.mem-modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.mem-modal-root[hidden] { display: none; }

.modal-panel {
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 24px;
  position: relative;
  animation: qpModalPop 240ms var(--ease-out) both;
}

.modal-panel.wide { max-width: 780px; }

.modal-panel.blackout-dark {
  max-width: 780px;
  background: #0C1018;
  color: #F8FAFC;
  border-color: rgba(239, 68, 68, 0.42);
  --surface: #131926;
  --surface-2: #1A2232;
  --ink: #F8FAFC;
  --body: #CBD5E1;
  --muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --accent: #F97316;
  --accent-hover: #FB923C;
  --accent-ink: #FDBA74;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --btn-bg: #F97316;
  --btn-hover: #FB923C;
  --btn-ink: #1A0C03;
  --ok: #4ADE80;
  --ok-bright: #22C55E;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --danger: #F87171;
  --danger-ink: #FCA5A5;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --ring-track: rgba(255, 255, 255, 0.12);
}

/* Pillar detail (interactive 5-pillar completion) */
.pillar-bar-track.lg { height: 8px; margin: 12px 0 16px; }
.pillar-night-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.pillar-night-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}
.pillar-night-row:hover { border-color: var(--border-strong); }
.pillar-night-row:active { transform: scale(0.99); }
.pillar-night-row.done { background: var(--ok-soft); border-color: rgba(22, 163, 74, 0.35); }
.pillar-night-row.next { border-color: var(--accent); }
.pillar-night-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 800;
}
.pillar-night-row.done .pillar-night-check { background: #15803D; border-color: #15803D; }
.pillar-night-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
.pillar-night-text .night-no { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.pillar-night-min { font-size: 0.78rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.step-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.step-dot {
  width: 24px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  transition: background-color 220ms ease;
}
.step-dot.done { background: var(--ok-bright); }
.step-dot.active { background: var(--accent); }

/* Animated Radial Drill Timer */
.drill-timer-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 16px;
}

.drill-ring-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drill-ring-svg {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.drill-task-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 120ms ease;
}

.drill-task-row:active { transform: scale(0.99); }
.drill-task-row.checked {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.42);
}

.drill-task-row input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--ok-bright);
  flex-shrink: 0;
}

.drill-task-row.checked input { animation: qpCheckPop 260ms var(--ease-out); }

.outage-clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.outage-clock-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #141B29;
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.outage-clock-card.warn { border-color: rgba(249, 115, 22, 0.55); }
.outage-clock-card.crit { border-color: rgba(239, 68, 68, 0.72); background: rgba(239, 68, 68, 0.14); }

.lantern-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-lantern);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 20px;
  background: #FFB347;
  transition: background-color 240ms ease;
}
.lantern-screen.bright { background: #FFF8EB; }
.lantern-screen.red-light { background: #991B1B; }

.qp-confetti-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
}

.qp-confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: qpConfettiFall 900ms var(--ease-expo) forwards;
}

/* Mobile Bottom Nav */
.mem-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

/* Sliding pill behind the active mobile tab icon */
.bnav-indicator {
  position: absolute;
  top: 7px;
  left: 0;
  width: 48px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms var(--ease-expo), opacity 160ms ease;
}
.mem-bottom-nav.has-indicator .bnav-indicator { opacity: 1; }

.bnav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, transform 120ms ease;
}
.bnav-item:active { transform: scale(0.92); }
.bnav-item.active { color: var(--accent-ink); }

/* Toast: centered above the bottom nav on phones, bottom-right on desktop; never catches taps */
.qp-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: max-content;
  margin: 0 auto;
  z-index: var(--z-toast);
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
  animation: qpModalPop 200ms var(--ease-out) both;
}
html[data-theme="night"] .qp-toast {
  background: #F8FAFC;
  color: #0F172A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & SPACIOUS DESKTOP)
   ========================================================================== */
/* Phones: icon-only Day/Night switch in the top bar so nothing clips at 360px */
@media (max-width: 479px) {
  .theme-switch.compact .theme-opt span { display: none; }
  .theme-switch.compact .theme-opt { padding: 4px 11px; gap: 0; }
  .blackout-pill-btn { padding: 7px 10px; }
  .mem-topbar { padding: 10px 14px; }
}

@media (min-width: 640px) {
  .mem-content { padding: 28px 28px 96px; gap: 36px; }
  .theme-chooser-bar { padding: 14px 18px; gap: 14px; }
  .theme-chooser-hint { display: inline; font-size: 0.86rem; color: var(--muted); }
  .crisis-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .night-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .vault-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .season-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stepper-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .calc-results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .watt-toggle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v75-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-switch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .invoice-table-wrap { display: block; }
  .invoice-mobile-list { display: none; }
}

@media (min-width: 1024px) {
  .mem-sidebar { display: flex; }
  .mem-bottom-nav, .mobile-only { display: none !important; }
  .desktop-only { display: inline-flex; }
  .offline-pill { display: inline-flex; }
  .mem-topbar { padding: 14px 36px; }
  .mem-content { padding: 34px 42px 68px; gap: 42px; }
  .hero-stage { grid-template-columns: 1.25fr 1fr; min-height: 360px; }
  .hero-stage-media { aspect-ratio: auto; min-height: 360px; }
  .hero-stage-body { padding: 34px 36px; }
  .pillar-photo-rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-columns: auto;
    overflow: visible;
    gap: 16px;
  }
  .night-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .vault-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .em-layout { grid-template-columns: 1.25fr 0.85fr; gap: 28px; }
  .qp-toast { left: auto; right: 28px; bottom: 28px; margin: 0; max-width: 420px; }
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   16PT HIGH-CONTRAST BLACK-ON-WHITE FRIDGE PRINT SHEET
   ========================================================================== */
.print-fridge-sheet { display: none; }

@media print {
  @page { margin: 0.45in; }
  html, body { background: #FFFFFF !important; color: #000000 !important; filter: none !important; }
  .mem-shell, .mem-bottom-nav, .mem-modal-root, .qp-toast, .lantern-screen { display: none !important; }
  .print-fridge-sheet {
    display: block !important;
    color: #000000 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16pt !important;
    line-height: 1.42 !important;
  }
  .print-box {
    border: 2pt solid #000000 !important;
    padding: 12pt 14pt !important;
    margin-bottom: 12pt !important;
    page-break-inside: avoid;
  }
  .print-page-break { page-break-before: always; }
  .print-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; }
  .print-wallet-card {
    border: 1.5pt dashed #000000 !important;
    padding: 9pt 11pt !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
  }
}
