/* "Sound therapy examples", device style (TEST build, third version).
   Same family as the tone tool and the "What's my next step?" check above it: deep-brown rim with a gold hairline,
   cream face, dark screen. Left: the four sounds as coloured pads (white/pearl, pink, brown, blue for binaural) with a
   tray underneath that shows what the sound is like, or the blue binaural sliders. Right: a "now playing" screen with a
   calm level meter (moves only while playing), a thick volume slider, a big Play button and the timer.
   The page's own script still does all the sound, volume, timer and binaural work; tinnitus-therapy2.js only paints
   the slider fill, the meter, the sound name and the playing light. */

#sound-therapy.st{--ink:#2A1F1A;--soft:#54483F;--rim:#2A1F1A;--gold:#E6B85C;--honey:#C9A25B;
  --c-white:#E9E3DA;--c-white-ring:#9E9386;--c-pink:#D28BB0;--c-brown:#7B5236;--c-blue:#3F6FBF;
  --c:var(--c-white-ring);--bar:#F6EFE6;
  max-width:1080px;margin:clamp(22px,3vw,34px) auto 0;padding:10px;border-radius:38px;border:0;
  background:linear-gradient(160deg,#3A2E27,var(--rim) 40%,#1B1411);transition:opacity .8s ease}
/* beat the band's own panel shadow and hover lift, so the gold hairline never flickers on hover */
#tone-generator #sound-therapy.st,#tone-generator #sound-therapy.st:hover,#sound-therapy.st:hover{border-radius:38px;
  box-shadow:0 0 0 1px rgba(230,184,92,.38),0 26px 50px rgba(0,0,0,.34),0 8px 18px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.10)}
#sound-therapy.st::before,#sound-therapy.st::after{display:none}
#sound-therapy.st[data-sound="pink"]{--c:var(--c-pink);--bar:#E8A9CA}
#sound-therapy.st[data-sound="brown"]{--c:var(--c-brown);--bar:#D09A68}
#sound-therapy.st[data-sound="binaural"]{--c:var(--c-blue);--bar:#86AEF2}

.st__face{border-radius:30px;padding:clamp(16px,2.4vw,30px);background:linear-gradient(170deg,#FCF8F3 0%,#F4ECE2 100%);
  box-shadow:inset 0 1px 0 #fff,inset 0 -2px 6px rgba(148,124,100,.18)}
.st__head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:6px clamp(18px,2.4vw,32px);align-items:end;
  padding:0 4px clamp(16px,2vw,22px);margin-bottom:clamp(16px,2vw,22px);border-bottom:1px solid rgba(201,162,91,.38)}
#sound-therapy .tg-therapy-title{font-family:'Playfair Display',Georgia,serif;font-weight:600;font-size:clamp(1.75rem,2.6vw,2.2rem);line-height:1.12;color:var(--ink);margin:0}
#sound-therapy .tg-therapy-intro{font-size:1.1rem;line-height:1.6;color:var(--soft);max-width:none;margin:0}

.st__main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(16px,2vw,24px);align-items:stretch}
.st__left,.st__right{display:flex;flex-direction:column;gap:14px;min-width:0}
.st__step{display:flex;align-items:center;gap:10px;margin:0;font:700 1.08rem/1.25 'Outfit',sans-serif;color:var(--ink)}
.st__num{flex:0 0 auto;display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;font:700 1rem/1 'Outfit',sans-serif;
  color:#F6EFE6;background:linear-gradient(160deg,#4A3A31,var(--ink));box-shadow:0 2px 5px rgba(42,31,26,.3)}

/* ---- the four sound pads ---- */
#sound-therapy .therapy-types{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:minmax(118px,1fr);gap:14px}
#sound-therapy .therapy-type-btn{--c:var(--c-white-ring);--t1:#FFFFFF;--t2:#EFE9E1;--disc:radial-gradient(circle at 34% 30%,#FFFFFF,#E4DDD3 70%,#D3CABE);
  position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;gap:4px;min-height:118px;margin:0;
  padding:62px 18px 16px;border-radius:20px;border:3px solid color-mix(in srgb,var(--c) 55%,transparent);text-align:left;cursor:pointer;color:var(--ink);
  background:linear-gradient(160deg,var(--t1),var(--t2));
  box-shadow:4px 5px 12px rgba(148,124,100,.30),-3px -3px 9px rgba(255,255,255,.9),inset 0 1px 0 rgba(255,255,255,.8);
  transition:background-color .2s,border-color .2s,box-shadow .2s;transform:none}
#sound-therapy .therapy-type-btn[data-therapy="pink"]{--c:var(--c-pink);--t1:#FFF6FA;--t2:#F6DCE9;--disc:radial-gradient(circle at 34% 30%,#F4CDE0,#D28BB0 60%,#B8678F)}
#sound-therapy .therapy-type-btn[data-therapy="brown"]{--c:var(--c-brown);--t1:#FAF1E8;--t2:#EAD7C4;--disc:radial-gradient(circle at 34% 30%,#B98A63,#7B5236 60%,#5A3A24)}
#sound-therapy .therapy-type-btn[data-therapy="binaural"]{--c:var(--c-blue);--t1:#F4F8FF;--t2:#DCE7F8;--disc:radial-gradient(circle at 34% 30%,#9DBDF2,#3F6FBF 60%,#2B5096)}
/* colour disc, top left */
#sound-therapy .therapy-type-btn::before{content:"";position:absolute;left:16px;top:14px;width:38px;height:38px;border-radius:50%;background:var(--disc);
  box-shadow:0 3px 7px rgba(42,31,26,.28),inset 0 -2px 4px rgba(0,0,0,.12)}
#sound-therapy .therapy-type-btn[data-therapy="white"]::before{box-shadow:0 0 0 2px #B9AEA1,0 3px 7px rgba(42,31,26,.22)}
#sound-therapy .therapy-type-btn::after{display:none}
#sound-therapy .therapy-type-btn strong{font:700 1.2rem/1.2 'Outfit',sans-serif;color:inherit}
#sound-therapy .therapy-type-btn small{font:500 1rem/1.3 'Outfit',sans-serif;color:var(--soft)}
/* status light, top right */
.st__led{position:absolute;top:18px;right:16px;width:16px;height:16px;border-radius:50%;background:rgba(42,31,26,.16);box-shadow:inset 0 1px 2px rgba(0,0,0,.25)}
#sound-therapy .therapy-type-btn:hover{border-color:var(--c);box-shadow:5px 7px 16px rgba(148,124,100,.38),-3px -3px 9px rgba(255,255,255,.9),inset 0 1px 0 rgba(255,255,255,.8)}

/* chosen pad: filled with its own colour, light on, pressed in */
#sound-therapy .therapy-type-btn.active{color:#fff;border-color:rgba(42,31,26,.55);
  box-shadow:inset 2px 3px 8px rgba(0,0,0,.30),0 0 0 1px rgba(230,184,92,.55),0 2px 4px rgba(42,31,26,.18)}
#sound-therapy .therapy-type-btn.active small{color:rgba(255,255,255,.95)}
#sound-therapy .therapy-type-btn.active .st__led{background:var(--gold);box-shadow:0 0 0 4px rgba(230,184,92,.32),inset 0 -1px 2px rgba(0,0,0,.2)}
#sound-therapy .therapy-type-btn.active::before{box-shadow:0 0 0 3px rgba(255,255,255,.75),0 3px 7px rgba(0,0,0,.3)}
#sound-therapy .therapy-type-btn[data-therapy="pink"].active{background:linear-gradient(160deg,#A9557F,#84395F)}
#sound-therapy .therapy-type-btn[data-therapy="brown"].active{background:linear-gradient(160deg,#835535,#553420)}
#sound-therapy .therapy-type-btn[data-therapy="binaural"].active{background:linear-gradient(160deg,#3F6FBF,#2A4E92)}
/* white is pale, so when chosen it stays pearl with dark text and gets a thick dark ring */
#sound-therapy .therapy-type-btn[data-therapy="white"].active{color:var(--ink);border-color:var(--ink);background:linear-gradient(160deg,#FFFFFF,#ECE6DE)}
#sound-therapy .therapy-type-btn[data-therapy="white"].active small{color:var(--soft)}
#sound-therapy .therapy-type-btn[data-therapy="white"].active::before{box-shadow:0 0 0 2px #8F8478,0 3px 7px rgba(42,31,26,.22)}

/* ---- tray under the pads: "sounds like" or the binaural sliders, same space either way ---- */
.st__tray{display:grid;min-height:132px}
.st__tray>*{grid-area:1/1}
#sound-therapy .therapy-binaural,#sound-therapy .therapy-binaural.visible{display:grid;grid-template-columns:1fr 1fr;gap:10px 20px;margin:0;
  align-content:center;padding:16px 20px 10px;border-radius:18px;visibility:hidden;
  background:linear-gradient(180deg,#F1F6FE,#E2EBF9);box-shadow:inset 3px 3px 8px rgba(63,111,191,.20),inset -3px -3px 8px rgba(255,255,255,.9),inset 0 0 0 2px rgba(63,111,191,.35)}
#sound-therapy .therapy-binaural.visible{visibility:visible}
#sound-therapy .therapy-binaural label{display:flex;justify-content:space-between;gap:8px;margin:0 0 2px;font:700 1.05rem/1.3 'Outfit',sans-serif;color:var(--ink)}
#sound-therapy .therapy-binaural label span{color:#2A4E92;font-variant-numeric:tabular-nums}
.st__info{display:grid;align-items:center;padding:16px 20px 16px 26px;border-radius:18px;position:relative;
  background:linear-gradient(180deg,#FFFDFA,#F6EFE6);box-shadow:inset 3px 3px 8px rgba(148,124,100,.22),inset -3px -3px 8px rgba(255,255,255,.9)}
.st__info::before{content:"";position:absolute;left:10px;top:16px;bottom:16px;width:6px;border-radius:3px;background:var(--c);transition:background-color .3s}
.therapy-binaural.visible+.st__info{visibility:hidden}
.st__like{grid-area:1/1;margin:0;font:400 1.08rem/1.5 'Outfit',sans-serif;color:var(--soft);visibility:hidden}
.st__like b{display:block;font-weight:700;color:var(--ink);margin-bottom:2px}
#sound-therapy:not([data-sound]) .st__like[data-for="white"],
#sound-therapy[data-sound="white"] .st__like[data-for="white"],
#sound-therapy[data-sound="pink"] .st__like[data-for="pink"],
#sound-therapy[data-sound="brown"] .st__like[data-for="brown"]{visibility:inherit}

/* ---- now-playing screen ---- */
.st__screen{position:relative;flex:1;display:flex;flex-direction:column;gap:10px;min-height:236px;padding:18px 20px 16px;border-radius:20px;color:#F6EFE6;
  background:linear-gradient(160deg,#2E241F,#221A16 60%);box-shadow:inset 0 2px 10px rgba(0,0,0,.55),0 1px 0 rgba(255,255,255,.7);overflow:hidden}
.st__screen::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,rgba(255,255,255,.06) 0%,rgba(255,255,255,0) 38%)}
.st__top{display:flex;align-items:center;justify-content:space-between;gap:10px;font:600 1rem/1 'Outfit',sans-serif}
.st__tag{display:inline-flex;align-items:center;gap:9px;padding:7px 12px;border-radius:999px;background:rgba(246,239,230,.10);color:rgba(246,239,230,.86)}
.st__tag i{width:11px;height:11px;border-radius:50%;background:rgba(246,239,230,.32);transition:background-color .3s,box-shadow .3s}
#sound-therapy.is-playing .st__tag{background:#F6EFE6;color:var(--ink)}
#sound-therapy.is-playing .st__tag i{background:#3E9A5E;box-shadow:0 0 0 3px rgba(62,154,94,.22)}
.st__clock{color:rgba(246,239,230,.72);white-space:nowrap}
#sound-therapy .therapy-timer-disp{min-width:0;margin-left:4px;font-weight:700;color:#F6EFE6;font-variant-numeric:tabular-nums;text-align:left}
#sound-therapy .therapy-timer-disp:empty::before{content:"off";font-weight:600;color:rgba(246,239,230,.72)}
.st__name{display:flex;align-items:center;gap:12px;margin:4px 0 0;font:600 clamp(1.6rem,2.4vw,2rem)/1.15 'Playfair Display',Georgia,serif;color:#fff}
.st__swatch{flex:0 0 auto;width:20px;height:20px;border-radius:50%;background:var(--bar);box-shadow:0 0 0 3px rgba(246,239,230,.18);transition:background-color .3s}
/* level meter: bars are added by tinnitus-therapy2.js; still and dim until Play, then a slow gentle sway */
.st__meter{flex:1;display:flex;align-items:center;gap:4px;min-height:64px;padding:4px 2px;
  background:linear-gradient(rgba(246,239,230,.14),rgba(246,239,230,.14)) center/100% 1px no-repeat}
.st__meter i{flex:1;height:calc(var(--h,.5)*100%);min-height:6px;border-radius:3px;background:var(--bar);opacity:.38;transform:scaleY(.22);transform-origin:center;
  transition:height .5s ease,transform .6s ease,opacity .6s ease,background-color .3s}
#sound-therapy.is-playing .st__meter i{opacity:.95;animation:stSway var(--d,2s) ease-in-out var(--dl,0s) infinite alternate}
@keyframes stSway{from{transform:scaleY(.45)}to{transform:scaleY(1)}}
#sound-therapy .therapy-status{min-height:2.9em;margin:0;font:500 1.05rem/1.4 'Outfit',sans-serif;color:rgba(246,239,230,.9)}
#sound-therapy .therapy-status:empty::before{content:"Press Play when you are ready.";color:rgba(246,239,230,.72)}

/* ---- volume + play deck ---- */
#sound-therapy .therapy-controls.st__deck{display:flex;flex-direction:column;align-items:stretch;gap:12px;flex-wrap:nowrap;margin:0;padding:16px 18px 18px;border-radius:20px;
  background:linear-gradient(180deg,#FFFDFA,#F6EFE6);box-shadow:inset 3px 3px 8px rgba(148,124,100,.22),inset -3px -3px 8px rgba(255,255,255,.9)}
#sound-therapy .therapy-vol{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 12px;flex:none;min-width:0}
#sound-therapy .therapy-vol label{font:700 1.08rem/1.2 'Outfit',sans-serif;color:var(--ink)}
#sound-therapy .therapy-vol-readout{min-width:70px;padding:7px 12px;border-radius:999px;text-align:center;font:700 1.05rem/1 'Outfit',sans-serif;color:#F6EFE6;
  background:linear-gradient(160deg,#4A3A31,var(--ink));box-shadow:0 2px 6px rgba(42,31,26,.25);font-variant-numeric:tabular-nums}
#sound-therapy .therapy-vol input{grid-column:1/-1}
.st__ends{grid-column:1/-1;display:flex;justify-content:space-between;font:500 1rem/1 'Outfit',sans-serif;color:var(--soft);padding:0 2px}

/* thick sliders that fill as they move (--v is set by tinnitus-therapy2.js); the input itself is 48px tall for easy tapping */
#sound-therapy input[type=range]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:48px;margin:0;padding:0;background:transparent;cursor:pointer;
  --fa:#5E3B24;--fb:#C9A25B;--fc:#E6B85C;--ring:#2A1F1A;accent-color:#C9A25B}
#sound-therapy .therapy-binaural input[type=range]{--fa:#86AEF2;--fb:#3F6FBF;--fc:#2A4E92;--ring:#2A4E92;accent-color:#3F6FBF}
#sound-therapy input[type=range]::-webkit-slider-runnable-track{height:18px;border-radius:10px;
  background:linear-gradient(90deg,var(--fa) 0,var(--fb) calc(var(--v,15%) * .6),var(--fc) var(--v,15%),#E2D6C7 var(--v,15%),#E9DFD3 100%);
  box-shadow:inset 0 2px 5px rgba(42,31,26,.32),inset 0 -1px 0 rgba(255,255,255,.35),0 1px 0 rgba(255,255,255,.95)}
#sound-therapy input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:40px;height:40px;margin-top:-11px;border-radius:50%;
  background:radial-gradient(circle at 50% 50%,var(--ring) 0 5px,transparent 6px),radial-gradient(circle at 38% 30%,#FFFFFF,#F3EBE0 60%,#DCCFBF);
  border:3px solid var(--ring);box-shadow:0 4px 10px rgba(42,31,26,.38),0 1px 2px rgba(42,31,26,.3),inset 0 1px 0 #fff}
#sound-therapy input[type=range]::-moz-range-track{height:18px;border-radius:10px;background:#E6DBCD;box-shadow:inset 0 2px 5px rgba(42,31,26,.32),0 1px 0 rgba(255,255,255,.95)}
#sound-therapy input[type=range]::-moz-range-progress{height:18px;border-radius:10px;background:linear-gradient(90deg,var(--fa),var(--fb) 60%,var(--fc))}
#sound-therapy input[type=range]::-moz-range-thumb{width:34px;height:34px;border-radius:50%;
  background:radial-gradient(circle at 50% 50%,var(--ring) 0 5px,transparent 6px),radial-gradient(circle at 38% 30%,#FFFFFF,#F3EBE0 60%,#DCCFBF);
  border:3px solid var(--ring);box-shadow:0 4px 10px rgba(42,31,26,.38)}
#sound-therapy input[type=range]:focus{outline:none}
#sound-therapy input[type=range]:focus-visible{outline:3px solid var(--ink);outline-offset:2px;border-radius:12px}

/* big play button: gold to start, dark brown while playing */
#sound-therapy .therapy-play{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:66px;padding:14px 28px;border-radius:999px;border:0;cursor:pointer;
  font:700 1.3rem/1 'Outfit',sans-serif;letter-spacing:.01em;color:var(--ink);background:linear-gradient(160deg,#F7DCA0,#E6B85C 55%,#C9A25B);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6),inset 0 -2px 0 rgba(120,84,30,.25),0 4px 8px rgba(42,31,26,.20),0 12px 24px rgba(42,31,26,.20);
  transition:background-color .2s,box-shadow .2s,color .2s;transform:none}
#sound-therapy .therapy-play svg{width:24px;height:24px;flex:0 0 auto}
#sound-therapy .therapy-play:hover{transform:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.6),inset 0 -2px 0 rgba(120,84,30,.25),0 6px 12px rgba(42,31,26,.26),0 16px 30px rgba(42,31,26,.24)}
#sound-therapy .therapy-play[aria-pressed="true"]{color:#F6EFE6;background:linear-gradient(160deg,#4A3A31,var(--ink) 60%,#1B1411);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 0 0 2px rgba(230,184,92,.6),0 8px 18px rgba(42,31,26,.30)}

/* ---- timer pills ---- */
#sound-therapy .therapy-timers{display:grid;grid-template-columns:auto repeat(4,minmax(0,1fr));align-items:center;gap:6px;margin:0;padding:6px 6px 6px 14px;border-radius:16px;
  background:#E8DED2;box-shadow:inset 2px 2px 5px rgba(148,124,100,.28),inset -2px -2px 5px rgba(255,255,255,.85)}
#sound-therapy .therapy-timers>span:first-child{font:700 1.05rem/1 'Outfit',sans-serif;color:var(--ink);margin-right:6px}
#sound-therapy .therapy-timer-btn{min-height:52px;padding:8px 6px;border-radius:11px;border:0;background:transparent;font:600 1.02rem/1.1 'Outfit',sans-serif;color:var(--ink);
  cursor:pointer;box-shadow:none;transition:background-color .2s,color .2s;transform:none;white-space:nowrap}
#sound-therapy .therapy-timer-btn:hover{background:rgba(255,255,255,.6);transform:none}
#sound-therapy .therapy-timer-btn.active{color:#F6EFE6;background:linear-gradient(160deg,#4A3A31,var(--ink));box-shadow:0 2px 6px rgba(42,31,26,.3)}

#sound-therapy .therapy-note{margin:clamp(16px,2vw,22px) 0 0;padding:14px 4px 0;border-top:1px solid rgba(201,162,91,.38);font:500 1.02rem/1.55 'Outfit',sans-serif;color:var(--soft);text-align:center}

/* focus: a dark ring that shows clearly on the cream face */
#sound-therapy .therapy-type-btn:focus-visible,#sound-therapy .therapy-timer-btn:focus-visible,#sound-therapy .therapy-play:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
#sound-therapy .therapy-type-btn:focus,#sound-therapy .therapy-timer-btn:focus,#sound-therapy .therapy-play:focus{outline-color:var(--ink)}

/* ---- tablet: one column; screen and deck side by side ---- */
@media(max-width:900px){
  .st__head{grid-template-columns:1fr}
  .st__main{grid-template-columns:1fr}
  #sound-therapy .therapy-types{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(132px,auto)}
  #sound-therapy .therapy-type-btn{padding:62px 14px 14px}
  .st__right{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
  .st__screen{min-height:0}
}
/* ---- phone ---- */
@media(max-width:640px){
  #tone-generator #sound-therapy.st,#tone-generator #sound-therapy.st:hover,#sound-therapy.st{border-radius:30px;padding:8px}
  .st__face{border-radius:24px;padding:16px 14px 18px}
  #sound-therapy .therapy-types{grid-template-columns:1fr 1fr;grid-auto-rows:minmax(112px,auto);gap:10px}
  #sound-therapy .therapy-type-btn{padding:56px 14px 14px;min-height:112px}
  #sound-therapy .therapy-type-btn::before{left:14px;top:12px;width:34px;height:34px}
  .st__led{top:16px;right:14px}
  #sound-therapy .therapy-type-btn strong{font-size:1.12rem}
  .st__right{display:flex}
  .st__screen{min-height:220px}
  #sound-therapy .therapy-binaural,#sound-therapy .therapy-binaural.visible{gap:6px 14px;padding:14px 14px 8px}
  .st__info{padding:14px 16px 14px 24px}
  #sound-therapy .therapy-timers{grid-template-columns:repeat(4,minmax(0,1fr));padding:6px}
  #sound-therapy .therapy-timers>span:first-child{grid-column:1/-1;padding:8px 8px 4px}
  #sound-therapy .therapy-timer-btn{font-size:1rem}
}
@media(prefers-reduced-motion:reduce){
  #sound-therapy.st,#sound-therapy .therapy-type-btn,#sound-therapy .therapy-play,#sound-therapy .therapy-timer-btn,.st__meter i,.st__tag i,.st__swatch,.st__info::before{transition:none}
  #sound-therapy.is-playing .st__meter i{animation:none;transform:scaleY(1)}
}
