/*
 * Beat the Stress: visual system.
 * Idea: the interface wears your mood. The four corners of the mood grid have
 * colours (tense rose, hyped amber, low periwinkle, calm teal). Once you check in,
 * --mood becomes the blend for your point, and during a break it drifts from
 * your starting colour toward your goal colour, song by song.
 * Type: Bricolage Grotesque (headlines), Atkinson Hyperlegible (reading).
 */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night: #16132c;
  --night-2: #1d1938;
  --surface: #221e3e;
  --raised: #2c2752;
  --line: #3a3466;
  --text: #f6f2ff;
  --muted: #b5aed3;
  --violet: #a48bff;
  --tense: #ff7088;
  --hyped: #ffb357;
  --low: #7d8bf2;
  --calm: #4fd8c0;
  --mood: var(--violet);
  --pre: #a7a2c6;
  --post: #fff4dc;
  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 28px;
  --tabs-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Bricolage", ui-rounded, system-ui, sans-serif;
  --body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@property --mood { syntax: "<color>"; inherits: true; initial-value: #a48bff; }
:root { transition: --mood 2.4s ease; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 16px/1.55 var(--body);
  background:
    radial-gradient(900px 520px at 85% -8%, color-mix(in srgb, var(--mood) 30%, transparent), transparent 65%),
    radial-gradient(700px 500px at -10% 110%, color-mix(in srgb, var(--mood) 12%, transparent), transparent 60%),
    var(--night);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--mood); }
h1, h2, h3 { font-family: var(--display); font-stretch: 90%; letter-spacing: -0.015em; }
h1 { font-size: clamp(32px, 7.4vw, 56px); line-height: 1.02; margin: 4px 0 12px; font-weight: 720; font-variation-settings: "opsz" 96; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.2; margin: 0 0 10px; font-weight: 680; }
h3 { font-size: 17px; margin: 18px 0 4px; font-weight: 650; }
p { margin: 0 0 10px; }
small { display: block; color: var(--muted); font-size: 13.5px; }
.dot { color: var(--mood); }
.eyebrow { font-size: 15px; color: var(--mood); font-weight: 700; margin: 0; letter-spacing: 0; }
.lead { color: var(--muted); font-size: 17.5px; max-width: 44ch; }
.fine { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; }
.warn { color: var(--hyped); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--mood); outline-offset: 3px; }

/* ---------- frame */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top)); background: linear-gradient(var(--night) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 750; font-stretch: 80%; font-size: 19px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--mood); }
.support-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
.support-btn:hover { border-color: var(--muted); }
main { padding: 4px 18px calc(var(--tabs-h) + 110px + var(--safe-b)); max-width: 1100px; margin: 0 auto; outline: none; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--night-2) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabs button { background: none; border: 0; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 12px; color: var(--muted); cursor: pointer; border-radius: 0; padding: 0; }
.tabs svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.tabs [aria-current="page"] { color: var(--text); }
.tabs [aria-current="page"] svg { color: var(--mood); }
body.research .tabs, body.in-session .tabs { display: none; }
body.in-session .miniplayer { display: none; }

@media (min-width: 900px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 96px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 84px; align-content: center; border-top: 0; border-right: 1px solid var(--line); }
  .topbar, main { margin-left: 96px; }
  body.research .topbar, body.research main, body.in-session .topbar, body.in-session main { margin-left: auto; }
  main { padding-bottom: 120px; }
}

/* ---------- surfaces: tonal layers, one border colour, radius by size */
.card { background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: var(--radius-m); padding: 20px; margin: 14px 0; }
.card h2:first-child { margin-top: 0; }
.hero { padding: 22px 0 10px; }
.hero.compact h1 { font-size: clamp(30px, 6.4vw, 46px); }

/* ---------- buttons */
button { cursor: pointer; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--night-2); padding: 11px 16px; transition: background .15s, border-color .15s, transform .1s; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--text); color: var(--night); border-color: var(--text); font-weight: 700; }
.primary:hover:not(:disabled) { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--mood) 45%, transparent); }
.big { padding: 16px 22px; font-size: 17px; width: 100%; border-radius: 999px; }
.ghost { background: transparent; border-color: transparent; }
.link { background: none; border: 0; padding: 4px; color: var(--mood); text-decoration: underline; text-underline-offset: 3px; }
.danger { border-color: #7a3a52; color: #ffb3c1; background: transparent; }
.round { width: 52px; height: 52px; border-radius: 50%; padding: 0; display: inline-grid; place-items: center; font-size: 18px; }
.round.big { width: 76px; height: 76px; font-size: 24px; background: var(--text); color: var(--night); border: 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--mood) 30%, transparent); }
.round.sm { width: 40px; height: 40px; font-size: 13px; flex: none; background: var(--raised); border-color: transparent; }
.sm { padding: 6px 10px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-row.center { justify-content: center; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 11px 12px; }
.sticky-cta { position: sticky; bottom: calc(var(--tabs-h) + 12px + var(--safe-b)); display: flex; gap: 10px; margin: 20px 0; z-index: 5; }
body.research .sticky-cta, body.in-session .sticky-cta { bottom: calc(12px + var(--safe-b)); }
@media (min-width: 900px) { .sticky-cta { bottom: 18px; max-width: 520px; } }
.sticky-cta .ghost { flex: 0 0 auto; background: color-mix(in srgb, var(--night) 80%, transparent); border-radius: 999px; padding: 16px 20px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 24px + var(--safe-b)); transform: translateX(-50%); background: var(--text); color: var(--night); padding: 10px 16px; border-radius: 999px; z-index: 99; font-weight: 700; max-width: 90vw; }

/* ---------- mood grid: the signature object */
.moodgrid-wrap { max-width: 460px; margin: 8px auto 0; display: grid; grid-template-columns: 1fr; }
.moodgrid { position: relative; touch-action: none; cursor: crosshair; border-radius: var(--radius-l); user-select: none; -webkit-user-select: none; box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--mood) 55%, transparent); transition: box-shadow 1.2s; }
.moodgrid svg { display: block; width: 100%; height: auto; }
.grid-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--display); font-stretch: 86%; font-weight: 650; font-size: 19px; text-shadow: 0 1px 12px rgba(0,0,0,.45); animation: pulse 2.6s ease-in-out infinite; }
.axis-label { text-align: center; font-size: 13px; color: var(--muted); padding: 6px 0; }
.axis-label.row { display: flex; justify-content: space-between; padding: 0 6px; }
.plane-veil { fill: var(--night); opacity: .38; }
.axis { stroke: #fff; stroke-opacity: .28; stroke-width: .6; stroke-dasharray: 1.5 2.5; }
.corner { fill: #fff; font-family: var(--body); font-size: 7.4px; font-weight: 700; opacity: .92; }
.corner.end { text-anchor: end; } .corner.mid { text-anchor: middle; }
.marker-halo { fill: #fff; opacity: .28; animation: halo 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.marker-dot { fill: #fff; stroke: var(--night); stroke-width: 2.5; }
.ghost-dot { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 2 2; opacity: .85; }
.ghost-label, .map-tag { fill: #fff; font-size: 7px; text-anchor: middle; font-weight: 700; }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes halo { 50% { transform: scale(1.25); opacity: .14; } }

/* ---------- goal */
.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.goal { --c: var(--violet); text-align: left; padding: 16px 16px 16px 18px; border-radius: var(--radius-m); position: relative; min-height: 92px; background: var(--surface); border: 1px solid transparent; overflow: hidden; }
.goal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.goal strong { font-family: var(--display); font-stretch: 86%; font-size: 18px; font-weight: 680; display: block; }
.goal small { margin-top: 2px; }
.goal em { display: inline-block; margin-top: 8px; font-style: normal; font-size: 12px; color: var(--night); background: var(--c); padding: 2px 9px; border-radius: 99px; font-weight: 700; }
.goal[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.goal-keep { grid-column: 1 / -1; min-height: 0; }
.options { display: grid; gap: 16px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.seg { display: inline-flex; background: var(--night-2); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; }
.seg button[aria-checked="true"] { background: var(--text); color: var(--night); font-weight: 700; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { flex: none; width: 52px; height: 32px; border-radius: 99px; background: var(--raised); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--mood); }
.switch input:checked + i::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + i { outline: 3px solid var(--mood); outline-offset: 2px; }

/* ---------- session */
.session { text-align: center; padding-top: 4px; }
.ring-wrap { position: relative; width: min(80vw, 330px); aspect-ratio: 1; margin: 16px auto; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 5; }
.ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.time { position: absolute; inset: 0; display: grid; place-content: center; }
.time strong { font-family: var(--display); font-stretch: 78%; font-size: 58px; line-height: 1; font-variant-numeric: tabular-nums; font-weight: 700; }
.breath { position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--mood) 55%, transparent), color-mix(in srgb, var(--mood) 8%, transparent) 70%); animation: breathe 10s ease-in-out infinite; }
.breath-text { position: absolute; left: 0; right: 0; bottom: 21%; font-size: 14px; height: 18px; font-weight: 700; }
.breath-text span { position: absolute; left: 0; right: 0; }
.breath-text .in { animation: bin 10s infinite; } .breath-text .out { animation: bout 10s infinite; }
.ring-wrap.breathing .time strong { font-size: 46px; }
.ring-wrap.paused .breath, .ring-wrap.paused .breath-text span { animation-play-state: paused; }
@keyframes breathe { 0% { transform: scale(.6); } 40% { transform: scale(1); } 100% { transform: scale(.6); } }
@keyframes bin { 0%, 38% { opacity: 1; } 42%, 100% { opacity: 0; } }
@keyframes bout { 0%, 38% { opacity: 0; } 42%, 96% { opacity: 1; } 100% { opacity: 0; } }
.now { min-height: 70px; }
.now strong { display: block; font-family: var(--display); font-stretch: 86%; font-size: 24px; font-weight: 680; line-height: 1.15; margin: 2px 0; }
.controls { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 16px 0; }
.volume { display: flex; align-items: center; gap: 12px; max-width: 360px; margin: 10px auto; color: var(--muted); font-size: 14px; }
.volume input, .stress input { flex: 1; accent-color: var(--mood); }
.how { text-align: left; max-width: 460px; margin: 18px auto; }
.how summary { cursor: pointer; font-weight: 700; }
.pathmap { width: 100%; max-width: 320px; display: block; margin: 12px auto; }
.path-line { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .8; }
.seg-dot { fill: rgba(255,255,255,.45); stroke: var(--night); stroke-width: 2; }
.seg-dot.done { fill: rgba(255,255,255,.8); } .seg-dot.now { fill: #fff; }
.start-dot { fill: var(--pre); stroke: var(--night); stroke-width: 1.5; }
.target-ring { fill: none; stroke: #fff; stroke-width: 2; }

/* ---------- check-out & result */
.stress label, .q { display: block; font-weight: 700; margin-bottom: 8px; }
.stress input { width: 100%; }
.stress input.unset { opacity: .45; }
.scale-ends { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 13px; }
.scale-ends output { color: var(--text); font-family: var(--display); font-weight: 700; font-size: 22px; }
.resultmap, .shiftchart { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.shift-line { stroke: #fff; stroke-opacity: .6; stroke-width: 1.2; }
.shift-line.strong { stroke-opacity: .95; stroke-width: 2.2; }
.arrowhead { fill: #fff; }
.pre-dot { fill: var(--pre); stroke: var(--night); stroke-width: 2; }
.post-dot { fill: var(--post); stroke: var(--night); stroke-width: 2; }
.hit { fill: transparent; }
.shift:hover .shift-line, .shift:focus .shift-line { stroke-opacity: 1; stroke-width: 2; }
.legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg.pre { background: var(--pre); } .lg.post { background: var(--post); } .lg.lib { background: #fff; } .lg.own { background: var(--night); box-shadow: inset 0 0 0 2.5px #fff; }
.support-card { background: color-mix(in srgb, var(--tense) 14%, var(--surface)); }

/* ---------- lists */
.tracklist { list-style: none; padding: 0; margin: 6px 0 0; }
.track { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.track:last-child { border-bottom: 0; }
.track .meta { flex: 1; min-width: 0; }
.track .meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.fav { font-size: 20px; padding: 6px 8px; color: var(--tense); }

/* ---------- music map */
.map-layout { display: grid; gap: 14px; }
.map-layout > * { min-width: 0; }
@media (min-width: 900px) { .map-layout { grid-template-columns: minmax(320px, 460px) 1fr; align-items: start; } .map-card { position: sticky; top: 70px; } }
.map-card { padding: 14px; }
.musicmap { width: 100%; display: block; }
.map-dot { cursor: pointer; outline: none; }
.map-dot .dot { fill: #fff; stroke: var(--night); stroke-width: 1.4; transition: r .15s; }
.map-dot.personal .dot { fill: var(--night); stroke: #fff; stroke-width: 2; }
.map-dot:hover .dot, .map-dot:focus .dot { r: 6; }
.map-dot:focus-visible .hit { stroke: #fff; stroke-width: 1.5; }
.map-dot.hl .dot { fill: var(--hyped); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chips button { border-radius: 999px; padding: 7px 15px; white-space: nowrap; background: var(--surface); border-color: transparent; }
.chips [aria-selected="true"] { background: var(--text); color: var(--night); font-weight: 700; }
.file-btn { display: inline-block; position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn span { display: inline-block; padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--night); font-weight: 700; }
.file-btn input:focus-visible + span { outline: 3px solid var(--mood); outline-offset: 2px; }

/* ---------- journey */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.stat { background: var(--surface); border-radius: var(--radius-m); padding: 14px 16px; }
.stat strong { font-family: var(--display); font-stretch: 80%; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; }
.empty { text-align: center; }

/* ---------- settings */
.how-list { padding-left: 20px; } .how-list li { margin-bottom: 8px; color: var(--muted); } .how-list strong { color: var(--text); }
.credits { padding-left: 18px; color: var(--muted); font-size: 14px; } .credits li { margin-bottom: 6px; }
.done { color: var(--calm); }

/* ---------- mini player */
.miniplayer { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabs-h) + 8px + var(--safe-b)); z-index: 25; display: flex; align-items: center; gap: 10px; background: var(--raised); border-radius: 999px; padding: 7px 10px 7px 7px; box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 0 0 1px var(--line); }
.miniplayer > div { flex: 1; min-width: 0; }
.miniplayer strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miniplayer .round { width: 44px; height: 44px; background: var(--text); color: var(--night); border: 0; }
@media (min-width: 900px) { .miniplayer { left: 116px; right: auto; width: 420px; bottom: 16px; } }

/* ---------- dialogs */
dialog { background: var(--surface); color: var(--text); border: 0; border-radius: var(--radius-l); padding: 24px; max-width: min(520px, 92vw); max-height: 90vh; overflow: auto; box-shadow: 0 40px 100px rgba(0,0,0,.6), inset 0 0 0 1px var(--line); }
dialog::backdrop { background: rgba(10, 8, 24, .72); backdrop-filter: blur(3px); }
.support-list { display: grid; gap: 10px; margin: 14px 0; }
.support-item { display: block; text-decoration: none; color: var(--text); background: var(--night-2); border-radius: var(--radius-m); padding: 13px 16px; }
.support-item strong { font-family: var(--display); font-stretch: 86%; font-size: 19px; }
dialog .seg.wide { margin: 10px 0; }

/* ---------- research sign-in, utilities */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.login { display: grid; gap: 14px; max-width: 420px; }
.login label { display: grid; gap: 6px; font-weight: 700; }
.login input { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; font-weight: 400; }
@media (max-width: 560px) { .wide-only { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  :root { transition: none; }
  .breath { transform: scale(.85); }
}
@media (max-width: 380px) { .goal-grid { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- background: sound-wave contour lines (drawn by js/waves.js) */
.bg-waves {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  opacity: .12; transition: opacity 1.2s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.15) 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.15) 100%);
}
.bg-waves svg { display: block; width: 200%; height: 100%; }
.bg-waves path { fill: none; stroke: var(--mood); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.bg-waves-lines { transform-box: fill-box; transform-origin: center; }
/* fine film grain so large dark areas do not look flat */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* home page: brighter, slow sideways drift */
body.home .bg-waves { opacity: .22; }
body.home .bg-waves svg { animation: waveDrift 90s linear infinite; }
@keyframes waveDrift { to { transform: translateX(-50%); } }
/* music break with the breathing guide on: lines swell with each breath (same 10 s cycle) */
body.in-session.breath-on .bg-waves { opacity: .2; }
body.in-session.breath-on .bg-waves-lines { animation: waveBreath 10s ease-in-out infinite; }
body.in-session.breath-on.paused .bg-waves-lines { animation-play-state: paused; }
@keyframes waveBreath { 0% { transform: scaleY(.8); } 40% { transform: scaleY(1.14); } 100% { transform: scaleY(.8); } }
/* research pages: still and neutral */
body.research .bg-waves { opacity: .07; }
body.research .bg-waves path { stroke: #b5aed3; }
body.research .bg-waves-lines, body.research .bg-waves svg { animation: none !important; }

/* ---------- goal preview map */
.goal-layout { display: grid; gap: 14px; margin: 14px 0; }
.goal-layout .goal-grid { margin: 0; align-content: start; }
.goal-map { margin: 0; padding: 14px; }
.goalmap { display: block; width: 100%; max-width: 260px; margin: 0 auto; }
.goal-map figcaption { text-align: center; margin-top: 8px; }
.plan-line { stroke: #fff; stroke-width: 2; stroke-dasharray: 4 4; stroke-linecap: round; opacity: .9; animation: planMarch 1.4s linear infinite; }
@keyframes planMarch { to { stroke-dashoffset: -16; } }
@media (min-width: 760px) {
  .goal-layout { grid-template-columns: minmax(240px, 300px) 1fr; align-items: start; }
  .goal-map { position: sticky; top: 74px; }
}
@media (max-width: 759px) {
  .goal-map { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 12px; }
  .goalmap { max-width: 150px; margin: 0; }
  .goal-map figcaption { text-align: left; margin: 0; }
}
