/* Mind & Spirit daily practice */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ms { padding-block: clamp(var(--space-12), 7vw, var(--space-20)); border-bottom: 1px solid var(--color-divider); }
.ms__head { max-width: 760px; margin-bottom: var(--space-8); }
.ms__head h2 { font-size: var(--text-2xl); font-weight: 400; line-height: 1.1; margin: var(--space-3) 0 var(--space-3); }
.ms__head h2 em { color: var(--color-primary); font-style: italic; }
.ms__head > p { color: var(--color-text-muted); font-size: var(--text-lg); margin: 0 0 var(--space-5); }
.ms__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.ms__chips { gap: var(--space-2) var(--space-5); }
.ms__chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  color: var(--color-text); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}
.ms__chips a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.ms__save { overflow-wrap: anywhere; margin: 0; padding: 0 0 0 18px; position: relative; font-size: var(--text-sm); color: var(--color-text-muted); }
.ms__save::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: var(--color-primary); }
.ms__save a { color: var(--color-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.ms__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(var(--space-8), 6vw, var(--space-16)); align-items: start; border-top: 1px solid var(--color-divider); padding-top: clamp(var(--space-8), 5vw, var(--space-12)); }
.ms-card { min-width: 0; scroll-margin-top: 96px; padding: 0; }
.ms-card + .ms-card { border-left: 1px solid var(--color-divider); padding-left: clamp(var(--space-8), 6vw, var(--space-16)); margin-left: calc(-1 * clamp(var(--space-8), 6vw, var(--space-16)) / 2); }
.ms-card__kicker { margin: 0 0 var(--space-2); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--color-primary); }
.ms-card__h { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1.2; margin: 0 0 var(--space-4); overflow-wrap: anywhere; }
.ms-card__meta { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ms-card__meta a, .ms-lines a, .ms-crisis a { color: var(--color-primary); font-weight: 600; }
.ms-card__fine { margin: var(--space-4) 0 0; font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.5; }

/* Devotion */
.ms-verse { margin: 0 0 var(--space-3); padding: 0 0 0 var(--space-4); border-left: 2px solid var(--color-primary); }
.ms-verse p { font-family: var(--font-display); font-size: var(--text-lg); font-style: italic; line-height: 1.45; margin: 0 0 var(--space-2); color: var(--color-text); }
.ms-verse cite { font-style: normal; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.02em; }
.ms-dev__body p { margin: 0 0 var(--space-4); color: var(--color-text); line-height: 1.65; }
.ms-dev__prayer { margin: var(--space-5) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--color-primary); max-width: 640px; }
.ms-dev__prayer p { font-style: italic; }
.ms-dev__prayer span, .ms-journal__lab { display: block; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.ms-dev__prayer p { margin: 0; line-height: 1.6; }
.ms-journal { display: block; }
.ms-journal__prompt { display: block; font-weight: 600; margin-bottom: var(--space-2); line-height: 1.45; }
.ms-journal textarea, .ms-add input {
  width: 100%; font: inherit; font-size: 16px; color: var(--color-text); background: transparent;
  border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; padding: 10px 0;
}
.ms-journal textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.ms-journal textarea:focus, .ms-add input:focus { outline: none; border-color: var(--color-primary); }

/* Today's practice: one continuous flow */
.ms-today { --ms-pad: 0px; --ms-rail: 48px; padding: 0; margin-bottom: clamp(var(--space-10), 6vw, var(--space-16)); }
.ms-today__head { max-width: 820px; margin: 0 0 var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-divider); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.ms-today__title { min-width: 0; flex: 1 1 320px; }
.ms-today__h { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.ms-theme::before { content: " · "; color: var(--color-text-muted); }
.ms-theme { color: var(--color-text); text-transform: capitalize; letter-spacing: 0.1em; }
.ms-thread { margin: var(--space-3) 0 0; max-width: 620px; color: var(--color-text-muted); font-size: var(--text-base); line-height: 1.55; }
.ms-version { display: flex; align-items: center; gap: var(--space-2); flex: 0 1 300px; min-width: 0; }
.ms-version span { flex: none; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--color-text-muted); }
.ms-version select {
  flex: 1; width: 100%; min-width: 0; min-height: 44px; padding: 0 var(--space-3); font: inherit; font-size: 16px; font-weight: 600; color: var(--color-text);
  background: transparent; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; cursor: pointer; text-overflow: ellipsis; padding-left: 0;
}
.ms-version select:focus { outline: none; border-color: var(--color-primary); }

.ms-flow { list-style: none; margin: 0; padding: 0 0 0 var(--ms-rail); max-width: 820px; counter-reset: step; position: relative; }
.ms-step { position: relative; padding-bottom: var(--space-8); animation: ms-in 0.5s ease both; counter-increment: step; scroll-margin-top: 130px; }
.ms-step:nth-child(2) { animation-delay: 0.08s; } .ms-step:nth-child(3) { animation-delay: 0.16s; } .ms-step:nth-child(4) { animation-delay: 0.24s; } .ms-step:nth-child(5) { animation-delay: 0.32s; }
.ms-step:last-child { padding-bottom: 0; }
.ms-step__icon {
  position: absolute; left: calc(-1 * var(--ms-rail)); top: -3px; width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--color-primary); background: var(--color-bg);
  transition: background 0.35s ease, color 0.35s ease;
}
.ms-step__icon svg { width: 22px; height: 22px; }
.ms-step.is-seen .ms-step__icon { background: var(--color-primary); color: var(--color-text-inverse); }
.ms-step.is-seen .ms-step__icon svg { width: 18px; height: 18px; }
.ms-step::after { content: ""; position: absolute; left: calc(-1 * var(--ms-rail) + 15px); top: 32px; bottom: 0; width: 2px; background: var(--color-divider); }
.ms-step.is-seen:not(.is-active)::after { background: var(--color-primary); }
.ms-step:last-child::after { display: none; }
.ms-step__lab { margin: 0 0 var(--space-3); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--color-primary); line-height: 26px; }
.ms-step__lab::before { content: counter(step) " · "; color: var(--color-text-muted); }

/* Sticky step tracker (phones and tablets) */
.ms-track { display: none; }
@media (max-width: 900px) {
  .ms-track {
    display: flex; position: sticky; top: var(--ms-header-h, 66px); z-index: 5; margin: 0 calc(-1 * var(--ms-wrap)) var(--space-6); padding: 0 var(--ms-wrap);
    background: color-mix(in oklab, var(--color-bg) 90%, transparent); backdrop-filter: blur(8px);
  }
  .ms-track a { flex: 1; display: grid; gap: 6px; justify-items: center; min-height: 48px; padding: 8px 2px 0; text-decoration: none; color: var(--color-text-muted); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; position: relative; }
  .ms-track a::after { content: ""; display: block; width: 100%; height: 2px; background: var(--color-divider); margin-top: auto; }
  .ms-track a.is-seen { color: var(--color-text); }
  .ms-track a.is-seen::after { background: var(--color-primary); }
  .ms-track a.is-active { color: var(--color-primary); }
  .ms-track a[hidden] { display: none; }
}

.ms-step__lead { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
.ms-step__h { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1.2; margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
@keyframes ms-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ms-verse.is-loading { opacity: 0.5; }

/* Quotes */
.ms-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.ms-quote { margin: 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--color-primary); }
.ms-quote p { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: var(--text-base); line-height: 1.4; color: var(--color-text); }
.ms-quote footer { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.02em; }
.ms-quote footer::before { content: "\2014 "; }

/* Video */
.ms-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 2px; overflow: hidden; }
.ms-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ms-video__empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: var(--space-4); color: #c9c1b1; text-align: center; font-size: var(--text-sm); }

/* Buttons */
.ms-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--space-5);
  background: var(--color-primary); color: var(--color-text-inverse); border: 1px solid var(--color-primary); border-radius: 2px;
  font-weight: 600; font-size: var(--text-sm); cursor: pointer;
}
.ms-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.ms-btn:focus-visible, .ms-mood button:focus-visible, .ms-link:focus-visible, .ms-item__rm:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ms-link { background: none; border: 0; padding: var(--space-2) 0; min-height: 44px; color: var(--color-text-muted); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ms-link:hover { color: var(--color-primary); }

/* Commitments */
.ms-progress { margin: 0 0 var(--space-3); font-weight: 600; color: var(--color-text); }
.ms-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; border-top: 1px solid var(--color-divider); }
.ms-item { display: flex; align-items: center; gap: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.ms-item label { flex: 1; display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-2) 0; cursor: pointer; min-width: 0; }
.ms-item input { width: 22px; height: 22px; flex: none; accent-color: var(--color-primary); }
.ms-item span { overflow-wrap: anywhere; line-height: 1.4; }
.ms-item.is-done span { color: var(--color-text-muted); text-decoration: line-through; }
.ms-item__rm { flex: none; width: 44px; height: 44px; background: none; border: 0; color: var(--color-text-muted); font-size: 1.3rem; cursor: pointer; }
.ms-item__rm:hover { color: var(--color-text); }
.ms-add { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.ms-add input { flex: 1; min-width: 0; min-height: 44px; }
.ms-mood { margin-bottom: var(--space-5); }
.ms-mood__lab { margin: 0 0 var(--space-2); font-weight: 600; }
.ms-mood__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.ms-mood button { min-height: 44px; background: none; border: 0; border-bottom: 2px solid var(--color-divider); color: var(--color-text-muted); font-size: var(--text-sm); cursor: pointer; padding: 0 2px; }
.ms-mood button:hover { color: var(--color-text); }
.ms-mood button[aria-checked="true"] { border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }
.ms-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); margin-bottom: var(--space-2); }
.ms-week__day { display: grid; gap: 4px; justify-items: center; }
.ms-week__bar { position: relative; display: block; width: 100%; height: 44px; background: transparent; border-bottom: 1px solid var(--color-divider); overflow: hidden; }
.ms-week__bar span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--color-primary); }
.ms-week__lab { font-size: 0.75rem; color: var(--color-text-muted); }
.ms-week__day.is-today .ms-week__lab { color: var(--color-primary); font-weight: 700; }

/* Tools */
.ms-crisis { padding: 0 0 0 var(--space-4); border-left: 2px solid var(--color-primary); line-height: 1.55; margin-bottom: var(--space-6); }
.ms-crisis strong { display: block; margin-bottom: 2px; }
.ms-tool { padding: var(--space-4) 0; border-top: 1px solid var(--color-divider); }
.ms-tool h4 { margin: 0 0 var(--space-1); font-family: var(--font-body); font-size: var(--text-base); font-weight: 700; letter-spacing: 0; }
.ms-tool > p { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; }
.ms-breath { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-3); }
.ms-breath__box { position: relative; width: 72px; height: 72px; flex: none; border: 2px solid var(--color-primary); border-radius: 2px; }
.ms-breath__dot { position: absolute; width: 12px; height: 12px; margin: -7px; background: var(--color-primary); left: 0; top: 100%; transition: left 4s linear, top 4s linear; }
.ms-breath[data-phase="in"] .ms-breath__dot { left: 0; top: 0; }
.ms-breath[data-phase="hold"] .ms-breath__dot { left: 100%; top: 0; }
.ms-breath[data-phase="out"] .ms-breath__dot { left: 100%; top: 100%; }
.ms-breath[data-phase="hold2"] .ms-breath__dot { left: 0; top: 100%; }
.ms-breath[data-phase="idle"] .ms-breath__dot { transition: none; }
.ms-breath__say { margin: 0; font-weight: 600; white-space: pre-wrap; }
.ms-ground { margin: 0 0 var(--space-3); padding: 0; list-style: none; display: grid; gap: 4px; }
.ms-ground li { padding: var(--space-2) var(--space-3); border-left: 2px solid var(--color-border); color: var(--color-text-muted); }
.ms-ground li strong { color: var(--color-text); margin-right: 6px; }
.ms-ground li.is-on { border-left-color: var(--color-primary); color: var(--color-text); font-weight: 600; }
.ms-ground li.is-done { color: var(--color-text-faint); }
.ms-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ms-details summary:hover { color: var(--color-primary); }
.ms-details ul { margin: var(--space-2) 0 0; padding-left: 1.2em; line-height: 1.55; }
.ms-details li { margin-bottom: var(--space-2); }
.ms-lines { padding-left: 0 !important; list-style: none; }
.ms-lines strong { display: block; }

@media (max-width: 900px) {
  .ms__grid { grid-template-columns: 1fr; gap: 0; }
  .ms-card + .ms-card { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--color-divider); padding-top: clamp(var(--space-8), 5vw, var(--space-12)); margin-top: clamp(var(--space-8), 5vw, var(--space-12)); }
}
/* Phone: bigger moments */
@media (max-width: 760px) {
  .ms-today { --ms-rail: 44px; --ms-wrap: clamp(var(--space-5), 4vw, var(--space-10)); }
  .ms-today__head { border-top: 0; padding-top: 0; }
  .ms-today__h { font-size: var(--text-xl); }
  .ms-version { flex-basis: 100%; }
  .ms-step { padding-bottom: var(--space-10); }
  .ms-verse { border-left: 0; padding: 0; }
  .ms-verse::before { content: "\201C"; display: block; font-family: var(--font-display); font-size: 4.5rem; line-height: 0.55; color: var(--color-primary); margin: 10px 0 6px -2px; }
  .ms-verse p { font-size: var(--text-xl); line-height: 1.4; }
  .ms-verse cite { color: var(--color-primary); }
  .ms-quotes { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--space-6); margin-right: calc(-1 * var(--ms-wrap)); padding-right: var(--ms-wrap); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ms-quotes::-webkit-scrollbar { display: none; }
  .ms-quote { flex: 0 0 78%; scroll-snap-align: start; }
  .ms-quote p { font-size: var(--text-lg); }
  .ms-quotes-hint { margin: var(--space-2) 0 0; font-size: 0.75rem; color: var(--color-text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
  .ms-video { position: relative; z-index: 1; margin-left: calc(-1 * (var(--ms-wrap) + var(--ms-rail))); margin-right: calc(-1 * var(--ms-wrap)); border-radius: 0; }
  .ms-journal textarea { min-height: 150px; font-size: 17px; }
}
@media (min-width: 761px) { .ms-quotes-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .ms-breath__dot { transition: none; } .ms-step { animation: none; } }
