@import url('./outfit.css');
/* Inter font import removed – using native system stack and self‑hosted Outfit */
/*
 * Global Design Standards v2.1 base layer (CEO-approved 2026-10-22).
 * Loaded after main.css. Additive only: tokens, focus, press, motion and hit-area rules.
 */
:root {
  /* 🌟 Surface & Canvas Semantic Tokens (Light Mode Default) */
  --canvas-ground: #f8fafc;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-hairline: rgba(0, 0, 0, 0.04);
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  
  /* 👑 Brand Identity (Daytime: Royal Heritage Crimson) */
  --brand-primary: #a31621;
  --brand-primary-hover: #8a1019;
  --brand-primary-rgb: 163, 22, 33;
  --brand-primary-glow: rgba(163, 22, 33, 0.16);
  --brand-primary-gradient: linear-gradient(135deg, #a31621 0%, #8a1019 100%);
  
  /* 🌟 Secondary Accents (Celebration Gold) */
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --accent-gold-rgb: 245, 158, 11;
  
  /* 🪟 Navigation Chrome */
  --nav-frosted-bg: rgba(255, 255, 255, 0.88);
  --nav-border: rgba(0, 0, 0, 0.08);

  /* Typography Scale */
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-2xl: 1.75rem;
  --text-display: 2.5rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --motion-fast: 150ms;
  --motion-base: 250ms;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --tap-min: 44px;
  --text-muted-aa: #475569; /* 7.6:1 on white */
  --card-bg: #ffffff;
  --text-color: #0f172a;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --hover-color: #f1f5f9;
}

/* 🌙 Super Premium Dark Theme & Brand Colour Luminance Inversion */
body.dark-mode:not(.public-layout):not([data-surface="light"]),
body.dark-theme:not(.public-layout):not([data-surface="light"]),
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) {
  /* Neutral OLED-Black & Elevated Charcoal Surfaces */
  --canvas-ground: #000000;
  --surface-card: #141416;
  --surface-elevated: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-hairline: rgba(255, 255, 255, 0.06);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted-aa: #cbd5e1; /* 11.4:1 on #141416 (WCAG AAA) */
  --card-bg: #141416;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.12);
  --hover-color: #1e293b;
  
  /* 💎 Brand Identity Inversion (Night-time: High-Contrast Luminous Rose Ruby) */
  /* Contrast ratio jumps from 2.19:1 (Failing) to 6.8:1 (Passing WCAG AAA on #141416) */
  --brand-primary: #ff4d61;
  --brand-primary-hover: #ff6b7d;
  --brand-primary-rgb: 255, 77, 97;
  --brand-primary-glow: rgba(255, 77, 97, 0.28);
  --brand-primary-gradient: linear-gradient(135deg, #ff4d61 0%, #e11d48 100%);
  
  /* 🏆 Cartier Heritage Gold Accent (Warm Luxury) */
  --accent-gold: #fbbf24;
  --accent-gold-light: rgba(251, 191, 36, 0.15);
  --accent-gold-rgb: 251, 191, 36;
  
  /* 🪟 Navigation Chrome */
  --nav-frosted-bg: rgba(20, 20, 22, 0.88);
  --nav-border: rgba(255, 255, 255, 0.09);
  
  color-scheme: dark;
}

body.dark-mode:not(.public-layout):not([data-surface="light"]),
body.dark-theme:not(.public-layout):not([data-surface="light"]),
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) {
  background-color: var(--canvas-ground, #000000) !important;
  color: var(--text-main, #f8fafc) !important;
}

body.dark-mode:not(.public-layout):not([data-surface="light"]) .card,
body.dark-mode:not(.public-layout):not([data-surface="light"]) .post-composer,
body.dark-mode:not(.public-layout):not([data-surface="light"]) .profile-card,
body.dark-mode:not(.public-layout):not([data-surface="light"]) .modal-content,
body.dark-theme:not(.public-layout):not([data-surface="light"]) .card,
body.dark-theme:not(.public-layout):not([data-surface="light"]) .post-composer,
body.dark-theme:not(.public-layout):not([data-surface="light"]) .profile-card,
body.dark-theme:not(.public-layout):not([data-surface="light"]) .modal-content,
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) .card,
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) .post-composer,
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) .profile-card,
[data-bs-theme="dark"]:not(.public-layout):not([data-surface="light"]) .modal-content {
  background-color: var(--surface-card, #141416) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
}

/* 🌙 Global Dark-Mode Typography & Surface Contrast Guarantees (WCAG AA/AAA) */
body.dark-mode .text-dark:not(.bg-warning):not(.btn-warning):not(.bg-warning-subtle):not(.bg-info):not(.bg-light):not(.surface-light):not([data-surface="light"]):not(.badge-warning):not(.badge-light):not(.badge-info):not(.badge-white):not([data-theme="light"]):not(.badge.bg-warning):not(.badge.bg-light):not(.badge.bg-info):not(.badge.bg-white),
body.dark-theme .text-dark:not(.bg-warning):not(.btn-warning):not(.bg-warning-subtle):not(.bg-info):not(.bg-light):not(.surface-light):not([data-surface="light"]):not(.badge-warning):not(.badge-light):not(.badge-info):not(.badge-white):not([data-theme="light"]):not(.badge.bg-warning):not(.badge.bg-light):not(.badge.bg-info):not(.badge.bg-white),
[data-bs-theme="dark"] .text-dark:not(.bg-warning):not(.btn-warning):not(.bg-warning-subtle):not(.bg-info):not(.bg-light):not(.surface-light):not([data-surface="light"]):not(.badge-warning):not(.badge-light):not(.badge-info):not(.badge-white):not([data-theme="light"]):not(.badge.bg-warning):not(.badge.bg-light):not(.badge.bg-info):not(.badge.bg-white),
body.dark-mode .text-body:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]),
body.dark-theme .text-body:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]),
[data-bs-theme="dark"] .text-body:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]),
body.dark-mode .text-black:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]),
body.dark-theme .text-black:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]),
[data-bs-theme="dark"] .text-black:not(.bg-warning):not(.btn-warning):not(.surface-light):not([data-surface="light"]) {
  color: var(--text-main, #f8fafc) !important;
}

/* Preserve dark legibility on solid amber/yellow & cyan warning surfaces and light surfaces */
body.dark-mode :is(.bg-warning, .btn-warning, .bg-warning-subtle, .bg-info, .btn-info, .bg-info-subtle, .surface-light, [data-surface="light"], .badge-warning, .badge-info) :is(.text-dark, .text-black, strong, b, h1, h2, h3, h4, h5, h6),
body.dark-mode .badge:is(.bg-warning, .bg-info).text-dark,
body.dark-mode .badge:is(.bg-warning, .bg-info) .text-dark,
body.dark-theme :is(.bg-warning, .btn-warning, .bg-warning-subtle, .bg-info, .btn-info, .bg-info-subtle, .surface-light, [data-surface="light"], .badge-warning, .badge-info) :is(.text-dark, .text-black, strong, b, h1, h2, h3, h4, h5, h6),
body.dark-theme .badge:is(.bg-warning, .bg-info).text-dark,
body.dark-theme .badge:is(.bg-warning, .bg-info) .text-dark,
[data-bs-theme="dark"] :is(.bg-warning, .btn-warning, .bg-warning-subtle, .bg-info, .btn-info, .bg-info-subtle, .surface-light, [data-surface="light"], .badge-warning, .badge-info) :is(.text-dark, .text-black, strong, b, h1, h2, h3, h4, h5, h6),
[data-bs-theme="dark"] .badge:is(.bg-warning, .bg-info).text-dark,
[data-bs-theme="dark"] .badge:is(.bg-warning, .bg-info) .text-dark {
  color: #0f172a !important;
}

/* 🛡️ Olutobi Permanent Safeguard: Light Surface Shield against Dark-Mode Text Inversion */
body.dark-mode .surface-light,
body.dark-theme .surface-light,
[data-bs-theme="dark"] .surface-light,
body.dark-mode [data-surface="light"],
body.dark-theme [data-surface="light"],
[data-bs-theme="dark"] [data-surface="light"],
body.dark-mode .bg-warning-subtle,
body.dark-theme .bg-warning-subtle,
[data-bs-theme="dark"] .bg-warning-subtle,
body.dark-mode .bg-light-subtle,
body.dark-theme .bg-light-subtle,
[data-bs-theme="dark"] .bg-light-subtle {
  color: #0f172a !important;
}

body.dark-mode .surface-light :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
body.dark-theme .surface-light :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
[data-bs-theme="dark"] .surface-light :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
body.dark-mode [data-surface="light"] :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
body.dark-theme [data-surface="light"] :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
[data-bs-theme="dark"] [data-surface="light"] :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold, .h1, .h2, .h3, .h4, .h5, .h6),
body.dark-mode .bg-warning-subtle :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold),
body.dark-theme .bg-warning-subtle :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold),
[data-bs-theme="dark"] .bg-warning-subtle :is(h1, h2, h3, h4, h5, h6, strong, b, .text-dark, .fw-bold) {
  color: #0f172a !important;
}

body.dark-mode .surface-light :is(p, span, label, small, .text-muted, .text-secondary),
body.dark-theme .surface-light :is(p, span, label, small, .text-muted, .text-secondary),
[data-bs-theme="dark"] .surface-light :is(p, span, label, small, .text-muted, .text-secondary),
body.dark-mode [data-surface="light"] :is(p, span, label, small, .text-muted, .text-secondary),
body.dark-theme [data-surface="light"] :is(p, span, label, small, .text-muted, .text-secondary),
[data-bs-theme="dark"] [data-surface="light"] :is(p, span, label, small, .text-muted, .text-secondary),
body.dark-mode .bg-warning-subtle :is(p, span, label, small, .text-muted, .text-secondary),
body.dark-theme .bg-warning-subtle :is(p, span, label, small, .text-muted, .text-secondary),
[data-bs-theme="dark"] .bg-warning-subtle :is(p, span, label, small, .text-muted, .text-secondary) {
  color: #475569 !important;
}

body.dark-mode .text-muted,
body.dark-theme .text-muted,
[data-bs-theme="dark"] .text-muted,
body.dark-mode .form-text,
body.dark-theme .form-text,
[data-bs-theme="dark"] .form-text {
  color: #cbd5e1 !important;
}

body.dark-mode .text-secondary,
body.dark-theme .text-secondary,
[data-bs-theme="dark"] .text-secondary {
  color: #cbd5e1 !important;
}

body.dark-mode .form-label,
body.dark-theme .form-label,
[data-bs-theme="dark"] .form-label,
body.dark-mode .col-form-label,
body.dark-theme .col-form-label,
[data-bs-theme="dark"] .col-form-label {
  color: #f1f5f9 !important;
}

/* Dark-Mode Surface Inversion for Bootstrap Utility Backgrounds */
body.dark-mode .bg-white:not(.bg-opacity-25):not(.badge),
body.dark-theme .bg-white:not(.bg-opacity-25):not(.badge),
[data-bs-theme="dark"] .bg-white:not(.bg-opacity-25):not(.badge) {
  background-color: var(--surface-card, #141416) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
}

body.dark-mode .bg-light,
body.dark-mode .bg-body-tertiary,
body.dark-mode .bg-body-secondary,
body.dark-theme .bg-light,
body.dark-theme .bg-body-tertiary,
body.dark-theme .bg-body-secondary,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body-tertiary,
[data-bs-theme="dark"] .bg-body-secondary {
  background-color: var(--surface-elevated, #1e293b) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.dark-mode .badge.bg-light,
body.dark-mode .badge.bg-white,
body.dark-theme .badge.bg-light,
body.dark-theme .badge.bg-white,
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-white {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* 🔍 Form Controls, Select Options & Input Group Addons in Dark Mode */
body.dark-mode select option,
body.dark-theme select option,
[data-bs-theme="dark"] select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

body.dark-mode .input-group-text,
body.dark-theme .input-group-text,
[data-bs-theme="dark"] .input-group-text {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

/* 🌙 Modal & Header Dark Mode Contrast Overrides */
body.dark-mode #familyFlyerModal .modal-header,
[data-bs-theme="dark"] #familyFlyerModal .modal-header {
  background: linear-gradient(135deg, #272210 0%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
}
body.dark-mode #familyFlyerModal .modal-title,
[data-bs-theme="dark"] #familyFlyerModal .modal-title {
  color: #f8fafc !important;
}
body.dark-mode #familyFlyerModal .modal-header .text-muted,
[data-bs-theme="dark"] #familyFlyerModal .modal-header .text-muted {
  color: #cbd5e1 !important;
}

body.dark-mode #lineageQuestModal .modal-header,
[data-bs-theme="dark"] #lineageQuestModal .modal-header {
  background: linear-gradient(135deg, #062a1b 0%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25) !important;
}
body.dark-mode #lineageQuestModal .modal-title,
body.dark-mode #lineageQuestModal h6.text-dark,
[data-bs-theme="dark"] #lineageQuestModal .modal-title,
[data-bs-theme="dark"] #lineageQuestModal h6.text-dark {
  color: #f8fafc !important;
}

body.dark-mode .capsule-message-box,
[data-bs-theme="dark"] .capsule-message-box {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-mode .kin-guarantee-title,
[data-bs-theme="dark"] .kin-guarantee-title {
  color: #4ade80 !important;
}

/* Subtle Semantic Badges & Alerts in Dark Mode */
body.dark-mode .bg-danger-subtle,
body.dark-theme .bg-danger-subtle,
[data-bs-theme="dark"] .bg-danger-subtle {
  background-color: rgba(225, 29, 72, 0.22) !important;
  color: #fecdd3 !important;
  border-color: rgba(244, 63, 94, 0.38) !important;
}

body.dark-mode .bg-danger-subtle.text-danger,
body.dark-mode .bg-danger-subtle .text-danger,
body.dark-theme .bg-danger-subtle.text-danger,
body.dark-theme .bg-danger-subtle .text-danger,
[data-bs-theme="dark"] .bg-danger-subtle.text-danger,
[data-bs-theme="dark"] .bg-danger-subtle .text-danger {
  color: #fecdd3 !important;
}

body.dark-mode .bg-success-subtle,
body.dark-theme .bg-success-subtle,
[data-bs-theme="dark"] .bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #86efac !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-mode .bg-success-subtle.text-success,
body.dark-mode .bg-success-subtle .text-success,
body.dark-theme .bg-success-subtle.text-success,
body.dark-theme .bg-success-subtle .text-success,
[data-bs-theme="dark"] .bg-success-subtle.text-success,
[data-bs-theme="dark"] .bg-success-subtle .text-success {
  color: #86efac !important;
}

body.dark-mode .bg-warning-subtle,
body.dark-theme .bg-warning-subtle,
[data-bs-theme="dark"] .bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

body.dark-mode .bg-warning-subtle.text-warning,
body.dark-mode .bg-warning-subtle .text-warning,
body.dark-mode .bg-warning-subtle .text-dark,
body.dark-theme .bg-warning-subtle.text-warning,
body.dark-theme .bg-warning-subtle .text-warning,
body.dark-theme .bg-warning-subtle .text-dark,
[data-bs-theme="dark"] .bg-warning-subtle.text-warning,
[data-bs-theme="dark"] .bg-warning-subtle .text-warning,
[data-bs-theme="dark"] .bg-warning-subtle .text-dark {
  color: #fde68a !important;
}

body.dark-mode .bg-primary-subtle,
body.dark-theme .bg-primary-subtle,
[data-bs-theme="dark"] .bg-primary-subtle,
body.dark-mode .bg-info-subtle,
body.dark-theme .bg-info-subtle,
[data-bs-theme="dark"] .bg-info-subtle {
  background-color: rgba(59, 130, 246, 0.2) !important;
  color: #bfdbfe !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

body.dark-mode .bg-primary-subtle.text-primary,
body.dark-mode .bg-primary-subtle .text-primary,
body.dark-theme .bg-primary-subtle.text-primary,
body.dark-theme .bg-primary-subtle .text-primary,
[data-bs-theme="dark"] .bg-primary-subtle.text-primary,
[data-bs-theme="dark"] .bg-primary-subtle .text-primary {
  color: #bfdbfe !important;
}

/* Semantic Status Text Luminance Boost on Dark Surfaces */
body.dark-mode .text-danger:not(.btn):not(.bg-danger),
body.dark-theme .text-danger:not(.btn):not(.bg-danger),
[data-bs-theme="dark"] .text-danger:not(.btn):not(.bg-danger) {
  color: #fb7185 !important;
}

body.dark-mode .text-success:not(.btn):not(.bg-success),
body.dark-theme .text-success:not(.btn):not(.bg-success),
[data-bs-theme="dark"] .text-success:not(.btn):not(.bg-success) {
  color: #4ade80 !important;
}

body.dark-mode .text-primary:not(.btn):not(.bg-primary),
body.dark-theme .text-primary:not(.btn):not(.bg-primary),
[data-bs-theme="dark"] .text-primary:not(.btn):not(.bg-primary) {
  color: #60a5fa !important;
}

/* Dark-Mode Form Controls & Inputs (Shared Across All Member Views) */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text,
body.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .form-control,
body.dark-theme .form-select,
body.dark-theme .input-group-text,
[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder,
body.dark-mode .form-control::placeholder,
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder,
body.dark-theme .form-control::placeholder,
[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder,
[data-bs-theme="dark"] .form-control::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* =====================================================================
 * 🛡️ Public Layout & Light Surface Ghost Typography Invariant Shield
 * Guarantees zero white-on-white / zero dark-on-dark contrast failures
 * across all public marketing and authentication pages.
 * ===================================================================== */
body.public-layout,
body[data-surface="light"],
body.surface-light,
.public-layout,
[data-surface="light"] {
  --canvas-ground: #f8fafc !important;
  --surface-card: #ffffff !important;
  --surface-elevated: #ffffff !important;
  --border-subtle: rgba(0, 0, 0, 0.07) !important;
  --border-hairline: rgba(0, 0, 0, 0.04) !important;
  --text-main: #0f172a !important;
  --text-secondary: #475569 !important;
  --text-tertiary: #94a3b8 !important;
  --text-muted: #475569 !important;
  --text-muted-aa: #475569 !important;
  --card-bg: #ffffff !important;
  --text-color: #0f172a !important;
  color-scheme: light !important;
}

body.public-layout,
body.dark-mode.public-layout,
body.dark-mode[data-surface="light"],
body.dark-theme[data-surface="light"],
[data-bs-theme="dark"][data-surface="light"] {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* Explicit Form Label & Input Contrast on Light Surfaces / Auth Containers */
body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-label, .col-form-label, label),
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-label, .col-form-label, label),
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-label, .col-form-label, label),
.public-layout :is(.form-label, .col-form-label, label),
.stitch-auth-container :is(.form-label, .col-form-label, label) {
  color: #374151 !important;
}

body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, .form-select, input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea),
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, .form-select, input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea),
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, .form-select, input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea),
.public-layout :is(.form-control, .form-select),
.stitch-auth-container :is(.form-control, .form-select) {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #d1d5db !important;
}

body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, input, textarea)::placeholder,
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, input, textarea)::placeholder,
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container) :is(.form-control, input, textarea)::placeholder,
.public-layout :is(.form-control, input, textarea)::placeholder,
.stitch-auth-container :is(.form-control, input, textarea)::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* Typography Headings & Body on Light Surfaces */
body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .feature-title, .stitch-title),
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .feature-title, .stitch-title),
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .feature-title, .stitch-title),
.public-layout :is(h1, h2, h3, h4, h5, h6, .feature-title, .stitch-title) {
  color: #0f172a !important;
}

body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) :is(.text-muted, .text-secondary, .stitch-subtitle, .stitch-divider, .stitch-checkbox-group),
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) :is(.text-muted, .text-secondary, .stitch-subtitle, .stitch-divider, .stitch-checkbox-group),
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) :is(.text-muted, .text-secondary, .stitch-subtitle, .stitch-divider, .stitch-checkbox-group),
.public-layout :is(.text-muted, .text-secondary),
.stitch-auth-container :is(.text-muted, .text-secondary, .stitch-subtitle, .stitch-divider, .stitch-checkbox-group) {
  color: #475569 !important;
}

body.dark-mode :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) .text-dark,
body.dark-theme :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) .text-dark,
[data-bs-theme="dark"] :is(.public-layout, [data-surface="light"], .surface-light, .stitch-auth-container, .feature-card) .text-dark,
.public-layout .text-dark {
  color: #0f172a !important;
}

/* Dark-Mode Tabs, Nav Pills & Secondary Buttons */
body.dark-mode .nav-pills .nav-link:not(.active),
body.dark-mode .nav-tabs .nav-link:not(.active),
body.dark-theme .nav-pills .nav-link:not(.active),
body.dark-theme .nav-tabs .nav-link:not(.active),
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active),
[data-bs-theme="dark"] .nav-tabs .nav-link:not(.active) {
  color: #cbd5e1 !important;
}

body.dark-mode .nav-pills .nav-link:not(.active):hover,
body.dark-mode .nav-tabs .nav-link:not(.active):hover,
body.dark-theme .nav-pills .nav-link:not(.active):hover,
body.dark-theme .nav-tabs .nav-link:not(.active):hover,
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active):hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:not(.active):hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .btn-light,
body.dark-mode .btn-white,
body.dark-mode .btn-outline-secondary,
body.dark-mode .btn-outline-dark,
body.dark-theme .btn-light,
body.dark-theme .btn-white,
body.dark-theme .btn-outline-secondary,
body.dark-theme .btn-outline-dark,
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-white,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-dark {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-mode .btn-close,
body.dark-theme .btn-close,
[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-start,
body.dark-mode .border-end,
body.dark-mode .border-light-subtle,
body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-bottom,
body.dark-theme .border-start,
body.dark-theme .border-end,
body.dark-theme .border-light-subtle,
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end,
[data-bs-theme="dark"] .border-light-subtle {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Shared Member Views & Widgets Dark-Mode Surface Overrides */
body.dark-mode .event-card > div,
body.dark-mode #memoriesCard,
body.dark-mode #milestonesCard [style*="linear-gradient"],
body.dark-mode #mobileMemoriesCard,
body.dark-mode #mobileMilestonesCard,
body.dark-mode .studio-toolbar,
body.dark-mode .members-toolbar-stitch,
body.dark-mode .relative-card,
body.dark-mode .member-card,
body.dark-mode .member-details,
body.dark-mode .sidebar-card,
body.dark-mode .content-card,
body.dark-mode .journal-card,
body.dark-mode .form-card,
body.dark-theme .event-card > div,
body.dark-theme #memoriesCard,
body.dark-theme #milestonesCard [style*="linear-gradient"],
body.dark-theme #mobileMemoriesCard,
body.dark-theme #mobileMilestonesCard,
body.dark-theme .studio-toolbar,
body.dark-theme .members-toolbar-stitch,
body.dark-theme .relative-card,
body.dark-theme .member-card,
body.dark-theme .member-details,
body.dark-theme .sidebar-card,
body.dark-theme .content-card,
body.dark-theme .journal-card,
body.dark-theme .form-card {
  background: var(--surface-card, #141416) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
}

body.dark-mode .relative-name,
body.dark-mode .member-name,
body.dark-mode .page-title,
body.dark-mode .section-title,
body.dark-mode .story-body,
body.dark-mode .story-body h2,
body.dark-mode .story-body h3,
body.dark-theme .relative-name,
body.dark-theme .member-name,
body.dark-theme .page-title,
body.dark-theme .section-title,
body.dark-theme .story-body,
body.dark-theme .story-body h2,
body.dark-theme .story-body h3 {
  color: var(--text-main, #f8fafc) !important;
}

body.dark-mode .relative-subtext,
body.dark-mode .card-meta-item,
body.dark-mode .member-detail,
body.dark-mode .story-body blockquote,
body.dark-theme .relative-subtext,
body.dark-theme .card-meta-item,
body.dark-theme .member-detail,
body.dark-theme .story-body blockquote {
  color: var(--text-secondary, #cbd5e1) !important;
}

body.dark-mode .ql-toolbar.ql-snow,
body.dark-mode .ql-container.ql-snow,
body.dark-mode #quillEditor,
body.dark-theme .ql-toolbar.ql-snow,
body.dark-theme .ql-container.ql-snow,
body.dark-theme #quillEditor {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

/* Primary buttons in dark mode: Luminous Ruby Gradient with crisp white text (Inviolable Red Surface Rule) */
body.dark-mode .btn-primary,
body.dark-theme .btn-primary,
[data-bs-theme="dark"] .btn-primary,
body.dark-mode .btn-stitch-primary,
body.dark-theme .btn-stitch-primary,
[data-bs-theme="dark"] .btn-stitch-primary {
  background: var(--brand-primary-gradient, linear-gradient(135deg, #ff4d61 0%, #e11d48 100%)) !important;
  border-color: var(--brand-primary, #ff4d61) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px var(--brand-primary-glow, rgba(255, 77, 97, 0.28)) !important;
}

/* ==========================================================================
   🌙 Global Modal Dark Theme & Sub-Surface System (TAT & Global Standards v2.1)
   Provides deep, cohesive luxury dark theme across ALL modals & dynamic dialogs
   ========================================================================== */

/* 1. Modal Dialog & Content Shell */
body.dark-mode .modal-content,
body.dark-theme .modal-content,
[data-bs-theme="dark"] .modal-content {
  background-color: var(--surface-card, #141416) !important;
  color: var(--text-main, #f8fafc) !important;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

/* Modal Headers */
body.dark-mode .modal-header,
body.dark-theme .modal-header,
[data-bs-theme="dark"] .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Modal Footers */
body.dark-mode .modal-footer,
body.dark-theme .modal-footer,
[data-bs-theme="dark"] .modal-footer {
  background-color: #10141e !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-secondary, #cbd5e1) !important;
}

/* Invert light-colored modal headers in dark mode (e.g. #fefce8, #f0fdf4) */
body.dark-mode .modal-header[style*="#fefce8"],
body.dark-mode .modal-header[style*="#fef3c7"],
body.dark-theme .modal-header[style*="#fefce8"],
body.dark-theme .modal-header[style*="#fef3c7"],
[data-bs-theme="dark"] .modal-header[style*="#fefce8"],
[data-bs-theme="dark"] .modal-header[style*="#fef3c7"] {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
}

body.dark-mode .modal-header[style*="#fefce8"] .text-dark,
body.dark-theme .modal-header[style*="#fefce8"] .text-dark,
[data-bs-theme="dark"] .modal-header[style*="#fefce8"] .text-dark,
body.dark-mode .modal-header[style*="#fef3c7"] .text-dark,
body.dark-theme .modal-header[style*="#fef3c7"] .text-dark,
[data-bs-theme="dark"] .modal-header[style*="#fef3c7"] .text-dark {
  color: #f8fafc !important;
}

body.dark-mode .modal-header[style*="#f0fdf4"],
body.dark-mode .modal-header[style*="#ecfdf5"],
body.dark-theme .modal-header[style*="#f0fdf4"],
body.dark-theme .modal-header[style*="#ecfdf5"],
[data-bs-theme="dark"] .modal-header[style*="#f0fdf4"],
[data-bs-theme="dark"] .modal-header[style*="#ecfdf5"] {
  background: linear-gradient(135deg, #052e16 0%, #064e3b 100%) !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25) !important;
}

body.dark-mode .modal-header[style*="#f0fdf4"] .text-dark,
body.dark-theme .modal-header[style*="#f0fdf4"] .text-dark,
[data-bs-theme="dark"] .modal-header[style*="#f0fdf4"] .text-dark {
  color: #f8fafc !important;
}

/* 2. Neutral Sub-Surface Cards Inside Modals (Replaces Blinding White Rectangles) */
.modal-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: var(--text-main, #0f172a);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .modal-sub-card,
body.dark-theme .modal-sub-card,
[data-bs-theme="dark"] .modal-sub-card,
body.dark-mode .modal-content [style*="background: #f8fafc"],
body.dark-mode .modal-content [style*="background:#f8fafc"],
body.dark-theme .modal-content [style*="background: #f8fafc"],
body.dark-theme .modal-content [style*="background:#f8fafc"],
[data-bs-theme="dark"] .modal-content [style*="background: #f8fafc"],
[data-bs-theme="dark"] .modal-content [style*="background:#f8fafc"] {
  background: #182030 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

/* 3. Rose/Ruby Tinted Lineage Cards Inside Modals */
.modal-sub-card-rose {
  background: #fdf8f8;
  border: 1px solid #f1d4d6;
  border-radius: 16px;
  color: var(--text-main, #0f172a);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .modal-sub-card-rose,
body.dark-theme .modal-sub-card-rose,
[data-bs-theme="dark"] .modal-sub-card-rose,
body.dark-mode .modal-content [style*="background: #fdf8f8"],
body.dark-mode .modal-content [style*="background:#fdf8f8"],
body.dark-mode .modal-content [style*="background: #fdf2f2"],
body.dark-mode .modal-content [style*="background:#fdf2f2"],
body.dark-theme .modal-content [style*="background: #fdf8f8"],
body.dark-theme .modal-content [style*="background:#fdf8f8"],
body.dark-theme .modal-content [style*="background: #fdf2f2"],
body.dark-theme .modal-content [style*="background:#fdf2f2"],
[data-bs-theme="dark"] .modal-content [style*="background: #fdf8f8"],
[data-bs-theme="dark"] .modal-content [style*="background:#fdf8f8"],
[data-bs-theme="dark"] .modal-content [style*="background: #fdf2f2"],
[data-bs-theme="dark"] .modal-content [style*="background:#fdf2f2"] {
  background: rgba(255, 77, 97, 0.08) !important;
  border: 1px solid rgba(255, 77, 97, 0.25) !important;
  color: #f8fafc !important;
}

/* 4. Amber/Yellow Notice Cards Inside Modals */
.modal-sub-card-amber {
  background: linear-gradient(135deg, #fefce8 0%, #fffbeb 100%);
  border: 1.5px solid #fde047;
  border-radius: 16px;
  color: #0f172a;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .modal-sub-card-amber,
body.dark-theme .modal-sub-card-amber,
[data-bs-theme="dark"] .modal-sub-card-amber,
body.dark-mode .modal-content [style*="background: #fefce8"],
body.dark-mode .modal-content [style*="background: #fffbeb"],
body.dark-mode .modal-content [style*="background: #fef3c7"],
body.dark-theme .modal-content [style*="background: #fefce8"],
body.dark-theme .modal-content [style*="background: #fffbeb"],
body.dark-theme .modal-content [style*="background: #fef3c7"],
[data-bs-theme="dark"] .modal-content [style*="background: #fefce8"],
[data-bs-theme="dark"] .modal-content [style*="background: #fffbeb"],
[data-bs-theme="dark"] .modal-content [style*="background: #fef3c7"] {
  background: rgba(245, 158, 11, 0.10) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.3) !important;
  color: #f8fafc !important;
}

/* 5. Emerald/Green Success Cards Inside Modals */
.modal-sub-card-green {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  color: #0f172a;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .modal-sub-card-green,
body.dark-theme .modal-sub-card-green,
[data-bs-theme="dark"] .modal-sub-card-green,
body.dark-mode .modal-content [style*="background: #f0fdf4"],
body.dark-mode .modal-content [style*="background:#f0fdf4"],
body.dark-theme .modal-content [style*="background: #f0fdf4"],
body.dark-theme .modal-content [style*="background:#f0fdf4"],
[data-bs-theme="dark"] .modal-content [style*="background: #f0fdf4"],
[data-bs-theme="dark"] .modal-content [style*="background:#f0fdf4"] {
  background: rgba(16, 185, 129, 0.10) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: #f8fafc !important;
}

/* 6. Message / Code Preview Terminal Inside Modals */
.modal-preview-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

body.dark-mode .modal-preview-box,
body.dark-theme .modal-preview-box,
[data-bs-theme="dark"] .modal-preview-box,
body.dark-mode .modal-content [style*="background: #f1f5f9"],
body.dark-mode .modal-content [style*="background:#f1f5f9"],
body.dark-theme .modal-content [style*="background: #f1f5f9"],
body.dark-theme .modal-content [style*="background:#f1f5f9"],
[data-bs-theme="dark"] .modal-content [style*="background: #f1f5f9"],
[data-bs-theme="dark"] .modal-content [style*="background:#f1f5f9"] {
  background: #0b1322 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
}

/* 7. Radio & Scope Selectors Inside Modals */
body.dark-mode .modal-content [role="radiogroup"] label,
body.dark-theme .modal-content [role="radiogroup"] label,
[data-bs-theme="dark"] .modal-content [role="radiogroup"] label {
  background-color: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .modal-content [role="radiogroup"] label:has(input:checked),
body.dark-theme .modal-content [role="radiogroup"] label:has(input:checked),
[data-bs-theme="dark"] .modal-content [role="radiogroup"] label:has(input:checked) {
  background-color: rgba(255, 77, 97, 0.15) !important;
  border-color: #ff4d61 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(255, 77, 97, 0.25);
}

/* 8. Kinship Chips Inside Modals */
.kinship-chip {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.dark-mode .kinship-chip:not(.active),
body.dark-theme .kinship-chip:not(.active),
[data-bs-theme="dark"] .kinship-chip:not(.active) {
  background-color: #1a2234 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
}

body.dark-mode .kinship-chip:not(.active):hover,
body.dark-theme .kinship-chip:not(.active):hover,
[data-bs-theme="dark"] .kinship-chip:not(.active):hover {
  background-color: #243048 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

body.dark-mode .kinship-chip.active,
body.dark-theme .kinship-chip.active,
[data-bs-theme="dark"] .kinship-chip.active {
  background: rgba(255, 77, 97, 0.22) !important;
  border: 1.5px solid #ff4d61 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(255, 77, 97, 0.32) !important;
}

/* 9. Action Buttons Inside Modals In Dark Mode */
body.dark-mode .modal-content .btn-outline-dark,
body.dark-theme .modal-content .btn-outline-dark,
[data-bs-theme="dark"] .modal-content .btn-outline-dark {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

body.dark-mode .modal-content .btn-outline-dark:hover,
body.dark-theme .modal-content .btn-outline-dark:hover,
[data-bs-theme="dark"] .modal-content .btn-outline-dark:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

body.dark-mode .modal-content .btn-outline-secondary,
body.dark-theme .modal-content .btn-outline-secondary,
[data-bs-theme="dark"] .modal-content .btn-outline-secondary {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

body.dark-mode .modal-content .btn-outline-secondary:hover,
body.dark-theme .modal-content .btn-outline-secondary:hover,
[data-bs-theme="dark"] .modal-content .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.dark-mode .modal-content .btn-outline-primary,
body.dark-theme .modal-content .btn-outline-primary,
[data-bs-theme="dark"] .modal-content .btn-outline-primary {
  background-color: rgba(255, 77, 97, 0.08) !important;
  color: #ff6b7d !important;
  border-color: #ff4d61 !important;
}

body.dark-mode .modal-content .btn-outline-primary:hover,
body.dark-theme .modal-content .btn-outline-primary:hover,
[data-bs-theme="dark"] .modal-content .btn-outline-primary:hover {
  background-color: rgba(255, 77, 97, 0.18) !important;
  color: #ffffff !important;
}

/* 10. Direct Phone Contacts and Inputs inside Modal Sub-Cards */
body.dark-mode .modal-content .modal-sub-card .form-control,
body.dark-theme .modal-content .modal-sub-card .form-control,
[data-bs-theme="dark"] .modal-content .modal-sub-card .form-control {
  background-color: #0b1322 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f8fafc !important;
}

body.dark-mode .modal-content .modal-sub-card .form-control:focus,
body.dark-theme .modal-content .modal-sub-card .form-control:focus,
[data-bs-theme="dark"] .modal-content .modal-sub-card .form-control:focus {
  border-color: #ff4d61 !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 97, 0.25) !important;
}

/* Keyboard focus: one definition for every interactive element */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-primary, #a31621);
  outline-offset: 2px;
}

/* Redesigned Comment Composer & Rounded Pills: Prevent rectangular outline clipping */
.comment-composer input:focus,
.comment-composer input:focus-visible,
.comment-composer__input:focus,
.comment-composer__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

.comment-composer__field {
  background-color: #f0f2f5;
  border: 1.5px solid transparent;
  border-radius: 9999px;
  padding: 2px 8px 2px 14px;
  transition: background-color var(--motion-fast) var(--ease),
              border-color var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease);
}

.comment-composer__field:hover {
  background-color: #e9ecef;
}

.comment-composer__field:focus-within {
  background-color: #ffffff !important;
  border-color: rgba(163, 22, 33, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(163, 22, 33, 0.12), 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

body.dark-mode .comment-composer__field {
  background-color: #1e293b !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .comment-composer__field:hover {
  background-color: #253349 !important;
}

body.dark-mode .comment-composer__field:focus-within {
  background-color: #0f172a !important;
  border-color: rgba(239, 107, 115, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(239, 107, 115, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .comment-composer__input {
  color: #f8fafc !important;
  background: transparent !important;
}

body.dark-mode .comment-composer__input::placeholder {
  color: #94a0b4 !important;
}

input.rounded-pill:focus-visible,
.form-control.rounded-pill:focus-visible {
  outline: none !important;
  border-color: var(--brand-primary, #a31621) !important;
  box-shadow: 0 0 0 3px rgba(163, 22, 33, 0.18) !important;
}

.comment-composer__tool {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #65676b;
  transition: background-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease);
}

.comment-composer__tool:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #1e293b;
}

.comment-composer__tool:active {
  transform: scale(0.92);
}

.comment-composer__tool:focus-visible {
  outline: 2px solid var(--brand-primary, #a31621);
  outline-offset: 1px;
  border-radius: 50%;
}

.comment-composer__tool[aria-expanded="true"] {
  color: var(--brand-primary, #a31621);
  background-color: rgba(163, 22, 33, 0.08);
}

.comment-composer__send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94a3b8;
  transition: all var(--motion-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comment-composer__send:hover {
  background-color: rgba(163, 22, 33, 0.08);
  color: var(--brand-primary, #a31621);
}

.comment-composer__send:active {
  transform: scale(0.92);
}

.comment-composer__send.is-active {
  color: var(--brand-primary, #a31621) !important;
  background-color: rgba(163, 22, 33, 0.1) !important;
  transform: scale(1.05);
}

body.dark-mode .comment-composer__tool {
  color: #94a0b4;
}

body.dark-mode .comment-composer__tool:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

body.dark-mode .comment-composer__send {
  color: #64748b;
}

body.dark-mode .comment-composer__send:hover {
  background-color: rgba(239, 107, 115, 0.12);
  color: #ef6b73;
}

body.dark-mode .comment-composer__send.is-active {
  color: #ef6b73 !important;
  background-color: rgba(239, 107, 115, 0.16) !important;
}

/* Press feedback is primary (works on touch) */
button:not(:disabled):active,
[role="button"]:active,
.pwa-tab-item:active {
  transform: scale(.98);
}

/* Hover lift is a pointer-only enhancement, never on touch */
@media (hover: none) {
  .btn:hover,
  .btn-brand:hover,
  .btn-primary:hover,
  .btn-brand-outline:hover,
  .btn-outline-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}

/* Reduced motion: honour the user's OS setting everywhere */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Hit areas: expand to 44px without changing the visual size */
.pwa-tab-item {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
}

/* AA contrast for light-mode secondary text (was #94a3b8, about 2.6:1) */
.notif-item-time {
  color: var(--text-muted-aa);
}
body.dark-mode .notif-item-time {
  color: #94a3b8;
}

/* =====================================================================
 * v2.2 Brand & Responsive layer (CEO brief 2026-10-25)
 * One brand: the "family" app icon, now crimson (#a31621) to match the UI, so
 * white text on it passes WCAG AA (7.8:1); the raw icon red does not (4.0:1).
 * Breakpoints: phone < 768, tablet 768-1199 (2-col), desktop >= 1200 (3-col).
 * ===================================================================== */
:root {
  --brand-primary: #a31621;
  --brand-primary-hover: #8a1019;
  --brand-primary-active: #7a0e16;
  --brand-primary-soft: #fbefef;
  --brand-primary-rgb: 163, 22, 33;
  --brand-gradient: linear-gradient(135deg, #b8202c 0%, #8a1019 100%);
  --brand-ink: #2a0a0d;
  --shadow-1: 0 1px 2px rgba(28, 21, 23, .06), 0 4px 12px rgba(28, 21, 23, .06);
  --shadow-2: 0 2px 4px rgba(28, 21, 23, .08), 0 12px 28px rgba(28, 21, 23, .12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bs-primary: #a31621;
  --bs-primary-rgb: 163, 22, 33;
  --bs-link-color: #a31621;
  --bs-link-color-rgb: 163, 22, 33;
  --bs-link-hover-color: #8a1019;
  --bs-link-hover-color-rgb: 138, 16, 25;
}

body.dark-mode,
[data-bs-theme="dark"] {
  --brand-primary: #b8202c;
  --brand-primary-hover: #e0454e;
  --brand-primary-soft: rgba(184,32,44, .16);
  --bs-link-color: #ef6b73;
  --bs-link-color-rgb: 255, 107, 107;
  --bs-link-hover-color: #f2a0a6;
}

/* Bootstrap primaries follow the brand wherever a page still uses them */
.btn-primary {
  --bs-btn-bg: #a31621;
  --bs-btn-border-color: #a31621;
  --bs-btn-hover-bg: #8a1019;
  --bs-btn-hover-border-color: #8a1019;
  --bs-btn-active-bg: #7a0e16;
  --bs-btn-active-border-color: #7a0e16;
  --bs-btn-disabled-bg: #a31621;
  --bs-btn-disabled-border-color: #a31621;
  --bs-btn-focus-shadow-rgb: 163, 22, 33;
}
.btn-outline-primary {
  --bs-btn-color: #a31621;
  --bs-btn-border-color: #a31621;
  --bs-btn-hover-bg: #a31621;
  --bs-btn-hover-border-color: #a31621;
  --bs-btn-active-bg: #8a1019;
  --bs-btn-active-border-color: #8a1019;
  --bs-btn-focus-shadow-rgb: 163, 22, 33;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--brand-primary-rgb), .18);
}
.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--brand-primary-rgb), .18); }
.progress-bar,
.dropdown-item.active,
.page-item.active .page-link { 
  background-color: var(--brand-primary); 
  border-color: var(--brand-primary); 
  color: #ffffff !important;
}

/* Nav Pills Invariant: Active states turn crimson with strictly crisp white font */
.nav-pills .nav-link {
  color: var(--text-muted-aa, #475569) !important;
  transition: all var(--motion-fast) var(--ease);
}
.nav-pills .nav-link:hover {
  color: var(--brand-primary, #a31621) !important;
  background-color: rgba(163, 22, 33, 0.06) !important;
}
.nav-pills .nav-link.active,
.nav-pills .nav-link.active:hover,
.nav-pills .nav-link.active:focus {
  background-color: var(--brand-primary, #a31621) !important;
  border-color: var(--brand-primary, #a31621) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(163, 22, 33, 0.25) !important;
}
.nav-pills .nav-link.active *,
.nav-pills .nav-link.active i,
.nav-pills .nav-link.active .bi,
.nav-pills .nav-link.active span {
  color: #ffffff !important;
}

/* Overflow safety: nothing may cause sideways scroll on any device */
html, body { max-width: 100%; overflow-x: clip; }
img, video { max-width: 100%; height: auto; }
/* Universal avatar circular integrity: prevent squishing or oval distortion on non-square portrait photos */
img.rounded-circle,
.post-composer img,
.composer-author__avatar,
.feed-comment-avatar,
.feed-comment-item > img,
.feed-comment-item .rounded-circle,
.avatar.profileImg {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  flex-shrink: 0;
}

.feed-comment-avatar,
.feed-comment-item > img,
.feed-comment-item img.rounded-circle {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  display: block;
}

.comment-gif {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 220px !important;
  object-fit: contain !important;
  border-radius: 12px;
}
.table-responsive, pre { max-width: 100%; overflow-x: auto; }

/* Touch devices: every control is a 44px target (Golden Invariant 8) */
@media (pointer: coarse) {
  .btn:not(.btn-close):not(.btn-sm),
  .form-control,
  .form-select,
  .dropdown-item { min-height: var(--tap-min); }
  .btn-sm { min-height: 40px; }
}

/* Mouse devices: cards respond, honestly and briefly */
@media (hover: hover) and (pointer: fine) {
  .feed-column .card,
  .sidebar-column .card {
    transition: box-shadow var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  }
  .feed-column .card:hover,
  .sidebar-column .card:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
  }
}

/* Phone: breathing room, notch/home-indicator safe, content never hides under the tab bar */
@media (max-width: 767.98px) {
  body .container-main { padding: 12px; gap: 14px; }
  body:has(.pwa-bottom-nav) { padding-bottom: calc(76px + var(--safe-bottom)); }
}

/* Tablet (iPad portrait & landscape): two columns instead of one long stack */
@media (min-width: 768px) and (max-width: 1199.98px) {
  body .container-main {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
    gap: 20px;
    padding: 20px;
    align-items: start;
  }
  body .container-main > .profile-column {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
  }
  body .container-main > .feed-column { grid-column: 1; grid-row: 2; }
  body .container-main > .sidebar-column {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: calc(80px + env(safe-area-inset-top, 0px));
  }
  body:has(.pwa-bottom-nav) { padding-bottom: calc(76px + var(--safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .feed-column .card:hover,
  .sidebar-column .card:hover { transform: none; }
}

/* Profile quick actions: preserve semantic icon accents while keeping balanced button surfaces */
.profile-column .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Public pages: balanced headlines, and a container that never hugs the screen edge */
h1, h2, .hero-title { text-wrap: balance; }
.hero-section .container,
.hero-section ~ section .container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-section .col-lg-6 { text-align: center; }
  .hero-section .d-flex.flex-sm-row { justify-content: center; }
}

/* Auth cards: float with a gutter on phones; brand-coloured native checkboxes/radios */
body .stitch-auth-container { width: calc(100% - 32px); }
@media (max-width: 480px) {
  body .stitch-auth-container { padding: 2rem 1.25rem; margin: 1.5rem auto 3rem; }
}
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--brand-primary); }

/* =====================================================================
 * v2.3 Calm CTAs (CEO chose option A "Crimson", 2026-10-25: bright red was too loud)
 * Solid call-to-action buttons use deep crimson (#a31621, 7.8:1 with white); brand red is kept for the logo,
 * links, icons, focus rings, active tabs and badges.
 * Change --cta-bg once to retune every primary button.
 * ===================================================================== */
:root {
  --cta-bg: #a31621;
  --cta-bg-hover: #8a1019;
  --cta-glow: 0 6px 16px rgba(var(--brand-primary-rgb), .28);
}
body.dark-mode,
[data-bs-theme="dark"] {
  --cta-bg: #a31621;
  --cta-bg-hover: #b8202c;
}

.btn-primary,
.btn-brand,
.btn-save,
.btn-confirm,
.btn-create-journal,
.btn-sanctuary-primary,
.stitch-submit,
.submitPost,
.cta-btn,
.cookie-btn-solid,
.swal2-styled.swal2-confirm,
.btn[style*="background"][style*="#a31621"],
.btn[style*="background"][style*="#b8202c"],
.btn[style*="background"][style*="#8a1019"],
.btn[style*="background"][style*="--primary-color"] {
  background: var(--cta-bg) !important;
  border-color: var(--cta-bg) !important;
  color: #fff !important;
}

/* ── v2.5 Multi-Tier Button Hierarchy (60-30-10 & WCAG AA Enforced) ── */
/* Tier 1: Primary Brand CTAs (10% High-Energy Crimson Accent) */
.btn-primary,
.btn-brand,
.btn-action,
.btn-tour-next,
.stitch-submit,
.submitPost,
.cta-btn {
  background: var(--cta-bg, #a31621) !important;
  background-color: var(--cta-bg, #a31621) !important;
  border-color: var(--cta-bg, #a31621) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(163, 22, 33, 0.2);
}

.btn-primary:hover,
.btn-brand:hover,
.btn-action:hover,
.btn-tour-next:hover,
.stitch-submit:hover,
.submitPost:hover,
.cta-btn:hover {
  background: var(--cta-bg-hover, #8a1019) !important;
  background-color: var(--cta-bg-hover, #8a1019) !important;
  border-color: var(--cta-bg-hover, #8a1019) !important;
  color: #ffffff !important;
}

/* Tier 2: Outline Primary & Brand Outline Buttons (Crisp Crimson Border + Soft Tint) */
.btn-outline-primary,
.btn-brand-outline {
  background-color: rgba(163, 22, 33, 0.04) !important;
  border: 1.5px solid var(--brand-primary, #a31621) !important;
  color: var(--brand-primary, #a31621) !important;
  font-weight: 600;
}

.btn-outline-primary:hover,
.btn-brand-outline:hover {
  background-color: var(--brand-primary, #a31621) !important;
  border-color: var(--brand-primary, #a31621) !important;
  color: #ffffff !important;
}

body.dark-mode .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-primary,
body.dark-mode .btn-brand-outline,
[data-bs-theme="dark"] .btn-brand-outline {
  background-color: rgba(239, 107, 115, 0.1) !important;
  border-color: #ef6b73 !important;
  color: #f8b4b9 !important;
}

body.dark-mode .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-primary:hover,
body.dark-mode .btn-brand-outline:hover,
[data-bs-theme="dark"] .btn-brand-outline:hover {
  background-color: #a31621 !important;
  border-color: #b8202c !important;
  color: #ffffff !important;
}

/* Tier 3: Secondary, Surface & Neutral Tonal Buttons (30% Structural Contrast) */
.btn-secondary {
  background-color: #475569 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

.btn-secondary:hover {
  background-color: #334155 !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}

.btn-outline-secondary,
.btn-outline-dark {
  background-color: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.dark-mode .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
body.dark-mode .btn-outline-dark,
[data-bs-theme="dark"] .btn-outline-dark {
  background-color: rgba(30, 41, 59, 0.8) !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
body.dark-mode .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-outline-dark:hover {
  background-color: #334155 !important;
  border-color: #64748b !important;
  color: #ffffff !important;
}

/* Surface Action & Light Buttons (.btn-light, .btn-surface-action) */
.btn-light,
.btn-surface-action {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 600;
  transition: all var(--motion-fast) var(--ease);
}

.btn-light:hover,
.btn-surface-action:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

body.dark-mode .btn-light,
[data-bs-theme="dark"] .btn-light,
body.dark-mode .btn-surface-action,
[data-bs-theme="dark"] .btn-surface-action {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .btn-light:hover,
[data-bs-theme="dark"] .btn-light:hover,
body.dark-mode .btn-surface-action:hover,
[data-bs-theme="dark"] .btn-surface-action:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

/* Semantic Status Buttons (Success / WhatsApp, Danger, Warning, Info) */
.btn-success {
  background-color: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.btn-success:hover {
  background-color: #047857 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
}

.btn-danger {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.btn-danger:hover {
  background-color: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

/* Inviolable Contrast Safeguard: Ban dark/black font on red/crimson surfaces */
.bg-danger,
.badge-danger,
.alert-danger,
.badge.bg-danger {
  color: #ffffff !important;
}

.bg-danger *,
.badge-danger *,
.alert-danger *,
.badge.bg-danger * {
  color: inherit;
}

.btn-warning {
  background-color: #f59e0b !important;
  border-color: #d97706 !important;
  color: #0f172a !important;
  font-weight: 700;
}

.btn-warning:hover {
  background-color: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}

/* Tier 4: Post Composer Quick-Action Pills & Heritage Action Cards */
.composer-quick-action {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  color: #1e293b !important;
  padding: 8px 10px !important;
  min-height: 44px;
  white-space: nowrap;
  transition: all var(--motion-fast) var(--ease);
}

.composer-quick-action span {
  color: #1e293b !important;
}

.composer-quick-action:hover,
.composer-quick-action:focus-visible {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.composer-quick-action.then-now-cta {
  background: linear-gradient(135deg, #fbefef 0%, #fce7e9 100%) !important;
  border: 1px solid rgba(163, 22, 33, 0.25) !important;
  color: #8a1019 !important;
}

.composer-quick-action.then-now-cta i,
.composer-quick-action.then-now-cta span {
  color: #8a1019 !important;
}

.composer-quick-action.then-now-cta:hover {
  background: linear-gradient(135deg, #f7d9dc 0%, #f5cbd0 100%) !important;
  border-color: rgba(163, 22, 33, 0.4) !important;
}

body.dark-mode .composer-quick-action,
[data-bs-theme="dark"] .composer-quick-action {
  background-color: rgba(30, 41, 59, 0.85) !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

body.dark-mode .composer-quick-action span,
[data-bs-theme="dark"] .composer-quick-action span {
  color: #f1f5f9 !important;
}

body.dark-mode .composer-quick-action:hover,
[data-bs-theme="dark"] .composer-quick-action:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
}

body.dark-mode .composer-quick-action.then-now-cta,
[data-bs-theme="dark"] .composer-quick-action.then-now-cta {
  background: rgba(163, 22, 33, 0.22) !important;
  border-color: rgba(239, 107, 115, 0.4) !important;
  color: #fecdd3 !important;
}

body.dark-mode .composer-quick-action.then-now-cta i,
[data-bs-theme="dark"] .composer-quick-action.then-now-cta i,
body.dark-mode .composer-quick-action.then-now-cta span,
[data-bs-theme="dark"] .composer-quick-action.then-now-cta span {
  color: #fecdd3 !important;
}

/* Right Sidebar Heritage Action Tiles */
.heritage-action-tile {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  color: #0f172a !important;
  transition: all var(--motion-fast) var(--ease);
}

.heritage-action-tile:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

body.dark-mode .heritage-action-tile,
[data-bs-theme="dark"] .heritage-action-tile {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .heritage-action-tile:hover,
[data-bs-theme="dark"] .heritage-action-tile:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
}
body.dark-mode .heritage-action-tile .tile-title,
[data-bs-theme="dark"] .heritage-action-tile .tile-title {
  color: #f8fafc !important;
}
body.dark-mode .heritage-action-tile .tile-subtitle,
[data-bs-theme="dark"] .heritage-action-tile .tile-subtitle {
  color: #94a3b8 !important;
}

/* Explicit exclusions: Navbar utility capsules & text links NEVER get white-on-white */
#mainNavbar #langMenu {
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1e293b !important;
}

#mainNavbar .btn-user-stitch {
  background: rgba(241, 245, 249, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1e293b !important;
}

#mainNavbar .btn-icon-stitch {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
}

body.dark-mode #mainNavbar #langMenu,
[data-bs-theme="dark"] #mainNavbar #langMenu {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode #mainNavbar .btn-user-stitch,
[data-bs-theme="dark"] #mainNavbar .btn-user-stitch {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode #mainNavbar .btn-icon-stitch,
[data-bs-theme="dark"] #mainNavbar .btn-icon-stitch {
  color: #cbd5e1 !important;
}

.btn-link {
  background: transparent !important;
  border: none !important;
  color: var(--brand-primary, #a31621) !important;
}

/* ── Subtitle Legibility Invariant: Minimum 14px (--text-sm) & WCAG AA Contrast ── */
.page-subtitle,
.section-subtitle,
.card-subtitle,
.widget-subtitle {
  font-size: var(--text-sm) !important;
  color: var(--text-muted-aa) !important;
  line-height: 1.5 !important;
}

.btn-primary:hover, .btn-primary:focus-visible,
.btn-brand:hover,
.btn-save:hover,
.btn-confirm:hover,
.btn-create-journal:hover,
.btn-sanctuary-primary:hover,
.stitch-submit:hover,
.submitPost:hover,
.cta-btn:hover,
.cookie-btn-solid:hover,
.swal2-styled.swal2-confirm:hover,
.btn[style*="background"][style*="#a31621"]:hover,
.btn[style*="background"][style*="#b8202c"]:hover,
.btn[style*="background"][style*="#8a1019"]:hover,
.btn[style*="background"][style*="--primary-color"]:hover {
  background: var(--cta-bg-hover) !important;
  border-color: var(--cta-bg-hover) !important;
  box-shadow: var(--cta-glow) !important;
}

/* Top bar: buttons never wrap onto two lines, long user names truncate inside their label instead of clipping the dropdown button */
#mainNavbar .btn { white-space: nowrap; }
#mainNavbar .btn-user-stitch {
  max-width: none !important;
  overflow: visible !important;
  flex-shrink: 0;
}
#mainNavbar .btn-user-stitch .user-name-label {
  display: inline-block;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Small laptops / iPad landscape (992-1199px): tighten the top bar so nothing is pushed off-screen */
@media (min-width: 992px) and (max-width: 1199.98px) {
  #mainNavbar .container-fluid { padding-inline: 12px; }
  #mainNavbar .stitch-nav-link { padding-inline: .45rem !important; font-size: .84rem; }
  #mainNavbar .stitch-nav-link i { margin-right: .2rem !important; }
  #mainNavbar .navbar-nav { gap: 0 !important; margin-left: .25rem !important; }
  #mainNavbar .btn-user-stitch .user-name-label { max-width: 90px; }
}

/* Centre "Add Photo" bubble follows the CTA colour */
.pwa-center-btn-bubble {
  background: var(--cta-bg) !important;
  box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), .28), 0 0 0 3px rgba(var(--brand-primary-rgb), .22) !important;
}

/* The logo tile never shrinks when the top bar is crowded */
#mainNavbar .navbar-brand,
#mainNavbar .brand-logo-icon-wrapper { flex: none; }
#mainNavbar .brand-logo-icon-wrapper img { min-width: 34px; }

/* =====================================================================
 * Native-First Social Hybrid (TAT & Olutobi Executive Determination):
 * Native OS font stack for feed/UI readability (SF Pro on iOS, Roboto on Android)
 * with Outfit / Plus Jakarta Sans geometric warmth for headings and display cards.
 * ===================================================================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Outfit", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
html, body, button, input, select, textarea, optgroup, .btn, .form-control, .form-select,
.navbar, .modal, .dropdown-menu, .swal2-popup, .swal2-html-container {
  font-family: var(--font-sans);
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .swal2-title, .tour-title, .modal-title, .card-title, .display-heading {
  font-family: var(--font-heading);
}

/* Landing: logo tile keeps its size next to the wordmark; centred copy stays centred on small screens */
.public-navbar .navbar-brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; flex: none; }
@media (max-width: 991.98px) { .hero-section .hero-subtitle { margin-inline: auto; max-width: 36rem; } }

/* Badges may wrap on phones instead of being clipped */
.invited-relative-hero .badge { white-space: normal; text-align: left; line-height: 1.3; }

/* RFC-0007 Follow-ups: Mentions & Thread Collapsing */
.mention-autocomplete {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 280px;
    max-width: 90vw;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 250;
}
.mention-autocomplete__header {
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    margin-bottom: 4px;
}
.mention-autocomplete__list {
    max-height: 220px;
    overflow-y: auto;
}
.mention-autocomplete__item {
    background: transparent;
    border-radius: 8px;
    transition: background 0.12s ease;
    cursor: pointer;
    min-height: 40px;
}
.mention-autocomplete__item:hover,
.mention-autocomplete__item--active {
    background: var(--hover-color, #f1f5f9);
}
.mention-autocomplete__item:focus-visible {
    outline: 2px solid var(--primary-color, #a31621);
    outline-offset: -1px;
}
.mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(163, 22, 33, 0.09);
    color: var(--primary-color, #a31621);
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.88em;
    vertical-align: baseline;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.mention-chip i {
    font-size: 0.9em;
    opacity: 0.85;
}
.mention-chip:hover {
    background: rgba(163, 22, 33, 0.18);
}
.comment-thread-toggle {
    transition: color 0.15s ease;
    cursor: pointer;
    font-family: inherit;
}
.comment-thread-toggle:hover {
    text-decoration: underline !important;
    opacity: 0.9;
}

/* ==========================================================================
   Design System: Dual-Form Architecture (Instagram Mobile & Facebook Desktop)
   Per design.md (v2.1 live specification)
   ========================================================================== */

/* 1. Mobile Feed Layout: Profile Card & Feed (< 992px) */
@media (max-width: 991.98px) {
  /* Left profile column with action buttons displayed prominently on mobile */
  .profile-column {
    display: block !important;
    order: 1 !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto 16px auto !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Quick actions: collapsed by default on mobile/tablet so the feed stays near the top */
  .profile-quick-actions:not(.is-open) {
    display: none !important;
  }

  .profile-quick-toggle {
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--border-color, #dddfe2);
    border-radius: 12px;
    background: transparent;
    color: var(--text-color, #1c1e21);
    transition: transform var(--motion-fast, 150ms) var(--ease, ease);
  }

  .profile-quick-toggle:active {
    transform: scale(0.98);
  }

  .profile-quick-chevron {
    transition: transform var(--motion-base, 250ms) var(--ease, ease);
  }

  .profile-quick-toggle[aria-expanded="true"] .profile-quick-chevron {
    transform: rotate(180deg);
  }

  @media (prefers-reduced-motion: reduce) {
    .profile-quick-chevron,
    .profile-quick-toggle {
      transition: none;
    }
  }

  .container-main {
    flex-direction: column !important;
    padding: 8px 4px calc(72px + env(safe-area-inset-bottom, 0px)) 4px !important;
    max-width: 500px !important;
    margin: 0 auto !important;
  }

  .feed-column {
    order: 2 !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .sidebar-column {
    order: 3 !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 16px auto 0 auto !important;
    position: static !important;
    max-height: none !important;
  }

  .reels-tray-wrapper {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
  }
}

/* 2. Instagram Mobile Story Circles (< 768px) */
.ig-stories-tray {
  margin-bottom: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.ig-stories-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 6px;
}
.ig-stories-scroll::-webkit-scrollbar {
  display: none;
}

.ig-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  width: 84px;
  min-height: 110px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}

.ig-story-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.ig-story-avatar-wrap:active {
  transform: scale(0.94);
}

/* Instagram Multi-Colour Living Conic Gradient Ring */
.ig-story-avatar-wrap.is-active {
  background: conic-gradient(from 180deg at 50% 50%, var(--brand-primary, #a31621) 0deg, #e11d48 90deg, var(--accent-gold, #f59e0b) 180deg, #e11d48 270deg, var(--brand-primary, #a31621) 360deg);
}

/* Birthday / Milestone Radiant Gold Ring */
.ig-story-avatar-wrap.is-gold {
  background: conic-gradient(from 180deg at 50% 50%, #f59e0b 0deg, #fbbf24 90deg, #fef08a 180deg, #fbbf24 270deg, #f59e0b 360deg);
}

/* Self / Add Story Ring */
.ig-story-avatar-wrap.is-self {
  background: transparent;
  padding: 0;
}

.ig-story-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  display: block;
  background-color: #f1f5f9;
}
body.dark-mode .ig-story-avatar,
body.dark-theme .ig-story-avatar {
  border-color: #000000;
  background-color: #1e293b;
}

.ig-story-plus-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #0095f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #ffffff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 149, 246, 0.4);
}
body.dark-mode .ig-story-plus-badge,
body.dark-theme .ig-story-plus-badge {
  border-color: #000000;
}

.ig-story-count-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #a31621 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(163, 22, 33, 0.45);
  z-index: 4;
}
body.dark-mode .ig-story-count-badge,
body.dark-theme .ig-story-count-badge {
  border-color: #0f172a;
}

.ig-story-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color, #262626);
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.25;
}

/* 3. Edge-to-Edge Feed Post Cards on Mobile (< 768px) */
@media (max-width: 767.98px) {
  .feed-post-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06)) !important;
    box-shadow: none !important;
    margin-bottom: 8px !important;
    padding: 12px 0 !important;
  }

  .feed-post-card .post-content,
  .feed-post-card .px-1,
  .feed-post-card .feed-actions-row {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .feed-post-card .post-images-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .feed-post-card .post-img-col {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .feed-post-card .post-media-stage {
    border-radius: 0 !important;
  }

  .feed-post-card .post-media-stage a,
  .feed-post-card .post-media-first-img {
    border-radius: 0 !important;
    max-height: 600px !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* 4. Desktop Facebook Mirror Styling (> 992px) */
@media (min-width: 992px) {
  .container-main {
    display: flex !important;
    gap: 24px !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 20px !important;
  }

  .profile-column {
    display: block !important;
    flex: 0 0 280px !important;
    position: sticky !important;
    top: calc(76px + env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
  }

  .feed-column {
    flex: 1 1 580px !important;
    max-width: 620px !important;
    min-width: 0 !important;
  }

  .sidebar-column {
    display: block !important;
    flex: 0 0 310px !important;
    position: sticky !important;
    top: calc(76px + env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
  }
}

/* ==============================================================================
   🌟 Super-Premium Instagram Minimalist Action Bar & Spring Micro-Interactions
   ============================================================================== */
.btn-action-glyph {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 50% !important;
  color: var(--text-main, #0f172a);
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 180ms ease,
              background-color 180ms ease,
              box-shadow 180ms ease,
              color 180ms ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-action-glyph:active {
  transform: scale(0.92);
}
@media (hover: hover) {
  .btn-action-glyph:hover {
    transform: translateY(-2px);
  }
}

/* 🌹 Like / Reaction Action Button - Modern Rose Crimson Border & Tactile Surface */
.btn-action-glyph.btn-action-like {
  border-color: rgba(225, 29, 72, 0.28);
  background: rgba(225, 29, 72, 0.05);
  color: #e11d48;
}
@media (hover: hover) {
  .btn-action-glyph.btn-action-like:hover {
    border-color: #f43f5e;
    background: rgba(225, 29, 72, 0.12);
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.22);
    color: #be123c;
  }
}
.btn-action-glyph.btn-action-like.is-liked {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.16);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.22), 0 4px 14px rgba(225, 29, 72, 0.28);
  color: #e11d48 !important;
}

/* 💬 Comment Action Button - Modern Electric Azure / Sapphire Border & Tactile Surface */
.btn-action-glyph.btn-action-comment {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
}
@media (hover: hover) {
  .btn-action-glyph.btn-action-comment:hover {
    border-color: #3b82f6;
    background: rgba(37, 99, 235, 0.12);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
  }
}

/* 🔖 Bookmark Action Button - Modern Royal Purple / Amethyst Border & Tactile Surface */
.btn-action-glyph.btn-action-bookmark {
  border-color: rgba(147, 51, 234, 0.28);
  background: rgba(147, 51, 234, 0.05);
  color: #9333ea;
}
@media (hover: hover) {
  .btn-action-glyph.btn-action-bookmark:hover {
    border-color: #a855f7;
    background: rgba(147, 51, 234, 0.12);
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.22);
    color: #7e22ce;
  }
}
.btn-action-glyph.btn-action-bookmark.is-saved {
  border-color: #9333ea;
  background: rgba(147, 51, 234, 0.16);
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.22), 0 4px 14px rgba(147, 51, 234, 0.28);
  color: #9333ea !important;
}

@keyframes heartSpringPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.38); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.btn-action-glyph.is-liked i,
.btn-action-glyph.is-liked svg {
  color: #ff2d55 !important;
  animation: heartSpringPop 350ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.dark-mode .btn-action-glyph,
body.dark-theme .btn-action-glyph,
[data-bs-theme="dark"] .btn-action-glyph {
  color: #f8fafc !important;
}
body.dark-mode .btn-action-glyph.btn-action-like,
body.dark-theme .btn-action-glyph.btn-action-like,
[data-bs-theme="dark"] .btn-action-glyph.btn-action-like {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185 !important;
}
body.dark-mode .btn-action-glyph.btn-action-comment,
body.dark-theme .btn-action-glyph.btn-action-comment,
[data-bs-theme="dark"] .btn-action-glyph.btn-action-comment {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa !important;
}
body.dark-mode .btn-action-glyph.btn-action-bookmark,
body.dark-theme .btn-action-glyph.btn-action-bookmark,
[data-bs-theme="dark"] .btn-action-glyph.btn-action-bookmark {
  border-color: rgba(192, 132, 252, 0.45);
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc !important;
}
body.dark-mode .btn-action-glyph.is-liked i,
body.dark-theme .btn-action-glyph.is-liked i,
[data-bs-theme="dark"] .btn-action-glyph.is-liked i {
  color: #ff2d55 !important;
}

/* Frosted glass acrylic chrome for top and bottom navigation bars */
.pwa-bottom-nav,
.brand-navbar-stitch {
  background: var(--nav-frosted-bg, rgba(255, 255, 255, 0.88)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border-top: 0.5px solid var(--nav-border, rgba(0, 0, 0, 0.08)) !important;
}
body.dark-mode .pwa-bottom-nav,
body.dark-mode .brand-navbar-stitch,
body.dark-theme .pwa-bottom-nav,
body.dark-theme .brand-navbar-stitch,
[data-bs-theme="dark"] .pwa-bottom-nav,
[data-bs-theme="dark"] .brand-navbar-stitch {
  background: var(--nav-frosted-bg, rgba(20, 20, 22, 0.88)) !important;
  border-color: var(--nav-border, rgba(255, 255, 255, 0.09)) !important;
}

/* ==========================================================================
   ⚡ Next-Gen Visual Supremacy Engine (VSE) — Display P3 & 2.5D Parallax
   ========================================================================== */
@supports (color: color(display-p3 1 0 0)) {
  :root.vse-p3-capable {
    --brand-primary-p3: color(display-p3 0.639 0.086 0.129);
    --vse-specular-edge: color(display-p3 1 1 1 / 0.12);
    --vse-crimson-glow: color(display-p3 0.85 0.12 0.2 / 0.18);
  }
}

.post-media-stage {
  perspective: 1000px;
  transform-style: preserve-3d;
  contain: layout paint;
  border-radius: var(--radius-md, 12px);
  background-color: #0b0f19; /* OLED deep black anchor */
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.15);
  transition: box-shadow var(--motion-base, 250ms) var(--ease, cubic-bezier(.16, 1, .3, 1));
}

.post-media-stage:hover {
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.25), 0 0 18px 0 var(--vse-crimson-glow, rgba(163, 22, 33, 0.12));
}

/* World-Class Media Supremacy: Cinematic Ambient Aura & Holographic Foil */
.feed-media-aura-container {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius-md, 12px);
}

.feed-media-aura-backdrop {
  position: absolute;
  inset: -6px -4px;
  z-index: 0;
  overflow: hidden;
  border-radius: 18px;
  filter: blur(32px) saturate(160%) brightness(1.08);
  opacity: 0.38;
  transform: scale(0.96) translateZ(0);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
  will-change: transform, opacity;
}

.feed-media-aura-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

body.dark-mode .feed-media-aura-backdrop,
body.dark-theme .feed-media-aura-backdrop,
[data-bs-theme="dark"] .feed-media-aura-backdrop {
  opacity: 0.52;
  filter: blur(36px) saturate(180%) brightness(1.15);
}

/* Holographic 2.5D Specular Foil Glint */
.vse-holo-foil-glint {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  background: linear-gradient(
    115deg,
    transparent 15%,
    rgba(255, 215, 0, 0.08) 32%,
    rgba(255, 255, 255, 0.32) 46%,
    rgba(255, 215, 0, 0.22) 54%,
    rgba(163, 22, 33, 0.1) 65%,
    transparent 80%
  );
  background-size: 250% 250%;
  background-position: var(--vse-glint-pos, 0% 0%);
  mix-blend-mode: overlay;
  transition: opacity 0.25s ease, background-position 0.08s linear;
}

.post-media-stage:hover .vse-holo-foil-glint,
.post-media-stage.has-glint .vse-holo-foil-glint {
  opacity: 1;
}

/* Lineage Spotlight & Face Kinship Drawer */
.lineage-spotlight-pill {
  position: absolute !important;
  bottom: 12px !important;
  left: 12px !important;
  z-index: 14 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(15, 23, 42, 0.78) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  user-select: none;
}

.lineage-spotlight-pill:hover,
.lineage-spotlight-pill.is-active {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(255, 215, 0, 0.55) !important;
  color: #fef08a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.lineage-spotlight-drawer {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 15 !important;
  padding: 12px 14px !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  background: rgba(15, 23, 42, 0.92) !important;
  border-top: 1px solid rgba(255, 215, 0, 0.35) !important;
  border-radius: 0 0 12px 12px !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
}

.lineage-spotlight-drawer.is-open {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.lineage-drawer-title {
  color: #fde047 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
}

.lineage-kin-card {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  transition: all 0.2s ease !important;
  cursor: pointer;
}

.lineage-kin-card:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 215, 0, 0.5) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Floating Voice Capsule Keepsake */
.voice-capsule-floating-pill,
button.voice-capsule-floating-pill {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 14 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: rgba(15, 23, 42, 0.82) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 9999px !important;
  padding: 5px 12px !important;
  color: #ffffff !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  user-select: none;
}

.voice-capsule-floating-pill:hover,
.voice-capsule-floating-pill.is-playing,
.voice-capsule-floating-pill button:hover,
.voice-capsule-floating-pill button.is-playing {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: #ffd700 !important;
  color: #fef08a !important;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4) !important;
  transform: scale(1.03) !important;
}

.voice-capsule-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
}

.voice-capsule-label {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.audio-mini-waveform {
  height: 14px;
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
}

.wave-bar {
  width: 2.5px;
  background: #ffd700;
  border-radius: 2px;
  height: 4px;
  transition: height 0.15s ease;
}

.is-playing .wave-bar {
  animation: waveBounce 0.9s ease-in-out infinite alternate !important;
}

.is-playing .wave-bar.bar-1 { animation-delay: 0.1s !important; }
.is-playing .wave-bar.bar-2 { animation-delay: 0.3s !important; }
.is-playing .wave-bar.bar-3 { animation-delay: 0.2s !important; }
.is-playing .wave-bar.bar-4 { animation-delay: 0.4s !important; }

@keyframes waveBounce {
  0% { height: 4px; }
  100% { height: 14px; }
}

@keyframes voicePhotoBreathe {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.02); filter: brightness(1.06) contrast(1.02); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Living photo breathing pulse during voice playback */
.photo-voice-playing img.post-media-first-img {
  animation: voicePhotoBreathe 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

.post-media-first-img {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

@media (prefers-reduced-motion: reduce) {
  .post-media-stage,
  .post-media-first-img {
    perspective: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==============================================================================
   🌟 Universal Icon & Button Explanatory Tooltip Styling (v2.1 Global Standard)
   Obsidian Glassmorphic Card, Crisp White Typography, GPU-Accelerated Micro-Elevation
   ============================================================================== */
.family-tooltip-container {
  position: fixed;
  z-index: 100050;
  display: none;
  pointer-events: none;
  opacity: 0;
  max-width: 280px;
  background: rgba(15, 23, 42, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff !important;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.015em;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.35), 0 2px 6px 0 rgba(0, 0, 0, 0.18);
  transition: opacity 120ms cubic-bezier(0.16, 1, 0.3, 1), transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
  text-align: center;
  word-wrap: break-word;
}

.family-tooltip-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(45deg);
  pointer-events: none;
  z-index: -1;
}

.family-tooltip-container[data-placement="top"] .family-tooltip-arrow {
  border-top: none;
  border-left: none;
}

.family-tooltip-container[data-placement="bottom"] .family-tooltip-arrow {
  border-bottom: none;
  border-right: none;
}

/* Dark mode parity */
body.dark-mode .family-tooltip-container,
body.dark-theme .family-tooltip-container,
[data-bs-theme="dark"] .family-tooltip-container {
  background: rgba(2, 6, 23, 0.96);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .family-tooltip-container {
    transition: none !important;
  }
}

/* ==============================================================================
   🌟 Super-Premium Instagram Multi-Image Carousel, Fanciful Badge & Navigation
   ============================================================================== */
.post-carousel-track::-webkit-scrollbar {
  display: none !important;
}

/* Super HD Crisp Image Rendering & ATG GPU Convolution Unsharp Lens */
.post-media-stage img,
.post-media-first-img,
.living-canvas-img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  filter: url(#atg-super-hd-lens) contrast(1.025) saturate(1.04);
}

/* Fanciful Glassmorphic Multi-Photo 3-Layer Luxury Stacked Cards Badge */
.carousel-fanciful-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(10, 15, 29, 0.88) !important;
  backdrop-filter: blur(18px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(200%) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.55) !important;
  border-radius: 9999px !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 215, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  padding: 6px 14px !important;
  z-index: 12 !important;
  pointer-events: none !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
}

.carousel-fanciful-badge .carousel-cards-icon {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.75));
  flex-shrink: 0;
}

.carousel-fanciful-badge .carousel-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.85);
  flex-shrink: 0;
}

.carousel-fanciful-badge .carousel-counter-text {
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  line-height: 1 !important;
}

/* Interactive Navigation Chevrons */
.carousel-nav-btn {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 15 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, opacity 0.2s ease !important;
  outline: none !important;
  padding: 0 !important;
  opacity: 0.88;
}

.carousel-nav-btn:hover {
  background: rgba(15, 23, 42, 0.94) !important;
  transform: translateY(-50%) scale(1.08) !important;
  opacity: 1 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
}

.carousel-nav-btn:active {
  transform: translateY(-50%) scale(0.94) !important;
}

.carousel-nav-prev {
  left: 10px !important;
}

.carousel-nav-next {
  right: 10px !important;
}

.post-carousel-dots {
  background: rgba(15, 23, 42, 0.08);
  padding: 4px 10px;
  border-radius: 9999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

body.dark-mode .post-carousel-dots,
body.dark-theme .post-carousel-dots,
[data-bs-theme="dark"] .post-carousel-dots {
  background: rgba(255, 255, 255, 0.08);
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary, #94a3b8);
  opacity: 0.55;
  transition: width 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease, opacity 200ms ease;
  display: inline-block;
  cursor: pointer;
}

.carousel-dot.is-active {
  width: 20px;
  border-radius: 4px;
  opacity: 1;
  background: var(--brand-primary, #a31621);
}

body.dark-mode .carousel-dot.is-active,
body.dark-theme .carousel-dot.is-active,
[data-bs-theme="dark"] .carousel-dot.is-active {
  background: var(--brand-primary, #ff4d61);
  box-shadow: 0 0 8px var(--brand-primary-glow, rgba(255, 77, 97, 0.5));
}

/* ==============================================================================
   🌟 Super-Premium Comment Meta Row — Subpixel Baseline & Vertical Precision
   ============================================================================== */
.comment-meta-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  margin-top: 4px !important;
  padding-left: 8px !important;
}

.comment-meta-row .comment-meta-item,
.comment-meta-row .comment-meta-btn {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.78rem !important;
  line-height: 1.2 !important;
  min-height: 28px !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.comment-meta-row .comment-meta-btn {
  cursor: pointer !important;
  position: relative !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: opacity 120ms ease, color 120ms ease !important;
}

.comment-meta-row .comment-meta-btn:hover {
  opacity: 0.8 !important;
  text-decoration: underline !important;
}

/* Expanded hit area for touchscreen accessibility (Fitts's Law 44px) */
.comment-meta-row .comment-meta-btn::after {
  content: '' !important;
  position: absolute !important;
  inset: -8px -6px !important;
  z-index: 1 !important;
}

.comment-meta-row .comment-views-count.cursor-pointer:hover {
  text-decoration: underline !important;
  opacity: 0.8 !important;
}

/* ==========================================================================
   🌟 LIVING HEIRLOOM GLASS 3D REACTIONS (Chamber 1 Sovereign Board Approved)
   ========================================================================== */

/* The Frosted Glass Floating Dock (Apple Vision / Heirloom Gem standard) */
.heirloom-glass-dock {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16),
              0 4px 12px -2px rgba(15, 23, 42, 0.08),
              inset 0 1px 1px 0 rgba(255, 255, 255, 0.9) !important;
  border-radius: 9999px !important;
  padding: 6px 10px !important;
  align-items: center !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease !important;
}

body.dark-mode .heirloom-glass-dock {
  background: rgba(15, 23, 42, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 20px 42px -6px rgba(0, 0, 0, 0.55),
              0 6px 14px -2px rgba(0, 0, 0, 0.4),
              inset 0 1px 1px 0 rgba(255, 255, 255, 0.18) !important;
}

/* Individual Reaction Interactive Button */
.heirloom-reaction-btn {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 4px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  touch-action: manipulation !important;
  user-select: none !important;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.2s ease !important;
}

.heirloom-reaction-btn:hover,
.heirloom-reaction-btn:focus-visible,
.heirloom-reaction-btn.touch-active {
  transform: translateY(-8px) scale(1.36) !important;
  filter: drop-shadow(0 12px 18px var(--heirloom-glow, rgba(225, 29, 72, 0.45))) !important;
  z-index: 10 !important;
}

.heirloom-reaction-btn:active {
  transform: scale(0.94) !important;
  transition-duration: 0.08s !important;
}

@media (hover: none) {
  .heirloom-reaction-btn:active,
  .heirloom-reaction-btn.touch-active {
    transform: translateY(-8px) scale(1.36) !important;
    filter: drop-shadow(0 12px 18px var(--heirloom-glow, rgba(225, 29, 72, 0.45))) !important;
    z-index: 10 !important;
  }
}

.heirloom-reaction-btn.active {
  background: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 0 0 2px var(--heirloom-glow, rgba(225, 29, 72, 0.4)) !important;
}

body.dark-mode .heirloom-reaction-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Floating Label Tooltip on Hover & Touch Scrub */
.heirloom-tooltip-pill {
  position: absolute !important;
  bottom: calc(100% + 6px) !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(4px) scale(0.85) !important;
  background: rgba(15, 23, 42, 0.9) !important;
  color: #ffffff !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  padding: 3px 8px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.heirloom-reaction-btn:hover .heirloom-tooltip-pill,
.heirloom-reaction-btn.touch-active .heirloom-tooltip-pill {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

/* Vector SVG Glass Micro-Kinetics & Razor-Sharp Rendering */
.heirloom-glass-svg {
  display: block !important;
  transition: transform 0.22s ease !important;
  overflow: visible !important;
  shape-rendering: geometricPrecision !important;
  text-rendering: geometricPrecision !important;
  image-rendering: -webkit-optimize-contrast !important;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Floating Comment Reaction Dock & Active Like Glyph Ergonomics */
.comment-reaction-float-bar {
  padding: 6px 10px !important;
  gap: 4px !important;
}

.comment-like-active-glyph svg {
  width: 22px !important;
  height: 22px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

@media (max-width: 768px) {
  .comment-reaction-float-bar {
    padding: 6px 8px !important;
    gap: 2px !important;
    bottom: calc(100% + 8px) !important;
    max-width: calc(100vw - 32px) !important;
  }
  .comment-reaction-float-bar .heirloom-reaction-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 4px !important;
  }
  .comment-like-active-glyph svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Milestone Post Radiant Heirloom Aura (Option C Hybrid) */
.heirloom-milestone-aura {
  position: relative !important;
}

.heirloom-milestone-aura::after {
  content: '' !important;
  position: absolute !important;
  inset: -2px !important;
  border-radius: inherit !important;
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.28), rgba(192, 132, 252, 0.28), rgba(244, 63, 94, 0.2)) !important;
  z-index: -1 !important;
  filter: blur(8px) !important;
  animation: heirloomAuraBreathe 3s ease-in-out infinite alternate !important;
}

@keyframes heirloomAuraBreathe {
  0% { opacity: 0.4; filter: blur(6px); }
  100% { opacity: 0.85; filter: blur(12px); }
}

@keyframes heirloomCrystalPulse {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.35); filter: drop-shadow(0 0 16px rgba(253, 224, 71, 0.8)); }
  100% { transform: scale(1); }
}

.heirloom-active-icon {
  animation: heirloomCrystalPulse 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ==========================================================================
   ⚡ LIVING HEIRLOOM GLASS MICRO-ACTIONS (Expressive Animated Reactions)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* 1. LOVE: Cardiac Double-Beat + Rising Ruby Micro-Hearts */
  .heirloom-love .hg-heart-body {
    transform-origin: 20px 20px;
    animation: hgLoveHeartbeat 1.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  }
  .heirloom-love .hg-heart-core {
    transform-origin: 20px 18px;
    animation: hgLoveCoreGlow 1.5s ease-in-out infinite alternate;
  }
  .heirloom-love .hg-love-spark-1 {
    transform-origin: 9px 6px;
    animation: hgLoveSparkFloat 1.8s ease-out infinite;
  }
  .heirloom-love .hg-love-spark-2 {
    transform-origin: 31px 6px;
    animation: hgLoveSparkFloat 1.8s ease-out 0.75s infinite;
  }

  /* 2. LIKE: Dynamic Thumbs-Up Tilt, Spring Nod & Topaz Rays */
  .heirloom-like .hg-thumb-hand {
    transform-origin: 18px 24px;
    animation: hgThumbPopAction 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  }
  .heirloom-like .hg-thumb-spark {
    transform-origin: 20px 9px;
    animation: hgThumbSparkPop 1.8s ease-out infinite;
  }

  /* 3. HAHA: Joyful Laughing Head Bounce, Chattering Mouth & Tears of Joy */
  .heirloom-haha .hg-haha-face {
    transform-origin: 20px 20px;
    animation: hgHahaLaughBounce 1.1s ease-in-out infinite;
  }
  .heirloom-haha .hg-haha-mouth {
    transform-origin: 20px 23px;
    animation: hgHahaMouthChatter 0.55s ease-in-out infinite alternate;
  }
  .heirloom-haha .hg-haha-tears {
    transform-origin: 20px 21px;
    animation: hgHahaTearsWiggle 0.55s ease-in-out infinite alternate;
  }

  /* 4. WOW / SHOCK: Astonished Raised Brows & Gasping Mouth */
  .heirloom-shock .hg-wow-brows {
    transform-origin: 20px 11px;
    animation: hgWowBrowsLift 1.6s ease-in-out infinite;
  }
  .heirloom-shock .hg-wow-mouth {
    transform-origin: 20px 25px;
    animation: hgWowMouthGasp 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  }
  .heirloom-shock .hg-wow-eyes {
    transform-origin: 20px 15.8px;
    animation: hgWowEyesWide 1.6s ease-in-out infinite;
  }

  /* 5. SAD / EMPATHY: Gentle Brow Tilt & Rolling Crystalline Teardrop */
  .heirloom-sad .hg-sad-brows {
    transform-origin: 20px 13px;
    animation: hgSadBrowsDroop 2.4s ease-in-out infinite alternate;
  }
  .heirloom-sad .hg-sad-tear {
    transform-origin: 26.8px 21px;
    animation: hgSadTearDrop 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* 6. CELEBRATE: Spinning Golden Starburst & Orbiting Diamond Sparkles */
  .heirloom-celebrate .hg-celebrate-star {
    transform-origin: 20px 20.5px;
    animation: hgCelebrateStarSpin 3.2s linear infinite;
  }
  .heirloom-celebrate .hg-celebrate-orbit {
    transform-origin: 20px 20px;
    animation: hgCelebrateOrbitPulse 1.4s ease-in-out infinite alternate;
  }
}

@keyframes hgLoveHeartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.14); }
  28% { transform: scale(0.96); }
  42% { transform: scale(1.10); }
  70% { transform: scale(1); }
}

@keyframes hgLoveCoreGlow {
  0% { opacity: 0.7; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1.18); }
}

@keyframes hgLoveSparkFloat {
  0% { opacity: 0; transform: translateY(4px) scale(0.4); }
  35% { opacity: 0.95; transform: translateY(-1px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-7px) scale(0.6); }
}

@keyframes hgThumbPopAction {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-14deg) translateY(1px) scale(0.92); }
  45% { transform: rotate(10deg) translateY(-2.5px) scale(1.14); }
  65% { transform: rotate(-3deg) translateY(0) scale(1.02); }
}

@keyframes hgThumbSparkPop {
  0%, 25%, 100% { opacity: 0; transform: scale(0.5); }
  45% { opacity: 1; transform: scale(1.2) translateY(-1.5px); }
  75% { opacity: 0; transform: scale(1.35) translateY(-3px); }
}

@keyframes hgHahaLaughBounce {
  0%, 100% { transform: rotate(-7deg) translateY(0); }
  25% { transform: rotate(7deg) translateY(-2px); }
  50% { transform: rotate(-6deg) translateY(0); }
  75% { transform: rotate(6deg) translateY(-1.5px); }
}

@keyframes hgHahaMouthChatter {
  0% { transform: scaleY(0.85) scaleX(0.96); }
  100% { transform: scaleY(1.14) scaleX(1.05); }
}

@keyframes hgHahaTearsWiggle {
  0% { transform: translateY(0) scale(0.92); }
  100% { transform: translateY(1.8px) scale(1.12); }
}

@keyframes hgWowBrowsLift {
  0%, 100% { transform: translateY(0); }
  40%, 65% { transform: translateY(-2.6px); }
}

@keyframes hgWowMouthGasp {
  0%, 100% { transform: scale(0.82); }
  40%, 65% { transform: scale(1.22); }
}

@keyframes hgWowEyesWide {
  0%, 100% { transform: scale(0.95); }
  45%, 65% { transform: scale(1.12); }
}

@keyframes hgSadBrowsDroop {
  0% { transform: translateY(-0.5px); }
  100% { transform: translateY(1.4px); }
}

@keyframes hgSadTearDrop {
  0% { opacity: 0; transform: translateY(-2px) scale(0.45); }
  25% { opacity: 1; transform: translateY(0px) scale(0.95); }
  75% { opacity: 1; transform: translateY(5.5px) scale(1.05); }
  100% { opacity: 0; transform: translateY(9px) scale(0.6); }
}

@keyframes hgCelebrateStarSpin {
  0% { transform: rotate(0deg) scale(0.95); }
  50% { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(0.95); }
}

@keyframes hgCelebrateOrbitPulse {
  0% { opacity: 0.45; transform: scale(0.85) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1.12) rotate(8deg); }
}

/* 3D Click Particle Burst Stage & Fountain */
.heirloom-burst-particle {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: heirloomBurstFly 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heirloomBurstFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.35) rotate(0deg);
  }
  65% {
    opacity: 1;
    transform: translate(var(--burst-dx, 0px), var(--burst-dy, -40px)) scale(var(--burst-scale, 1)) rotate(var(--burst-rot, 15deg));
  }
  100% {
    opacity: 0;
    transform: translate(var(--burst-dx, 0px), calc(var(--burst-dy, -40px) + 16px)) scale(0.25) rotate(var(--burst-rot, 15deg));
  }
}

/* ==============================================================================
   🌟 Zero-CLS Shimmering Skeleton Surface & Mobile Safe-Area Invariants (Segun Gate)
   ============================================================================== */
.vse-skeleton-surface {
  background-color: #0f172a;
  background-image: linear-gradient(
    110deg,
    rgba(15, 23, 42, 0.92) 8%,
    rgba(30, 41, 59, 0.96) 18%,
    rgba(15, 23, 42, 0.92) 33%
  );
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .vse-skeleton-surface {
    animation: vseSkeletonShimmer 1.8s linear infinite;
  }
}

@keyframes vseSkeletonShimmer {
  to {
    background-position-x: -200%;
  }
}

/* ==============================================================================
   📸 Living Canvas: Adaptive Cinematic Zoom & Tactile Lens Engine
   Inspired by Leonardo Hotels Ken Burns with Viewport & Directional Intelligence
   ============================================================================== */

/* Stage boundary locks aspect ratio and clips zoom overflow with zero layout shifts */
.post-media-stage {
  position: relative;
  overflow: hidden !important;
  isolation: isolate;
  contain: paint;
}

/* Base image styling with GPU hardware acceleration */
.post-media-stage .post-media-first-img,
.post-media-stage .living-canvas-img {
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

/* 🌟 Viewport-Activated Living Motion: Only animates when active in viewport */
.post-media-stage.is-living-active:not(.living-drift-b):not(.living-drift-c) .post-media-first-img,
.post-media-stage.is-living-active.living-drift-a .post-media-first-img {
  animation: livingCanvasDriftA 16s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

/* Alternating directional variations for visual richness across feed cards */
.post-media-stage.is-living-active.living-drift-b .post-media-first-img {
  animation: livingCanvasDriftB 18s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

.post-media-stage.is-living-active.living-drift-c .post-media-first-img {
  animation: livingCanvasDriftC 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

/* Multi-image Carousel: Active slide inherits the living drift */
.post-media-stage.is-living-active .carousel-slide-item.is-slide-active .living-canvas-img {
  animation: livingCanvasDriftA 16s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

/* Ambient Backlight Aura breathes in theatre-grade synchrony with the photo */
.feed-media-aura-container:has(.post-media-stage.is-living-active) .feed-media-aura-backdrop {
  animation: livingCanvasAuraPulse 16s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

/* Keyframes: Cinematic slow breath zoom-in with subtle vertical pan */
@keyframes livingCanvasDriftA {
  0% {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
  50% {
    transform: translate3d(-0.6%, -1.2%, 0) scale3d(1.055, 1.055, 1);
  }
  100% {
    transform: translate3d(0.5%, -1.8%, 0) scale3d(1.085, 1.085, 1);
  }
}

/* Keyframes: Cinematic slow breath zoom-out from gentle elevation */
@keyframes livingCanvasDriftB {
  0% {
    transform: translate3d(0.8%, 0, 0) scale3d(1.08, 1.08, 1);
  }
  50% {
    transform: translate3d(0, -0.8%, 0) scale3d(1.04, 1.04, 1);
  }
  100% {
    transform: translate3d(-0.8%, 0.6%, 0) scale3d(1, 1, 1);
  }
}

/* Keyframes: Gentle diagonal glide across wide heritage landscapes */
@keyframes livingCanvasDriftC {
  0% {
    transform: translate3d(-1%, 0, 0) scale3d(1.02, 1.02, 1);
  }
  50% {
    transform: translate3d(0, -1%, 0) scale3d(1.075, 1.075, 1);
  }
  100% {
    transform: translate3d(1%, -0.5%, 0) scale3d(1.04, 1.04, 1);
  }
}

/* Keyframes: Ambient Backlight Aura breathing pulse */
@keyframes livingCanvasAuraPulse {
  0% {
    transform: scale(0.96) translateZ(0);
    opacity: 0.38;
    filter: blur(32px) saturate(160%) brightness(1.08);
  }
  100% {
    transform: scale(1.04) translateZ(0);
    opacity: 0.56;
    filter: blur(42px) saturate(190%) brightness(1.22);
  }
}

/* Desktop Hover Enhancement: Pauses auto-drift and smoothly yields to pointer */
@media (hover: hover) {
  .post-media-stage:hover .post-media-first-img,
  .post-media-stage:hover .living-canvas-img {
    animation-play-state: paused;
  }
}

/* Mobile Touch-and-Hold / Active Inspection ("Peek & Magnify") */
@media (hover: none) and (pointer: coarse) {
  .post-media-stage:active .post-media-first-img,
  .post-media-stage:active .living-canvas-img {
    transform: scale3d(1.15, 1.15, 1) translate3d(0, 0, 0) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    animation-play-state: paused !important;
  }
}

/* 🛡️ Strict Accessibility Guard: Inviolable Reduced Motion Invariant */
@media (prefers-reduced-motion: reduce) {
  .post-media-stage.is-living-active .post-media-first-img,
  .post-media-stage.is-living-active.living-drift-b .post-media-first-img,
  .post-media-stage.is-living-active.living-drift-c .post-media-first-img,
  .post-media-stage.is-living-active .carousel-slide-item.is-slide-active .living-canvas-img,
  .feed-media-aura-container:has(.post-media-stage.is-living-active) .feed-media-aura-backdrop {
    animation: none !important;
    transform: none !important;
  }
}

/* ==========================================================================
   🎬 Native Video Browser Overlay Elimination (WebKit / Blink / Gecko)
   Suppresses redundant browser-native play/pause buttons, start playback buttons,
   and overlay indicators that obstruct custom video players.
   ========================================================================== */
video.feed-post-video::-webkit-media-controls-start-playback-button,
video.feed-post-video::-webkit-media-controls-overlay-play-button,
video.feed-post-video::-webkit-media-controls-play-button,
.video-rendition-frame video::-webkit-media-controls-start-playback-button,
.video-rendition-frame video::-webkit-media-controls-overlay-play-button,
.video-rendition-frame video::-webkit-media-controls-play-button,
.video-embed-container video::-webkit-media-controls-start-playback-button,
.video-embed-container video::-webkit-media-controls-overlay-play-button,
.video-embed-container video::-webkit-media-controls-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}







