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

.te-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.2rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.te-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.te-panel .eyebrow { margin-bottom: .3rem; }
.te-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.te-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; }
.te-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.te-play { min-width: 11rem; padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 650; cursor: pointer; }
.te-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.te-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.te-small { padding: .3rem .75rem; font-size: .8rem; white-space: nowrap; }
.te-group-label { margin: 0 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.te-group-label span { margin-left: .4rem; color: var(--muted); letter-spacing: 0; text-transform: none; }

/* The studio floor */
.te-stage { position: relative; margin-top: 1rem; border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 20%, #3d2c40, #160f17 75%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.te-svg { display: block; width: 100%; height: auto; }
.te-spot, .te-beam { opacity: 0; transition: opacity .25s; }
.te-beam { opacity: 0; }
.te-station.is-on .te-spot { opacity: 1; }
.te-station.is-on .te-beam { opacity: .5; }
.te-station.is-on .te-lamp { fill: #ff5a3c; }
.te-station.is-on .te-guitar { animation: te-rock .5s ease-in-out infinite alternate; transform-origin: 0 40px; }
.te-station.is-on .te-strings line { stroke: #fff3c4; }
@keyframes te-rock { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
.te-name { fill: #f6efe0; font-family: var(--serif); font-size: 22px; font-weight: 650; }
.te-sub { fill: #b8aca0; font-family: var(--mono); font-size: 12px; }
.te-station.is-on .te-name { fill: #ffd76a; }
.te-note { font-size: 26px; animation: te-rise 1.3s ease-out forwards; }
@keyframes te-rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-90px); opacity: 0; } }
.te-readout { position: absolute; top: .7rem; left: .9rem; display: flex; gap: .7rem; align-items: baseline; pointer-events: none; }
.te-chord { padding: .15rem .6rem; border-radius: 8px; background: rgba(0,0,0,.45); color: #ffd76a; font-family: var(--serif); font-size: 1.3rem; font-weight: 650; }
.te-bar { color: #d8cfc4; font-family: var(--mono); font-size: .78rem; }

/* The order */
.te-order-wrap { margin-top: 1rem; }
.te-order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem; }
.te-order-head .te-group-label { margin: 0; }
.te-presets, .te-rigs { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.te-presets button, .te-rigs button { padding: .28rem .7rem; border: 1.5px solid var(--paper-line); border-radius: 999px; background: #fffaf0; color: var(--ink); font-size: .78rem; cursor: pointer; }
.te-presets button[aria-pressed="true"], .te-rigs button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.te-rigs > span { color: var(--muted); font-size: .76rem; margin-right: .1rem; }
.te-order { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .3rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.te-order li:nth-child(3n) { margin-right: .4rem; }
.te-slot { display: flex; flex-direction: column; align-items: center; justify-content: end; width: 100%; min-height: 58px; padding: .3rem .2rem; border: 0; border-bottom: 5px solid var(--pc); border-radius: 10px; background: #f4eee2; color: var(--ink); cursor: pointer; }
.te-slot span { min-height: 1em; color: var(--muted); font-family: var(--mono); font-size: .62rem; }
.te-slot strong { font-size: .92rem; }
.te-slot:hover { background: #ece3d0; }
.te-slot.is-now { background: var(--pc); color: #fff; }
.te-slot.is-now span { color: rgba(255,255,255,.8); }

/* The players */
.te-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.te-player { padding: .7rem .85rem; border: 1.5px solid var(--paper-line); border-left: 6px solid var(--pc); border-radius: 12px; background: #fffaf0; transition: box-shadow .2s; }
.te-player.is-now { box-shadow: 0 0 0 3px var(--pc); }
.te-player-top { display: flex; justify-content: space-between; align-items: start; gap: .5rem; margin-bottom: .5rem; }
.te-player-top strong { display: block; font-size: 1rem; }
.te-player-top span { color: var(--muted); font-size: .8rem; }

/* Your turn */
.te-you { margin-top: 1rem; padding: .8rem .9rem; border: 1.5px dashed #c8b9e6; border-radius: 14px; background: #f7f2fd; transition: box-shadow .2s, background .2s; }
.te-you.is-wanted { border-style: solid; border-color: #8350c4; }
.te-you.is-now { background: #efe4fd; box-shadow: 0 0 0 4px rgba(131,80,196,.35); }
.te-you-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem; margin-bottom: .5rem; }
.te-you-head .te-group-label { margin: 0; }
.te-keys { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: .3rem; }
.te-key { display: flex; flex-direction: column; align-items: center; gap: .2rem; min-height: 64px; padding: .45rem .1rem .35rem; border: 0; border-radius: 10px; background: linear-gradient(180deg, #5b3b8c, #3e2566); color: #f4eefc; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.te-key strong { font-family: var(--serif); font-size: 1rem; }
.te-key kbd { padding: 0 .3rem; border-radius: 4px; background: rgba(0,0,0,.25); color: inherit; font-size: .66rem; }
.te-key.is-hit { background: linear-gradient(180deg, #ffd76a, #e5a930); color: var(--ink); }

.te-status { margin: 1rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fdf0cf; font-size: .88rem; }
.te-fine { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }

/* The story */
.te-story > p:not(.eyebrow) { max-width: 80ch; }
.te-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.2rem; }
.te-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.te-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.te-step p { margin: 0; }
.te-n { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .72rem; }
.te-story a { color: var(--pink-ink); }
.te-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.te-method a { color: var(--gold); }
.te-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

@media (max-width: 1000px) { .te-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .te-players { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .te-order { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-order li:nth-child(3n) { margin-right: 0; }
  .te-keys { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .te-key kbd { display: none; }
  .te-name { font-size: 28px; } .te-sub { display: none; }
  .te-readout { top: .35rem; left: .4rem; } .te-chord { padding: .05rem .4rem; font-size: .85rem; } .te-bar { font-size: .62rem; }
}
@media (max-width: 560px) { .te-steps { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .te-station.is-on .te-guitar { animation: none; } .te-spot, .te-beam, .te-player, .te-you { transition: none; } }
