.tl-page { width: var(--page); margin: 0 auto; }
.tl-page [hidden] { display: none !important; }
.tl-page.page-columns, .tl-page .page-columns, #tl-explorer.page-columns { display: block !important; }
.tl-page .page-columns > * { grid-column: auto !important; }
.tl-heading { max-width: 800px; margin: 3rem 0 1.5rem; }
.tl-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.tl-heading h1 { color: var(--paper); font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1.06; margin: 0 0 1rem; }
.tl-heading h1 em { color: var(--gold); }
.tl-heading > p:last-child { color: var(--soft); font-size: 1.05rem; max-width: 64ch; }
.tl-loading { color: var(--soft); }
.tl-page button { font-family: var(--sans); }
.tl-page button:focus-visible, .tl-page input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.tl-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.25rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.tl-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.tl-panel .eyebrow { margin-bottom: .3rem; }
.tl-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; margin-bottom: .6rem; }
.tl-sub { max-width: 80ch; margin: 0 0 1rem; color: var(--muted); font-size: .88rem; }
.tl-sub kbd, .tl-hold kbd { padding: 0 .3rem; border: 1px solid currentColor; border-radius: 4px; font-family: var(--mono); font-size: .75em; background: transparent; color: inherit; box-shadow: none; }
.tl-note { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }

.tl-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.tl-play { min-width: 7.5rem; padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.tl-play[aria-pressed="true"] { background: var(--ink); color: var(--gold); }
.tl-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .85rem; cursor: pointer; }
.tl-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* The desk */
.tl-desk { --desk: #231c2e; --strip: #2f2640; --line: #4a3f5c; --label: #fff5e1; --dim: #b9adc9;
  display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 1rem; padding: 1rem; border-radius: 12px;
  background: linear-gradient(180deg, #2a2236, var(--desk)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); color: var(--label); }
.tl-strips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 6px repeat(5, minmax(0, 1fr)); gap: .55rem; }
.tl-divider { background: var(--line); border-radius: 3px; }
.tl-strip { display: flex; flex-direction: column; align-items: stretch; gap: .55rem; min-width: 0; padding: .7rem .55rem; border-radius: 9px; background: var(--strip); border-top: 4px solid var(--c); }
.tl-strip-top { min-height: 92px; }
.tl-strip.is-backing .tl-strip-top { min-height: 0; }
.tl-strip.is-backing .tl-knob { margin-top: auto; }
.tl-strip.is-backing .tl-fader-wrap { margin-top: 0; }
.tl-strip.is-backing::after { content: ""; height: 2.05rem; flex: none; } /* lines faders up with the loops’ Hold buttons */
.tl-strip h3 { margin: .15rem 0 0; color: var(--label); font-family: var(--sans); font-size: .92rem; font-weight: 600; line-height: 1.2; }
.tl-what { margin: .1rem 0 0; color: var(--dim); font-size: .7rem; line-height: 1.25; }

.tl-tape { display: block; width: 100%; max-width: 92px; height: auto; }
.tl-tape-path { fill: none; stroke: #6b4a2f; stroke-width: 4; stroke-dasharray: 9 3 2 3; stroke-dashoffset: var(--dash, 0); }
.tl-desk.is-playing .tl-tape-path { stroke: #8a5a34; }
.tl-capstan { fill: #3b3150; stroke: var(--c); stroke-width: 2; }
.tl-pencil { fill: #f2c94c; stroke: #1f1830; stroke-width: 1; }
.tl-spokes line { stroke: var(--c); stroke-width: 2; }
.tl-spokes { transform-box: fill-box; transform-origin: center; transform: rotate(var(--spin, 0deg)); }

.tl-knob { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 .3rem; font-size: .68rem; color: var(--dim); }
.tl-knob span { font-family: var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.tl-knob output { font-family: var(--mono); color: var(--label); }
.tl-knob input { grid-column: 1 / -1; width: 100%; accent-color: var(--c); margin: .2rem 0 0; }
.tl-rev { padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--label); font-size: .74rem; cursor: pointer; }
.tl-rev[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #1f1830; }

.tl-fader-wrap { display: flex; justify-content: center; align-items: stretch; gap: .5rem; height: 170px; margin-top: auto; }
.tl-fader { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 100%; margin: 0; accent-color: var(--c); cursor: ns-resize; }
.tl-meter { position: relative; width: 8px; border-radius: 4px; background: #191322; overflow: hidden; }
.tl-meter i { position: absolute; inset: auto 0 0 0; height: calc(var(--m, 0) * 100%); background: linear-gradient(0deg, #1fb5a9 0 60%, #ffc72c 60% 85%, #e23d80 85%); background-size: 100% 170px; background-position: bottom; transition: height .06s linear; }
.tl-hold { padding: .45rem .3rem; border: 1px solid var(--c); border-radius: 6px; background: transparent; color: var(--label); font-size: .76rem; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.tl-hold.is-on { background: var(--c); color: #1f1830; }

.tl-masterbox { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: .8rem; border-radius: 9px; background: var(--strip); }
.tl-vu { position: relative; aspect-ratio: 12 / 7; border-radius: 8px; background: #fbecd0; overflow: hidden; }
.tl-vu svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-vu-arc { fill: none; stroke: #1f1830; stroke-width: 1.5; }
.tl-vu-red { fill: none; stroke: #c2185b; stroke-width: 4; }
.tl-vu text { fill: #1f1830; font-family: var(--mono); font-size: 10px; text-anchor: middle; }
.tl-needle { position: absolute; left: 50%; bottom: 11%; width: 2px; height: 72%; margin-left: -1px; background: #1f1830; transform-origin: 50% 100%; transform: rotate(var(--vu, -48deg)); transition: transform .08s linear; }
.tl-status { margin: 0; color: var(--dim); font-size: .8rem; }

/* Story */
.tl-story > p:not(.eyebrow), .tl-story li { max-width: 78ch; }
.tl-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.tl-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.tl-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.tl-step p { margin: 0; }
.tl-n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .85rem; }
.tl-five ol { margin: .4rem 0 1rem; padding-left: 1.3rem; }
.tl-five li { margin-bottom: .35rem; }
.tl-time { margin-left: .4rem; padding: .05rem .4rem; border-radius: 4px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: .72rem; }
.tl-story a { color: var(--pink-ink); }

.tl-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.tl-method a { color: var(--gold); }
.tl-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

@media (max-width: 1100px) {
  .tl-desk { grid-template-columns: minmax(0, 1fr); }
  .tl-masterbox { flex-direction: row; align-items: center; }
  .tl-vu { width: 160px; flex: none; }
  .tl-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tl-strips { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tl-strip { grid-column: span 2; }
  .tl-strip.is-backing, .tl-strip:nth-child(7), .tl-strip:nth-child(8) { grid-column: span 3; }
  .tl-divider { display: none; }
  .tl-fader-wrap { height: 140px; }
  .tl-desk { padding: .6rem; }
}
@media (max-width: 560px) {
  .tl-steps { grid-template-columns: minmax(0, 1fr); }
  .tl-vu { width: 120px; }
}

/* Drawn knobs for speed and pan (assets/grab.js); the sliders stay focusable for the keyboard */
.tl-knob.has-dial { grid-template-columns: 1fr auto; grid-template-rows: auto auto; position: relative; }
.tl-knob.has-dial input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tl-dial { grid-column: 1 / -1; justify-self: center; display: block; width: 38px; height: 38px; margin: .3rem 0 .1rem; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 38% 32%, #5a5168, #1c1626 72%); box-shadow: 0 0 0 2px var(--c), 0 4px 8px rgba(0,0,0,.45), inset 0 -2px 3px rgba(0,0,0,.4); transform: rotate(var(--turn, 0deg)); }
.tl-dial::after { content: ""; position: absolute; left: 50%; top: 4px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.tl-knob.has-dial:focus-within .tl-dial { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Faders: a ridged cap in a slot, with a scale beside it */
.tl-fader { -webkit-appearance: none; appearance: none; background: transparent; width: 34px; }
.tl-fader::-webkit-slider-runnable-track { width: 6px; border-radius: 3px; background: #0d0a12; box-shadow: inset 0 0 0 1px #3a3048; }
.tl-fader::-moz-range-track { width: 6px; border-radius: 3px; background: #0d0a12; box-shadow: inset 0 0 0 1px #3a3048; }
.tl-fader::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 20px; margin-left: -13px; border-radius: 4px; border: 0; cursor: grab;
  background: repeating-linear-gradient(0deg, #2b2533 0 2px, #4a4256 2px 4px), #3a3346; box-shadow: inset 0 0 0 1px #6b6080, inset 0 -6px 0 -4px var(--c), 0 3px 6px rgba(0,0,0,.55); }
.tl-fader::-moz-range-thumb { width: 32px; height: 20px; border-radius: 4px; border: 0; cursor: grab;
  background: repeating-linear-gradient(0deg, #2b2533 0 2px, #4a4256 2px 4px), #3a3346; box-shadow: inset 0 0 0 1px #6b6080, 0 3px 6px rgba(0,0,0,.55); }
.tl-fader:active::-webkit-slider-thumb { cursor: grabbing; }
.tl-fader:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.tl-fader-wrap { position: relative; }
.tl-fader-wrap::after { content: ""; position: absolute; top: 10px; bottom: 10px; right: calc(50% - 30px); width: 6px;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.35) 0 1px, transparent 1px 15px); pointer-events: none; }
