/* How to play (/tutorial): one card over the purple band, one step at a time. Uses the player manual's headings
   (.man-h), the home hero's chart and knobs (knobs.css, hero.css) and the site's tokens. */
.tt-page { background: var(--neutral-2); }
.tt-band { position: relative; height: 320px; }
.tt-band .pp-hero-bg { bottom: 0; }
.tt-main { position: relative; margin-top: -232px; padding-bottom: 72px; --tt-top: 88px; }
.has-demo-bar .tt-main { margin-top: -196px; --tt-top: 124px; }

.tt-card { display: flex; flex-direction: column; max-width: 1140px; margin: 0 auto; background: #fff; border: 1px solid var(--neutral-4); border-radius: 16px;
  box-shadow: 0 4px 24px rgba(28,22,47,.06), 0 0 24px rgba(100,45,255,.1), 0 40px 80px -30px rgba(28,22,47,.35); }
/* Desktop: the whole step fits on the screen */
@media (min-width: 901px) and (min-height: 640px) {
  .tt-card { height: clamp(580px, calc(100svh - var(--tt-top) - 14px), 720px); }
  .tt-steps { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
  .tt-step { flex: 1; align-content: center; }
}

/* Top bar: title, progress, skip */
.tt-top { display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-bottom: 1px solid var(--neutral-4); }
.tt-title { margin: 0; font: 500 15px var(--f-ui); color: var(--neutral-12); white-space: nowrap; }
.tt-title span { font-weight: 400; color: var(--neutral-10); }
.tt-dots { flex: 1; display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tt-dots li { flex: 1; }
.tt-dots button { position: relative; width: 100%; padding: 12px 0 0; border: 0; background: none; font: 500 12px var(--f-ui); color: var(--neutral-10); text-align: left; cursor: pointer; }
.tt-dots button::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 2px; background: var(--neutral-4); transition: background .2s; }
.tt-dots .done button::before { background: var(--brand-6); }
.tt-dots .on button::before { background: var(--brand-9); }
.tt-dots .on button { color: var(--brand-11); }
.tt-dots button:hover { color: var(--brand-11); }
.tt-dots button:focus-visible, .tt-skip:focus-visible { outline: 2px solid var(--brand-9); outline-offset: 3px; border-radius: 4px; }
.tt-skip { border: 0; background: none; padding: 6px 0; font: 500 13px var(--f-ui); color: var(--neutral-11); cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.tt-skip:hover { color: var(--brand-11); }

/* One step: copy on the left, the visual on the right */
.tt-step { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 30px; padding: 22px 26px 18px; }
.tt-step[hidden] { display: none; }
.tt-js .tt-step:not([hidden]) { animation: tt-in .3s ease-out; }
@keyframes tt-in { from { opacity: 0; transform: translateY(6px); } }
.tt-step .man-h { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; border-bottom: 1px solid var(--neutral-4); padding-bottom: 12px; margin: 0 0 14px; }
.tt-step .man-n { grid-row: span 2; font: 400 34px/1 var(--f-head); color: var(--brand-6); }
.tt-step .man-h em { font: 500 12px var(--f-code); font-style: normal; letter-spacing: .14em; color: var(--brand-11); text-transform: uppercase; }
.tt-step .man-h h2 { margin: 2px 0 0; font: 400 26px/1.2 var(--f-head); letter-spacing: -0.01em; outline: none; }
.tt-copy p { margin: 0 0 12px; font: 400 16px/1.6 var(--f-body); color: var(--neutral-12); }
.tt-copy b { font-weight: 600; }
.tt-copy .tt-small, .tt-small { font: 400 14px/1.55 var(--f-ui); color: var(--neutral-11); }
.tt-copy .tt-small b { font-weight: 500; color: var(--neutral-12); }
.tt-vis { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.tt-screen { padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--neutral-4); box-shadow: 0 18px 40px -26px rgba(55,0,135,.35); --c-area: rgba(124,77,255,.18); --c-inst: #1c1630; --c-bar: #e5484d; }
.tt-vis .tt-screen { background: linear-gradient(180deg, #fff, #fbfaff); }
.tt-note { margin: 8px 0 0; font: 400 13px/1.5 var(--f-ui); color: var(--neutral-11); }

/* Charts (the home hero's) */
.tt-chart { display: flex; height: 230px; }
.tt-chart .lab-chart { height: 100%; }
.tt-wave-only .c-inst, .tt-wave-only .c-max, .tt-wave-only .c-min, .tt-wave-only .c-bars { display: none; }
.tt-step .sy-legend { gap: 6px 12px; }
.tt-step .sy-stats { margin-top: 8px; }
.tt-step .sy-stats b { font-size: 22px; }
.tt-step .lc-cap { min-height: 46px; }
.tt-step .lab-bar { margin-top: 8px; }
.tt-screen.busy .lab-chart { opacity: .55; transition: opacity .2s; }

/* 1 · live count */
.tt-read { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-family: var(--f-ui); }
.tt-read span { font-size: 13px; color: var(--neutral-11); }
.tt-read b { font: 400 34px/1.1 var(--f-head); color: var(--brand-11); font-variant-numeric: tabular-nums; min-width: 2.4em; }
.tt-read small { font-size: 13px; color: var(--neutral-11); }
.tt-themes { margin: 14px 0 0; }

/* 2 · legend keys */
.tt-keys { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.tt-keys li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; font: 400 14px/1.5 var(--f-ui); color: var(--neutral-11); }
.tt-keys b { color: var(--neutral-12); font-weight: 500; }
.tt-keys i { margin-top: 4px; width: 14px; height: 12px; border-radius: 2px; }
.tt-keys .k-wait { background: #f5a524; }
.tt-keys .k-lost { background: #e5484d; }
.tt-keys .k-lines { height: 10px; border-top: 2px dashed #9b7aff; border-bottom: 2px dotted #16a37f; border-radius: 0; }

/* 3 · instances */
.tt-math { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; font-family: var(--f-ui); text-align: center; }
.tt-math > div { padding: 10px 6px; border-radius: 10px; background: var(--neutral-2); }
.tt-math > div.hl { background: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-6); }
.tt-math > div > span { display: block; font-size: 12px; color: var(--neutral-11); }
.tt-math b { display: block; font: 400 30px/1.15 var(--f-head); color: var(--neutral-12); }
.tt-math .hl b { color: var(--brand-11); }
.tt-math small { font-size: 11px; color: var(--neutral-10); }
.tt-math i { font: 400 22px var(--f-head); font-style: normal; color: var(--neutral-9); }
.tt-rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 6px; margin: 14px 0; min-height: 30px; }
.tt-rack i { display: block; height: 26px; border-radius: 5px; background: var(--brand-9); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.tt-rack.go i { animation: tt-boot 1.6s steps(1, end) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes tt-boot { 0% { background: var(--neutral-4); box-shadow: none; } 1% { background: repeating-linear-gradient(135deg, #cfc6ee 0 5px, #e9e3ff 5px 10px); } 70% { background: var(--brand-9); } }
.tt-life { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: l; }
.tt-life li { padding: 10px; border-radius: 10px; background: var(--neutral-2); font: 400 12px/1.4 var(--f-ui); color: var(--neutral-11); }
.tt-life b { display: block; margin-bottom: 2px; font: 500 13px var(--f-ui); color: var(--neutral-12); }
.tt-life .start { background: repeating-linear-gradient(135deg, #f1edff 0 6px, #f8f6ff 6px 12px); }
.tt-life .ready { background: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-6); }

/* 4 · exercise */
.tt-lead { font-size: 15px !important; color: var(--neutral-11) !important; margin-bottom: 8px !important; }
.tt-knobs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 10px 10px; border-radius: 14px; background: linear-gradient(180deg, #f4f1ff, #e6e0fa); border: 1px solid #d6cdf5; }
.tt-knobs > div { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; }
.tt-knobs small { font: 400 12px/1.35 var(--f-ui); color: #4a3f73; }
.tt-knobs .knob svg { width: 84px; }
.tt-knobs .k-led { fill: #cfc6ee; }
.tt-knobs .k-led.on { fill: #7c4dff; filter: drop-shadow(0 0 3px rgba(124,77,255,.9)); }
.tt-knobs .k-body { fill: #2b2440; }
.tt-knobs .k-cap { fill: #3d3459; stroke: #5b5080; stroke-width: 1; }
.tt-knobs .k-pointer { stroke: #fff; stroke-width: 3; }
.tt-knobs .knob-read span { color: #4a3f73; }
.tt-knobs .knob-read b { color: #3a0ca3; font-size: 20px; }
.tt-goals { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font: 500 14px var(--f-ui); color: var(--neutral-11); }
.tt-goals li { display: flex; align-items: center; gap: 10px; }
.tt-goals i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--neutral-7); flex: none; position: relative; transition: background .2s, border-color .2s; }
.tt-goals li.ok { color: var(--positive-11); }
.tt-goals li.ok i { background: var(--positive-9); border-color: var(--positive-9); }
.tt-goals li.ok i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tt-advice { min-height: 46px; margin: 0 0 6px; padding: 7px 10px; border-radius: 8px; background: #f4f1ff; color: #3a2a7a; font: 500 13px/1.4 var(--f-ui); }
.tt-advice.bad { background: #fde8e8; color: #b42323; }
.tt-advice.warn { background: #fff3dc; color: #8a5300; }
.tt-advice.good { background: #e3f6ee; color: #0e7a5a; }
.tt-cost small { display: block; font: 400 11px var(--f-code); color: var(--neutral-10); min-height: 14px; }
.tt-costnote { min-height: 40px; margin: 8px 0 0; font: 400 13px/1.5 var(--f-ui); color: var(--neutral-11); }
.tt-costnote b { color: var(--neutral-12); font-weight: 500; }

/* 5 · score */
.tt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.tt-modes > div { padding: 12px 14px; border-radius: 12px; background: var(--neutral-2); font: 400 13px/1.45 var(--f-ui); color: var(--neutral-11); }
.tt-modes b { display: block; margin-bottom: 2px; font: 500 15px var(--f-ui); color: var(--neutral-12); }
.tt-score { text-align: center; font-family: var(--f-ui); }
.tt-score-k { display: block; margin-bottom: 10px; font: 500 12px var(--f-code); letter-spacing: .1em; text-transform: uppercase; color: var(--brand-11); }
.tt-sum { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.tt-sum > div { padding: 12px; border-radius: 10px; background: var(--neutral-2); }
.tt-sum span { display: block; font-size: 12px; color: var(--neutral-11); }
.tt-sum b { display: block; font: 400 28px/1.2 var(--f-head); color: var(--neutral-12); }
.tt-sum .lost b { color: #d13415; }
.tt-sum small { font-size: 11px; color: var(--neutral-10); }
.tt-sum i { font: 400 24px var(--f-head); font-style: normal; color: var(--neutral-9); }
.tt-score-arrow { margin: 10px 0; font: 500 13px var(--f-ui); color: var(--neutral-11); }
.tt-lcd { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 8px; background: #a8d8b0; box-shadow: inset 0 2px 6px rgba(0,0,0,.25); font-family: var(--f-code); color: #173d1f; }
.tt-lcd span { font-size: 11px; letter-spacing: .14em; }
.tt-lcd b { font: 500 28px var(--f-code); letter-spacing: .08em; }
.tt-budget { margin: 14px 0 0; text-align: left; }
.tt-budget b small { margin-left: 6px; }
.tt-budget > small { display: block; margin-top: 4px; font-size: 12px; color: var(--neutral-11); }

/* 6 · ready */
.tt-cta { display: grid; gap: 10px; margin: 18px 0 14px; max-width: 420px; }
.tt-cta .pp-btn { height: 48px; }
.tt-btn-soft { color: var(--brand-11); background: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-6); }
.tt-btn-soft:hover { background: var(--brand-3); }
.tt-recap-h { display: block; margin-bottom: 10px; font: 500 12px var(--f-code); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-11); }
.tt-recap ol { list-style: none; counter-reset: r; margin: 0; padding: 0; display: grid; gap: 10px; }
.tt-recap li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--neutral-2); font: 400 15px/1.45 var(--f-ui); color: var(--neutral-11); }
.tt-recap li::before { content: counter(r); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-9); color: #fff; font: 500 14px var(--f-head); }
.tt-recap li b { color: var(--neutral-12); font-weight: 500; }

/* Bottom bar: Back, step count, Next */
.tt-nav { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--neutral-4); background: #fff; border-radius: 0 0 16px 16px; }
.tt-nav .qbtn { width: auto; min-width: 120px; margin: 0; }
.tt-nav .qbtn[hidden] { display: none; }
.tt-nav .qbtn-outline[disabled] { visibility: hidden; }
.tt-count { flex: 1; text-align: center; font: 500 13px var(--f-code); color: var(--neutral-10); }
#tt-next.pulse { animation: lab-pulse 1.3s ease-in-out infinite; }

/* Without JavaScript every step shows, one after the other (and search engines read them all) */
body:not(.tt-js) .tt-nav, body:not(.tt-js) .tt-dots { display: none; }

@media (max-width: 900px) {
  .tt-band { height: 240px; }
  .tt-main { margin-top: -150px; padding-bottom: 32px; }
  .has-demo-bar .tt-main { margin-top: -114px; }
  .tt-step { grid-template-columns: 1fr; gap: 16px; padding: 18px 16px 16px; }
  .tt-top { flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
  .tt-dots { order: 3; flex-basis: 100%; }
  .tt-dots button { font-size: 0; padding-top: 6px; }
  .tt-skip { margin-left: auto; }
  .tt-nav { position: sticky; bottom: 0; z-index: 5; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 20px -14px rgba(28,22,47,.35); }
  .tt-nav .qbtn { min-width: 96px; }
  .tt-step .man-h h2 { font-size: 22px; }
  .tt-step .man-n { font-size: 28px; }
  .tt-chart { height: 200px; }
  /* Phones: the chart comes right under the title in the chart and exercise steps, so it stays in view */
  .tt-step[data-step="2"] .tt-copy, .tt-step[data-step="4"] .tt-copy { display: contents; }
  .tt-step[data-step="2"] > .tt-vis, .tt-step[data-step="4"] > .tt-vis { order: 1; }
  .tt-step[data-step="2"] .tt-copy > :not(.man-h), .tt-step[data-step="4"] .tt-copy > :not(.man-h) { order: 2; margin: 0 !important; }
  .tt-step[data-step="4"] .tt-goals { margin: 0; }
  .tt-step[data-step="2"] .man-h, .tt-step[data-step="4"] .man-h { margin: 0; }
}
@media (max-width: 520px) {
  .tt-math { grid-template-columns: 1fr 1fr 1fr; }
  .tt-math i { display: none; }
  .tt-math b { font-size: 24px; }
  .tt-life { grid-template-columns: 1fr 1fr; }
  .tt-knobs { padding: 10px 4px 8px; gap: 4px; }
  .tt-knobs .knob svg { width: 72px; }
  .tt-knobs small { font-size: 11px; }
  .tt-modes { grid-template-columns: 1fr; }
  .tt-sum b { font-size: 22px; }
  .tt-step .sy-stats b { font-size: 18px; }
  .tt-copy p { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-js .tt-step:not([hidden]), .tt-rack.go i, #tt-next.pulse { animation: none; }
  .tt-dots button::before, .tt-goals i { transition: none; }
}
