:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --paper-deep: #ece7dc;
  --ink: #21312d;
  --muted: #69736e;
  --sage: #779486;
  --sage-dark: #45665a;
  --sage-pale: #dce7df;
  --sky: #cadde1;
  --sand: #e8d8bd;
  --rose: #e4c8c5;
  --violet: #d9d2e5;
  --white: #fffefb;
  --shadow: 0 20px 50px rgba(45, 62, 55, .12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-serif: "Charter", "Iowan Old Style", "Palatino", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  min-block-size: 100dvh;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(69, 102, 90, .3); outline-offset: 3px; }

/* Improve Text Layout & Legibility (Modern Web Guidance) */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}
p, blockquote, li, .case-card-body, .lecture-body {
  text-wrap: pretty;
}

/* Touch & Mobile Interaction Enhancements */
button, a, input, select, textarea, [role="button"], .filter-chip, .pattern-chip, .duration-chip {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100dvh;
  min-block-size: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(96px + var(--safe-bottom));
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(68px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 20px 8px;
  background: rgba(246, 243, 236, .84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-family: var(--font-serif); font-size: 20px; letter-spacing: .08em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.brand-mark { display: block; width: 38px; height: 38px; object-fit: contain; }

.quiet-button, .text-button, .icon-button, .filter-chip { border: 0; background: transparent; cursor: pointer; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang-button { padding: 6px 12px; border: 1px solid rgba(69,102,90,.25); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--sage-dark); font-size: 12px; font-weight: 750; letter-spacing: .05em; }
.install-button { padding: 9px 15px; border: 1px solid rgba(69,102,90,.25); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--sage-dark); font-size: 13px; font-weight: 650; }
.view { display: none; padding: 0 18px 28px; animation: enter .35s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 380px; padding: 42px 24px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #e9efe9 0%, #d8e3dc 55%, #d0ded8 100%);
}
@media (min-width: 720px) {
  .hero { min-height: 420px; padding: 58px 40px 38px; }
}
.hero::after { content: ""; position: absolute; inset: auto -30px -100px auto; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.26); filter: blur(2px); z-index: -1; }
.eyebrow { margin: 0 0 9px; color: var(--sage-dark); font-size: 11px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.hero h1, .page-intro h1 { margin: 0; font-family: var(--font-serif); font-weight: 520; letter-spacing: -.03em; line-height: 1.18; }
.hero h1 { max-width: 510px; font-size: clamp(38px, 8vw, 61px); }
.hero h1 em { color: var(--sage-dark); font-style: normal; }
.hero > p:not(.eyebrow) { max-width: 380px; margin: 20px 0 26px; color: #52635d; font-size: 15px; line-height: 1.8; }
.primary-button, .secondary-button, .complete-button, .danger-button {
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 700;
}
.primary-button { display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px 14px 14px; background: var(--ink); color: white; box-shadow: 0 12px 24px rgba(33,49,45,.2); }
.play-dot { display: grid; place-items: center; width: 31px; height: 31px; padding-left: 2px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 10px; }
.hero-orbit { position: absolute; z-index: -1; border: 1px solid rgba(69,102,90,.18); border-radius: 50%; }
.orbit-one { width: 245px; height: 245px; top: -74px; right: -52px; }
.orbit-two { width: 150px; height: 150px; top: -26px; right: -7px; }

.section-block { padding: 34px 2px 8px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2, .section-heading h3 { margin: 0; font-family: var(--font-serif); font-size: 25px; font-weight: 560; }
.text-button { padding: 8px 0; color: var(--sage-dark); font-size: 13px; font-weight: 650; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-card { position: relative; min-height: 166px; overflow: hidden; padding: 18px; border: 0; border-radius: 22px; text-align: left; cursor: pointer; }
.quick-card.sage { background: var(--sage-pale); }
.quick-card.sky { background: var(--sky); }
.quick-card.sand { background: var(--sand); }
.quick-card.rose { background: var(--rose); }
.quick-card.violet { background: var(--violet); }
.quick-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -24px; bottom: -32px; border: 1px solid rgba(33,49,45,.15); border-radius: 50%; box-shadow: 0 0 0 19px rgba(255,255,255,.11); }
.quick-card small { display: block; margin-bottom: 21px; color: rgba(33,49,45,.62); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.quick-card strong { display: block; max-width: 130px; font-family: var(--font-serif); font-size: 20px; line-height: 1.35; }
.quick-card span { display: block; margin-top: 8px; color: rgba(33,49,45,.64); font-size: 12px; }

.breath-card {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 28px;
  margin: 28px 0 20px;
  padding: 34px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(150deg, #253932 0%, #172420 100%);
  color: white;
  box-shadow: 0 18px 45px rgba(20, 32, 27, 0.16);
  position: relative;
  overflow: hidden;
}
.breath-copy h2 { margin: 0 0 14px; font-family: var(--font-serif); font-size: 25px; font-weight: 500; letter-spacing: -0.02em; }
.breath-copy .eyebrow { color: #b9cec4; }
.breath-patterns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.pattern-chip { padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: rgba(255,255,255,.76); font-size: 11.5px; font-weight: 500; cursor: pointer; transition: all .2s ease; }
.pattern-chip:hover { background: rgba(255,255,255,.14); color: #fff; }
.pattern-chip.active { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); color: #fff; box-shadow: 0 0 12px rgba(255,255,255,.15); }
.breath-info-card { display: none !important; }
.breath-controls-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.secondary-button { padding: 10px 20px; border-radius: 999px; border: none; background: #ffffff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s ease; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.secondary-button:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.breath-duration-group { display: flex; align-items: center; gap: 3px; background: rgba(255,255,255,.08); padding: 3px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); }
.duration-chip { padding: 4px 10px; border-radius: 999px; border: none; background: transparent; color: rgba(255,255,255,.6); font-size: 11px; cursor: pointer; transition: all .2s; }
.duration-chip:hover { color: #fff; }
.duration-chip.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }

.breath-visual {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px 0 16px;
  position: relative;
}

.breath-orb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 45% 35%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.16) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45),
              inset 0 -4px 14px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.25),
              0 10px 30px rgba(0, 0, 0, 0.28);
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1), background .8s, border-color .4s, box-shadow .8s;
  will-change: transform;
}

/* Outer Ambient Bioluminescent Aurora Aura */
.breath-orb::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(142, 205, 175, 0.5) 0%, rgba(98, 185, 150, 0.15) 60%, transparent 100%);
  filter: blur(20px);
  opacity: 0.55;
  z-index: -1;
  transition: all 1s ease;
  pointer-events: none;
}

/* Concentric Harmonic Orbit Ripple Ring */
.breath-orb::after {
  content: "";
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  opacity: 0.65;
  z-index: -1;
  animation: orbitRipple 30s linear infinite;
  transition: all 1s ease;
  pointer-events: none;
}

@keyframes orbitRipple {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes idleBreath {
  0%, 100% {
    transform: scale(0.97);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 25px rgba(142, 205, 175, 0.2);
  }
  50% {
    transform: scale(1.03);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 40px rgba(142, 205, 175, 0.38);
  }
}

.breath-orb:not(.inhale):not(.hold):not(.exhale):not(.pause) {
  animation: idleBreath 4.5s ease-in-out infinite;
}

/* Phase 1: Inhale (吸气 - 苍翠生机) */
.breath-orb.inhale {
  transform: scale(1.22);
  border-color: rgba(142, 235, 185, 0.95);
  background: radial-gradient(circle at 45% 35%, rgba(142, 235, 185, 0.35) 0%, rgba(65, 160, 115, 0.15) 55%, rgba(0, 0, 0, 0.2) 100%);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.6),
              0 0 0 10px rgba(142, 205, 175, 0.18),
              0 0 45px rgba(142, 205, 175, 0.45);
}
.breath-orb.inhale::before {
  opacity: 0.9;
  background: radial-gradient(circle, rgba(142, 235, 185, 0.65) 0%, rgba(98, 185, 150, 0.25) 65%, transparent 100%);
  transform: scale(1.25);
}
.breath-orb.inhale::after {
  opacity: 0.9;
  border-color: rgba(142, 235, 185, 0.6);
  transform: scale(1.2);
}
.breath-orb.inhale span { color: #c4ecd8; }

/* Phase 2: Hold (屏息 - 暖金凝神) */
.breath-orb.hold {
  transform: scale(1.22);
  border-color: rgba(255, 210, 105, 0.95);
  background: radial-gradient(circle at 45% 35%, rgba(255, 215, 115, 0.38) 0%, rgba(200, 145, 45, 0.16) 55%, rgba(0, 0, 0, 0.2) 100%);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.65),
              0 0 0 12px rgba(246, 196, 92, 0.2),
              0 0 55px rgba(246, 196, 92, 0.5);
}
.breath-orb.hold::before {
  opacity: 0.95;
  background: radial-gradient(circle, rgba(255, 215, 115, 0.7) 0%, rgba(220, 160, 45, 0.25) 65%, transparent 100%);
  transform: scale(1.25);
}
.breath-orb.hold::after {
  opacity: 0.9;
  border-color: rgba(255, 210, 105, 0.65);
  transform: scale(1.2);
}
.breath-orb.hold span { color: #ffe28a; }

/* Phase 3: Exhale (呼气 - 澄澈碧空) */
.breath-orb.exhale {
  transform: scale(.84);
  border-color: rgba(135, 210, 245, 0.9);
  background: radial-gradient(circle at 45% 35%, rgba(135, 210, 245, 0.28) 0%, rgba(60, 135, 180, 0.12) 55%, rgba(0, 0, 0, 0.2) 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4),
              0 0 0 8px rgba(135, 198, 235, 0.14),
              0 0 35px rgba(135, 198, 235, 0.32);
}
.breath-orb.exhale::before {
  opacity: 0.6;
  background: radial-gradient(circle, rgba(135, 210, 245, 0.5) 0%, rgba(60, 135, 180, 0.15) 65%, transparent 100%);
  transform: scale(0.9);
}
.breath-orb.exhale::after {
  opacity: 0.5;
  border-color: rgba(135, 210, 245, 0.4);
  transform: scale(0.9);
}
.breath-orb.exhale span { color: #bde4fb; }

/* Phase 4: Pause (静心 - 虚空紫蔼) */
.breath-orb.pause {
  transform: scale(.84);
  border-color: rgba(210, 175, 250, 0.95);
  background: radial-gradient(circle at 45% 35%, rgba(210, 175, 250, 0.32) 0%, rgba(130, 95, 180, 0.14) 55%, rgba(0, 0, 0, 0.2) 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4),
              0 0 0 8px rgba(198, 162, 238, 0.16),
              0 0 40px rgba(198, 162, 238, 0.35);
}
.breath-orb.pause::before {
  opacity: 0.65;
  background: radial-gradient(circle, rgba(210, 175, 250, 0.55) 0%, rgba(130, 95, 180, 0.18) 65%, transparent 100%);
  transform: scale(0.9);
}
.breath-orb.pause::after {
  opacity: 0.5;
  border-color: rgba(210, 175, 250, 0.45);
  transform: scale(0.9);
}
.breath-orb.pause span { color: #e6d3fb; }

.breath-orb span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  transition: color 0.4s ease;
}
.breath-orb b {
  margin: 3px 0;
  font-family: var(--font-serif);
  font-size: 46px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.breath-orb .breath-total {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 580px) {
  .breath-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 22px;
    padding: 34px 20px 28px;
  }
  .breath-patterns, .breath-controls-row { justify-content: center; }
  .breath-copy h2 { font-size: 23px; }
  .breath-visual {
    order: -1;
    min-height: 200px;
    padding: 22px 0 14px;
  }
}

.safety-note { display: flex; gap: 13px; padding: 17px; border: 1px solid rgba(69,102,90,.14); border-radius: 18px; background: rgba(255,255,255,.42); }
.safety-note > span { color: var(--sage-dark); font-size: 23px; }
.safety-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.safety-note strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 13px; }

.page-intro { padding: 33px 4px 25px; }
.page-intro h1 { max-width: 650px; font-family: var(--font-serif); font-size: clamp(35px, 7vw, 54px); }
.page-intro > p:last-child { max-width: 590px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.filter-row { display: flex; gap: 8px; margin: 4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { flex: none; padding: 9px 15px; border: 1px solid rgba(33,49,45,.12); border-radius: 999px; background: rgba(255,255,255,.4); color: var(--muted); font-size: 12px; }
.filter-chip.active { border-color: var(--ink); background: var(--ink); color: white; }
.library-list { display: grid; gap: 12px; }
.library-card { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 15px; padding: 13px; border: 1px solid rgba(33,49,45,.08); border-radius: 22px; background: rgba(255,255,255,.58); cursor: pointer; text-align: left; }
.library-art { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 17px; }
.library-art.sage { background: var(--sage-pale); } .library-art.sky { background: var(--sky); } .library-art.sand { background: var(--sand); } .library-art.rose { background: var(--rose); } .library-art.violet { background: var(--violet); }
.library-art::before, .library-art::after { content: ""; position: absolute; border: 1px solid rgba(33,49,45,.18); border-radius: 50%; }
.library-art::before { width: 64px; height: 64px; } .library-art::after { width: 37px; height: 37px; }
.library-art span { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.54); font-size: 9px; }
.library-copy { min-width: 0; }
.library-copy small { color: var(--sage-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.library-copy strong { display: block; margin: 5px 0; overflow: hidden; font-family: var(--font-serif); font-size: 18px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.library-copy span { color: var(--muted); font-size: 11px; }
.save-button { position: relative; z-index: 2; width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; font-size: 24px; }
.empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
.stats-grid article { padding: 18px 8px; border-radius: 20px; background: rgba(255,255,255,.56); text-align: center; }
.stats-grid strong { display: block; font-family: var(--font-serif); font-size: 28px; font-weight: 520; }
.stats-grid span { color: var(--muted); font-size: 10px; }
.history-card { margin-top: 25px; padding: 22px; border-radius: var(--radius-lg); background: rgba(255,255,255,.48); }
.history-list { display: grid; gap: 3px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-top: 1px solid rgba(33,49,45,.08); }
.history-item strong { display: block; font-size: 13px; }.history-item span { color: var(--muted); font-size: 11px; }

/* Profile & Settings Navigation */
.profile-intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.settings-gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(33, 49, 45, 0.12);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(33, 49, 45, 0.04);
}
.settings-gear-btn:hover {
  background: #ffffff;
  border-color: var(--sage);
  box-shadow: 0 4px 14px rgba(33, 49, 45, 0.1);
  transform: rotate(45deg);
}
.settings-gear-btn:active {
  transform: scale(0.92) rotate(45deg);
}

.view-back-bar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 550;
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(33, 49, 45, 0.08);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.back-btn:hover {
  background: #ffffff;
  border-color: var(--sage);
  transform: translateX(-2px);
}

/* Settings View & Cards */
.settings-group-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.settings-card { margin-top: 25px; padding: 22px; border-radius: var(--radius-lg); background: rgba(255,255,255,.48); }
.settings-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(33,49,45,.08); }
.settings-group-label { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.settings-group-desc { font-size: 11px; color: var(--muted); margin: 3px 0 10px 0; }
.voice-picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 480px) { .voice-picker-row { grid-template-columns: 1fr; } }
.voice-btn {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
  border: 1px solid rgba(33,49,45,.12); background: rgba(255,255,255,.6); cursor: pointer; text-align: left;
  transition: all .15s ease;
}
.voice-btn.active {
  background: #ffffff; border-color: var(--sage-dark); box-shadow: 0 4px 12px rgba(69,102,90,.1);
}
.voice-indicator { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; }
.voice-btn.active .voice-indicator { border-color: var(--sage-dark); background: var(--sage-dark); }
.voice-btn strong { display: block; font-size: 13px; }
.voice-btn span { font-size: 10px; color: var(--muted); }

.settings-list { display: grid; gap: 10px; margin-top: 10px; }
.settings-list article { display: flex; gap: 15px; padding: 19px; border-radius: 20px; background: rgba(255,255,255,.5); }
.settings-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sage-pale); color: var(--sage-dark); }
.settings-list strong { font-size: 14px; }.settings-list p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-account-group { display: flex; flex-direction: column; gap: 10px; }
.profile-logout-wrap { width: 100%; }
.danger-button { width: 100%; margin-top: 6px; padding: 13px; background: rgba(143,75,75,.08); color: #8f4b4b; font-size: 12px; border-radius: 16px; border: 1px solid rgba(143,75,75,.15); cursor: pointer; }
.danger-button:hover { background: rgba(143,75,75,.14); }
.version { margin: 20px 0 0; color: #999; font-size: 10px; text-align: center; }

/* Journal Styles */
.journal-hero-card {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(170px, .65fr);
  align-items: center; min-height: 270px; margin-top: 4px; padding: 32px; border-radius: 30px;
  background: linear-gradient(138deg, #e9efe9 0%, #dce7df 55%, #d7e4de 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.58);
}
.journal-hero-card::after {
  content: ""; position: absolute; z-index: -1; width: 250px; height: 250px; right: -78px; bottom: -110px;
  border-radius: 50%; background: rgba(255,255,255,.26); box-shadow: 0 0 0 32px rgba(255,255,255,.09);
}
.journal-hero-copy { position: relative; z-index: 2; max-width: 520px; }
.journal-hero-copy .eyebrow { color: var(--sage-dark); }
.journal-hero-copy h1 { font-size: clamp(42px, 7vw, 58px); }
.journal-hero-copy > p:last-of-type { max-width: 470px; margin: 14px 0 22px; color: #52635d; font-size: 14px; line-height: 1.75; }
.journal-hero-action {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 17px 6px 7px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 24px rgba(33,49,45,.18); transition: transform .18s ease, box-shadow .18s ease;
}
.journal-hero-action:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(33,49,45,.23); }
.journal-hero-action-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: rgba(255,255,255,.14); }
.journal-hero-art { position: relative; justify-self: center; width: 180px; height: 180px; }
.journal-hero-orb {
  position: absolute; inset: 18px; border: 1px solid rgba(69,102,90,.16); border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, rgba(255,255,255,.7), rgba(255,255,255,.16) 58%, rgba(119,148,134,.12));
  box-shadow: 0 0 0 18px rgba(255,255,255,.13), 0 18px 40px rgba(69,102,90,.1);
}
.journal-hero-orb::before, .journal-hero-orb::after {
  content: ""; position: absolute; left: 50%; width: 44px; height: 72px; border: 2px solid rgba(69,102,90,.3); border-width: 0 2px 2px 0;
  border-radius: 0 0 42px 0; transform-origin: bottom;
}
.journal-hero-orb::before { top: 19px; transform: translateX(-94%) rotate(28deg); }
.journal-hero-orb::after { bottom: 19px; transform: translateX(-5%) rotate(208deg); }
.journal-hero-line { position: absolute; height: 1px; border-radius: 999px; background: rgba(69,102,90,.2); transform: rotate(-14deg); }
.journal-hero-line.line-one { width: 54px; top: 35px; right: 0; }
.journal-hero-line.line-two { width: 34px; top: 52px; right: 5px; }
.journal-hero-line.line-three { width: 46px; bottom: 36px; left: 1px; }

.journal-templates-card { margin-top: 30px; }
.journal-templates-card .section-heading { margin-bottom: 14px; }
.template-chips-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.template-card {
  position: relative; display: flex; min-width: 0; min-height: 148px; flex-direction: column; align-items: flex-start; gap: 13px;
  overflow: hidden; padding: 15px; border-radius: 20px; border: 1px solid rgba(255,255,255,.64);
  background: var(--sage-pale); cursor: pointer; text-align: left; box-shadow: 0 8px 22px rgba(45,62,55,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.template-card[data-opentpl="sleep"] { background: rgba(217,210,229,.72); }
.template-card[data-opentpl="panic"] { background: rgba(228,200,197,.68); }
.template-card[data-opentpl="gratitude"] { background: rgba(232,216,189,.76); }
.template-card[data-opentpl="free"] { background: rgba(202,221,225,.72); }
.template-card::after {
  content: ""; position: absolute; width: 74px; height: 74px; right: -27px; bottom: -29px;
  border: 1px solid rgba(33,49,45,.1); border-radius: 50%; box-shadow: 0 0 0 14px rgba(255,255,255,.1);
}
.template-card:hover { transform: translateY(-2px); border-color: rgba(69,102,90,.2); box-shadow: 0 13px 26px rgba(45,62,55,.09); }
.tpl-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.54); font-size: 17px; }
.template-card > div { min-width: 0; }
.template-card strong { display: block; color: var(--ink); font-family: var(--font-serif); font-size: 15px; font-weight: 600; }
.template-card p { margin: 5px 0 0; color: rgba(33,49,45,.62); font-size: 10.5px; line-height: 1.45; }
.template-arrow { position: absolute; z-index: 1; top: 17px; right: 15px; color: rgba(33,49,45,.5); font-size: 15px; }

.journal-feed-section { margin-top: 36px; }
.journal-feed-section .section-heading { margin-bottom: 13px; }
.journal-filter-row {
  display: flex; width: fit-content; max-width: 100%; gap: 3px; overflow-x: auto; padding: 4px;
  border: 1px solid rgba(33,49,45,.06); border-radius: 999px; background: rgba(255,255,255,.42); scrollbar-width: none;
}
.journal-filter-row::-webkit-scrollbar { display: none; }
.journal-filter-row .filter-chip {
  flex: 0 0 auto; padding: 7px 12px; border-color: transparent; border-radius: 999px;
  color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.journal-filter-row .filter-chip.active {
  border-color: rgba(69,102,90,.16); background: rgba(255,255,255,.92); color: var(--sage-dark);
  box-shadow: 0 4px 12px rgba(45,62,55,.09);
}
.journal-list { display: grid; gap: 12px; margin-top: 15px; }
.journal-card {
  position: relative; overflow: hidden; padding: 19px 20px 17px 23px; border: 1px solid rgba(255,255,255,.82); border-radius: 22px;
  background: rgba(255,255,255,.66); box-shadow: 0 8px 24px rgba(45,62,55,.045); transition: transform .2s ease, box-shadow .2s ease;
}
.journal-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #9ab9a9; }
.journal-card[data-template="sleep"]::before { background: #a9a0bd; }
.journal-card[data-template="panic"]::before { background: #cc9189; }
.journal-card[data-template="gratitude"]::before { background: #d4ac65; }
.journal-card[data-template="free"]::before { background: #90b5bd; }
.journal-card:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(45,62,55,.075); }
.journal-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.journal-badges-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.journal-badge-tpl { color: var(--sage-dark); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.journal-badge-mood, .journal-badge-intensity, .journal-body-tag {
  display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px;
  background: rgba(33,49,45,.045); color: #52625c; font-size: 10.5px;
}
.journal-badge-intensity { gap: 5px; font-variant-numeric: tabular-nums; }
.journal-badge-intensity i { width: 7px; height: 7px; border-radius: 50%; background: #b9b982; }
.journal-badge-intensity[data-level="1"] i, .journal-badge-intensity[data-level="2"] i { background: #8fb5a2; }
.journal-badge-intensity[data-level="3"] i, .journal-badge-intensity[data-level="4"] i { background: #a9bb91; }
.journal-badge-intensity[data-level="7"] i, .journal-badge-intensity[data-level="8"] i { background: #d4956d; }
.journal-badge-intensity[data-level="9"] i, .journal-badge-intensity[data-level="10"] i { background: #c97067; }
.journal-date { color: var(--muted); font-size: 10.5px; }
.journal-card-title { margin: 0 0 8px; color: var(--ink); font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.journal-card-content { color: #465650; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.journal-card-footer {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px;
  border-top: 1px solid rgba(33,49,45,.055);
}
.journal-delete-btn {
  flex: 0 0 auto; padding: 5px 8px; border: 0; border-radius: 999px; background: transparent;
  color: #9a6561; font-size: 10.5px; cursor: pointer; transition: background .15s ease;
}
.journal-delete-btn:hover { background: rgba(164,83,83,.08); }
.journal-empty-card {
  display: grid; place-items: center; min-height: 250px; padding: 38px 20px; overflow: hidden; text-align: center;
  border: 1px solid rgba(255,255,255,.82); border-radius: 24px;
  background: radial-gradient(circle at 50% 28%, rgba(220,231,223,.72), transparent 36%), rgba(255,255,255,.44);
}
.journal-empty-visual {
  position: relative; display: grid; place-items: center; width: 78px; height: 78px; margin-bottom: 14px;
  border-radius: 50%; background: rgba(255,255,255,.7); box-shadow: 0 0 0 12px rgba(220,231,223,.46), 0 12px 28px rgba(69,102,90,.09);
}
.journal-empty-visual span { font-size: 25px; }
.journal-empty-card strong { font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.journal-empty-card p { max-width: 360px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
@media (max-width: 700px) {
  .journal-hero-card { grid-template-columns: minmax(0, 1fr) 110px; min-height: 248px; padding: 26px 22px; }
  .journal-hero-art { width: 118px; height: 118px; opacity: .78; transform: translateX(16px); }
  .journal-hero-orb { inset: 13px; }
  .journal-hero-orb::before, .journal-hero-orb::after { width: 28px; height: 48px; }
  .journal-hero-orb::before { top: 13px; }
  .journal-hero-orb::after { bottom: 13px; }
  .journal-hero-line { display: none; }
  .template-chips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-card { min-height: 138px; }
  .template-card:last-child { grid-column: span 2; min-height: 112px; }
}
@media (max-width: 420px) {
  .journal-hero-card { grid-template-columns: 1fr; min-height: 260px; }
  .journal-hero-copy { max-width: 78%; }
  .journal-hero-art { position: absolute; right: 8px; bottom: 22px; }
  .journal-card-footer { align-items: flex-start; }
}

/* Journal Modal */
.journal-modal {
  position: fixed; z-index: 110; inset: 0; visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.journal-modal.open { visibility: visible; opacity: 1; pointer-events: auto; }
.journal-backdrop {
  position: absolute; inset: 0; background: rgba(21,31,28,.54); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
}
.journal-modal-panel {
  position: absolute; bottom: 0; left: 0; right: 0; max-width: 620px; margin: auto; max-height: 92dvh;
  overflow-y: auto; background: radial-gradient(circle at 92% 2%, rgba(213,226,216,.9), transparent 32%), var(--paper);
  border: 1px solid rgba(255,255,255,.72); border-bottom: 0; border-top-left-radius: 30px; border-top-right-radius: 30px;
  padding: 28px 20px calc(20px + var(--safe-bottom)); box-shadow: 0 -18px 55px rgba(12,24,19,.2);
  display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}
.journal-modal-panel::before {
  content: ""; position: absolute; top: 9px; left: 50%; width: 36px; height: 4px; border-radius: 999px;
  background: rgba(33,49,45,.16); transform: translateX(-50%);
}
@media (min-width: 640px) {
  .journal-modal-panel {
    position: relative; top: 50%; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.72);
    border-radius: 30px; max-height: 88vh; padding: 28px;
  }
  .journal-modal-panel::before { display: none; }
}
.journal-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
.journal-modal-header .eyebrow { margin-bottom: 5px; color: var(--sage); font-size: 10px; }
.journal-modal-header h2 { margin: 0; font-family: var(--font-serif); font-size: 29px; font-weight: 560; letter-spacing: -.025em; }
.journal-modal-header .icon-button {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 0;
  border: 1px solid rgba(33,49,45,.08); border-radius: 50%; background: rgba(255,255,255,.62);
  color: var(--muted); font-size: 14px; box-shadow: 0 4px 12px rgba(33,49,45,.06);
}
.modal-template-selector {
  display: flex; gap: 7px; flex: 0 0 auto; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: none; scroll-snap-type: x proximity;
}
.modal-template-selector::-webkit-scrollbar { display: none; }
.modal-tpl-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 11px; border-radius: 999px; border: 1px solid rgba(33,49,45,.07); background: rgba(255,255,255,.42);
  color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.modal-tpl-btn::before { font-size: 13px; line-height: 1; }
.modal-tpl-btn[data-tpl="mood"]::before { content: "🌿"; }
.modal-tpl-btn[data-tpl="sleep"]::before { content: "🌙"; }
.modal-tpl-btn[data-tpl="panic"]::before { content: "⚡"; }
.modal-tpl-btn[data-tpl="gratitude"]::before { content: "☀️"; }
.modal-tpl-btn[data-tpl="free"]::before { content: "🍃"; }
.modal-tpl-btn:hover { background: rgba(255,255,255,.72); color: var(--ink); }
.modal-tpl-btn.active {
  background: rgba(255,255,255,.92); color: var(--sage-dark); border-color: rgba(69,102,90,.18);
  box-shadow: 0 6px 16px rgba(45,62,55,.1); transform: translateY(-1px);
}
.journal-form { display: flex; flex: 0 0 auto; flex-direction: column; gap: 11px; }
.form-section { display: flex; flex-direction: column; gap: 8px; }
.journal-field-card {
  padding: 14px; border: 1px solid rgba(255,255,255,.78); border-radius: 20px;
  background: rgba(255,255,255,.5); box-shadow: 0 8px 24px rgba(45,62,55,.045);
}
.form-label { font-size: 11px; font-weight: 700; color: #52625c; letter-spacing: .04em; }
.chips-selector { display: flex; flex-wrap: wrap; gap: 7px; }
.mood-field-card .chips-selector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mood-chip, .body-chip {
  border: 1px solid transparent; color: var(--ink); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.mood-chip {
  min-width: 0; min-height: 42px; padding: 8px 4px; border-radius: 14px; background: rgba(220,231,223,.72);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.mood-chip[data-mood="放松"], .mood-chip[data-mood="喜悦"] { background: rgba(232,216,189,.58); }
.mood-chip[data-mood="焦虑"], .mood-chip[data-mood="悲伤"] { background: rgba(202,221,225,.62); }
.mood-chip[data-mood="紧绷"] { background: rgba(228,200,197,.58); }
.mood-chip[data-mood="疲惫"], .mood-chip[data-mood="混沌"] { background: rgba(217,210,229,.55); }
.mood-chip:hover, .body-chip:hover { transform: translateY(-1px); }
.mood-chip.active {
  border-color: rgba(69,102,90,.42); background: rgba(255,255,255,.94);
  box-shadow: 0 0 0 2px rgba(69,102,90,.08), 0 5px 13px rgba(45,62,55,.09);
}
.body-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px;
  background: rgba(255,255,255,.6); border-color: rgba(33,49,45,.07); font-size: 11.5px;
}
.body-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: rgba(69,102,90,.32); }
.body-chip.active {
  background: var(--sage-pale); color: var(--sage-dark); border-color: rgba(69,102,90,.28);
  box-shadow: 0 3px 10px rgba(69,102,90,.08);
}
.body-chip.active::before { background: var(--sage-dark); box-shadow: 0 0 0 3px rgba(69,102,90,.1); }
.intensity-section { gap: 9px; background: rgba(255,255,255,.64); }
.intensity-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intensity-value {
  display: inline-flex; align-items: baseline; gap: 3px; color: var(--sage-dark); white-space: nowrap;
}
.intensity-value strong { font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.intensity-value span { font-size: 11px; font-weight: 600; }
.intensity-picker {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: end; gap: 3px;
  padding: 8px 7px 6px; border: 1px solid rgba(33,49,45,.06); border-radius: 16px;
  background: linear-gradient(110deg, rgba(148,181,162,.13), rgba(221,189,125,.11) 58%, rgba(204,123,99,.09));
}
.intensity-option {
  min-width: 0; height: 48px; padding: 2px 0; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px; -webkit-tap-highlight-color: transparent;
}
.intensity-orb {
  width: var(--orb-size); height: var(--orb-size); border-radius: 50%; background: var(--orb-color);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.58); opacity: .58;
  transform: scale(.88); transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.intensity-number { font-size: 9px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.intensity-option:hover .intensity-orb { opacity: .82; transform: scale(1); }
.intensity-option.active { color: var(--ink); }
.intensity-option.active .intensity-orb {
  opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 4px rgba(255,255,255,.82), 0 4px 12px rgba(60,73,66,.25);
  animation: intensity-breathe 2.4s ease-in-out infinite;
}
.intensity-option.active .intensity-number { font-weight: 750; }
.intensity-option:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 1px; }
.intensity-option[data-intensity="1"] { --orb-size: 12px; --orb-color: #8fb5a2; }
.intensity-option[data-intensity="2"] { --orb-size: 14px; --orb-color: #91b6a0; }
.intensity-option[data-intensity="3"] { --orb-size: 16px; --orb-color: #9bb99c; }
.intensity-option[data-intensity="4"] { --orb-size: 18px; --orb-color: #a9bb91; }
.intensity-option[data-intensity="5"] { --orb-size: 20px; --orb-color: #b9b982; }
.intensity-option[data-intensity="6"] { --orb-size: 22px; --orb-color: #c8b477; }
.intensity-option[data-intensity="7"] { --orb-size: 24px; --orb-color: #d3a66f; }
.intensity-option[data-intensity="8"] { --orb-size: 26px; --orb-color: #d4956d; }
.intensity-option[data-intensity="9"] { --orb-size: 28px; --orb-color: #cf826b; }
.intensity-option[data-intensity="10"] { --orb-size: 30px; --orb-color: #c97067; }
.intensity-scale-labels {
  display: flex; justify-content: space-between; padding: 0 6px; color: var(--muted); font-size: 10px; font-weight: 550;
}
@keyframes intensity-breathe {
  0%, 100% { transform: scale(1.04); }
  50% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .intensity-orb { transition: none; }
  .intensity-option.active .intensity-orb { animation: none; }
}
.journal-writing-card {
  overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 20px;
  background: rgba(255,254,251,.72); box-shadow: 0 9px 24px rgba(45,62,55,.05);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.journal-writing-card:focus-within {
  border-color: rgba(69,102,90,.28); background: rgba(255,254,251,.94); box-shadow: 0 0 0 3px rgba(69,102,90,.07), 0 10px 25px rgba(45,62,55,.06);
}
.journal-writing-card input:focus-visible, .journal-writing-card textarea:focus-visible { outline: 0; }
.journal-title-input {
  width: 100%; padding: 14px 15px 12px; border: 0; border-bottom: 1px solid rgba(33,49,45,.07);
  border-radius: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--font-serif);
  font-size: 16px; font-weight: 560; box-sizing: border-box;
}
.journal-content-textarea {
  width: 100%; padding: 13px 15px 16px; border: 0; border-radius: 0; outline: 0; background: transparent;
  color: #374742; font-size: 13px; line-height: 1.7; resize: vertical; min-height: 145px; box-sizing: border-box;
}
.journal-title-input::placeholder, .journal-content-textarea::placeholder { color: #8a938f; }
.modal-actions {
  position: sticky; z-index: 2; bottom: calc(-20px - var(--safe-bottom)); display: grid; grid-template-columns: 90px 1fr;
  align-items: center; gap: 9px; margin-top: 1px; padding: 9px 0 calc(4px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(246,243,236,0), var(--paper) 26%);
}
.journal-cancel-button, .journal-save-button { min-height: 46px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; }
.journal-cancel-button { background: rgba(255,255,255,.58); color: var(--muted); box-shadow: inset 0 0 0 1px rgba(33,49,45,.07); }
.journal-save-button {
  display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--ink); color: #fff;
  box-shadow: 0 12px 24px rgba(33,49,45,.18); transition: transform .18s ease, box-shadow .18s ease;
}
.journal-save-button::after { content: "→"; font-size: 16px; font-weight: 500; }
.journal-save-button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(33,49,45,.22); }

/* Daily insights */
.insight-intro { padding-bottom: 18px; text-align: center; }
.insight-intro > p:last-child { margin-right: auto; margin-left: auto; }
.insight-toolbar {
  display: flex; width: fit-content; margin: 0 auto 22px; padding: 4px; border: 1px solid rgba(69,102,90,.11);
  border-radius: 999px; background: rgba(255,255,255,.46); box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.insight-toolbar button {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 12px; font-weight: 680; transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.insight-toolbar button.active { background: var(--white); color: var(--ink); box-shadow: 0 5px 14px rgba(45,62,55,.09); }
.insight-toolbar button span:last-child:not(:first-child) {
  display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; border-radius: 999px;
  background: rgba(69,102,90,.09); color: var(--sage-dark); font-size: 10px;
}
.insight-stage { width: min(100%, 720px); margin: 0 auto; padding-bottom: 18px; perspective: 1200px; }
.insight-card {
  --insight-accent: #7f9d8e;
  --insight-wash: rgba(187,211,198,.42);
  position: relative; isolation: isolate; min-height: 510px; padding: 25px 27px 20px; border: 1px solid rgba(255,255,255,.9);
  border-radius: 32px; outline: 0; background:
    radial-gradient(circle at 90% 4%, var(--insight-wash), transparent 35%),
    linear-gradient(145deg, rgba(255,254,251,.98), rgba(246,241,231,.94));
  box-shadow: 0 30px 65px rgba(42,57,51,.13), 0 3px 12px rgba(42,57,51,.05);
  transform-style: preserve-3d; will-change: transform, opacity;
}
.insight-card::before, .insight-card::after {
  content: ""; position: absolute; z-index: -2; right: 12px; bottom: -8px; left: 12px; height: 42px;
  border: 1px solid rgba(70,84,77,.07); border-radius: 0 0 28px 28px; background: #ede8dd; transform: translateZ(-1px);
}
.insight-card::after { z-index: -3; right: 22px; bottom: -14px; left: 22px; background: #e3ded2; }
.insight-card[data-tradition="dao"] { --insight-accent: #6f8b7f; --insight-wash: rgba(175,205,190,.38); }
.insight-card[data-tradition="world"] { --insight-accent: #9a7d62; --insight-wash: rgba(221,194,160,.34); }
.insight-card:focus-visible { box-shadow: 0 0 0 4px rgba(69,102,90,.15), 0 30px 65px rgba(42,57,51,.13); }
.insight-card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.insight-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.insight-tradition, .insight-daily-tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 999px;
  color: var(--insight-accent); font-size: 10px; font-weight: 760; letter-spacing: .08em;
}
.insight-tradition { border: 1px solid color-mix(in srgb, var(--insight-accent) 30%, transparent); background: rgba(255,255,255,.54); }
.insight-daily-tag { background: color-mix(in srgb, var(--insight-accent) 11%, transparent); }
.insight-favorite-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid rgba(69,102,90,.1); border-radius: 50%;
  background: rgba(255,255,255,.55); color: var(--sage-dark); cursor: pointer; font-size: 23px; line-height: 1;
  box-shadow: 0 7px 16px rgba(45,62,55,.06); transition: transform .18s ease, background .18s ease, color .18s ease;
}
.insight-favorite-btn:hover { transform: translateY(-1px) scale(1.03); }
.insight-favorite-btn.active { background: var(--insight-accent); color: #fff; }
.insight-content { position: relative; padding: 48px 3px 0; }
.insight-quote-mark {
  position: absolute; top: 20px; left: -4px; color: color-mix(in srgb, var(--insight-accent) 25%, transparent);
  font-family: Georgia, serif; font-size: 84px; line-height: 1; pointer-events: none;
}
.insight-content blockquote {
  min-height: 118px; margin: 0; color: #25352f; font-family: var(--font-serif); font-size: clamp(26px, 5.2vw, 38px);
  font-weight: 500; letter-spacing: -.018em; line-height: 1.52;
}
.insight-original { margin: 15px 0 0; color: #7d817c; font-family: var(--font-serif); font-size: 13px; font-style: italic; line-height: 1.65; }
.insight-source-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 25px; padding-top: 18px;
  border-top: 1px solid rgba(69,102,90,.09);
}
.insight-source-row > div { display: grid; gap: 5px; }
.insight-source-row strong { font-family: var(--font-serif); font-size: 15px; font-weight: 650; }
.insight-source-row span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.insight-source-link { flex: 0 0 auto; color: var(--insight-accent); font-size: 11px; font-weight: 720; text-decoration: none; }
.insight-meaning {
  margin-top: 22px; padding: 18px 19px; border: 1px solid rgba(255,255,255,.7); border-radius: 20px;
  background: color-mix(in srgb, var(--insight-wash) 52%, rgba(255,255,255,.5));
}
.insight-meaning span { color: var(--insight-accent); font-size: 10px; font-weight: 780; letter-spacing: .12em; }
.insight-meaning p { margin: 8px 0 0; color: #485750; font-size: 13px; line-height: 1.78; }
.insight-card-footer { display: flex; justify-content: space-between; margin-top: 21px; color: #8b928e; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.insight-empty { min-height: 390px; padding: 95px 20px 50px; text-align: center; }
.insight-empty > span { display: block; color: var(--sage); font-family: var(--font-serif); font-size: 48px; }
.insight-empty strong { display: block; margin-top: 14px; font-family: var(--font-serif); font-size: 24px; font-weight: 550; }
.insight-empty p { max-width: 320px; margin: 11px auto 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.insight-turn-controls { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin: 25px 4px 0; }
.insight-turn-controls button {
  min-height: 50px; border: 1px solid rgba(69,102,90,.12); border-radius: 999px; cursor: pointer; font-size: 12px;
  font-weight: 720; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.insight-prev-btn { background: rgba(255,255,255,.55); color: var(--sage-dark); }
.insight-next-btn { border-color: transparent !important; background: var(--ink); color: #fff; box-shadow: 0 12px 25px rgba(33,49,45,.16); }
.insight-turn-controls button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 25px rgba(33,49,45,.12); }
.insight-turn-controls button:disabled { cursor: default; opacity: .38; }
.insight-note { max-width: 600px; margin: 15px auto 0; color: #89908c; font-size: 9px; line-height: 1.65; text-align: center; }

@media (max-width: 560px) {
  .insight-intro { padding-top: 24px; }
  .insight-card { min-height: 490px; padding: 20px 20px 18px; border-radius: 27px; }
  .insight-content { padding-top: 42px; }
  .insight-content blockquote { min-height: 102px; font-size: clamp(24px, 7.5vw, 31px); line-height: 1.48; }
  .insight-source-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .insight-meaning { padding: 16px; }
  .insight-turn-controls { margin-top: 23px; }
}

.bottom-nav {
  position: fixed; z-index: 30; right: 12px; bottom: calc(10px + var(--safe-bottom)); left: 12px;
  display: grid; grid-template-columns: repeat(5,1fr);
  max-width: 580px; margin: auto; padding: 6px;
  border: 1px solid rgba(255,255,255,.7); border-radius: 25px;
  background: rgba(252,250,245,.88);
  box-shadow: 0 14px 40px rgba(33,49,45,.16);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  user-select: none; -webkit-user-select: none;
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px; border: 0; border-radius: 18px;
  background: transparent; color: #727e78; cursor: pointer;
  font-size: 10px; font-weight: 550;
  touch-action: manipulation;
  transition: all .2s ease;
}
.bottom-nav button .nav-icon {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .15s ease;
}
.bottom-nav button.active { background: var(--ink); color: #ffffff; }
.bottom-nav button.active .nav-icon { stroke: #ffffff; }

.player-sheet {
  position: fixed; z-index: 100; inset: 0;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .25s, visibility .25s;
}
.player-sheet.open { visibility: visible; opacity: 1; pointer-events: auto; }
.player-backdrop {
  position: absolute; inset: 0; width: 100%; border: 0;
  background: rgba(21,31,28,.38); backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}
.player-panel {
  position: absolute; right: 0; bottom: 0; left: 0;
  max-width: 620px; max-height: 92dvh;
  margin: auto; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 24px calc(30px + var(--safe-bottom));
  border-radius: 32px 32px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 60px rgba(19,30,26,.2);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2,.75,.25,1);
}
.player-sheet.open .player-panel { transform: translateY(0); }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 9px; border-radius: 10px; background: #cbc8c0; }
.player-actions { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.icon-button { width: 42px; height: 42px; color: var(--ink); font-size: 25px; }
.player-artwork { position: relative; display: grid; place-items: center; width: min(62vw, 270px); aspect-ratio: 1; margin: 15px auto 22px; overflow: hidden; border-radius: 50%; background: var(--sage-pale); transition: background .2s; }
.player-artwork.sage { background: var(--sage-pale); } .player-artwork.sky { background: var(--sky); } .player-artwork.sand { background: var(--sand); } .player-artwork.rose { background: var(--rose); } .player-artwork.violet { background: var(--violet); }
.art-ring { position: absolute; border: 1px solid rgba(33,49,45,.16); border-radius: 50%; }.ring-a { width: 74%; height: 74%; }.ring-b { width: 46%; height: 46%; }
.player-artwork i { width: 18%; height: 28%; border: 2px solid rgba(33,49,45,.42); border-radius: 70% 0 70% 0; transform: rotate(45deg); }
.player-panel > .eyebrow, .player-panel > h2, .player-summary { text-align: center; }
.player-panel > h2 { margin: 0; font-family: var(--font-serif); font-size: 28px; font-weight: 560; }
.player-summary { max-width: 440px; margin: 9px auto 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.voice-switch { display: grid; grid-template-columns: 1fr 1fr; max-width: 280px; margin: 0 auto 20px; padding: 4px; border: 1px solid rgba(69,102,90,.14); border-radius: 999px; background: rgba(255,255,255,.54); }
.voice-switch button { padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.voice-switch button.active { background: var(--ink); color: white; box-shadow: 0 4px 12px rgba(33,49,45,.16); }
.seek-bar { width: 100%; height: 4px; accent-color: var(--sage-dark); cursor: pointer; }
.time-row { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: 10px; }
.play-controls { display: grid; grid-template-columns: 1fr 48px 68px 48px 1fr; align-items: center; gap: 9px; margin: 17px 0 20px; }
.small-control, .round-control, .main-play { border: 0; background: transparent; cursor: pointer; }
.small-control { color: var(--muted); font-size: 11px; }.round-control { font-size: 25px; }.round-control small { font-size: 8px; }.main-play { display: grid; place-items: center; width: 68px; height: 68px; padding-left: 5px; border-radius: 50%; background: var(--ink); color: white; font-size: 22px; box-shadow: 0 14px 25px rgba(33,49,45,.2); }
.complete-button { width: 100%; padding: 13px; border: 1px solid rgba(69,102,90,.22); background: transparent; color: var(--sage-dark); font-size: 12px; }
.transcript-panel { margin-top: 22px; padding: 20px; border-radius: 22px; background: rgba(255,255,255,.58); }
.transcript-panel p { margin: 0; padding: 11px 0; border-top: 1px solid rgba(33,49,45,.07); color: #4f5a56; font-size: 13px; line-height: 1.8; }
.transcript-panel p:first-child { border-top: 0; }
.toast { position: fixed; z-index: 150; bottom: calc(98px + var(--safe-bottom)); left: 50%; visibility: hidden; min-width: 180px; padding: 12px 17px; border-radius: 999px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 10px); transition: .25s; font-size: 12px; text-align: center; }
.toast.show { visibility: visible; opacity: 1; transform: translate(-50%,0); }

@media (min-width: 720px) {
  .topbar { padding-inline: 28px; }
  .view { padding-inline: 28px; }
  .hero { padding: 65px 50px 42px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .library-list { grid-template-columns: repeat(2, 1fr); }
  .library-card { grid-template-columns: 78px 1fr auto; }
}

/* Study cards on Home */
.study-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .study-grid { grid-template-columns: 1fr 1fr; } }
.study-card { display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid rgba(33,49,45,.08); border-radius: var(--radius-lg); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.study-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(33,49,45,.08); }
.study-card.sage { background: linear-gradient(135deg, rgba(220,231,223,.75), rgba(255,255,255,.6)); }
.study-card.sky { background: linear-gradient(135deg, rgba(202,221,225,.75), rgba(255,255,255,.6)); }
.study-tag { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: rgba(33,49,45,.08); color: var(--sage-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.study-card strong { margin: 10px 0 6px; font-family: var(--font-serif); font-size: 19px; line-height: 1.35; }
.study-card p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.study-action { color: var(--sage-dark); font-size: 12px; font-weight: 600; }

/* Library Tab Switcher */
.library-tabs { display: flex; gap: 6px; margin: 0 0 20px; padding: 5px; border-radius: 999px; background: rgba(33,49,45,.06); max-width: 480px; }
.lib-tab { flex: 1; padding: 9px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; transition: all .2s; text-align: center; }
.lib-tab.active { background: var(--ink); color: white; box-shadow: 0 3px 10px rgba(33,49,45,.14); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Featured Lecture Card */
.featured-lecture-card { padding: 26px 22px; border: 1px solid rgba(69,102,90,.18); border-radius: var(--radius-lg); background: rgba(255,255,255,.72); box-shadow: 0 12px 36px rgba(33,49,45,.06); }
.featured-lecture-header { margin-bottom: 16px; }
.featured-lecture-header h2 { margin: 6px 0 4px; font-family: var(--font-serif); font-size: 24px; font-weight: 580; }
.featured-lecture-header p { margin: 0; color: var(--muted); font-size: 13px; }
.lecture-intro-summary { padding: 14px; border-radius: 16px; background: var(--sage-pale); color: #2e433b; font-size: 13px; line-height: 1.7; margin-bottom: 20px; }
.lecture-intro-summary p { margin: 6px 0 0; }
.lecture-axioms-grid { display: grid; gap: 8px; margin-bottom: 24px; }
@media (min-width: 600px) { .lecture-axioms-grid { grid-template-columns: 1fr 1fr; } }
.axiom-card { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.8); border: 1px solid rgba(33,49,45,.06); }
.axiom-badge { display: inline-block; padding: 2px 7px; border-radius: 6px; background: rgba(69,102,90,.12); color: var(--sage-dark); font-size: 10px; font-weight: 700; margin-bottom: 5px; }
.axiom-card p { margin: 0; font-size: 12px; line-height: 1.6; color: #374642; }

.lecture-sections { display: grid; gap: 16px; }
.lecture-section-block { padding: 18px 20px; border-radius: 18px; background: rgba(252,250,245,.82); border: 1px solid rgba(33,49,45,.06); }
.lecture-section-block h3 { margin: 0 0 12px; font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.lecture-body p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.8; color: #374642; }
.lecture-body p:last-child { margin-bottom: 0; }
.lecture-body strong { color: #1c2b27; font-weight: 600; }
.lecture-body code { font-family: monospace; font-size: 12px; padding: 2px 5px; background: rgba(33,49,45,.08); border-radius: 4px; }
.lecture-ol, .lecture-ul { margin: 8px 0 12px 20px; padding: 0; font-size: 13.5px; line-height: 1.8; color: #374642; }
.lecture-ol li, .lecture-ul li { margin-bottom: 6px; }
.lecture-ol li strong, .lecture-ul li strong { color: #1c2b27; }
.lecture-quote { margin: 12px 0 14px; padding: 12px 16px; border-left: 3px solid var(--sage); background: rgba(220,231,223,.3); border-radius: 0 12px 12px 0; font-style: normal; color: #283d36; line-height: 1.75; font-size: 13px; }
.lecture-action-box { margin-top: 20px; padding: 16px; border-radius: 16px; background: var(--paper-deep); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lecture-action-box p { margin: 0; font-size: 12px; color: var(--muted); }

/* Curriculum Stages (30 Lectures) */
.curriculum-stages { display: grid; gap: 10px; }
.stage-item { border: 1px solid rgba(33,49,45,.07); border-radius: 18px; background: rgba(255,255,255,.5); overflow: hidden; transition: background .2s; }
.stage-item.open { background: rgba(255,255,255,.7); }
.stage-summary-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.stage-summary-btn strong { font-size: 14px; color: var(--ink); display: block; font-weight: 600; }
.stage-summary-btn span { font-size: 11px; color: var(--muted); }
.stage-chevron { font-size: 12px; color: var(--muted); transition: transform .25s; }
.stage-item.open .stage-chevron { transform: rotate(180deg); }
.stage-lectures-list { display: none; padding: 0 14px 14px; border-top: 1px solid rgba(33,49,45,.05); }
.stage-item.open .stage-lectures-list { display: grid; gap: 8px; padding-top: 12px; }
.curriculum-lecture-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-radius: 14px; background: rgba(255,255,255,.6); font-size: 13px; border: 1px solid rgba(33,49,45,.05); transition: all .2s ease; }
.curriculum-lecture-row.completed { border: 1px solid rgba(69,102,90,.16); background: #ffffff; cursor: pointer; box-shadow: 0 2px 8px rgba(33,49,45,.02); }
.curriculum-lecture-row.completed:hover { background: #ffffff; transform: translateY(-1px); border-color: rgba(69,102,90,.35); box-shadow: 0 4px 16px rgba(33,49,45,.05); }
.curriculum-lecture-main { flex: 1; min-width: 0; }
.curriculum-lecture-title-row { display: flex; align-items: baseline; gap: 8px; }
.curriculum-lecture-num { font-family: var(--font-sans); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.curriculum-lecture-row.completed .curriculum-lecture-num { color: var(--sage-dark); }
.curriculum-lecture-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.curriculum-lecture-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.curriculum-lecture-status { flex-shrink: 0; }
.lecture-selector-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
.lecture-selector-pill { padding: 6px 14px; border-radius: 999px; background: rgba(33,49,45,.06); border: 1px solid rgba(33,49,45,.08); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .2s ease; font-family: inherit; }
.lecture-selector-pill:hover { background: rgba(33,49,45,.1); }
.lecture-selector-pill.active { background: var(--sage-dark); color: #fff; border-color: var(--sage-dark); }
.lecture-status-pill { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(33,49,45,.05); color: var(--muted); white-space: nowrap; }
.lecture-status-pill.ready { background: var(--ink); color: #fff; font-weight: 600; font-size: 12px; padding: 5px 14px; box-shadow: 0 2px 8px rgba(33,49,45,.12); transition: background .2s ease; }
.curriculum-lecture-row.completed:hover .lecture-status-pill.ready { background: var(--sage-dark); }

/* Available Lectures Grid (Course Catalog) */
.available-lectures-section { margin-bottom: 28px; }
.available-lectures-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .available-lectures-grid { grid-template-columns: 1fr 1fr; } }
.available-lecture-card { padding: 20px 20px 18px; border-radius: var(--radius-lg); border: 1px solid rgba(69, 102, 90, 0.16); background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 18px rgba(33, 49, 45, 0.04); cursor: pointer; display: flex; flex-direction: column; transition: all 0.22s ease; }
.available-lecture-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.98); box-shadow: 0 8px 26px rgba(33, 49, 45, 0.08); border-color: var(--sage-dark); }
.available-lecture-badge-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.available-lecture-card h3 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.available-lecture-sub { margin: 0 0 10px; font-size: 12px; color: var(--sage-dark); font-weight: 500; }
.available-lecture-desc { margin: 0 0 14px; font-size: 12.5px; line-height: 1.6; color: #4a5c56; flex: 1; }
.available-lecture-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(33, 49, 45, 0.06); padding-top: 10px; margin-top: auto; }
.available-lecture-highlights { font-size: 11px; color: var(--muted); }
.badge-count { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--sage-pale); color: var(--sage-dark); font-weight: 600; }
.lecture-ready-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--sage-pale); color: var(--sage-dark); font-weight: 700; letter-spacing: 0.3px; }
.lecture-back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(33, 49, 45, 0.12); background: rgba(255, 255, 255, 0.9); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; font-family: inherit; box-shadow: 0 2px 8px rgba(33, 49, 45, 0.04); }
.lecture-back-btn:hover { background: #fff; border-color: var(--sage-dark); color: var(--sage-dark); }
.lecture-detail-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.lecture-detail-view { animation: fadeIn 0.25s ease; }
.cases-list { display: grid; gap: 16px; }
.case-card { border: 1px solid rgba(33,49,45,.08); border-radius: 20px; background: rgba(255,255,255,.8); box-shadow: 0 4px 20px rgba(33,49,45,.03); overflow: hidden; transition: all .2s ease; }
.case-card:hover { box-shadow: 0 8px 28px rgba(33,49,45,.06); background: rgba(255,255,255,.95); }
.case-card-header { padding: 18px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.case-badge-row { display: flex; gap: 6px; margin-bottom: 8px; }
.case-cat-pill { font-size: 10px; font-weight: 700; color: var(--sage-dark); background: var(--sage-pale); padding: 2px 8px; border-radius: 999px; }
.case-tag-pill { font-size: 10px; color: var(--muted); background: rgba(33,49,45,.06); padding: 2px 8px; border-radius: 999px; }
.case-card-header h3 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 18px; font-weight: 560; color: var(--ink); }
.case-card-header p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.case-toggle-arrow { flex: none; font-size: 12px; color: var(--muted); padding-top: 4px; transition: transform .25s ease; }
.case-card.open .case-toggle-arrow { transform: rotate(180deg); color: var(--sage-dark); }

.case-card-body { display: none; padding: 16px 22px 24px; border-top: 1px solid rgba(33,49,45,.06); }
.case-card.open .case-card-body { display: block; animation: fadeIn .22s ease; }

/* Scenes inside the case */
.case-scene-section { margin-top: 22px; }
.case-scene-section:first-child { margin-top: 4px; }

.scene-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.scene-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.scene-badge.student { background: rgba(184, 155, 126, 0.15); color: #8c6843; }
.scene-badge.coach { background: var(--sage-pale); color: var(--sage-dark); }
.scene-badge.science { background: rgba(69, 102, 90, 0.08); color: #3f5e53; }
.scene-hint { font-size: 11px; color: var(--muted); }

/* 1. Student Voice (Experiential quote) */
.student-experience-quote { margin: 0; padding: 13px 16px; background: rgba(246, 243, 236, 0.7); border: 1px solid rgba(201, 185, 166, 0.35); border-radius: 12px; font-size: 13.5px; line-height: 1.75; color: #3b3934; }
.student-experience-quote p { margin: 0; }

/* 2. Dialogue Timeline (No boxes, pure progressive flow) */
.dialogue-timeline { display: flex; flex-direction: column; padding-left: 0; margin-top: 4px; }
.dialogue-node { display: flex; gap: 12px; position: relative; }
.node-indicator { display: flex; flex-direction: column; align-items: center; flex: none; width: 22px; }
.node-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--sage-pale); color: var(--sage-dark); font-family: var(--font-sans); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #ffffff; z-index: 1; }
.node-stem { width: 1.5px; flex: 1; background: rgba(69, 102, 90, 0.16); margin: 4px 0; }
.dialogue-node:last-child .node-stem { display: none; }

.node-body { flex: 1; min-width: 0; padding-bottom: 16px; }
.dialogue-node:last-child .node-body { padding-bottom: 4px; }
.node-title-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; padding-top: 1px; }
.node-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.node-intent { font-size: 11px; color: var(--muted); }

.node-content { font-size: 13px; line-height: 1.72; color: #2b3b35; }
.dialogue-line { margin: 0 0 6px; }
.dialogue-line:last-child { margin-bottom: 0; }

/* Mantra Group / Sequential Recitation (Clean, no left bar, zero redundant indent) */
.mantra-group { margin: 8px 0 6px; padding: 10px 14px; background: rgba(220, 231, 223, 0.35); border: 1px solid rgba(69, 102, 90, 0.12); border-radius: 12px; }
.mantra-group:last-child { margin-bottom: 0; }
.mantra-group-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mantra-tag { font-size: 10px; font-weight: 700; color: var(--sage-dark); text-transform: uppercase; letter-spacing: .06em; }
.mantra-subtag { font-size: 10px; color: var(--muted); padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.65); }
.mantra-list { display: flex; flex-direction: column; gap: 6px; }
.mantra-item { display: flex; align-items: baseline; gap: 6px; }
.mantra-item.single { display: block; }
.mantra-index { flex: none; font-family: var(--font-sans); font-size: 11.5px; font-weight: 700; color: var(--sage-dark); line-height: 1.5; }
.mantra-content { flex: 1; min-width: 0; }
.mantra-quote { font-family: var(--font-serif); font-size: 14.5px; font-weight: 600; line-height: 1.55; color: #12241f; }
.mantra-hint { display: block; font-size: 11px; color: #4a6358; margin-top: 2px; }

/* 3. Mechanism Prose */
.mechanism-section { padding-top: 14px; border-top: 1px dashed rgba(33,49,45,.1); }
.mechanism-prose { font-size: 12.5px; line-height: 1.75; color: #4a5a54; padding-left: 2px; }
.mechanism-prose p { margin: 0; }

.case-action-row { margin-top: 20px; display: flex; justify-content: flex-end; }

/* Account / Cloud Sync Card */
.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid rgba(69, 102, 90, 0.12);
  box-shadow: 0 4px 16px rgba(45, 62, 55, 0.04);
}
.account-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.account-badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a0aba5;
}
.account-badge.online {
  color: var(--sage-dark);
}
.account-badge.online::before {
  background: #2ea043;
  box-shadow: 0 0 0 2px rgba(46, 160, 67, 0.2);
}
.account-tip {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.account-email {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.account-action-btn {
  padding: 8px 16px;
  border: 1px solid rgba(69, 102, 90, 0.25);
  border-radius: 999px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.account-logout-btn {
  padding: 6px 14px;
  border: 1px solid rgba(200, 60, 60, 0.2);
  border-radius: 999px;
  background: transparent;
  color: #a83838;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Auth Modal / Panel */
.auth-panel {
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
}
.auth-header {
  margin-bottom: 24px;
}
.auth-header h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--ink);
}
.auth-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(69, 102, 90, 0.22);
  background: #ffffff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(33, 49, 45, 0.04);
  font-family: inherit;
  margin-top: 20px;
}
.google-auth-btn:hover {
  background: rgba(246, 248, 246, 1);
  border-color: var(--sage-dark);
  box-shadow: 0 4px 14px rgba(33, 49, 45, 0.08);
}
.google-auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.google-icon {
  flex-shrink: 0;
}
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(33, 49, 45, 0.1);
}
.auth-divider span {
  padding: 0 12px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.form-group input {
  padding: 13px 16px;
  border: 1px solid rgba(69, 102, 90, 0.2);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px; /* 16px prevents iOS automatic zoom on focus */
  -webkit-appearance: none;
}
.form-group input:focus {
  border-color: var(--sage-dark);
  outline: none;
  box-shadow: 0 0 0 3px rgba(69, 102, 90, 0.15);
}
.link-button {
  background: transparent;
  border: none;
  color: var(--sage-dark);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  text-align: right;
}

/* Mobile UI/UX Optimizations (Modern Web Guidance) */
.lecture-selector-tabs,
.breath-patterns,
.filter-row,
.library-tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.lecture-selector-tabs::-webkit-scrollbar,
.breath-patterns::-webkit-scrollbar,
.filter-row::-webkit-scrollbar,
.library-tabs::-webkit-scrollbar {
  display: none;
}

@media (pointer: coarse) {
  .quiet-button, .filter-chip, .pattern-chip, .duration-chip, .lib-tab, .lecture-selector-pill {
    min-block-size: 38px;
  }
  .icon-button {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
  .bottom-nav button {
    min-block-size: 52px;
  }
}

.primary-button:active,
.secondary-button:active,
.google-auth-btn:active,
.study-card:active,
.quick-card:active,
.lib-tab:active,
.pattern-chip:active,
.duration-chip:active,
.filter-chip:active,
.curriculum-lecture-row.completed:active,
.account-action-btn:active,
.bottom-nav button:active {
  transform: scale(0.975);
  transition: transform 0.08s ease;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
