/* Tool pages (sleep sounds, chronotype quiz). Builds on styles.css tokens. */
.tool-top { position: relative; background: none; padding-bottom: 14px; }
.tool-hero { position: relative; padding: clamp(18px, 4vw, 48px) 0 clamp(40px, 5vw, 64px); overflow: hidden; }
.tool-hero .stars { opacity: .45; }
.tool-hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.04; margin-bottom: 18px; }
.tool-hero .lede { max-width: 40em; }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--ivory); }

.panel { position: relative; z-index: 2; background: linear-gradient(170deg, #121b42, var(--card) 60%); border: 1px solid rgba(147, 169, 255, .3); border-radius: 28px; padding: clamp(18px, 3vw, 32px); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9), 0 0 80px -30px rgba(84, 104, 240, .35); }
.result-cta { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--stroke); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: center; }
.result-cta h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 0 0 6px; }
.result-cta p { margin: 0; font-size: 15px; }
.result-cta .cta-row { margin-top: 0; }

/* Article copy */
.article { padding: var(--section-pad) 0 0; }
.article section { margin-bottom: clamp(40px, 5vw, 64px); scroll-margin-top: 16px; }
.article h2 { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 16px; }
.article h3 { font-size: 23px; margin: 26px 0 8px; }
.article ul, .article ol { padding-left: 1.2em; }
.article li { margin-bottom: 8px; }
.answer { color: var(--text); font-size: 18.5px; }
.updated { font-size: 14px; color: var(--text-3); }
.table-wrap { overflow-x: auto; margin: 18px 0 8px; border: 1px solid var(--stroke); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 520px; }
caption { text-align: left; padding: 14px 16px 0; color: var(--text-3); font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
thead th { font: 17px/1.3 var(--serif); color: var(--ivory); font-weight: 400; }
tbody th { color: var(--text); font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.sources { font-size: 14.5px; color: var(--text-3); }
.sources li { margin-bottom: 6px; }

/* Related tools */
.tools-nav { margin: 0 0 var(--section-pad); }
.tools-nav h2 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 18px; }
.tools-nav ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tools-nav a { display: block; height: 100%; text-decoration: none; padding: 18px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); transition: border-color .2s ease; }
.tools-nav a:hover { border-color: rgba(147, 169, 255, .5); }
.tools-nav a[aria-current="page"] { border-color: var(--peri); }
.tools-nav strong { display: block; font: 20px/1.25 var(--serif); color: var(--ivory); font-weight: 400; margin-bottom: 4px; }
.tools-nav span { font-size: 14.5px; color: var(--text-2); }

.page-end { position: relative; text-align: center; padding: clamp(64px, 8vw, 110px) 0; overflow: hidden; border-top: 1px solid var(--stroke); }
.page-end h2 { font-size: clamp(32px, 4vw, 52px); }
.page-end p { color: var(--text); }

@media (max-width: 759px) {
  .result-cta { grid-template-columns: 1fr; }
  .tools-nav ul { grid-template-columns: 1fr; }
  .tool-hero h1 { font-size: clamp(36px, 10.5vw, 48px); }
}
@media (min-width: 760px) and (max-width: 1023px) { .tools-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Sleep sounds mixer */
.mixer-head { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "play controls" "scope scope"; gap: 14px 22px; align-items: center; }
.mixer-head .play { grid-area: play; } .mixer-head .scope { grid-area: scope; } .mixer-head .mixer-controls { grid-area: controls; justify-content: flex-end; }
.play { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 28px 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ivory); color: var(--navy); font: 600 19px/1 var(--sans); box-shadow: 0 12px 34px -10px rgba(242, 235, 221, .45); transition: transform .15s ease; }
.play svg { width: 24px; height: 24px; fill: currentColor; }
.play:hover { transform: translateY(-1px); }
.play:active { transform: scale(.98); }
.play .i-pause, .is-playing .play .i-play { display: none; }
.is-playing .play .i-pause { display: block; }
.play:disabled { opacity: .5; cursor: not-allowed; }
.scope { width: 100%; height: 60px; }
.mixer-controls { display: flex; gap: 18px; align-items: flex-end; }
.ctl { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-3); letter-spacing: .02em; }
.ctl select { appearance: none; -webkit-appearance: none; background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393a9ff' stroke-width='1.8' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center / 11px;
  color: var(--text); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 34px 10px 12px; font: 15px var(--sans); min-height: 44px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 140px; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(147, 169, 255, .3); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(147, 169, 255, .3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--ivory); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--ivory); }
.mixer-status { margin: 18px 0 0; color: var(--text); min-height: 1.6em; }
.mixer-note { margin: 16px 0 0; }
.sounds { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.snd { --tint: 147, 169, 255; position: relative; border-radius: 18px; background: var(--navy-2); border: 1px solid var(--stroke); overflow: hidden; transition: border-color .2s ease, background .2s ease; }
.snd button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 16px 18px 6px; cursor: pointer; }
.snd button:focus-visible { outline: 2px solid var(--peri); outline-offset: -4px; border-radius: 16px; }
.snd strong { display: flex; align-items: center; gap: 10px; font: 20px/1.25 var(--serif); color: var(--ivory); font-weight: 400; }
.snd strong::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: rgba(var(--tint), .35); transition: background .2s ease, box-shadow .2s ease; }
.snd span { display: block; font-size: 14px; color: var(--text-3); margin: 2px 0 0 20px; }
.snd input[type="range"] { display: block; width: calc(100% - 36px); margin: 4px 18px 10px; opacity: .35; transition: opacity .2s ease; }
.snd.on { border-color: rgba(var(--tint), .75); background: linear-gradient(160deg, rgba(var(--tint), .16), var(--navy-2) 70%); }
.snd.on strong::before { background: rgb(var(--tint)); box-shadow: 0 0 10px rgb(var(--tint)); }
.snd.on input[type="range"] { opacity: 1; }
.s-brown { --tint: 214, 150, 96; } .s-pink { --tint: 240, 160, 190; } .s-white { --tint: 230, 232, 245; }
.s-rain, .s-stream { --tint: 120, 170, 255; } .s-thunder { --tint: 160, 140, 255; } .s-ocean { --tint: 63, 199, 181; }
.s-wind { --tint: 176, 183, 219; } .s-fire { --tint: 244, 184, 96; }
.mixer-hero > div:first-child { position: sticky; top: 24px; }
.mixer-hero { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 56px); align-items: start; }

@media (max-width: 1023px) { .mixer-hero { grid-template-columns: 1fr; } .mixer-hero > div:first-child { position: static; } }
@media (max-width: 759px) {
  .mixer-head { grid-template-columns: 1fr; grid-template-areas: "play" "scope" "controls"; gap: 14px; }
  .mixer-head .mixer-controls { justify-content: space-between; }
  .play { justify-content: center; width: 100%; }
  .mixer-controls { justify-content: space-between; }
  .mixer-controls input[type="range"] { width: 100%; }
  .mixer-controls .ctl { flex: 1; }
  .sounds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .snd button { padding: 14px 14px 4px; }
  .snd strong { font-size: 18px; }
  .snd span { margin-left: 0; font-size: 13px; }
  .snd strong::before { display: none; }
  .snd input[type="range"] { width: calc(100% - 28px); margin: 2px 14px 8px; }
}
@media (prefers-reduced-motion: reduce) { .play, .snd, .snd input[type="range"] { transition: none; } .play:hover { transform: none; } }
.cta-center .cta-row { justify-content: center; }
.article .faq { padding: 0; }
