*{box-sizing:border-box}body{margin:0;background:#101014;color:#f3f1f7;font:16px Inter,system-ui,sans-serif}header{border-bottom:1px solid #2c2b33;height:72px;display:flex;align-items:center;gap:18px;padding:0 max(5vw,calc((100vw - 1120px)/2));color:#a6a4b1;font-size:14px}.brand{display:flex;align-items:center;gap:10px;color:white;font-size:25px;font-weight:650;letter-spacing:-1px}.brand i{background:#c5b2ff;color:#241839;font-size:34px;line-height:29px;height:32px;width:32px;border-radius:9px;text-align:center}.divider{height:20px;border-left:1px solid #43414b}button,select,input{font:inherit}button,select{color:#dedce6;background:#25242c;border:1px solid #393840;border-radius:8px;padding:9px 14px;cursor:pointer}button:hover{filter:brightness(1.15)}:focus-visible{outline:2px solid #ceadff;outline-offset:3px}.night{margin-left:auto;background:transparent;white-space:nowrap}main{max-width:1100px;margin:40px auto;padding:0 25px}h1{margin:0;font-size:clamp(32px,4vw,48px);font-weight:540;letter-spacing:-2px}.tabs{display:inline-flex;padding:4px;border-radius:10px;background:#222128;margin:21px 0}.tabs button{border:0;background:transparent;min-width:94px;color:#aaa8b6}.tabs .active{color:#f0eaff;background:#45404e;box-shadow:0 1px 4px #131118}.monitor,.panel{border:1px solid #34303e;border-radius:15px;overflow:hidden}.monitor{position:relative;isolation:isolate;background:#16131e;padding:22px 26px;height:245px;display:flex;flex-direction:column}.monitorTop,.monitorFoot{display:flex;align-items:center;gap:18px}.monitorTop{justify-content:space-between}.eyebrow{font:12px ui-monospace,monospace;letter-spacing:2px;color:#c6bed5}.badge{font-size:12px;background:#26222f;padding:4px 10px;border:1px solid #494052;border-radius:15px}.reading{margin-top:14px;font:17px ui-monospace,monospace;color:#b9aece}.reading strong{font:500 45px system-ui;color:white;letter-spacing:-2px}canvas{position:absolute;inset:0;width:100%;height:100%;z-index:-1}.monitorFoot{margin-top:auto;color:#cbc4d6;font:13px ui-monospace,monospace}.monitorFoot b{display:inline-block;width:8px;height:8px;background:#bb9bfe;border-radius:50%}.monitorFoot span:nth-child(2) b{background:#88ccc7}time{margin-left:auto}.columns{display:grid;grid-template-columns:1.45fr 1fr;gap:18px;margin:18px 0}.panel{padding:23px 25px;background:#1b1a20}h2{font-size:20px;letter-spacing:-.6px;font-weight:550;margin:0 0 20px}.control+.control{border-top:1px solid #34313c;padding-top:15px;margin-top:16px}.field,.stop,.transport{display:flex;align-items:center;justify-content:space-between;gap:10px}.field label,.stop{font-size:15px}.value{display:flex;align-items:center;border:1px solid #3c3845;border-radius:7px;background:#141319;padding:5px 9px;color:#a8a1b4;font:13px ui-monospace,monospace}.value input{width:4em;border:0;color:#e6defa;text-align:right;background:transparent;appearance:textfield}.value input::-webkit-inner-spin-button{appearance:none}input[type=range]{display:block;width:100%;min-width:0;accent-color:#bd9df6;cursor:pointer;margin:0;height:24px;zoom:1.15}.limits{display:flex;justify-content:space-between;font:12px ui-monospace,monospace;color:#aaa3b5}.stop{margin:20px 0}.stop select{font-size:14px}.transport button{height:42px}.transport #play{flex:1;background:#c5a7fc;color:#201729;border:0;font-weight:650}footer{display:flex;justify-content:space-between;color:#a9a3b4;font-size:13px;margin:20px 0}.row{display:flex;gap:15px;align-items:end;margin:15px 0}.row label{flex:1;font-size:14px;color:#c6bed0}.row input{display:block;width:100%;padding:8px;background:#121115;color:white;border:1px solid #49414e;border-radius:6px}p{color:#b9b2c3}.row button{padding:8px}#curtain{position:fixed;inset:0;background:#000;width:100%;height:100%;border:0;border-radius:0;z-index:5}[hidden]{display:none!important}@media(max-width:700px){header{gap:10px;padding:0 16px;height:60px}.columns{grid-template-columns:1fr}main{margin:23px auto;padding:0 15px}.monitor,.panel{padding:19px}.monitor{height:225px}.row{gap:7px}.night{padding:7px;font-size:13px}footer{gap:15px}.monitorFoot{gap:9px;font-size:11px}}

.band,.timerBox,.templates form,.duration{display:flex;align-items:center;gap:12px}.band{justify-content:space-between;background:#201d28;border-left:3px solid #b197df;border-radius:8px;padding:14px 19px;margin:17px 0}.band h2{margin:4px 0 0;font-size:19px}.band a{color:#cbb8e8;font-size:13px}.timerBox{margin:20px 0;flex-wrap:wrap;justify-content:space-between}.timerBox input[type=checkbox]{accent-color:#bf9df4}.duration{gap:7px}.duration label,.templates label,small{color:#c2bccc;font-size:14px}.duration input,.templates input,.templates select{background:#141319;color:#eee;border:1px solid #443d50;border-radius:6px;padding:7px}.duration input{width:4em}#remaining:not(:empty){flex-basis:100%}.templates{border-top:1px solid #34313c;margin-top:21px;padding-top:18px}.templates form{display:inline-flex;margin:0 20px 12px 0;align-items:end}.templates label>*{display:block;margin-top:5px;max-width:100%;width:180px}.templates small{display:block}button:disabled{opacity:.55}.band .eyebrow{font-size:11px}@media(max-width:450px){.band{gap:9px}.band h2{font-size:16px}.band a{font-size:12px}.timerBox{justify-content:start}}

main>h1{margin-bottom:23px}
.primaryAction{background:#c5a7fc;color:#151119;font-weight:650;border:1px solid transparent;min-height:46px;padding:10px 18px}
#timerOn[aria-pressed=true]{background:#d6c2fb}
.shiftHeading{display:flex;align-items:center;gap:14px}.shiftHeading h2{margin:0}.shiftHeading button{flex-shrink:0}#shiftStatus:not(:empty){display:block;margin-top:10px}
.shiftMonitor { display: grid; gap: 7px; padding: 10px 12px; margin: 8px 0; background: #201b2a; border: 1px solid #3d324d; border-radius: 10px; }
.shiftMonitorRow { display: flex; align-items: center; gap: 8px 12px; }
.shiftMonitorSummary { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; color: #eee4fc; font-size: .875rem; }
#stopLiveShift { flex: none; min-height: 44px; padding-inline: 10px; font-size: .875rem; }
#shiftClock { color: #d2c2e8; font: .8125rem ui-monospace, monospace; white-space: nowrap; }
#shiftClock:empty { display: none; }
#shiftProgress { display: block; width: 100%; height: 4px; border: 0; border-radius: 8px; overflow: hidden; background: #393043; accent-color: #bf9ff6; appearance: none; }
#shiftProgress::-webkit-progress-bar { background: #393043; }
#shiftProgress::-webkit-progress-value { background: #bf9ff6; }
#shiftProgress::-moz-progress-bar { background: #bf9ff6; }
.toneHeading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
#studioView .toneHeading h2 { margin: 0; }
#tonePresetToggle { min-height: 44px; background: #c5a7fc; border-color: transparent; color: #201729; }
#tonePresetToggle[aria-expanded="true"] { background: #b899f2; }
.tonePresetList { display: grid; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid #393840; border-radius: 10px; background: #18171e; }
.tonePresetList button { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; min-height: 44px; text-align: left; padding: 8px 10px; border: 0; }
.tonePresetList button span, .tonePresetStatus { color: #c4bcd1; font-size: .875rem; }
.tonePresetStatus:not(:empty) { margin-bottom: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .tonePresetList { animation: tone-presets-in .18s ease-out; }
  @keyframes tone-presets-in { from { opacity: .5; transform: translateY(-3px); } }
}
.transport button{min-height:46px}
@media(max-width:520px){.shiftHeading{gap:10px}.shiftHeading button{padding-inline:12px}.timerBox{gap:12px}.duration input{font-size:16px}}

.viewTabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px;
  background: #211f28;
  border-radius: 11px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: #60536f transparent;
}
.viewTabs button { flex: none; white-space: nowrap; border: 0; background: transparent; min-height: 44px; }
.viewTabs button:focus-visible { outline-offset: -2px; }
.viewTabs [aria-selected=true] { background: #433b50; color: #f2eaff; box-shadow: inset 0 -2px var(--beat-tab-accent, #c5a7fc); }
#studioView>h1,#guideView>h1{margin-bottom:20px}
.guideCard{--accent:#a6dec8;display:grid;grid-template-columns:minmax(230px,42%) 1fr;align-items:center;gap:25px;padding:clamp(20px,4vw,46px);border:1px solid color-mix(in srgb,var(--accent) 28%,#242129);border-radius:16px;background:radial-gradient(ellipse at 20% 40%,color-mix(in srgb,var(--accent) 12%,#17151c),#17151c 75%);color:var(--accent)}
.dialArea{text-align:center}#guideDial{position:relative;margin:auto;width:min(100%,265px);aspect-ratio:1;border-radius:50%;touch-action:none;cursor:grab;user-select:none;background:#151419;box-shadow:0 0 0 1px #ffffff17,inset 0 0 36px #0008}#guideDial:active{cursor:grabbing}
.dialScale{position:absolute;inset:8%;border-radius:50%;background:repeating-conic-gradient(from -150deg,#ffffff60 0 0.65deg,transparent 0.65deg 5deg);mask:radial-gradient(transparent 64%,black 65%)}.dialPointer{position:absolute;inset:4%;transform:rotate(var(--turn));pointer-events:none}.dialPointer i{display:block;margin:auto;height:11%;width:8px;border-radius:6px;background:var(--accent);box-shadow:0 0 10px color-mix(in srgb,var(--accent) 50%,transparent)}
.dialCenter{position:absolute;inset:29%;border-radius:50%;display:grid;place-content:center;background:radial-gradient(circle at 50% 80%,color-mix(in srgb,var(--accent) 13%,#17151c),#19171e);border:1px solid #ffffff17}.dialCenter strong{font-weight:530;font-size:clamp(26px,4vw,45px);line-height:1.1;font-variant-numeric:tabular-nums}.dialCenter span,#guideRange{font:14px ui-monospace,monospace}.dialMark{position:absolute;transform:translate(-50%,-50%);font:18px Georgia,serif;color:#b5aebc;pointer-events:none}.dialMark.active{color:var(--accent);font-weight:bold}#dialHelp{display:block;margin:12px auto 0}.guideCard h2{font-size:clamp(34px,5vw,54px);margin:6px 0 3px;letter-spacing:-2px}.guideCard h3{margin:0;color:#eeeaf4;font-size:19px}.guideCard p{line-height:1.5;color:#d1cad8;max-width:48ch}.guideCard p:last-child{margin-bottom:0}.guideNotes{font-size:14px;line-height:1.5;max-width:85ch}.guideNotes a{color:#d2c2f0;white-space:nowrap}
@media(max-width:640px){.guideCard{grid-template-columns:1fr;gap:18px;padding:18px}#guideDial{width:min(47vw,175px)}#guideText p{margin:8px 0}.guideCard h2{font-size:32px}#guideView>h1{font-size:32px;margin-bottom:12px}.viewTabs{margin-bottom:14px}}

.bandDetails{grid-column:1/-1;border-top:1px solid color-mix(in srgb,var(--accent) 23%,#25232a);min-width:0}
#readToggle{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 4px;border:0;background:transparent;color:var(--accent);font-weight:600}
#readToggle::after{content:'+'}#readToggle[aria-expanded=true]::after{content:'−'}
#morePanel{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .26s ease,opacity .2s ease}
#readToggle[aria-expanded=true]+#morePanel{grid-template-rows:1fr;opacity:1}
.moreClip{min-height:0;overflow:hidden}
@media(prefers-reduced-motion:reduce){#morePanel{transition:none}}
.bandDetails section{max-width:70ch;padding:4px 0 12px}.bandDetails p{max-width:none}.bandDetails a{color:var(--accent);font-size:14px}

.mixNote{margin:0 0 10px;font-size:14px;line-height:1.35}

.studioTop{display:flex;align-items:center;gap:20px;margin:0 0 12px}
.studioTop h1{font-size:24px;letter-spacing:-.8px}
.studioTop .transport{gap:8px}.studioTop #play{min-width:104px}
#studioView .monitor{height:155px;padding:14px 18px}
#studioView .reading{margin:0;line-height:1}
#studioView .reading strong{font-size:35px}
#studioView .band{padding:6px 12px;margin:8px 0}
#studioView .band h2{font-size:15px;line-height:1.3;letter-spacing:-.2px;margin:0}
#studioView .columns{margin:10px 0;gap:12px}
@media(max-width:700px){
  main{margin-top:12px}.viewTabs{margin-bottom:10px}
  .studioTop{justify-content:space-between;gap:8px;margin-bottom:8px}
  .studioTop h1{font-size:19px}.studioTop #play{min-width:85px}
  #studioView .monitor{height:100px;padding:8px 12px}
  #studioView .reading strong{font-size:25px}
  #studioView .panel{padding:14px}
  #studioView .panel h2{margin-bottom:12px}
  #studioView .control+.control{margin-top:10px;padding-top:10px}
  #studioView .band a{flex-shrink:0}
}

#curtain span{color:#828282;border:1px solid #414141;border-radius:99px;padding:10px 18px;font-size:14px;letter-spacing:.02em;-webkit-text-stroke:.2px #999}

#audioModeSettings{margin-top:16px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:15px}#audioModeSettings .mixNote{width:100%;margin:0}

.readerToolbar { position: relative; z-index: 2; }
.readerShelf { position: relative; }
.readerTitleRow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.readerTitleRow h1 { min-width: 0; }
.readerShelfActions { display: flex; align-items: center; }
#readerShelfToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 44px;
  padding: 0 11px;
  color: #d9c6fa;
  background: #24202c;
  border-color: #41394e;
  font-size: .875rem;
}
#readerShelfToggle[aria-expanded="true"] { background: #3b314c; }
#readerShelfToggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.readerSurpriseSlot[inert] { display: none; }
#readerSurprise {
  min-height: 44px;
  margin-inline-start: 6px;
  padding: 0 11px;
  border-color: #6a5785;
  background: #362a47;
  color: #f2eaff;
  font-size: .875rem;
  white-space: nowrap;
}
#readerSurprise:focus-visible { outline-offset: -3px; }
.readerShelfPanel {
  position: absolute;
  inset: calc(100% + 8px) auto auto 0;
  width: min(100%, 34rem);
  max-height: min(31rem, 65vh);
  max-height: min(31rem, 65dvh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid #494052;
  border-radius: 14px;
  background: #201c29;
  box-shadow: 0 14px 36px #09070bb5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
}
.readerShelfPanel:not([inert]) { opacity: 1; visibility: visible; transform: none; }
.readerShelfControls { display: flex; flex-wrap: wrap; gap: 8px; }
.readerShelfControls input {
  min-height: 44px;
  min-width: 0;
  flex: 1 1 12rem;
  padding: 8px 10px;
  border: 1px solid #494052;
  border-radius: 8px;
  background: #15121b;
  color: #f2eaff;
}
.readerShelfControls button, .readerShelfThemes button { min-height: 44px; font-size: .875rem; }
.readerShelfPanel button[aria-pressed="true"] { background: #413451; color: #f1e6ff; border-color: #75628f; }
.readerShelfThemes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.readerShelfThemes button { padding-inline: 10px; border-radius: 20px; }
.readerShelfResults {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.readerShelfResults button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  min-height: 70px;
  height: 100%;
  border-color: #494052;
  background: #282232;
  color: #f2eaff;
  text-align: left;
  font-weight: 600;
  line-height: 1.3;
}
.readerShelfResults button[aria-current="true"] { background: #352b42; border-color: #9177b5; }
.readerShelfResults span { font-size: .875rem; font-weight: 400; color: #c9bed7; }
.readerShelfResults.is-list { grid-template-columns: 1fr; gap: 4px; }
.readerShelfResults.is-list button { min-height: 44px; background: transparent; }
.readerShelfResults.is-list span { display: none; }
@media (max-width: 420px) {
  .readerShelfResults { grid-template-columns: 1fr; }
  .readerShelfResults button { min-height: 56px; }
}
@media (prefers-reduced-motion: no-preference) {
  #readerShelfToggle svg { transition: transform .22s ease; }
  .readerSurpriseSlot:not([inert]) { animation: reader-surprise-in .2s ease-out; }
  @keyframes reader-surprise-in { from { opacity: .25; transform: translateX(-5px); } }
  .readerShelfPanel {
    transition: opacity .2s ease, transform .2s ease, visibility 0s .2s;
  }
  .readerShelfPanel:not([inert]) { transition-delay: 0s; }
}
.readerByline {
  margin: 6px 0 22px;
  color: #c2bccc;
  line-height: 1.5;
}
.readerLayout {
  display: grid;
  grid-template-columns: minmax(168px, 216px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}
.readerLayout:has(.readerContents[hidden]) { grid-template-columns: minmax(0, 1fr); }
.readerContents {
  padding: 16px 12px;
}
.readerContents h2 {
  margin: 0 10px 8px;
  font-size: 1rem;
}
.readerContents ol {
  display: grid;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.readerContents button {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
  background: transparent;
  border-color: transparent;
}
.readerContents button[aria-current="page"] {
  background: #433b50;
  color: #f2eaff;
}
.readerJump {
  display: none;
}
.readerBook {
  padding: clamp(18px, 4vw, 46px);
  background: radial-gradient(ellipse at 15% 0%, #221d2c, #1b1a20 56%);
}
.readerChapter, .readerPagination {
  max-width: 65ch;
  margin-inline: auto;
}
.readerChapter h2 {
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #3c3648;
  color: #f2eaff;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-style: italic;
  line-height: 1.12;
  letter-spacing: -.03em;
  overflow-wrap: break-word;
  scroll-margin-top: 18px;
}
.readerChapter p {
  color: #ded8e8;
  font-size: 1.0625rem;
  line-height: 1.72;
  margin: 0 0 1em;
}
.readerChapter .readerTextSubtitle { color: #d5c1fa; font-style: italic; }
#readerTextBody p { white-space: pre-line; }
.readerAphorism h3 {
  color: #d5c1fa;
  font-size: .9rem;
  font-weight: 500;
  margin: 0 0 6px;
}
#readerTextBody .readerAphorism + .readerAphorism {
  border-top: 1px solid #3c3648;
  padding-top: 16px;
  margin-top: 16px;
}
.readerChapter .readerTextCredit, .readerChapter .readerTextNote p {
  color: #c2bccc;
  font-size: .875rem;
}
.readerChapter .readerTextCredit { margin: 18px 0 2px; }
.readerTextNote { margin: 8px 0 0; }
.readerTextNote summary { cursor: pointer; color: #d2c2f0; padding-block: 6px; }
.readerChapter blockquote {
  margin: 8px 0 1.25em;
  padding-left: 14px;
  border-left: 2px solid #b197df;
  color: #d5c1fa;
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.5;
}
.readerSource {
  display: inline-block;
  color: #d2c2f0;
  font-size: .875rem;
  line-height: 1.5;
  padding-block: 8px;
  text-underline-offset: 3px;
}
.readerPagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  margin-top: 16px;
  border-top: 1px solid #3c3648;
}
.readerPagination button {
  min-height: 46px;
}
#readerPrevious { justify-self: start; }
#readerNext { justify-self: end; }
#readerPosition {
  color: #c2bccc;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 641px) and (hover: hover) and (pointer: fine) {
  .readerContents {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #494052 transparent;
  }
}

@media (max-width: 640px), (max-width: 950px) and (hover: none) and (pointer: coarse) {
  main:has(#readerView:not([hidden])) .viewNav,
  .readerToolbar {
    position: sticky;
    margin-inline: calc(-1 * var(--reader-gutter, 25px));
    padding-inline: var(--reader-gutter, 25px);
    background: #101014;
  }
  main:has(#readerView:not([hidden])) .viewNav {
    top: 0;
    z-index: 4;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }
  main:has(#readerView:not([hidden])) .viewTabs {
    margin-bottom: 0;
  }
  .readerToolbar {
    top: var(--reader-nav-height, 62px);
    z-index: 3;
    padding-block: 4px 12px;
    border-bottom: 1px solid #2c2b33;
  }
  .readerToolbar h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .readerLayout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 12px;
  }
  .readerContents { display: none; }
  .readerJump { display: flex; align-items: center; gap: 12px; }
  .readerJump select { flex: 1; min-width: 0; min-height: 44px; }
  .readerByline { font-size: .875rem; margin: 4px 0 10px; }
  .readerChapter h2 {
    scroll-margin-top: calc(var(--reader-nav-height, 62px) + var(--reader-toolbar-height, 116px) + 12px);
  }
  .readerPagination button { padding-inline: 11px; }
}

@media (max-width: 700px) {
  main { --reader-gutter: 15px; }
}
@media (max-width: 340px) {
  .viewTabs button { padding-inline: 9px; }
  .readerPagination { gap: 6px; }
}

.zener-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 20px;
}
.zener-heading button {
  min-height: 44px;
  color: #d2c2f0;
  background: #252031;
  border-color: #49415e;
}
.zener-art { position: absolute; }

.zener-game {
  width: min(100%, 540px);
  margin-inline: auto;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #221d2c, #1b1a20 62%);
}
.zener-intro p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.zener-tip-toggle {
  min-height: 44px;
  color: #d2c2f0;
  background: #252031;
  border-color: #49415e;
}
.zener-scene {
  position: relative;
  width: 180px;
  height: 276px;
  margin: 27px auto 18px;
  perspective: 850px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 10px;
  transition: opacity .18s ease;
}
.zener-scene[aria-disabled="false"] { cursor: grab; }
.zener-scene[aria-disabled="false"]:active { cursor: grabbing; }
.zener-scene.skipping { opacity: 0; }
.zener-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  will-change: transform;
  transition: transform .64s cubic-bezier(.22,.75,.22,1);
}
.zener-card.dragging { transition: none; }
.zener-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: radial-gradient(ellipse at 70% 5%, #26223b, transparent 55%),
    linear-gradient(155deg, #191b2c, #101421 70%, #152a32);
  box-shadow: 0 0 0 1px #a997d3, 0 0 20px #a78be54a, inset 0 0 19px #b6a6e321;
}
.zener-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset -2px -2px 9px #86e7ed56;
  pointer-events: none;
}
.zener-front { transform: rotateY(180deg); }
.zener-front svg {
  width: 102px;
  height: 102px;
  color: #d8f7ff;
  filter: drop-shadow(0 0 7px #92d7f7a0);
}
.zener-back svg { width: 145px; height: 215px; }
.zener-status {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: 14px 0 0;
  line-height: 1.45;
  color: #ded8e8;
}
.zener-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.zener-choice {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 64px;
  padding: 6px 1px;
  font-size: .875rem;
}
.zener-choice svg { width: 27px; height: 27px; color: #d2c2f0; }
.zener-choice[aria-pressed="true"] {
  opacity: 1;
  border-color: #c5a7fc;
  color: #f2eaff;
  background: #433b50;
}
.zener-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.zener-actions button { min-height: 46px; }
#zener-skip { background: transparent; }
.zener-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 22px 0 10px;
  border-top: 1px solid #3c3648;
  padding-top: 14px;
}
.zener-stats dt { color: #c2bccc; font-size: .875rem; }
.zener-stats dd {
  margin: 3px 0 0;
  color: #f2eaff;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.zener-note { margin: 0; font-size: .8125rem; line-height: 1.5; }
.zener-practice-tip {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(430px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 25px 24px 22px;
  border: 1px solid #685782;
  border-radius: 16px;
  background: radial-gradient(ellipse at top right, #2b2341, #1b1a20 68%);
  color: #f2eaff;
  box-shadow: 0 18px 80px #0009;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: opacity .24s ease, transform .32s cubic-bezier(.2,.75,.25,1);
}
.zener-practice-tip.shown { opacity: 1; transform: none; }
.zener-practice-tip::backdrop {
  background: #05070f00;
  backdrop-filter: blur(0);
  transition: background .24s ease, backdrop-filter .24s ease;
}
.zener-practice-tip.shown::backdrop { background: #05070fb8; backdrop-filter: blur(5px); }
.zener-tip-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zener-tip-heading h2 { margin: 0; }
.zener-tip-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: #d2c2f0;
}
.zener-tip-close svg { width: 17px; height: 17px; }
.zener-practice-tip p { line-height: 1.6; }
.zener-practice-tip .zener-evidence {
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #3c3648;
  font-size: .875rem;
}
body:has(.zener-practice-tip[open]) { overflow: hidden; }
@media (max-width: 470px) {
  .viewTabs button { padding-inline: 8px; font-size: .875rem; }
  .zener-heading { gap: 8px 12px; margin-bottom: 14px; }
  .zener-heading h1 { font-size: clamp(1.625rem, 7vw, 2rem); }
  .zener-choices { gap: 4px; }
  .zener-choice { font-size: .75rem; }
  .zener-actions .primaryAction { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .zener-card, .zener-scene, .zener-practice-tip, .zener-practice-tip::backdrop { transition: none; }
}

.zener-stage {
  display: grid;
  grid-template-rows: 0fr;
}
.zener-stage.open { grid-template-rows: 1fr; }
.zener-stage-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
}
.zener-stage.open .zener-stage-inner { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .viewTabs button {
    transition: background-color .18s ease-out, color .18s ease-out;
  }
  main > [role="tabpanel"]:not([hidden]) {
    animation: phase-view-in .19s ease-out;
  }
  .readerChapter:not([hidden]) {
    animation: phase-chapter-in .18s ease-out;
  }
  .zener-stage {
    transition: grid-template-rows .36s cubic-bezier(.22,.75,.22,1);
  }
  .zener-stage-inner {
    transform: translateY(-6px);
    transition: opacity .32s ease-out, transform .36s cubic-bezier(.22,.75,.22,1);
  }
  .zener-stage.open .zener-stage-inner { transform: none; }

  @keyframes phase-view-in {
    from { opacity: .68; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes phase-chapter-in {
    from { opacity: .68; }
    to { opacity: 1; }
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 641px) and (hover: hover) and (pointer: fine) {
  @supports (animation-timeline: scroll()) {
    .readerContents {
      animation: reader-contents-glide linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 300px;
    }
    @keyframes reader-contents-glide {
      from { translate: 0 0; }
      to { translate: 0 6px; }
    }
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 640px),
       (prefers-reduced-motion: no-preference) and (max-width: 950px) and (hover: none) and (pointer: coarse) {
  main > #readerView:not([hidden]) { animation-name: phase-chapter-in; }
}

.zener-learn-intro {
  max-width: 42ch;
  margin: 0 auto;
  line-height: 1.55;
}
.zener-learn-front {
  align-content: center;
  gap: 14px;
  padding: 20px 15px;
}
#zener-learn-caption {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #e7dafa;
  font-size: .9375rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.zener-learn-editor, .zener-learn-picker {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  text-align: left;
}
.zener-learn-editor :is(input, textarea) {
  width: 100%;
  border: 1px solid #494052;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f2eaff;
  background: #141319;
  font: inherit;
  line-height: 1.45;
}
.zener-learn-editor textarea { resize: vertical; }
.zener-learn-name-field { display: grid; gap: 8px; margin-bottom: 6px; }
.zener-learn-picker select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: no-preference) {
  .zener-learning:not([hidden]), .zener-learn-editor:not([hidden]) {
    animation: phase-chapter-in .18s ease-out;
  }
}

.breath-heading, .breath-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.breath-heading { margin-bottom: 18px; }
.breath-settings-heading { margin-bottom: 16px; }
.breath-settings-heading h2 { margin: 0; }
.breath-heading button, .breath-settings-heading button { min-height: 44px; }
.breath-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(265px, 1fr);
  align-items: start;
  gap: 18px;
}
.breath-session {
  text-align: center;
  background: radial-gradient(ellipse at 50% 25%, #241d32, #1b1a20 68%);
}
.breath-visual {
  isolation: isolate;
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 350px);
  aspect-ratio: 1;
  margin: 0 auto 15px;
}
.breath-visual::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, #a176ed40, #9b68e121 40%, transparent 68%);
  opacity: 0;
}
.breath-visual canvas { z-index: 0; }
.breath-visual:has(#breath-final-cue:not([hidden]))::before { opacity: 1; }
.breath-visual:has(#breath-final-cue:not([hidden])) canvas { filter: hue-rotate(17deg) saturate(1.2); }
.breath-phase {
  position: relative;
  display: grid;
  z-index: 1;
  gap: 6px;
  pointer-events: none;
}
#breath-final-cue {
  position: absolute;
  bottom: calc(100% + 10px);
  justify-self: center;
  width: max-content;
  padding: 3px 10px;
  border-radius: 1rem;
  background: #37284b;
  color: #ead9ff;
  font-size: .875rem;
  line-height: 1.35;
}
#breath-phase {
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 600;
  color: #f2eaff;
}
#breath-phase-time {
  min-height: 1.2em;
  font: 1rem ui-monospace, monospace;
  color: #c9bae0;
}
.breath-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.breath-actions button { min-height: 46px; }
.breath-clock, .breath-duration, .breath-field > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.breath-clock {
  max-width: 350px;
  margin: 0 auto;
  color: #c2bccc;
}
#breath-clock {
  color: #f2eaff;
  font: 1rem ui-monospace, monospace;
}
#breath-progress {
  width: min(100%, 350px);
  height: 6px;
  margin-top: 7px;
  accent-color: #c5a7fc;
}
#breath-calibration h2 { margin: 0 0 8px; }
#breath-instructions {
  max-width: 47ch;
  margin: 0 auto;
  line-height: 1.5;
}
.breath-pads {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.breath-pads button {
  width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  border-color: #685782;
  color: #e9dcff;
  background: #292135;
  font-weight: 600;
}
.breath-pads button + button { margin-left: 10px; }
.breath-pads button[data-active="true"] {
  color: #1c1429;
  background: #c5a7fc;
  border-color: #e0ceff;
}
.breath-samples, .breath-result {
  margin: 11px 0 0;
  color: #e1d2f5;
}
.breath-result { line-height: 1.55; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .breath-visual::before { transition: opacity .85s ease; }
  .breath-visual canvas { transition: filter .85s ease; }
  #breath-final-cue:not([hidden]) { animation: breath-summary-in .65s ease-out both; }
  :is(.breath-result, .breath-touch-summary):not([hidden]) {
    animation: breath-summary-in .55s cubic-bezier(.2, .65, .3, 1) both;
  }
  @keyframes breath-summary-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
#breath-timings { min-width: 0; margin: 0; padding: 0; border: 0; }
.breath-field { margin-bottom: 16px; }
.breath-field label, .breath-duration label { color: #e2dbe9; }
.breath-value {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  padding: 4px 7px;
  color: #c2bccc;
  border: 1px solid #494052;
  border-radius: 7px;
  background: #141319;
}
.breath-value input {
  width: 4em;
  min-height: 28px;
  padding: 0 2px;
  text-align: right;
  border: 0;
  color: #f2eaff;
  background: transparent;
  appearance: textfield;
}
.breath-value input::-webkit-inner-spin-button { appearance: none; }

.breath-duration { border-top: 1px solid #3c3648; padding-top: 14px; }
.breath-settings-note { margin: 12px 0 0; font-size: .875rem; line-height: 1.45; }
.breath-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 670px) {
  .breath-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .breath-heading { margin-bottom: 12px; }
  .breath-visual { width: min(100%, 245px, 36vh); margin-bottom: 8px; }
  .breath-pads button { width: 72px; }
}
.breath-touch-options, .breath-touch-averages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 390px;
  margin: 10px auto;
}
.breath-touch-options label { display: grid; gap: 6px; text-align: left; }
.breath-touch-options select { min-width: 0; min-height: 44px; padding-inline: 8px; }
.breath-feedback {
  border-top: 1px solid #3c3648;
  margin-top: 18px;
  padding-top: 12px;
  color: #e2dbe9;
}
.breath-feedback-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.breath-feedback-controls :is(button, select) { min-height: 44px; }
.breath-feedback p { margin: 7px 0 0; font-size: .875rem; line-height: 1.45; }
.breath-feedback p:empty { display: none; }
#breath-touch-live { max-width: 390px; margin: 0 auto 10px; }
#breath-touch-clock { font: 1rem ui-monospace, monospace; color: #f2eaff; }
.breath-target-cue { min-height: 1.4em; margin: 7px 0 0; color: #e1d2f5; }
.breath-pads button[data-target="true"] {
  border-color: #93ded3;
  background: #9fddd3;
  color: #142620;
}
.breath-touch-summary { max-width: 390px; margin: 0 auto; }
.breath-touch-summary h3 { margin: 0; }
.breath-touch-summary p { line-height: 1.48; }
.breath-touch-averages > div {
  border: 1px solid #3c3648;
  border-radius: 8px;
  padding: 8px 4px;
}
.breath-touch-summary dt { color: #c2bccc; font-size: .875rem; }
.breath-touch-summary dd { margin: 4px 0 0; color: #f2eaff; font-variant-numeric: tabular-nums; }
#breath-touch-air-detail {
  margin-top: 14px;
  border: 1px solid #3c3648;
  border-radius: 8px;
  text-align: left;
  padding: 0 12px;
}
#breath-touch-air-detail summary { padding: 12px 0; cursor: pointer; color: #e1d2f5; }
.breath-touch-gases { display: grid; gap: 8px; margin: 4px 0 8px; }
.breath-touch-gases > div { display: flex; justify-content: space-between; gap: 10px; }
.breath-touch-gases dd { margin: 0; white-space: nowrap; }
#breath-touch-air-detail p { font-size: .875rem; }
#breath-touch-air-detail a { color: #d2c2f0; }
.breath-session:has(#breath-touch-summary:not([hidden])) .breath-visual { display: none; }
@media (max-width: 670px) {
  .breath-session:has(#breath-touch-live:not([hidden])) .breath-visual { width: min(100%, 215px, 32vh); }
}

.breath-dialog {
  width: min(700px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: auto;
  padding: clamp(15px, 4vw, 26px);
  color: #f2eaff;
  border: 1px solid #685782;
  border-radius: 16px;
  background: radial-gradient(ellipse at top right, #2b2341, #1b1a20 68%);
  box-shadow: 0 18px 80px #0009;
}
.breath-dialog::backdrop { background: #100d15bb; backdrop-filter: blur(4px); }
body:has(.breath-dialog[open]) { overflow: hidden; }
.breath-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.breath-dialog-heading h2 { margin: 0; }
.breath-dialog-close {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}
.breath-preset-layout {
  display: grid;
  grid-template-columns: minmax(214px, 1fr) minmax(0, 1.12fr);
  gap: clamp(16px, 4vw, 28px);
  align-items: center;
  margin-top: 16px;
}
.breath-wheel {
  position: relative;
  isolation: isolate;
  margin: auto;
  width: min(100%, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #282034 29%, #17131f 30%, #30263d 68%, #1a1621 69%);
  border: 1px solid #66577e;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.breath-wheel.is-dragging, .breath-wheel.is-dragging button { cursor: grabbing; }
.breath-wheel::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: repeating-conic-gradient(#d9c4ff48 0 .75deg, transparent .75deg 6deg);
  mask: radial-gradient(circle closest-side, transparent 86%, #000 87% 97%, transparent 98%);
  pointer-events: none;
}
.breath-wheel-marker {
  position: absolute;
  inset: 3%;
  pointer-events: none;
  transform: rotate(var(--preset-turn, 0deg));
}
.breath-wheel-marker::before {
  content: "";
  display: block;
  width: 5px;
  height: 11px;
  margin: 0 auto;
  border-radius: 10px;
  background: #d9c4ff;
  box-shadow: 0 0 11px #c5a7fcc2;
}
.breath-wheel-center {
  position: absolute;
  inset: 30%;
  display: grid;
  place-content: center;
  color: #e1d2f5;
  font: .78rem ui-monospace, monospace;
  text-align: center;
  pointer-events: none;
}
.breath-wheel button {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 46px;
  min-height: 44px;
  padding: 5px 7px;
  font-size: .78rem;
  line-height: 1.1;
  white-space: nowrap;
  border-radius: 12px;
  background: #342944;
  border-color: #594b6a;
}
.breath-wheel button[aria-pressed="true"] { background: #c5a7fc; color: #1c1429; border-color: #e1d2f5; }
.breath-preset-copy h3, .breath-benefits-copy h3 { margin: 0; }
.breath-preset-copy p, .breath-benefits-copy p { line-height: 1.5; }
.breath-preset-timing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.breath-preset-timing > div {
  padding: 7px 8px;
  border: 1px solid #3c3648;
  border-radius: 8px;
}
.breath-preset-timing dt { color: #c2bccc; font-size: .875rem; }
.breath-preset-timing dd { margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.breath-benefits-dialog { width: min(575px, calc(100% - 24px)); }
.breath-benefits-copy { display: grid; gap: 16px; margin-top: 16px; }
.breath-benefits-copy section + section { border-top: 1px solid #3c3648; padding-top: 14px; }
.breath-benefits-copy p { margin: 6px 0; }
.breath-benefits-copy a { color: #d2c2f0; font-size: .9375rem; text-underline-offset: 3px; }
@media (max-width: 540px) {
  .breath-preset-layout { grid-template-columns: minmax(0, 1fr); }
  .breath-wheel { width: min(100%, 228px); }
}
@media (prefers-reduced-motion: no-preference) {
  .breath-dialog[open] { animation: phase-view-in .2s ease-out; }
  .breath-wheel-marker { transition: transform .2s ease-out; }
  .breath-wheel.is-dragging .breath-wheel-marker { transition: none; }
}

.ambientControls { margin-top: 18px; }
.ambientControls button, .ambientControls select {
  min-height: 44px;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ambientToggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  flex-wrap: wrap;
  width: 100%;
  text-align: left;
}
.ambientToggle > span { display: inline-flex; align-items: center; gap: 9px; }
.ambientToggle small { color: #d8c3f0; min-width: 0; overflow-wrap: anywhere; }
.ambientChevron {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .22s ease;
}
.ambientToggle[aria-expanded="true"] .ambientChevron { transform: translateY(3px) rotate(225deg); }
.ambientReveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .25s ease, opacity .2s ease, visibility 0s .25s;
}
.ambientReveal:not([inert]) {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.ambientClip { min-height: 0; overflow: hidden; }
.ambientPanelBody { padding: 12px 3px 4px; }
.ambientTop, .ambientCategories { display: flex; flex-wrap: wrap; gap: 6px; }
.ambientTop { justify-content: space-between; }
.ambientTop button { padding-inline: 9px; font-size: .875rem; }
.ambientControls button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--detail-accent, #c5a7fc) 24%, #201d26);
  border-color: color-mix(in srgb, var(--detail-accent, #c5a7fc) 60%, #302d37);
  color: color-mix(in srgb, var(--detail-accent, #c5a7fc) 40%, white);
}
.ambientCategory { margin-top: 12px; }
.ambientSoundGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8.75rem, 100%), 1fr));
  gap: 6px;
}
.ambientSoundGrid button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  text-align: left;
  font-size: .85rem;
}
.ambientIcon {
  display: inline-grid;
  flex: 0 0 1.15em;
  place-items: center;
  color: #c9aefa;
  font-size: 1rem;
}
.ambientRanges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr));
  gap: 8px 16px;
  margin-top: 12px;
}
.ambientRanges .soundRange {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 7px;
  color: #ded8e8;
  font-size: .875rem;
}
.ambientRanges .soundRange > input[type="range"] {
  grid-column: 1 / -1;
  background: transparent;
}
.ambientRanges output { color: #cec1dd; font: .75rem ui-monospace, monospace; }
.ambientProfile { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .875rem; }
.ambientProfile select { min-width: 0; max-width: 78%; }
.ambientMusicVolume { grid-template-columns: 1fr; }
#tonePanel { margin: 10px 0 12px; }
.toneVolume { border-top: 1px solid #34313c; margin-top: 15px; padding-top: 15px; }
.toneVolume .timerBox { justify-content: flex-start; margin: 12px 0 0; }
.toneVolume #remaining:empty { display: none; }
.playAlong {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 3; pointer-events: none; transform: translateY(var(--drift, 0px));
  transition: transform .45s ease-out;
}
.playNotes { display: flex; gap: 8px; }
.playAlong button {
  pointer-events: auto; width: 48px; height: 48px; border-radius: 50%; padding: 0;
  touch-action: manipulation; background: radial-gradient(circle at 33% 23%, #6f6087d9, #24212edb 78%);
  color: #f1eafb; border: 1px solid #ae96cd70; box-shadow: 0 0 12px #a68ad320;
  backdrop-filter: blur(7px); display: grid; place-items: center;
  transition: transform .5s ease, opacity .45s ease, background-color .3s, border-color .3s;
}
.playAlong button small { display: none; color: inherit; font-size: 12px; }
.playHint {
  position: absolute; bottom: calc(100% + 7px); right: 0; width: 100%; text-align: center;
  color: #d7c6ea; font-size: .78rem; text-shadow: 0 1px 4px #111; opacity: 0;
}
.playAlong .playExpand { position: absolute; right: 0; bottom: 0; opacity: 0; transform: scale(.78); pointer-events: none; }
.playAlong.folded .playExpand { opacity: .83; transform: none; pointer-events: auto; }
.playAlong.folded .playNotes button { transform: translateX(var(--gather)) scale(.74); opacity: 0; pointer-events: none; }
.playNotes button:nth-child(1) { --gather: 112px; --delay: 0s; }
.playNotes button:nth-child(2) { --gather: 56px; --delay: 2s; }
.playNotes button:nth-child(3) { --gather: 0px; --delay: 4s; }
.playNotes button[data-feedback] { border-color: #c9a9ee; }
.playNotes button[data-feedback="playing"] { background: #6c587eeb; }
@media (hover: none), (pointer: coarse) {
  .playAlong button span { display: none; }
  .playAlong button small { display: inline; }
}
@media (prefers-reduced-motion: no-preference) {
  .playAlong:not(.folded) .playHint { animation: play-invitation 5s ease-in-out both; }
  .playAlong:not(.folded) .playNotes button { animation: play-nudge 6s ease-in-out var(--delay) infinite; }
  @keyframes play-nudge { 0%, 33%, 100% { box-shadow: 0 0 8px #ad91d422; } 16% { box-shadow: 0 0 15px #c0a0ec65; } }
  @keyframes play-invitation { 0%, 100% { opacity: 0; } 25%, 66% { opacity: .9; } }
}
@media (prefers-reduced-motion: reduce) {
  .playAlong, .playAlong button { transform: none; transition: none; }
  .playAlong:not(.folded) .playHint { opacity: .85; }
}
.ambientAdvanced { margin-top: 10px; }
.ambientAdvanced summary { cursor: pointer; padding: 7px 0; color: #d8c3f0; font-size: .875rem; }
.ambientAdvanced .ambientProfile { margin-top: 8px; }
@media (max-width: 470px) {
  .ambientProfile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .ambientProfile select { max-width: 100%; }
}
@media (max-width: 345px) {
  header { gap: 6px; padding-inline: 12px; }
  header .divider + span { font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ambientCategory:not([hidden]) { animation: ambient-in .2s ease-out; }
  .ambientIcon.is-animated { animation: ambient-waves .52s ease-out; }
  .ambientIcon[data-motion="rain"].is-animated { animation-name: ambient-rain; }
  .ambientIcon[data-motion="thunder"].is-animated { animation-name: ambient-thunder; }
  .ambientIcon[data-motion="forest"].is-animated { animation-name: ambient-leaf; }
  @keyframes ambient-in { from { transform: translateY(-3px); opacity: .38; } }
  @keyframes ambient-waves { 45% { transform: translateY(-2px) scaleX(1.18); } }
  @keyframes ambient-rain { 20% { transform: translateY(-4px); opacity: .65; } 65% { transform: translateY(3px); } }
  @keyframes ambient-thunder { 55% { color: #f0dbff; text-shadow: 0 0 9px #a988e1; } }
  @keyframes ambient-leaf { 30% { transform: rotate(-12deg); } 68% { transform: rotate(7deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .ambientControls button, .ambientControls select, .ambientChevron, .ambientReveal { transition: none; }
}

.wave-inks { position:absolute; inset:0; z-index:-2; overflow:hidden; pointer-events:none }
.wave-inks i { position:absolute; inset:0; opacity:0 }
.wave-inks i:first-child { background:linear-gradient(100deg,#a6baff,#8ed0ed);opacity:1 }
.wave-inks i:nth-child(2) { background:linear-gradient(100deg,#b79af5,#d7bdf1) }
.wave-inks i:nth-child(3) { background:linear-gradient(100deg,#8dcfc5,#b5e2c4) }
.wave-inks i:nth-child(4) { background:linear-gradient(100deg,#ebc57c,#f6daa1) }
.wave-inks i:nth-child(5) { background:linear-gradient(100deg,#ef9b8e,#f8b7a8) }

/* Inherit the sampled shade only inside the current panel and header. */
.brand i, .primaryAction, #timerOn[aria-pressed=true], #tonePresetToggle,
.breath-pads button[data-active="true"], .breath-wheel button[aria-pressed="true"],
.breath-wheel-marker::before {
  background-color: var(--detail-accent, #c5a7fc);
}
#tonePresetToggle[aria-expanded="true"] {
  background-color: color-mix(in srgb, var(--detail-accent, #c5a7fc) 88%, white);
}
.viewTabs [aria-selected=true] { color: var(--beat-tab-accent, #f2eaff); }
#black, #bandName, .band a, #shiftClock, .reading strong, .value input,
.ambientIcon, .ambientToggle small, .ambientAdvanced summary, .ambientRanges output,
.playHint, .playExpand, .playNotes button span, .guideNotes a,
#readerShelfToggle, #readerSurprise, .readerSource, .readerTextNote summary,
.readerChapter .readerTextSubtitle, .readerAphorism h3, .readerContents button[aria-current="page"],
.zener-heading button, .zener-tip-toggle, .zener-tip-close, .zener-choice svg, .zener-front svg,
#zener-learn-caption, .zener-stats dd, .breath-wheel-center, #breath-phase, #breath-phase-time,
#breath-clock, #breath-touch-clock, .breath-benefits-copy a, #breath-touch-air-detail :is(a, summary) {
  color: var(--detail-accent, #d2c2f0);
}
.band, .readerChapter blockquote { border-left-color: var(--detail-accent, #b197df); }
.monitorFoot span:first-child b { background-color: var(--detail-accent, #bb9bfe); }
.monitorFoot span:nth-child(2) b {
  background-color: color-mix(in srgb, var(--detail-accent, #bb9bfe) 35%, #80d5dc);
}
#shiftProgress, #breath-progress, .ambientRanges input[type=range], .breath-field input[type=range] {
  accent-color: var(--detail-accent, #bf9ff6);
}
#shiftProgress::-webkit-progress-value { background-color: var(--detail-accent, #bf9ff6); }
#shiftProgress::-moz-progress-bar { background-color: var(--detail-accent, #bf9ff6); }
#zener-card-gradient stop:first-child { stop-color: var(--detail-accent, #c0a5ee); }
#zener-card-back [fill^="#"] { fill: var(--detail-accent, #d4c8ef); }


/* Extra height makes the touch target more forgiving without scaling the native artwork. */
@media (max-width: 700px), (any-pointer: coarse) {
  input[type="range"] { height: 66px; }
  @supports (zoom: 1.5) {
    input[type="range"] { zoom: 1.5; height: 44px; }
  }
}

@media (max-width: 600px) {
  #studioView .band { flex-wrap: wrap; gap: 0 4px; padding: 0 8px; }
  #studioView .band h2 { white-space: nowrap; font-size: clamp(12px, 3.55vw, 15px); }
  #studioView .band a { display: grid; place-items: center; min-width: 30px; min-height: 38px; font-size: 16px; margin-inline-start: auto; }
  #studioView .band a span { display: none; }
}
@media (max-width: 350px) {
  #studioView .band { padding-inline: 4px; column-gap: 2px; }
  #studioView .band a { min-width: 24px; }
  #studioView .band h2 { letter-spacing: -.35px; }
}

#tonePanel .toneHeading { flex-wrap:wrap; gap:6px; }
.toneHeading h2 { flex:1; }
#ambientToggle { min-height:44px; color:var(--detail-accent,#d2c2f0); }
#tonePanel .timerBox { justify-content:flex-start; margin:12px 0 0; }
#ambientControls { margin:0; }
.ambientPanelBody { padding-top:0; }
.ambientSwitch { position:relative; isolation:isolate; display:grid; grid-template-columns:repeat(3,1fr); align-items:center; width:min(100%,340px); min-height:48px; border:1px solid #45404e; border-radius:24px; background:#16151b; color:#f3f1f7; text-align:center; }
.ambientSwitch::before { content:""; position:absolute; z-index:-1; inset:3px auto 3px 3px; width:calc((100% - 6px)/3); transform:translateX(calc(var(--sound-panel,0)*100%)); border-radius:22px; background:color-mix(in srgb,var(--detail-accent,#c5a7fc) 30%,#201d26); }
.ambientTop { margin-bottom:14px; align-items:center; }
.ambientSwitch input[type=range] { position:absolute; inset:0; width:100%; height:100%; zoom:1; margin:0; opacity:0; cursor:pointer; touch-action:pan-y; }
.ambientSwitch:focus-within { outline:2px solid var(--detail-accent,#c5a7fc); outline-offset:2px; }
@media(prefers-reduced-motion:no-preference) {
  .ambientSwitch::before { transition:transform .22s ease; }
  .ambientCategory:not([hidden]), #tonePane:not([hidden]) { animation:sound-pane-in .22s ease-out; }
  #ambientMusic { --sound-entry:8px; }
  @keyframes sound-pane-in { from { opacity:0;transform:translateX(var(--sound-entry,-8px)); } to { opacity:1;transform:none; } }
}
@media(max-width:420px){#tonePanel .toneHeading h2{font-size:17px;margin-bottom:0;} .toneHeading button{padding-inline:8px;} .ambientSwitch{flex:1;min-width:145px;} }

.ambientSoundGrid .phase-ambient-icon { width:21px; height:21px; color:var(--detail-accent,#c5a7fc); }
.ambientStyleTitle { margin:4px 0 8px; }
#ambientCredits { margin-top:10px; font-size:.85rem; }
#ambientCredits summary, #ambientCredits a { color:var(--detail-accent,#c5a7fc); }

.soundLayers { display:flex; gap:6px; margin-inline-start:auto; }
@media (max-width:600px) {
  .ambientTop .ambientSwitch { flex:0 0 100%; width:100%; }
  .soundLayers { width:100%; }
  .soundLayers button { flex:1 1 auto; }
}

#ambientSounds [hidden] { display:none; }
#toneControls {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:clamp(12px,3vw,28px);
  margin-top:12px;
  container-type:inline-size;
}
#studioView #toneControls .control { min-width:0; margin:0; padding:0; border:0; }
#tonePane .toneVolume { margin-top:0; padding-top:10px; }
#tonePane .control input[type="range"] { zoom:1; height:48px; }
@media (any-pointer:coarse), (max-width:700px) {
  #tonePane .control input[type="range"] { height:66px; }
}
@container (max-width:490px) {
  #toneControls .field { flex-direction:column; align-items:flex-start; gap:4px; }
}

.soundHelpLabel { display:inline-flex; align-items:center; gap:3px; }
#tonePane .soundHelpLabel { min-width:0; }
#tonePanel .soundHelp {
  display:inline-grid; place-items:center; flex:none; width:28px; height:32px;
  min-height:0; padding:0; background:transparent; border:0; color:var(--detail-accent,#c5a7fc);
}
.soundHelp span { width:16px; height:16px; border:1px solid currentColor; border-radius:50%; font:600 11px/14px system-ui; }
.soundHelp:focus-visible { outline:2px solid currentColor; border-radius:6px; }
@media (hover:hover) {
  .soundHelp:hover span { background:var(--detail-accent,#c5a7fc); color:#19171e; }
}
.soundHelp:focus-visible span, .soundHelp[aria-expanded="true"] span {
  background:var(--detail-accent,#c5a7fc); color:#19171e;
}
.soundHelpText {
  position:fixed; inset:auto; margin:0; width:min(17rem,calc(100vw - 16px)); padding:12px 14px;
  border:1px solid color-mix(in srgb,var(--help-accent,#c5a7fc) 50%,#323039);
  border-radius:12px; box-shadow:0 5px 18px #0006; background:#26242c; color:#efedf4;
  font-size:.875rem; line-height:1.45;
}
@media (prefers-reduced-motion:no-preference) {
  .soundHelp span { transition:background-color .14s,color .14s; }
  .soundHelpText:popover-open { animation:helpBubbleIn .14s ease-out; }
  @keyframes helpBubbleIn { from { opacity:0; } to { opacity:1; } }
}

.soundRange, #tonePane .control {
  position:relative;
  isolation:isolate;
}
.soundRange::before, #tonePane .control::before {
  content:"";
  position:absolute;
  inset:-2px -5px;
  z-index:-1;
  pointer-events:none;
  border-radius:12px;
  background:radial-gradient(ellipse at 50% 35%,
    color-mix(in srgb,var(--detail-accent,#c5a7fc) 7%,transparent) 0%,
    color-mix(in srgb,var(--detail-accent,#c5a7fc) 4%,transparent) 60%,
    transparent 100%);
}


.ambientRanges .soundRange { container-type:inline-size; grid-template-columns:minmax(0,1fr) auto; }
.ambientRanges .soundRange .value { justify-self:end; }
@container (max-width:225px) {
  .soundRange > .soundHelpLabel, .soundRange > .value { grid-column:1/-1; }
  .ambientRanges .soundRange > .value { justify-self:start; }
}

@media (any-pointer:coarse), (max-width:700px) {
  input[type="range"]:not(#ambientView),
  #tonePane .control input[type="range"] {
    height:76px;
    zoom:1;
    touch-action:pan-y;
  }
}

.mixStrip {
  --selected:0; position:relative; isolation:isolate; display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr)); padding:3px; margin-bottom:14px;
  background:#16151b; border:1px solid #45404e; border-radius:20px;
  touch-action:none; user-select:none; -webkit-user-select:none;
}
.mixStrip::before {
  content:""; position:absolute; z-index:-1; inset:3px auto 3px 3px;
  width:calc((100% - 6px)/3); border-radius:17px;
  transform:translateX(calc(var(--selected)*100%));
  background:color-mix(in srgb,var(--detail-accent,#c5a7fc) 21%,#201d26);
}
.mixSegment { display:flex; flex-direction:column; align-items:stretch; min-width:0; }
#ambientControls .mixStrip button { border:0; background:transparent; padding:0 3px; min-height:0; }
#ambientControls .mixName { height:34px; color:#edeaf2; font-size:1rem; }
#ambientControls .mixPower { height:27px; display:flex; align-items:center; justify-content:center; gap:5px; color:#b8b5bf; font-size:.75rem; }
.mixPower::before { content:""; height:6px; width:6px; border-radius:50%; border:1px solid currentColor; }
#ambientControls .mixPower[aria-pressed=true] { color:var(--detail-accent,#c5a7fc); }
.mixPower[aria-pressed=true]::before { background:currentColor; }
.mixStrip button:focus-visible { outline:2px solid var(--detail-accent,#c5a7fc); outline-offset:-2px; }
@media(prefers-reduced-motion:no-preference){.mixStrip::before { transition:transform .18s ease-out; }}
