/* ─── Design Tokens ─── */
:root {
  --color-primary:    #0891B2;
  --color-secondary:  #22D3EE;
  --color-accent:     #059669;
  --color-bg:         #ECF8FA;
  --color-fg:         #164E63;
  --color-muted:      #E8F1F6;
  --color-border:     #A5F3FC;
  --color-surface:    #FBFEFF;
  --color-destructive:#DC2626;
  --color-ring:       var(--color-primary);
  --color-fg-soft:    rgba(22,78,99,0.72);
  --color-fg-muted:   rgba(22,78,99,0.58);
  --color-nav-bg:     rgba(20,78,99,0.92);
  --color-nav-border: rgba(165,243,252,0.15);
  --color-footer-bg:  #123849;
  --color-footer-fg:  rgba(255,255,255,0.74);
  --color-footer-muted: rgba(255,255,255,0.5);
  --color-section-wash: linear-gradient(135deg, var(--color-primary-05), rgba(5,150,105,0.05));
  --color-crisis-bg: linear-gradient(135deg, var(--color-fg), var(--color-primary));
  --hero-note-bg: linear-gradient(135deg, rgba(13,148,136,0.16), rgba(14,165,233,0.14));
  --hero-note-border: var(--color-primary-30);
  --hero-note-fg: #0F4C5C;
  --hero-note-shadow: 0 14px 28px var(--color-primary-12);

  /* extended organic palette */
  --color-sage:       #6B9E78;
  --color-earth:      #8B7355;
  --color-blush:      #F9A8D4;
  --color-amber:      #F59E0B;
  --color-pink:       #EC4899;
  --color-sky:        #0EA5E9;
  --color-navy:       #1E3A8A;

  /* primary alpha tints (light: #0891B2 = 8,145,178) */
  --color-primary-05: rgba(8,145,178, 0.05);
  --color-primary-06: rgba(8,145,178, 0.06);
  --color-primary-07: rgba(8,145,178, 0.07);
  --color-primary-08: rgba(8,145,178, 0.08);
  --color-primary-10: rgba(8,145,178, 0.10);
  --color-primary-12: rgba(8,145,178, 0.12);
  --color-primary-14: rgba(8,145,178, 0.14);
  --color-primary-18: rgba(8,145,178, 0.18);
  --color-primary-30: rgba(8,145,178, 0.30);
  --color-primary-50: rgba(8,145,178, 0.50);

  /* spacing scale (4px base) */
  --space-1:    4px;
  --space-1-5:  6px;
  --space-2:    8px;
  --space-2-5:  10px;
  --space-3:    12px;
  --space-3-5:  14px;
  --space-4:    16px;
  --space-4-5:  18px;
  --space-5:    20px;
  --space-6:    24px;
  --space-7:    28px;
  --space-8:    32px;
  --space-10:   40px;
  --space-12:   48px;
  --space-14:   56px;
  --space-16:   64px;
  --space-20:   80px;

  /* type scale */
  --text-2xs:  0.75rem;
  --text-xs:   0.85rem;
  --text-sm:   0.92rem;
  --text-base: 1rem;
  --text-lg:   1.15rem;
  --text-xl:   1.35rem;
  --text-2xl:  1.6rem;
  --text-3xl:  1.9rem;
  --text-4xl:  2.2rem;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 20px rgba(0,0,0,0.10);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl:32px;
  --radius-full: 9999px;

  --transition: 200ms ease;
  --transition-slow: 400ms ease;
  color-scheme: light;
}

html[data-theme='dark'] {
  --color-primary:    #5DB9D1;
  --color-secondary:  #88D9E8;
  --color-accent:     #5EB592;
  --color-bg:         #0D1922;
  --color-fg:         #E3F0F4;
  --color-muted:      #122633;
  --color-border:     #254556;
  --color-surface:    #10202B;
  --color-ring:       #7CD3E3;
  --color-fg-soft:    rgba(227,240,244,0.76);
  --color-fg-muted:   rgba(227,240,244,0.6);
  --color-nav-bg:     rgba(9,18,24,0.88);
  --color-nav-border: rgba(136,217,232,0.12);
  --color-footer-bg:  #09141B;
  --color-footer-fg:  rgba(227,240,244,0.76);
  --color-footer-muted: rgba(227,240,244,0.5);
  --color-section-wash: linear-gradient(135deg, rgba(15,39,52,0.9), rgba(13,29,38,0.95));
  --color-crisis-bg: linear-gradient(135deg, #112532, #18455B);
  --hero-note-bg: linear-gradient(135deg, rgba(10,72,81,0.92), rgba(17,74,104,0.88));
  --hero-note-border: rgba(124,211,227,0.2);
  --hero-note-fg: #ECFAFD;
  --hero-note-shadow: 0 18px 36px rgba(0,0,0,0.28);
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.28);
  --shadow-md:  0 8px 18px rgba(0,0,0,0.24);
  --shadow-lg:  0 18px 36px rgba(0,0,0,0.28);
  --shadow-xl:  0 28px 52px rgba(0,0,0,0.34);
  /* primary alpha tints (dark: #5DB9D1 = 93,185,209) */
  --color-primary-05: rgba(93,185,209,0.05);
  --color-primary-06: rgba(93,185,209,0.06);
  --color-primary-07: rgba(93,185,209,0.07);
  --color-primary-08: rgba(93,185,209,0.08);
  --color-primary-10: rgba(93,185,209,0.10);
  --color-primary-12: rgba(93,185,209,0.12);
  --color-primary-14: rgba(93,185,209,0.14);
  --color-primary-18: rgba(93,185,209,0.18);
  --color-primary-30: rgba(93,185,209,0.30);
  --color-primary-50: rgba(93,185,209,0.50);
  color-scheme: dark;
}

/* ─── Reset ─── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Heebo', sans-serif;
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition);
}

#techniques-section,
#about-section,
#crisis-section {
  scroll-margin-top: 128px;
}

/* ─── Alpine.js Cloak ─── */
[x-cloak] { display: none !important; }

/* ─── Background organic blobs ─── */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blobFloat 18s ease-in-out infinite;
}
.blob-1 { width:500px;height:500px;background:var(--color-secondary);top:-100px;right:-150px;animation-delay:0s; }
.blob-2 { width:400px;height:400px;background:var(--color-accent);bottom:10%;left:-120px;animation-delay:-6s; }
.blob-3 { width:350px;height:350px;background:var(--color-primary);top:40%;right:30%;animation-delay:-12s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(20px,-30px) scale(1.05); }
  66%      { transform: translate(-15px,20px) scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; }
}

/* ─── Nav ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-nav-border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4-5);
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Heebo', sans-serif;
}
.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.nav-logo-text {
  font-size: var(--text-lg);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.01em;
}
.nav-logo-sub {
  font-size: var(--text-2xs);
  color: var(--color-secondary);
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  align-items: center;
}
.nav-links a, .nav-links button {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  padding: 0;
}
.nav-links a:hover, .nav-links button:hover { color: #FFFFFF; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600 !important;
}
.nav-back-btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .nav-links { display: none; } }
@media (max-width: 480px) {
  .theme-toggle span { display: none; }
  .theme-toggle { padding-inline: 11px; }
}

/* ─── Layout ─── */
main { position: relative; z-index: 1; }
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
section { padding: 80px 0; }
@media (max-width: 768px) { section { padding: 56px 0; } }

/* ─── SPA View Transitions ─── */
.view-wrap {
  min-height: calc(100vh - 64px);
}

/* Alpine x-transition classes for view enter */
.view-enter        { transition: opacity 280ms cubic-bezier(0.22,1,0.36,1), transform 280ms cubic-bezier(0.22,1,0.36,1); }
.view-enter-start  { opacity: 0; transform: translateY(14px); }
.view-enter-end    { opacity: 1; transform: translateY(0); }
.view-leave        { transition: opacity 150ms ease; }
.view-leave-start  { opacity: 1; }
.view-leave-end    { opacity: 0; }

/* ─── Hero ─── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-10);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-6);
}
.hero-badge svg { width:14px;height:14px; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--color-fg);
  line-height: 1.15;
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: var(--text-xl);
  color: var(--color-fg-soft);
  max-width: 560px;
  margin: 0 auto 48px;
  font-weight: 400;
  line-height: 1.7;
}
.hero-note {
  max-width: 640px;
  margin: -20px auto 0;
  padding: 16px 20px;
  border-radius: var(--radius-xl);
  background: var(--hero-note-bg);
  border: 1px solid var(--hero-note-border);
  box-shadow: var(--hero-note-shadow);
  color: var(--hero-note-fg);
  font-size: var(--text-sm);
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme='dark'] .blob { opacity: 0.12; }
html[data-theme='dark'] .theme-toggle {
  background: rgba(227,240,244,0.08);
  border-color: rgba(227,240,244,0.12);
}
html[data-theme='dark'] .theme-toggle:hover {
  background: rgba(227,240,244,0.13);
  border-color: rgba(227,240,244,0.18);
}

/* ─── Emotion Check-In ─── */
.checkin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 40px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
}
.checkin-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-2);
}
.checkin-sub {
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
  margin-bottom: var(--space-7);
}
.emotion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}
@media (max-width: 600px) { .emotion-grid { grid-template-columns: repeat(2, 1fr); } }
.emotion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 16px 12px;
  background: var(--color-muted);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-fg);
}
.emotion-btn:hover {
  border-color: var(--color-border);
  background: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.emotion-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-08);
  color: var(--color-primary);
}
.emotion-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.checkin-result {
  background: linear-gradient(135deg, var(--color-primary-06), rgba(5,150,105,0.06));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: right;
}
.checkin-result-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-2-5);
}
.checkin-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.recommend-tag {
  background: var(--color-primary);
  color: white;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: 'Heebo', sans-serif;
}
.recommend-tag:hover {
  background: var(--color-fg);
  transform: translateY(-1px);
}

/* ─── Section Headers ─── */
.section-header { text-align: center; margin-bottom: var(--space-14); }
.section-tag {
  display: inline-block;
  background: var(--color-primary-10);
  color: var(--color-primary);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--color-fg);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}
.section-desc {
  font-size: var(--text-base);
  color: var(--color-fg-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Technique Cards ─── */
.techniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.technique-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: right;
  font-family: 'Heebo', sans-serif;
}
.technique-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: var(--card-accent, var(--color-primary));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}
.technique-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--card-accent, var(--color-border));
}
.technique-card:hover::before { transform: scaleX(1); }
.technique-card:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-icon-bg, var(--color-primary-10));
  flex-shrink: 0;
}
.card-icon-wrap svg { width: 28px; height: 28px; color: var(--card-accent, var(--color-primary)); }

.card-body { flex: 1; }
.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-1-5);
}
.card-subtitle {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--card-accent, var(--color-primary));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-2-5);
}
.card-desc {
  font-size: var(--text-sm);
  color: var(--color-fg-soft);
  line-height: 1.6;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1-5);
  margin-top: var(--space-3);
}
.card-tag {
  font-size: var(--text-2xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--card-icon-bg, var(--color-primary-10));
  color: var(--card-accent, var(--color-primary));
}
.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
}
.card-cta-text {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--card-accent, var(--color-primary));
}
.card-cta-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-icon-bg, var(--color-primary-10));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.card-cta-arrow svg { width: 16px; height: 16px; color: var(--card-accent, var(--color-primary)); }
.technique-card:hover .card-cta-arrow {
  background: var(--card-accent, var(--color-primary));
}
.technique-card:hover .card-cta-arrow svg { color: white; }

/* ─── Evidence badges ─── */
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-2xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(5,150,105,0.1);
  color: var(--color-accent);
  border: 1px solid rgba(5,150,105,0.2);
}
.evidence-badge svg { width: 10px; height: 10px; }

/* ─── Info Section ─── */
.info-section { background: var(--color-section-wash); }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-8);
}
.info-item {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.info-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.info-icon-wrap svg { width: 22px; height: 22px; color: var(--color-primary); }
.info-item-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-1-5);
}
.info-item-text {
  font-size: var(--text-sm);
  color: var(--color-fg-soft);
  line-height: 1.6;
}

/* ─── Crisis Section ─── */
.crisis-section {
  background: var(--color-crisis-bg);
  color: white;
  text-align: center;
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}
.crisis-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.crisis-inner { position: relative; z-index: 1; }
.crisis-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
}
.crisis-desc {
  font-size: var(--text-base);
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.crisis-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}
.crisis-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
}
.crisis-link:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}
.crisis-link svg { width: 18px; height: 18px; }

/* ─── Floating Crisis Button ─── */
.crisis-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220,38,38,0.35);
  transition: all var(--transition);
}
.crisis-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.45);
}
.crisis-fab svg { width: 18px; height: 18px; }

.crisis-panel {
  position: fixed;
  bottom: 80px;
  left: 24px;
  z-index: 150;
  background: var(--color-surface);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 300px;
  box-shadow: var(--shadow-xl);
}
.crisis-panel-title {
  font-size: var(--text-base);
  font-weight: 800;
  color: #DC2626;
  margin-bottom: var(--space-1);
}
.crisis-panel-subtitle {
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  margin-bottom: var(--space-4);
}
.crisis-panel-link {
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-fg);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--transition);
  font-family: 'Heebo', sans-serif;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: right;
}
.crisis-panel-link:hover { background: var(--color-muted); }
.crisis-panel-link svg {
  width: 18px;
  height: 18px;
  color: #DC2626;
  flex-shrink: 0;
}
.crisis-panel-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

@media (max-width: 640px) {
  .crisis-fab {
    bottom: 16px;
    left: 16px;
    padding: 10px 16px;
    font-size: var(--text-xs);
  }
  .crisis-panel {
    bottom: 68px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}

/* ─── Footer ─── */
footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-fg);
  padding: 40px 0;
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.footer-logo {
  font-size: var(--text-lg);
  font-weight: 800;
  color: white;
}
.footer-desc {
  font-size: var(--text-xs);
  max-width: 400px;
  line-height: 1.6;
}
.footer-contact {
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
}
.footer-divider {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.footer-credit {
  font-size: var(--text-xs);
  line-height: 1.8;
}
.footer-credit strong { color: white; }
.footer-note {
  font-size: var(--text-2xs);
  color: var(--color-footer-muted);
  margin-top: var(--space-1);
}

/* ─── Technique Detail View ─── */
.technique-view {
  padding: 32px 0 100px;
}
.technique-view-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  font-size: var(--text-sm);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  transition: all var(--transition);
  margin-bottom: 0;
  flex-shrink: 0;
}
.technique-view-back:hover {
  background: rgba(255,255,255,0.18);
  color: white;
}
.technique-view-back svg { width: 18px; height: 18px; }

.technique-view-topbar {
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-nav-border);
  position: sticky;
  top: 64px;
  z-index: 90;
}
.technique-view-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
}
.technique-view-topbar-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.technique-detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 40px;
  max-width: 720px;
  margin: 40px auto 0;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 600px) {
  .technique-detail-card {
    padding: 28px 20px;
    border-radius: var(--radius-xl);
    margin: 20px auto 0;
  }

  .hero-note {
    margin-top: -24px;
    font-size: var(--text-sm);
  }

  .technique-view-topbar {
    padding-inline: 16px;
  }

  .technique-view-topbar-title {
    font-size: var(--text-xs);
  }

  .breath-pattern-tabs {
    flex-direction: column;
  }

  .breath-controls {
    width: 100%;
    flex-direction: column;
  }

  .breath-controls .btn {
    width: 100%;
    justify-content: center;
  }

  .affect-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intensity-label {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: var(--space-3);
  }

  .intensity-value {
    align-self: flex-start;
  }

  .intensity-scale {
    font-size: var(--text-2xs);
  }

  .mantra-shell {
    padding: 18px;
    border-radius: 20px;
  }

  .mantra-examples {
    grid-template-columns: 1fr;
  }

  .mantra-chip {
    min-height: auto;
    padding: 14px 15px;
    font-size: var(--text-xs);
  }

  .mantra-editor {
    min-height: 104px;
    font-size: var(--text-sm);
  }

  .mantra-preview-card {
    padding: 20px;
    border-radius: 20px;
  }

  .mantra-preview-text {
    font-size: var(--text-base);
  }

  .detail-header {
    gap: var(--space-3-5);
  }

  .detail-title {
    font-size: var(--text-xl);
  }

  .grounding-nav {
    gap: var(--space-3);
  }
}

/* ─── Technique Detail Header ─── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-icon svg { width: 32px; height: 32px; }
.detail-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-fg);
  margin-bottom: var(--space-1);
}
.detail-subtitle {
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
}

/* ─── YouTube Video Embed ─── */
.video-section {
  margin: 28px 0;
}
.video-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-fg-muted);
  margin-bottom: var(--space-2-5);
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}
.video-label svg { width: 14px; height: 14px; }
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-muted);
  border: 1px solid var(--color-border);
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Breathing Exercise ─── */
.breath-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: 16px 0 32px;
}
.breath-circle-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.breath-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--color-border);
}
.breath-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 var(--color-primary-30);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
}
.breath-circle.inhale {
  transform: scale(1.2);
  box-shadow: 0 0 0 20px var(--color-primary-10);
}
.breath-circle.hold {
  transform: scale(1.2);
  box-shadow: 0 0 0 15px var(--color-primary-08);
}
.breath-circle.topup {
  transform: scale(1.28);
  box-shadow: 0 0 0 12px var(--color-primary-08);
}
.breath-circle.exhale {
  transform: scale(0.9);
  box-shadow: 0 0 0 5px var(--color-primary-05);
}
.breath-phase-text {
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
  letter-spacing: 0.04em;
}
.breath-count {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: white;
  line-height: 1;
}
.breath-label {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-fg);
  text-align: center;
}
.breath-controls { display: flex; gap: var(--space-3); }
.breath-pattern-tabs {
  display: flex;
  gap: var(--space-2);
  background: var(--color-muted);
  padding: 6px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}
.breath-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(22,78,99,0.6);
  cursor: pointer;
  transition: all var(--transition);
}
.breath-tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.cycles-display {
  font-size: var(--text-xs);
  color: rgba(22,78,99,0.6);
  margin-top: var(--space-3);
}
.breath-steps-list {
  margin-bottom: var(--space-3);
}

/* ─── Grounding Steps ─── */
.grounding-progress {
  display: flex;
  gap: var(--space-1-5);
  margin-bottom: var(--space-7);
}
.progress-dot {
  height: 6px;
  flex: 1;
  border-radius: 3px;
  background: var(--color-muted);
  transition: background var(--transition);
}
.progress-dot.done { background: var(--color-accent); }
.progress-dot.current { background: var(--color-primary); }
.grounding-sense {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.grounding-question {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-2);
}
.grounding-hint {
  font-size: var(--text-sm);
  color: rgba(22,78,99,0.6);
  margin-bottom: var(--space-6);
}
.grounding-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  margin-bottom: var(--space-7);
}
.grounding-item-input {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.item-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}
.grounding-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-sm);
  color: var(--color-fg);
  background: var(--color-bg);
  transition: border-color var(--transition);
  direction: rtl;
}
.grounding-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-12);
}
.grounding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Grounding Completion ─── */
.grounding-done-wrap {
  text-align: center;
  padding: 24px 0;
}
.grounding-done-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(5,150,105,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.grounding-done-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-fg);
  margin-bottom: var(--space-2-5);
}
.grounding-done-text {
  font-size: var(--text-sm);
  color: rgba(22,78,99,0.7);
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto 24px;
}

/* ─── Category Filter Pills ─── */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  justify-content: center;
}
.filter-pill {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: transparent;
  font-size: var(--text-xs);
  font-family: inherit;
  font-weight: 600;
  color: var(--color-fg-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ─── Post-Completion CTA ─── */
.post-completion {
  text-align: center;
  padding: 28px 0 8px;
  margin-top: var(--space-7);
  border-top: 1px solid var(--color-border);
}
.post-completion-question {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-4-5);
}
.post-completion-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Steps List ─── */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step-item {
  display: flex;
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 2px -16px;
}
.step-item:last-child { border-bottom: none; }
.step-item:hover { background: var(--color-muted); }
.step-item.step-active { background: var(--color-primary-07); }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.step-active .step-num {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.step-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-fg);
  margin-bottom: var(--space-1);
}
.step-desc {
  font-size: var(--text-xs);
  color: rgba(22,78,99,0.6);
  line-height: 1.5;
}

/* ─── Timer ─── */
.exercise-instruction {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-fg);
  text-align: center;
  max-width: 300px;
}
.simple-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  padding: 24px 0;
}
.timer-circle {
  position: relative;
  width: 160px;
  height: 160px;
}
.timer-svg {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}
.timer-track {
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 8;
}
.timer-fill {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1s linear;
}
.timer-fill--amber { stroke: var(--color-amber); }
.timer-fill--blue  { stroke: var(--color-sky); }
.timer-fill--green { stroke: var(--color-accent); }
.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-seconds {
  font-size: var(--text-4xl);
  font-weight: 900;
  color: var(--color-fg);
  line-height: 1;
}
.timer-label-sm {
  font-size: var(--text-2xs);
  color: rgba(22,78,99,0.55);
}

/* ─── Compassion / Reappraisal ─── */
.compassion-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.compassion-step {
  background: var(--color-muted);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border-right: 4px solid var(--color-primary);
}
.compassion-step--pink { border-right-color: var(--color-pink); }
.compassion-step--green { border-right-color: var(--color-accent); }
.compassion-step--amber { border-right-color: var(--color-amber); }
.compassion-step-num {
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1-5);
}
.compassion-step-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-1);
}
.compassion-step-text {
  font-size: var(--text-xs);
  color: var(--color-fg-soft);
  line-height: 1.6;
}
.compassion-quote {
  font-style: italic;
  font-size: var(--text-base);
  color: var(--color-primary);
  margin-top: var(--space-2);
  padding: 12px 16px;
  background: var(--color-primary-07);
  border-radius: var(--radius-md);
  font-weight: 500;
}
.detail-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ─── Repeatable Mantra ─── */
.mantra-shell {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,246,255,0.84));
  border: 1px solid rgba(191,219,254,0.95);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 16px 32px rgba(37,99,235,0.08);
}
.mantra-label,
.mantra-preview-label,
.mantra-editor-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-fg);
}
.mantra-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3-5);
  margin-bottom: var(--space-4-5);
}
.mantra-chip {
  width: 100%;
  min-height: 88px;
  padding: 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(147,197,253,0.72);
  background: rgba(255,255,255,0.86);
  color: var(--color-navy);
  text-align: right;
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.55;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.mantra-chip:hover {
  transform: translateY(-1px);
  border-color: #60A5FA;
  box-shadow: 0 12px 24px rgba(37,99,235,0.08);
}
.mantra-chip.selected {
  border-color: #2563EB;
  background: linear-gradient(180deg, rgba(219,234,254,0.96), rgba(239,246,255,0.98));
  box-shadow:
    0 16px 28px rgba(37,99,235,0.1),
    inset 0 1px 0 rgba(255,255,255,0.9);
}
.mantra-editor-label {
  display: block;
  margin-bottom: var(--space-2-5);
}
.mantra-editor {
  width: 100%;
  min-height: 118px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(186,230,253,0.95);
  background: rgba(255,255,255,0.92);
  color: var(--color-fg);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-base);
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.mantra-editor::placeholder {
  color: rgba(22,78,99,0.46);
}
.mantra-editor:focus-visible {
  outline: none;
  border-color: #60A5FA;
  box-shadow: 0 0 0 5px rgba(96,165,250,0.16);
  background: #fff;
}
.mantra-editor-note {
  margin-top: var(--space-2-5);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-fg-muted);
}
.mantra-preview {
  margin-top: var(--space-4-5);
}
.mantra-preview-card {
  margin-top: var(--space-3);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(191,219,254,0.3));
  border: 1px solid rgba(147,197,253,0.7);
}
.mantra-preview-text {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--color-navy);
  font-weight: 700;
}
.mantra-preview-repeat {
  margin-top: var(--space-2-5);
  font-size: var(--text-xs);
  color: rgba(30,58,138,0.72);
}
html[data-theme='dark'] .checkin-result,
html[data-theme='dark'] .affect-result,
html[data-theme='dark'] .evidence-info {
  background: linear-gradient(135deg, rgba(20,48,62,0.9), rgba(14,34,45,0.96));
}
html[data-theme='dark'] .mantra-shell {
  background: linear-gradient(180deg, rgba(13,31,42,0.96), rgba(17,39,53,0.9));
  border-color: rgba(124,211,227,0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 18px 34px rgba(0,0,0,0.28);
}
html[data-theme='dark'] .mantra-chip {
  background: rgba(18,39,52,0.92);
  border-color: rgba(93,185,209,0.24);
  color: #E3F0F4;
}
html[data-theme='dark'] .mantra-chip:hover {
  border-color: rgba(124,211,227,0.38);
  box-shadow: 0 14px 28px rgba(0,0,0,0.24);
}
html[data-theme='dark'] .mantra-chip.selected {
  background: linear-gradient(180deg, rgba(16,57,76,0.95), rgba(18,39,52,0.96));
  border-color: rgba(124,211,227,0.44);
}
html[data-theme='dark'] .mantra-editor {
  background: rgba(10,25,34,0.94);
  border-color: rgba(93,185,209,0.24);
}
html[data-theme='dark'] .mantra-editor::placeholder {
  color: rgba(227,240,244,0.4);
}
html[data-theme='dark'] .mantra-preview-card {
  background: linear-gradient(135deg, rgba(11,57,86,0.42), rgba(14,34,45,0.9));
  border-color: rgba(124,211,227,0.2);
}
html[data-theme='dark'] .mantra-preview-text {
  color: #F3FBFD;
}
html[data-theme='dark'] .mantra-preview-repeat {
  color: rgba(227,240,244,0.68);
}

/* ─── Affect Labeling ─── */
.affect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2-5);
  margin-bottom: var(--space-6);
}
.affect-chip {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-muted);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-fg);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.affect-chip:hover { border-color: var(--color-primary); background: var(--color-primary-07); }
.affect-chip.selected { border-color: var(--color-primary); background: var(--color-primary-12); color: var(--color-primary); }
.affect-result {
  background: linear-gradient(135deg, rgba(5,150,105,0.07), var(--color-primary-07));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: var(--space-4);
}
.affect-result-title {
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-2);
}
.affect-result-text {
  font-size: var(--text-sm);
  color: var(--color-fg-soft);
  line-height: 1.6;
}
.affect-result-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  margin-top: var(--space-3-5);
  padding: 8px 16px;
  background: var(--color-primary-10);
  border: 1px solid var(--color-primary-30);
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.affect-result-link:hover {
  background: var(--color-primary-18);
  border-color: var(--color-primary-50);
}
.intensity-wrap { margin: 20px 0; }
.intensity-shell {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(165,243,252,0.9);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 12px 24px rgba(22,78,99,0.08);
}
html[data-theme='dark'] .intensity-shell {
  background: rgba(13,29,39,0.92);
  border-color: rgba(93,185,209,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 16px 30px rgba(0,0,0,0.24);
}
.intensity-label {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-3-5);
}
.intensity-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-fg);
}
.intensity-subtitle {
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  margin-top: 2px;
}
.intensity-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: var(--color-primary-08);
  color: var(--color-primary);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.intensity-value-num {
  font-size: var(--text-lg);
  line-height: 1;
}
.intensity-value-total {
  font-size: var(--text-xs);
  opacity: 0.72;
}
.intensity-slider-wrap {
  position: relative;
  padding: 6px 0 4px;
}
.intensity-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background:
    linear-gradient(to right,
      #3aa9c4 0%,
      #3aa9c4 var(--slider-progress, 44%),
      rgba(22,78,99,0.12) var(--slider-progress, 44%),
      rgba(22,78,99,0.12) 100%);
  outline: none;
  direction: ltr;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.8),
    inset 0 0 0 1px rgba(22,78,99,0.04);
}
.intensity-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: transparent;
}
.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.98), rgba(255,255,255,0.92) 58%, rgba(232,241,246,0.98) 100%);
  cursor: pointer;
  border: 1px solid rgba(22,78,99,0.08);
  box-shadow:
    0 10px 18px rgba(22,78,99,0.18),
    0 2px 4px rgba(22,78,99,0.08),
    inset 0 1px 0 rgba(255,255,255,0.95);
  margin-top: -10px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.intensity-slider:hover::-webkit-slider-thumb {
  transform: scale(1.03);
}
.intensity-slider:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 10px 18px rgba(22,78,99,0.18),
    0 2px 4px rgba(22,78,99,0.08),
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 0 0 6px var(--color-primary-14);
}
.intensity-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(22,78,99,0.12);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.8),
    inset 0 0 0 1px rgba(22,78,99,0.04);
}
.intensity-slider::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: #3aa9c4;
}
.intensity-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.98), rgba(255,255,255,0.92) 58%, rgba(232,241,246,0.98) 100%);
  cursor: pointer;
  border: 1px solid rgba(22,78,99,0.08);
  box-shadow:
    0 10px 18px rgba(22,78,99,0.18),
    0 2px 4px rgba(22,78,99,0.08),
    inset 0 1px 0 rgba(255,255,255,0.95);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.intensity-slider:focus-visible::-moz-range-thumb {
  box-shadow:
    0 10px 18px rgba(22,78,99,0.18),
    0 2px 4px rgba(22,78,99,0.08),
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 0 0 6px var(--color-primary-14);
}
.intensity-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--color-fg-muted);
}

/* ─── PMR ─── */
.pmr-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pmr-step-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 18px;
  background: var(--color-muted);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Heebo', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-fg);
  text-align: right;
  width: 100%;
}
.pmr-step-label {
  flex: 1 1 auto;
  min-width: 0;
}
.pmr-step-chevron {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 16px;
  transition: transform 200ms ease;
}
.pmr-step-chevron.is-open {
  transform: rotate(180deg);
}
.pmr-step-btn.active {
  border-color: var(--color-accent);
  background: rgba(5,150,105,0.08);
  color: var(--color-accent);
}
.pmr-step-btn:hover:not(.active) { background: var(--color-border); }
.pmr-step-detail {
  padding: 12px 18px 16px;
  background: rgba(5,150,105,0.06);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--text-xs);
  color: var(--color-fg-soft);
  line-height: 1.6;
  margin-top: -8px;
  border: 1.5px solid rgba(5,150,105,0.2);
  border-top: none;
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.evidence-info {
  background: rgba(5,150,105,0.07);
  border: 1px solid rgba(5,150,105,0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: var(--space-6);
}
.evidence-info-title {
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.evidence-info-text {
  font-size: var(--text-xs);
  color: var(--color-fg-soft);
  line-height: 1.5;
}
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 24px 0;
}

/* ─── Completion Screen ─── */
.completion-screen {
  text-align: center;
  padding: 48px 0 32px;
}
.completion-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(5,150,105,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.completion-icon svg { width: 40px; height: 40px; color: var(--color-accent); }
.completion-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-fg);
  margin-bottom: var(--space-3);
}
.completion-text {
  font-size: var(--text-base);
  color: var(--color-fg-soft);
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.completion-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-muted); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

/* ─── Focus ─── */
:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }

/* Elements on dark/colored backgrounds need a white ring */
.nav-logo:focus-visible,
.nav-links a:focus-visible,
.nav-links button:focus-visible,
.nav-back-btn:focus-visible,
.technique-view-back:focus-visible,
.crisis-link:focus-visible,
.crisis-panel-link:focus-visible,
.crisis-fab:focus-visible {
  outline-color: #ffffff;
  outline-offset: 3px;
}

/* Programmatically-focused headings — suppress visible outline */
.detail-title:focus { outline: none; }

/* ─── Screen-reader only ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Skip navigation link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ════════════════════════════════════════════
   ANIMATIONS & ILLUSTRATIONS
   ════════════════════════════════════════════ */

/* ─── Keyframes (motion-only, no-preference guard) ─── */
@media (prefers-reduced-motion: no-preference) {
  @keyframes phaseTextAppear {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes drawCircle {
    to { stroke-dashoffset: 0; }
  }
  @keyframes drawCheck {
    to { stroke-dashoffset: 0; }
  }
  @keyframes dotComplete {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.22); }
    100% { transform: scale(1); }
  }
  @keyframes bodyRegionPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
  }
  @keyframes hillFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-4px); }
  }
  @keyframes scanBodyUp {
    from { transform: translateY(138px); }
    to   { transform: translateY(-40px); }
  }
}

/* ─── 1. Breathing — phase text crossfade ─── */
.breath-phase-text {
  animation: phaseTextAppear 0.25s ease-out both;
}

/* ─── 2. Timer completion — drawn checkmark ─── */
.timer-check-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.timer-check-svg {
  width: 62px;
  height: 62px;
  overflow: visible;
}
.timer-check-circle {
  fill: none;
  stroke: var(--timer-check-color, var(--color-accent));
  stroke-width: 3;
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  transform-origin: center;
}
.timer-check-mark {
  fill: none;
  stroke: var(--timer-check-color, var(--color-accent));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}
@media (prefers-reduced-motion: no-preference) {
  .timer-check-circle { animation: drawCircle 0.4s ease-out forwards; }
  .timer-check-mark   { animation: drawCheck 0.45s ease-out 0.3s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .timer-check-circle { stroke-dashoffset: 0; }
  .timer-check-mark   { stroke-dashoffset: 0; }
}
.timer-done-msg {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-fg);
  text-align: center;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .timer-done-msg { animation: phaseTextAppear 0.35s ease-out 0.65s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .timer-done-msg { opacity: 1; }
}

/* ─── 3. Grounding — circle dots with checkmarks ─── */
/* Override the existing flat-bar dot style */
.grounding-progress {
  justify-content: center;
}
.progress-dot {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-dot.done {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .progress-dot.done { animation: dotComplete 0.35s ease-out; }
}
.progress-dot.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.progress-dot-check {
  width: 14px;
  height: 14px;
  display: block;
}

/* ─── 4 & 5. Body Silhouette (PMR + Body Scan) ─── */
.body-region {
  stroke: var(--color-fg);
  stroke-opacity: 0.18;
  stroke-width: 1.5;
  fill: none;
  transition: fill 0.4s ease;
}
.body-region--active {
  fill: rgba(124,58,237,0.3);
}
@media (prefers-reduced-motion: no-preference) {
  .body-region--active { animation: bodyRegionPulse 2.2s ease-in-out infinite; }
}
.body-region--done { fill: rgba(124,58,237,0.1); }

/* PMR layout: silhouette + accordion side by side */
.pmr-layout {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.pmr-silhouette-col {
  flex: 0 0 72px;
  position: sticky;
  top: 80px;
}
.pmr-silhouette-svg {
  width: 72px;
  height: auto;
  display: block;
  overflow: visible;
}
.pmr-accordion-col { flex: 1; min-width: 0; }

@media (max-width: 480px) {
  .pmr-layout { flex-direction: column; gap: var(--space-3); }
  .pmr-silhouette-col { flex: none; position: static; align-self: center; }
  .pmr-silhouette-svg { width: 60px; }
}

/* ─── 6. Body Scan — silhouette + scan beam ─── */
.bodyscan-region {
  stroke: var(--color-accent);
  stroke-opacity: 0.2;
  stroke-width: 1.2;
  fill: rgba(5,150,105,0.05);
}
.body-scan-svg-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}
.body-scan-silhouette {
  width: 72px;
  height: auto;
  overflow: visible;
  display: block;
}
.scan-beam-rect {
  animation-play-state: paused;
}
.scan-beam-rect.scan-active {
  animation-play-state: running;
}
@media (prefers-reduced-motion: no-preference) {
  .scan-beam-rect.scan-active {
    animation: scanBodyUp 600s linear forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scan-beam-rect { display: none; }
}

/* ─── 7. Safe Place — ambient landscape ─── */
.safeplace-landscape {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
  line-height: 0;
}
.safeplace-landscape svg {
  width: 100%;
  height: 80px;
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .hill-near {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: hillFloat 12s ease-in-out infinite;
  }
  .hill-mid {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: hillFloat 17s ease-in-out 4s infinite;
  }
}
html[data-theme='dark'] .safeplace-sky { stop-color: #0C1E26; }
html[data-theme='dark'] .safeplace-landscape .hill-far,
html[data-theme='dark'] .safeplace-landscape .hill-mid,
html[data-theme='dark'] .safeplace-landscape .hill-near { opacity: 0.35; }

/* ─── Safety / Contraindications ─── */
.safety-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2-5) var(--space-3);
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.28);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-fg-soft);
  line-height: 1.55;
}
.safety-note-icon {
  flex-shrink: 0;
  font-size: var(--text-base);
  line-height: 1;
  margin-top: 1px;
}
html[data-theme='dark'] .safety-note {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
}
.general-disclaimer {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--color-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  line-height: 1.6;
  text-align: center;
}
