/* Keep off-canvas navigation drawers from expanding the document width. */
html { overflow-x: clip; }
@supports not (overflow-x: clip) {
  html { overflow-x: hidden; }
}

.nepsis-dialog {
  width: min(92vw, 28rem);
  max-width: 28rem;
  padding: 1.5rem;
  color: var(--fg, #3A2418);
  background: var(--card, #FFFBF6);
  border: 1px solid var(--border, #EADCCB);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 5rem rgba(14, 27, 23, .25);
}
.nepsis-dialog::backdrop { background: rgba(14, 27, 23, .55); }
.nepsis-dialog h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.nepsis-dialog input { box-sizing: border-box; width: 100%; min-height: 2.8rem; padding: .65rem .8rem; border: 1px solid #a9b6ae; border-radius: .6rem; font: inherit; }
.nepsis-dialog-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.1rem; }
.nepsis-dialog-actions button { min-height: 2.6rem; padding: .5rem .9rem; font: inherit; cursor: pointer; }
@media (max-width: 390px) { .nepsis-dialog { padding: 1.1rem; } .nepsis-dialog-actions button { flex: 1; } }
.nepsis-menu-button { min-width: 2.7rem; min-height: 2.7rem; border: 1px solid var(--border, #EADCCB); border-radius: 50%; color: var(--fg, #3A2418); background: var(--card, #FFFBF6); font: inherit; cursor: pointer; }
.nepsis-site-drawer { position: fixed; z-index: 1002; inset: 0 0 0 auto; display: flex; flex-direction: column; gap: .2rem; width: min(88vw, 22rem); padding: 5.5rem 1.2rem 1.2rem; overflow-y: auto; background: var(--card, #FFFBF6); box-shadow: -1rem 0 3rem rgba(40, 28, 20, .18); transform: translateX(105%); transition: transform .24s ease; }
.nepsis-site-drawer.open { transform: translateX(0); }
.nepsis-site-drawer a { display: block; padding: .75rem .9rem; border-radius: .65rem; color: var(--fg, #3A2418); text-decoration: none; font-weight: 700; }
.nepsis-site-drawer a:hover, .nepsis-site-drawer a:focus-visible { background: var(--bg, #F6EEE4); outline-color: var(--orange, #B9552A); }
.nepsis-menu-scrim { position: fixed; z-index: 1001; inset: 0; border: 0; background: rgba(32, 27, 22, .35); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.nepsis-menu-scrim.open { opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .nepsis-site-drawer, .nepsis-menu-scrim { transition: none; } }

/* The sticky header paints over the drawer's Close control. Keep that
   control below the header so it can be seen and clicked, without
   covering the menu button. */
#drawer .close {
  position: relative;
  top: auto;
  right: auto;
  align-self: flex-end;
  margin-top: 64px;
  z-index: 1;
}
/* The 404 page lifts the drawer over the header. Put the header bar
   back above that drawer, but let clicks pass through to Close, and
   keep the menu button itself clickable so it can toggle. */
body.missing-page:has(#drawer.open) header.top {
  z-index: 85;
  pointer-events: none;
}
body.missing-page:has(#drawer.open) #menuBtn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

/* Closed overlays leave the render and hit trees. .open keeps the painted look. */
.scrim:not(.open),
.acc-scrim:not(.open),
.sub-modal:not(.open),
.acc-modal:not(.open),
.account:not(.open),
.nepsis-menu-scrim:not(.open) {
  display: none !important;
  pointer-events: none !important;
}
.sub-modal:not(.open) *,
.acc-modal:not(.open) *,
.account:not(.open) * {
  pointer-events: none !important;
}
@starting-style {
  .scrim.open,
  .acc-scrim.open,
  .sub-modal.open,
  .acc-modal.open,
  .account.open,
  .nepsis-menu-scrim.open {
    opacity: 0;
  }
}

/* Simple brand mark: a flat orange dot, with Nepsis as separate text. */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo .dot,
body.home-page .logo .dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  border-radius: 50%;
  background: none;
  background-image: url("../brand/nepsis-mark.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: none;
}
.logo span:not(.dot) {
  color: inherit;
}

.hero-copy {
  container-type: inline-size;
}
body.home-page .hero h1 {
  max-width: 100%;
  font-size: clamp(1.85rem, 8.4cqi, 4.2rem);
  letter-spacing: -0.03em;
  word-spacing: 0.06em;
}
body.home-page .hero h1 .hero-kicker,
body.home-page .hero h1 em {
  display: block;
  font-size: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}
body.home-page .hero h1 .hero-kicker {
  white-space: nowrap;
}
.hero-copy .knowledge-note {
  margin-top: 18px;
  margin-bottom: 0;
  max-width: 36rem;
  padding: 14px 16px 16px;
  overflow: visible;
}
.hero-copy .knowledge-note .eyebrow {
  margin-bottom: 6px;
}
.hero-copy .knowledge-note p {
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.hero-copy .knowledge-note p:last-child {
  margin-bottom: 0;
}
.whop-upsell {
  margin-top: 12px;
  padding: 12px 0 2px;
  border-top: 1px solid rgba(58, 36, 24, 0.08);
}
.whop-upsell a {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--muted, #7A5F50);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.whop-upsell a:hover,
.whop-upsell a:focus-visible {
  color: var(--orange, #F0702A);
  text-decoration: underline;
}
.whop-upsell a:focus-visible {
  outline: 3px solid #F0702A55;
  outline-offset: 3px;
  border-radius: 6px;
}
.hero-copy .knowledge-note .whop-upsell {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 10px 0 0;
}
.hero-copy .knowledge-note .whop-upsell a {
  font-size: 0.8rem;
  line-height: 1.55;
}

/* Visible practice timer: larger centered time, orange ring, active and complete states. */
.practice-page .stage {
  container-type: inline-size;
  transition: border-color .4s ease, box-shadow .4s ease;
}
.practice-page .ring {
  width: min(100%, 240px);
  height: auto;
  aspect-ratio: 1;
  margin: 12px auto 8px;
}
.practice-page .ring svg {
  width: 100%;
  height: 100%;
}
.practice-page .ring .track {
  stroke: rgba(240, 138, 36, 0.2);
}
.practice-page .ring .prog {
  stroke: #F08A24;
  transition: stroke-dashoffset .25s linear, stroke .4s ease;
}
.practice-page .ring .time {
  font-size: clamp(2.5rem, 28cqi, 3.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  color: #3A2418;
}
.practice-page .stage.is-running {
  border-color: #F08A24;
  box-shadow: 0 14px 36px -18px rgba(240, 138, 36, 0.6);
}
.practice-page .stage.is-running .time {
  color: #F08A24;
}
.practice-page .stage.is-running .dot2 {
  background: #F08A24;
  box-shadow: 0 0 0 6px rgba(240, 138, 36, 0.22);
}
.practice-page .stage.is-complete .msg,
.practice-page .stage.is-complete .after {
  animation: nepsis-complete-in .85s ease;
}
@keyframes nepsis-complete-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .practice-page .stage.is-complete .msg,
  .practice-page .stage.is-complete .after {
    animation: none;
  }
}

/* Homepage: one clear Start button, without a stage row on the first screen. */
body.home-page .hero-copy .btns {
  margin-bottom: 0;
}
body.home-page .hero-copy .btn-primary {
  background: #F08A24;
  border-color: #F08A24;
  color: #fff;
  box-shadow: 0 16px 36px -16px rgba(240, 138, 36, 0.65);
}
body.home-page .hero-copy .knowledge-note {
  margin-top: 14px;
}


/* Thought parking: a small in-stage field, only while a timer is running. */
.practice-page .thought-park {
  display: none;
  margin: 10px 0 4px;
  text-align: left;
}
.practice-page .stage.is-running .thought-park {
  display: block;
}
.practice-page .thought-park-label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #3A2418;
}
/* Stage cards are narrow, so the field takes the full width and the button sits below it. */
.practice-page .thought-park-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.practice-page .thought-park-input {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #EADCCB;
  border-radius: 0.65rem;
  background: #FFFBF6;
  color: #3A2418;
  font: inherit;
  font-size: 16px;
}
.practice-page .thought-park-input:focus {
  outline: 2px solid rgba(240, 138, 36, 0.45);
  outline-offset: 1px;
  border-color: #F08A24;
}
.practice-page .thought-park-save {
  flex: 0 0 auto;
  width: 100%;
  white-space: normal;
}
.practice-page .thought-park-privacy {
  margin: 6px 0 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #7A6558;
}
.practice-page .thought-park-ok {
  min-height: 1.2em;
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #3A2418;
}
.practice-page .thought-park-return {
  position: static;
  display: block;
  min-height: 0;
  margin: 6px 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #FFF8EE;
  border: 1px solid rgba(240, 138, 36, 0.25);
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #3A2418;
}
.practice-page .thought-park-return:empty {
  display: none;
}
/* Kept notes: shown under the card when no timer is running. */
.practice-page .thought-park-review {
  margin: 10px 0 4px;
  text-align: left;
  font-size: 0.9rem;
  color: #3A2418;
}
.practice-page .stage.is-running .thought-park-review {
  display: none;
}
.practice-page .thought-park-review summary {
  cursor: pointer;
  min-height: 2.2rem;
  display: list-item;
  padding: 0.3rem 0;
}
.practice-page .thought-park-review .thought-park-privacy {
  margin: 4px 0 6px;
}
.practice-page .thought-park-list {
  margin: 6px 0 8px;
  padding-left: 1.1rem;
  max-height: 12rem;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.practice-page .thought-park-list li {
  margin: 0 0 6px;
  line-height: 1.35;
}
.practice-page .thought-park-when {
  color: #7A6558;
  font-size: 0.8rem;
}
@media (prefers-reduced-motion: reduce) {
  .practice-page .thought-park-ok { transition: none; }
}

/* Return-to-reading question after a note is kept */
.practice-page .thought-park-next { margin: 8px 0 0; }
.practice-page .thought-park-next[hidden] { display: none; }
.practice-page .thought-park-next-q {
  display: block; margin: 0 0 8px; font-size: 0.9rem; line-height: 1.4; font-weight: 700; color: #3A2418;
}
.practice-page .thought-park-anchor {
  margin: 6px 0 0; font-size: 0.88rem; line-height: 1.4; color: #B4612A; font-weight: 700; overflow-wrap: anywhere;
}
.practice-page .thought-park-anchor:empty { display: none; }
.practice-page .thought-park-next-item { display: block; color: #B4612A; font-size: 0.82rem; }
@media (min-width: 700px) {
  .practice-page .thought-park-input { font-size: 0.9rem; padding: 0.5rem 0.6rem; }
}
/* Practice page: opt-in completion notification under the stages */
.notify-row { text-align: center; margin: 18px 0 0; }
.notify-btn { font-size: 14px; padding: 10px 16px; }
.notify-btn:disabled { opacity: .6; cursor: not-allowed; }
.notify-blocked { margin: 10px auto 0; max-width: 32rem; font-size: .9rem; color: var(--muted); }
.notify-blocked[hidden] { display: none; }

/* Google OAuth: calm loading state on the sign-in button */
.nepsis-oauth-spinner {
  display: none;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(58, 36, 24, .18);
  border-top-color: var(--orange, #B9552A);
  box-sizing: border-box;
}
button.is-oauth-loading,
.btn.is-oauth-loading {
  cursor: wait;
  opacity: .92;
  pointer-events: none;
}
button.is-oauth-loading .nepsis-oauth-spinner,
.btn.is-oauth-loading .nepsis-oauth-spinner {
  display: inline-block;
  animation: nepsis-oauth-spin .7s linear infinite;
}
button.is-oauth-loading > svg,
.btn.is-oauth-loading > svg {
  opacity: .35;
}
@media (prefers-reduced-motion: reduce) {
  button.is-oauth-loading .nepsis-oauth-spinner,
  .btn.is-oauth-loading .nepsis-oauth-spinner {
    animation: none;
    border-top-color: rgba(58, 36, 24, .18);
    background: var(--orange, #B9552A);
  }
}
@keyframes nepsis-oauth-spin {
  to { transform: rotate(360deg); }
}
/* Ambient focus sounds: discreet corner widget, always opt-in.
   Bottom-left keeps clear of the analytics settings control (bottom-right). */
.nepsis-ambient {
  position: fixed;
  z-index: 80;
  left: max(14px, env(safe-area-inset-left));
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-family: inherit;
  pointer-events: none;
}
.nepsis-ambient > * { pointer-events: auto; }
.nepsis-ambient-toggle {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--border, #EEDCC8);
  background: rgba(255, 253, 248, 0.94);
  color: var(--fg, #3A2418);
  box-shadow: 0 10px 28px -16px rgba(120, 60, 30, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.nepsis-ambient-toggle:hover,
.nepsis-ambient-toggle:focus-visible {
  transform: translateY(-2px);
  border-color: var(--orange, #F0702A);
  color: var(--ember, #D8392B);
  outline: none;
}
.nepsis-ambient-icon { width: 22px; height: 22px; display: block; }
.nepsis-ambient-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(240, 112, 42, 0.35);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}
.nepsis-ambient-toggle > svg,
.nepsis-ambient-toggle > .visually-hidden {
  pointer-events: none;
}
.nepsis-ambient.is-playing .nepsis-ambient-toggle {
  border-color: var(--orange, #F0702A);
  color: var(--orange, #F0702A);
}
.nepsis-ambient.is-playing .nepsis-ambient-pulse {
  animation: nepsis-ambient-pulse 1.8s ease-out infinite;
}
.nepsis-ambient-panel {
  width: min(18.5rem, calc(100vw - 28px));
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid var(--border, #EEDCC8);
  background: rgba(255, 253, 248, 0.97);
  color: var(--fg, #3A2418);
  box-shadow: 0 18px 40px -22px rgba(120, 60, 30, 0.55);
  backdrop-filter: blur(10px);
}
.nepsis-ambient-panel[hidden] { display: none; }
.nepsis-ambient-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nepsis-ambient-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.nepsis-ambient-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border, #EEDCC8);
  background: transparent;
  color: var(--muted, #7A5F50);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.nepsis-ambient-close:hover,
.nepsis-ambient-close:focus-visible {
  border-color: var(--orange, #F0702A);
  color: var(--ember, #D8392B);
  outline: none;
}
.nepsis-ambient-hint {
  margin: 6px 0 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted, #7A5F50);
}
.nepsis-ambient-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.nepsis-ambient-pick {
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  border: 1.5px solid var(--border, #EEDCC8);
  background: #fff;
  color: var(--fg, #3A2418);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.nepsis-ambient-pick:hover,
.nepsis-ambient-pick:focus-visible {
  transform: translateY(-1px);
  border-color: var(--orange, #F0702A);
  outline: none;
}
.nepsis-ambient-pick.active {
  background: #FBE9CF;
  border-color: var(--orange, #F0702A);
  color: var(--ember, #D8392B);
}
.nepsis-ambient-vol {
  display: grid;
  gap: 6px;
  margin: 12px 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted, #7A5F50);
}
.nepsis-ambient-vol input[type="range"] {
  width: 100%;
  accent-color: var(--orange, #F0702A);
}
.nepsis-ambient-stop {
  width: 100%;
  min-height: 2.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--border, #EEDCC8);
  background: #fff;
  color: var(--fg, #3A2418);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}
.nepsis-ambient-stop:hover:not(:disabled),
.nepsis-ambient-stop:focus-visible:not(:disabled) {
  border-color: var(--orange, #F0702A);
  color: var(--ember, #D8392B);
  outline: none;
}
.nepsis-ambient-stop:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.nepsis-ambient .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes nepsis-ambient-pulse {
  0% { opacity: 0.7; transform: scale(0.94); }
  100% { opacity: 0; transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .nepsis-ambient-toggle,
  .nepsis-ambient-pick { transition: none; }
  .nepsis-ambient.is-playing .nepsis-ambient-pulse { animation: none; opacity: 0.55; transform: none; }
}
/* Keep the toggle reachable in zen mode; collapse the open panel chrome. */
body.zen-active .nepsis-ambient-panel { display: none; }
body.zen-active .nepsis-ambient { z-index: 120; }
@media (max-width: 420px) {
  .nepsis-ambient {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  .nepsis-ambient-toggle { width: 46px; height: 46px; }
}
