/* ==================================================================
   TRANCE 2.5.0.4: a firelit drum circle on the parchment page
   ------------------------------------------------------------------
   Every colour comes from the tokens below. Supporters can pick one
   of four looks (data-skin on #trance-app): gold (the default),
   neon (colourful dark), warm (light warm) and cold (light cold).
   The transport keys and display use /parts/audio/retro-keys.css.
================================================================== */
#trance-app {
    --t-bg1: #1b120e;
    --t-bg2: #2a1912;
    --t-bg3: #3a2216;
    --t-glow1: rgba(239, 154, 90, .22);
    --t-glow2: rgba(201, 143, 143, .12);
    --t-ink: #f1e6d6;
    --t-ink-rgb: 241, 230, 214;
    --t-muted: #bba795;
    --t-hl-rgb: 255, 255, 255;          /* tints for tiles and fields */
    --t-accent: #ef9a5a;
    --t-accent-rgb: 239, 154, 90;
    --t-accent-hi: #ffd2a4;
    --t-accent-ink: #2a140a;
    --t-panel: rgba(0, 0, 0, .2);
    --t-stop: #d63a2f;
    --t-toast: #3a2216;
    --t-shadow: 0 18px 40px rgba(40, 20, 10, .32);
    --t-hue-dark: 0%;                   /* light looks darken lane colours for contrast */
    --t-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --t-line: rgba(var(--t-ink-rgb), .12);
    --t-tile: rgba(var(--t-hl-rgb), .045);
    --t-tile-on: rgba(var(--t-hl-rgb), .09);

    /* retro keys */
    --rk-tray: linear-gradient(180deg, #0f0a07, #1d140e);
    --rk-face-hi: #f6efe2; --rk-face: #e2d4ba; --rk-face-lo: #c9b797; --rk-edge: #7a6447;
    --rk-ink: #2b2016; --rk-led: #ffb347; --rk-stop: #b3261e;
    --rk-tray-ink-rgb: 241, 230, 214;   /* labels on the dark slide-switch tray, in every look */
    --rk-lcd: linear-gradient(180deg, #1f160a, #120c04); --rk-lcd-ink: #ffbf5e; --rk-lcd-glow: rgba(255, 175, 70, .45);

    position: relative;
    box-sizing: border-box;
    max-width: 920px;
    margin: 1.5rem auto;
    padding: 18px 22px 16px;
    border-radius: 22px;
    color: var(--t-ink);
    background:
        radial-gradient(90% 60% at 50% 110%, var(--t-glow1), transparent 65%),
        radial-gradient(60% 40% at 15% -10%, var(--t-glow2), transparent 60%),
        linear-gradient(170deg, var(--t-bg1) 0%, var(--t-bg2) 55%, var(--t-bg3) 100%);
    box-shadow: var(--t-shadow), inset 0 1px 0 rgba(255,255,255,.05);
    font-size: 16px;
    line-height: 1.45;
    transition: background .4s ease, color .4s ease;
}

/* ---------- the four looks ---------- */
#trance-app[data-skin="neon"] {
    --t-bg1: #0e0b26; --t-bg2: #1a1042; --t-bg3: #2b0f3f;
    --t-glow1: rgba(255, 92, 190, .25); --t-glow2: rgba(64, 210, 255, .22);
    --t-ink: #efeaff; --t-ink-rgb: 239, 234, 255; --t-muted: #aea6d6;
    --t-accent: #ff5fbf; --t-accent-rgb: 255, 95, 191; --t-accent-hi: #7ff3ff; --t-accent-ink: #1a0721;
    --t-toast: #241452; --t-shadow: 0 18px 44px rgba(30, 10, 70, .45);
    --rk-tray: linear-gradient(180deg, #08061a, #160d33);
    --rk-face-hi: #f3f0ff; --rk-face: #d8d1f4; --rk-face-lo: #b7addf; --rk-edge: #5b4a99;
    --rk-ink: #24183f; --rk-led: #5ff6ff; --rk-stop: #e0245e; --rk-tray-ink-rgb: 239, 234, 255;
    --rk-lcd: linear-gradient(180deg, #071a1e, #031013); --rk-lcd-ink: #6ff7e6; --rk-lcd-glow: rgba(80, 245, 225, .5);
}
#trance-app[data-skin="warm"] {
    --t-bg1: #fbf4e8; --t-bg2: #f5e7d0; --t-bg3: #efd9b9;
    --t-glow1: rgba(226, 132, 64, .18); --t-glow2: rgba(255, 255, 255, .6);
    --t-ink: #3b2a1d; --t-ink-rgb: 59, 42, 29; --t-muted: #7b6450;
    --t-hl-rgb: 120, 80, 40;
    --t-accent: #c4612c; --t-accent-rgb: 196, 97, 44; --t-accent-hi: #e98a4b; --t-accent-ink: #fff;
    --t-panel: rgba(255, 255, 255, .45); --t-toast: #fff6ea; --t-shadow: 0 16px 34px rgba(110, 70, 30, .18);
    --t-hue-dark: 38%;
    --rk-tray: linear-gradient(180deg, #4a3526, #5e4431);
    --rk-face-hi: #fffaf1; --rk-face: #efe2cc; --rk-face-lo: #dac6a5; --rk-edge: #8a6c4c;
    --rk-tray-ink-rgb: 250, 238, 222;
    --rk-lcd: linear-gradient(180deg, #2a2213, #1b1509);
}
#trance-app[data-skin="cold"] {
    --t-bg1: #f3f7fb; --t-bg2: #e4edf6; --t-bg3: #d4e1ee;
    --t-glow1: rgba(70, 140, 220, .16); --t-glow2: rgba(255, 255, 255, .7);
    --t-ink: #1f2b3a; --t-ink-rgb: 31, 43, 58; --t-muted: #5b6b7e;
    --t-hl-rgb: 40, 70, 110;
    --t-accent: #2d6fb5; --t-accent-rgb: 45, 111, 181; --t-accent-hi: #5aa2e6; --t-accent-ink: #fff;
    --t-panel: rgba(255, 255, 255, .5); --t-toast: #f4f8fc; --t-shadow: 0 16px 34px rgba(30, 60, 100, .16);
    --t-hue-dark: 40%;
    --rk-tray: linear-gradient(180deg, #2b3646, #3a475a);
    --rk-face-hi: #ffffff; --rk-face: #e6ebf1; --rk-face-lo: #c8d1dc; --rk-edge: #6d7d92;
    --rk-ink: #1d2733; --rk-led: #48c0ff; --rk-stop: #c62828; --rk-tray-ink-rgb: 230, 238, 248;
    --rk-lcd: linear-gradient(180deg, #0c1a24, #061118); --rk-lcd-ink: #8fe3ff; --rk-lcd-glow: rgba(110, 210, 255, .45);
}

#trance-app *, #trance-app *::before, #trance-app *::after { box-sizing: border-box; }
#trance-app [hidden] { display: none !important; }
#trance-app h2, #trance-app h3 { margin: 0; font-family: Georgia, serif; font-weight: normal; color: var(--t-ink); }
#trance-app h2 { font-size: 1.15rem; }
#trance-app h3 { font-size: 1rem; }
#trance-app h2:hover, #trance-app h3:hover { color: inherit; }
#trance-app button, #trance-app input, #trance-app select, #trance-app textarea { font-family: var(--t-ui); font-size: 15px; }
#trance-app p { margin: 0; }

/* ---------- title and looks ---------- */
.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tr-title { font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.1; }
.tr-badge { font-family: var(--t-ui); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; vertical-align: middle; padding: 2px 8px; margin-left: 6px; border-radius: 99px; background: rgba(var(--t-accent-rgb), .2); color: var(--t-accent); }
.tr-skins { display: flex; gap: 6px; }
.tr-skin { width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer; border: 2px solid rgba(var(--t-ink-rgb), .25); }
.tr-skin[data-skin="gold"] { background: linear-gradient(135deg, #2a1912 50%, #ef9a5a 50%); }
.tr-skin[data-skin="neon"] { background: conic-gradient(#ff5fbf, #7ff3ff, #8b5cff, #ff5fbf); }
.tr-skin[data-skin="warm"] { background: linear-gradient(135deg, #f5e7d0 50%, #c4612c 50%); }
.tr-skin[data-skin="cold"] { background: linear-gradient(135deg, #e4edf6 50%, #2d6fb5 50%); }
.tr-skin[aria-checked="true"] { border-color: var(--t-ink); box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), .5); }

/* ---------- console: keys, display, dials ---------- */
.tr-console {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(170px, 230px);
    gap: 16px; align-items: center;
    padding-bottom: 16px; border-bottom: 1px solid var(--t-line);
}
.tr-deck .i-pause, #tr-play[aria-pressed="true"] .i-play { display: none; }
#tr-play[aria-pressed="true"] .i-pause { display: block; }
.tr-lcd { min-width: 0; display: flex; flex-direction: column; gap: 4px; min-height: 76px; justify-content: center; }
.tr-status { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.tr-lcd-row { display: flex; gap: 10px; align-items: baseline; font-size: .78rem; opacity: .85; }
.tr-lcd-info { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .06em; }
.tr-countdown { font-size: .9rem; opacity: 1; }
.tr-rec-time { color: #ff6b5e; text-shadow: 0 0 6px rgba(255, 80, 60, .6); }
.tr-beats { display: flex; gap: 6px; margin-top: 2px; }
.tr-beats i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .15; transition: opacity .08s; }
.tr-beats i.is-on { opacity: 1; box-shadow: 0 0 8px currentColor; }
.tr-dials { display: flex; flex-direction: column; gap: 3px; }
.tr-dial { display: flex; flex-direction: column; font-family: var(--t-ui); font-size: .76rem; color: var(--t-muted); }
.tr-dial b { color: var(--t-ink); font-weight: 600; }
.tr-dial-row { flex-direction: row; align-items: center; gap: 8px; margin-top: 4px; }
.tr-dial-row select { flex: 1 1 auto; padding: 4px 8px !important; }

/* ---------- banner, presets, mix bar ---------- */
.tr-banner.tr-il-note { flex-direction: column; align-items: flex-start; }
.tr-il-note p { line-height: 1.5; }
.tr-il-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(var(--t-accent-rgb), .12); border: 1px solid rgba(var(--t-accent-rgb), .35); font-family: var(--t-ui); font-size: .92rem; }
.tr-presets { padding: 16px 0 4px; }
.tr-presets h2 { margin-bottom: 10px; }
.tr-presets h3 { margin: 14px 0 8px; color: var(--t-muted); }
.tr-empty-note { padding: 18px; border-radius: 14px; border: 1px dashed rgba(var(--t-ink-rgb), .25); font-family: var(--t-ui); font-size: .92rem; color: var(--t-muted); text-align: center; }
.tr-empty-note strong { color: var(--t-ink); font-weight: 600; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-chip { border: 1px solid var(--t-line); background: var(--t-tile); color: var(--t-ink); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-size: 14px !important; }
.tr-chip:hover { background: var(--t-tile-on); }
.tr-chip[aria-pressed="true"] { background: var(--t-accent); color: var(--t-accent-ink); border-color: var(--t-accent); }
.tr-chips.is-supporter .tr-chip { border-color: rgba(var(--t-accent-rgb), .35); }

.tr-mixbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 0; margin-top: 10px; border-top: 1px solid var(--t-line); }
.tr-seg { display: inline-flex; border: 1px solid var(--t-line); border-radius: 10px; overflow: hidden; }
.tr-seg-btn { border: 0; background: transparent; color: var(--t-muted); padding: 8px 14px; cursor: pointer; }
.tr-seg-btn[aria-pressed="true"] { background: var(--t-accent); color: var(--t-accent-ink); }
.trance.is-together .tr-field.is-cycle { opacity: .4; pointer-events: none; }
.tr-field { display: flex; flex-direction: column; gap: 4px; font-family: var(--t-ui); font-size: .8rem; color: var(--t-muted); }
.tr-lock { font-style: normal; font-size: .8em; }

/* ---------- adding parts ---------- */
.tr-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; padding: 12px; border-radius: 12px; background: var(--t-tile); }
.tr-add select { flex: 1 1 240px; width: auto !important; }

/* ---------- lanes ---------- */
.tr-lanes { display: grid; gap: 10px; }
.tr-lane { --hue: var(--t-accent); --hue-ink: color-mix(in srgb, var(--hue), #000 var(--t-hue-dark)); border-radius: 14px; padding: 10px 12px 8px; background: var(--t-tile); border-left: 3px solid var(--hue); }
.tr-lane-head { display: flex; align-items: center; gap: 10px; }
.tr-lane-head h3 { color: var(--hue-ink); }
.tr-lane-head h3 button { all: unset; cursor: text; border-bottom: 1px dashed transparent; }
.tr-lane-head h3 button:hover { border-bottom-color: currentColor; }
.tr-lane-switch {
    position: relative; flex: 0 0 auto; width: 52px; height: 26px; border-radius: 99px; cursor: pointer; padding: 0;
    border: 1px solid color-mix(in srgb, var(--hue) 60%, transparent);
    background: color-mix(in srgb, var(--hue) 35%, transparent);
    transition: background .15s ease;
}
.tr-lane-switch .tr-knob { position: absolute; top: 3px; left: 28px; width: 18px; height: 18px; border-radius: 50%; background: var(--t-ink); box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: left .15s ease; }
.tr-lane-switch kbd { position: absolute; top: 4px; left: 8px; font-family: var(--t-ui); font-size: 11px; color: var(--t-accent-ink); font-weight: 700; }
#trance-app[data-skin="warm"] .tr-lane-switch kbd, #trance-app[data-skin="cold"] .tr-lane-switch kbd { color: var(--t-ink); }
.tr-lane-switch[aria-pressed="false"] { background: rgba(var(--t-hl-rgb), .06); border-color: var(--t-line); }
.tr-lane-switch[aria-pressed="false"] .tr-knob { left: 4px; background: var(--t-muted); }
.tr-lane-switch[aria-pressed="false"] kbd { left: auto; right: 9px; color: var(--t-muted); }
.tr-lane-switch:active .tr-knob { transform: scale(.9); }
.tr-lane.is-off { opacity: .5; border-left-style: dashed; }
.tr-lane.is-resting { border-left-style: dotted; background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--hue) 7%, transparent) 10px 20px), var(--t-tile); }
.tr-lane.is-resting .tr-part { opacity: .45; filter: saturate(.4); }
.tr-lane-rest { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px; border-radius: 12px; font-family: var(--t-ui); font-size: 12px; font-weight: 600; color: var(--hue-ink); background: color-mix(in srgb, var(--hue) 22%, transparent); border: 1px dashed color-mix(in srgb, var(--hue) 60%, transparent); animation: tr-rest-breathe 2.4s ease-in-out infinite; }
@keyframes tr-rest-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
#trance-app[data-skin="teletext"] .tr-lane.is-resting { background: #000; }
#trance-app[data-skin="teletext"] .tr-lane-rest { background: #00f; color: #ff0; border-color: #ff0; }
.tr-lane.is-resting .tr-lane-info { color: var(--hue-ink); }
.tr-lane.is-resting .tr-lane-switch { background: color-mix(in srgb, var(--hue) 15%, transparent); }
/* a lane waiting to come in or drop out at the next phrase */
.tr-lane.is-pending { animation: tr-await 1.1s ease-in-out infinite; }
.tr-lane.is-pending .tr-lane-info { color: var(--hue-ink); font-weight: 600; }
.tr-lane.is-pending .tr-lane-switch .tr-knob { animation: tr-blink .55s ease-in-out infinite alternate; }
@keyframes tr-await { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 transparent; } 50% { opacity: .55; box-shadow: 0 0 18px -4px var(--hue); } }
@keyframes tr-blink { to { opacity: .35; } }
.tr-lane.is-custom { border-left-width: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--hue) 9%, transparent), var(--t-tile)); }
.tr-lane-empty { font-family: var(--t-ui); font-size: .82rem; color: var(--t-muted); padding: 6px 0 2px; }
.tr-lanes-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-top: 8px; }
.tr-lanes-foot .tr-play-hint { flex: 1 1 280px; }
.tr-play-hint kbd { font-family: var(--t-ui); font-size: .75rem; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--t-line); background: rgba(var(--t-hl-rgb), .06); }
.tr-lane-info { flex: 1 1 auto; font-family: var(--t-ui); font-size: .78rem; color: var(--t-muted); }
.tr-lane-progress { height: 2px; margin: 6px 0 4px; background: rgba(var(--t-ink-rgb), .08); border-radius: 2px; overflow: hidden; }
.tr-lane-progress i { display: block; height: 100%; width: 0; background: var(--hue); transition: width .3s linear; }

.tr-part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 170px) auto; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid rgba(var(--t-ink-rgb), .05); }
.tr-part:first-of-type { border-top: 0; }
.tr-part-name { background: none; border: 0; padding: 2px 0; margin: 0; color: var(--t-muted); cursor: pointer; text-align: left; font-size: 14.5px !important; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tr-part-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-part-name::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--t-muted); }
.tr-part-name:hover span { text-decoration: underline; text-decoration-color: var(--hue); text-underline-offset: 3px; }
.tr-part.is-on .tr-part-name { color: var(--t-ink); }
.tr-part.is-on .tr-part-name::before { background: var(--hue); border-color: var(--hue); box-shadow: 0 0 8px var(--hue); }
.trance.is-playing .tr-part.is-on .tr-part-name::before { animation: tr-pulse 1s ease-in-out infinite; }
@keyframes tr-pulse { 50% { box-shadow: 0 0 2px var(--hue); } }
.tr-part.is-waiting .tr-part-name { opacity: .75; }
.tr-part.is-muted .tr-part-name { text-decoration: line-through; opacity: .5; }
.tr-part-tools { display: flex; gap: 4px; }
.tr-icon { width: 30px; height: 28px; border-radius: 8px; border: 1px solid var(--t-line); background: transparent; color: var(--t-muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.tr-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tr-icon:hover { color: var(--t-ink); border-color: rgba(var(--t-ink-rgb), .3); }
.tr-icon[aria-pressed="true"] { color: var(--t-ink); background: rgba(var(--t-accent-rgb), .2); border-color: rgba(var(--t-accent-rgb), .55); }
.tr-icon.is-kill:hover { color: var(--t-stop); border-color: rgba(214, 58, 47, .5); }
.tr-skip { padding: 2px 8px !important; font-size: 12px !important; }

/* ---------- a part's editor ---------- */
.tr-detail { grid-column: 1 / -1; margin: 6px 0 8px; padding: 10px 12px 12px; border-radius: 12px; background: var(--t-panel); border: 1px solid color-mix(in srgb, var(--hue) 40%, transparent); }
.tr-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-family: var(--t-ui); font-size: .85rem; color: var(--t-muted); }
.tr-detail-head strong { color: var(--t-ink); font-weight: 600; }
.tr-done { padding: 6px 16px !important; }
.tr-detail-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 10px; }
.tr-detail-ctl .tr-field { min-width: 110px; }
.tr-gridhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--t-ui); font-size: .8rem; color: var(--t-muted); margin-bottom: 6px; }
.tr-gridhead select { width: auto !important; padding: 4px 8px !important; }
.tr-grid { display: grid; grid-template-columns: repeat(var(--cols, 16), minmax(0, 1fr)); gap: 3px; }
.tr-cell { aspect-ratio: 1; min-width: 0; border-radius: 4px; border: 1px solid rgba(var(--t-ink-rgb), .08); background: rgba(var(--t-ink-rgb), .04); color: var(--t-ink); font-size: 11px !important; padding: 0; line-height: 1; cursor: default; }
.tr-grid.is-editable .tr-cell { cursor: pointer; }
.tr-grid.is-editable .tr-cell:hover { border-color: var(--hue); }
.tr-cell.is-beat { background: rgba(var(--t-ink-rgb), .07); }
.tr-cell.is-bar { border-left-color: rgba(var(--t-ink-rgb), .35); }
.tr-cell:not([data-v="0"]) { background: color-mix(in srgb, var(--hue) 55%, transparent); color: var(--t-accent-ink); font-weight: 700; }
.tr-cell[data-v="2"] { background: var(--hue); }
.tr-cell[data-v="3"] { background: color-mix(in srgb, var(--hue) 28%, transparent); }
.tr-cell.is-head { outline: 2px solid var(--t-accent-hi); outline-offset: -1px; }
.tr-cell:disabled { opacity: 1; }

/* ---------- sliders ---------- */
#trance-app input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 2px 0 0; cursor: pointer; --fill: var(--hue, var(--t-accent)); }
#trance-app input[type="range"]:focus { outline: none; }
#trance-app input[type="range"]:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; border-radius: 6px; }
#trance-app input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--fill) var(--value, 0%), rgba(var(--t-hl-rgb), .13) var(--value, 0%)); }
#trance-app input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(var(--t-hl-rgb), .13); }
#trance-app input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--fill); }
#trance-app input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--t-ink); border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
#trance-app input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--t-ink); border: 0; }

/* ---------- buttons, fields, panels ---------- */
.tr-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--t-line); background: rgba(var(--t-hl-rgb), .06); color: var(--t-ink) !important; text-decoration: none !important; cursor: pointer; font-family: var(--t-ui); font-size: 14px !important; line-height: 1.2; white-space: nowrap; }
.tr-btn:hover { background: rgba(var(--t-hl-rgb), .12); }
.tr-btn.is-accent { background: var(--t-accent); color: var(--t-accent-ink) !important; border-color: var(--t-accent); }
.tr-btn.is-quiet { background: none; border-color: transparent; color: var(--t-muted) !important; padding: 6px 8px; }
.tr-btn.is-quiet:hover { color: var(--t-ink) !important; }
.tr-btn[aria-expanded="true"] { background: rgba(var(--t-hl-rgb), .14); }
#trance-app input[type="text"], #trance-app select, #trance-app textarea { width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--t-line); background: rgba(var(--t-hl-rgb), .06); color: var(--t-ink); }
#trance-app select option, #trance-app select optgroup { color: #222; }
#trance-app textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; margin: 8px 0; resize: vertical; }
.tr-note { font-family: var(--t-ui); font-size: .82rem; color: var(--t-muted); }
.tr-help { font-family: var(--t-ui); font-size: .88rem; color: var(--t-muted); margin-bottom: 10px !important; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 4px; margin-top: 14px; border-top: 1px solid var(--t-line); }
.tr-panel { margin-top: 12px; padding: 16px; border-radius: 14px; background: var(--t-panel); border: 1px solid var(--t-line); }
.tr-panel > h2 { margin-bottom: 12px; }
.tr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.tr-row input[type="text"], .tr-row select { flex: 1 1 200px; width: auto !important; min-width: 0; }
.tr-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; margin: 10px 0; }
.tr-list { list-style: none; margin: 0; padding: 0; }
.tr-list li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--t-line); font-family: var(--t-ui); font-size: .9rem; }
.tr-list li:last-child { border-bottom: 0; }
.tr-list .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-list .empty { color: var(--t-muted); }
.tr-list li.is-current { color: var(--t-accent); }
.tr-list li.is-current .name::after { content: "\00a0\00a0\25B6\00a0now"; font-size: .8em; }
.tr-embed { margin-top: 12px; font-family: var(--t-ui); font-size: .88rem; color: var(--t-muted); }
.tr-embed summary { cursor: pointer; color: var(--t-ink); }
.tr-embed .tr-note { margin-top: 6px; }
.tr-mini-preview { display: block; width: 100%; height: 132px; margin-top: 10px; border: 0; border-radius: 14px; background: transparent; }
.tr-switch { display: flex; gap: 10px; align-items: flex-start; font-family: var(--t-ui); font-size: .88rem; color: var(--t-muted); cursor: pointer; margin-bottom: 8px; }
.tr-switch input { margin-top: 3px; accent-color: var(--t-accent); width: 18px; height: 18px; flex: 0 0 auto; }
.tr-switch strong, .tr-note strong { color: var(--t-ink); }
.tr-locked { margin-top: 8px !important; }
.tr-teaser { border-color: rgba(var(--t-accent-rgb), .3); background: linear-gradient(160deg, rgba(var(--t-accent-rgb), .08), rgba(0,0,0,.15)); }
.tr-teaser ul { margin: 0 0 14px; padding-left: 1.2em; font-family: var(--t-ui); font-size: .9rem; color: var(--t-muted); }
.tr-teaser li { margin: 4px 0; }
.tr-teaser strong { color: var(--t-ink); font-weight: 600; }
#tr-meta { text-align: center; margin-top: 14px; font-family: var(--t-ui); font-size: .78rem; color: var(--t-muted); opacity: .75; }
#tr-meta a { color: inherit; text-decoration: none; margin-right: 6px; }
#tr-version { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tr-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 14px 26px; border-radius: 22px; background: var(--t-toast); color: var(--t-ink); border: 1px solid rgba(var(--t-accent-rgb), .5); font-family: var(--t-ui); font-size: 17px; line-height: 1.4; width: max-content; max-width: min(680px, calc(100vw - 32px)); box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 10000; text-align: center; }
.tr-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
/* questions in the app's own style (they stay inside fullscreen) */
.tr-dialog { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.tr-dialog[hidden] { display: none; }
.tr-dialog-box { width: min(460px, 100%); padding: 22px 26px; border-radius: 22px; background: var(--t-toast); color: var(--t-ink); border: 1px solid rgba(var(--t-accent-rgb), .5); box-shadow: 0 16px 40px rgba(0,0,0,.4); font-family: var(--t-ui); }
.tr-dialog-box h3 { margin: 0 0 8px; font-size: 19px; }
.tr-dialog-box p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
.tr-dialog-box p:empty { display: none; }
.tr-dialog-box input[type="text"] { margin-bottom: 14px; font-size: 16px; }
.tr-dialog-btns { display: flex; gap: 10px; justify-content: flex-end; }
#trance-app[data-skin="teletext"] .tr-dialog-box { background: #00f; color: #ff0; border: 0; border-radius: 0; }
.trance.is-embed { margin: 0 auto; border-radius: 16px; }

@media (max-width: 760px) {
    .tr-console { grid-template-columns: auto minmax(0, 1fr); }
    .tr-dials { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
    .tr-dial-row { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    #trance-app { padding: 14px 12px 12px; border-radius: 16px; margin: 1rem 0; }
    .tr-console { grid-template-columns: 1fr; gap: 12px; }
    .tr-deck { justify-self: center; }
    .rk-key { min-width: 56px; }
    .tr-part { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
    .tr-part > input[type="range"] { display: none; }
    .tr-icon { width: 28px; }
    .tr-grid3 { grid-template-columns: 1fr; }
    .tr-grid { grid-template-columns: repeat(min(var(--cols, 16), 8), minmax(0, 1fr)); }
    .tr-actions .tr-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .trance.is-playing .tr-part.is-on .tr-part-name::before, .tr-lane.is-pending, .tr-lane.is-pending .tr-lane-switch .tr-knob { animation: none; }
    .tr-lane.is-pending { outline: 2px dashed var(--hue); outline-offset: 2px; }
}

/* ==================================================================
   2.6: the conductor, queued changes, lane +, sleep
   Anything waiting for the music wears a dashed outline and a badge
   with its countdown; changes that happen straight away wear nothing.
================================================================== */
#trance-app { --t-wait: #ffc861; --t-wait-rgb: 255, 200, 97; --t-dj: #b99bff; --t-dj-rgb: 185, 155, 255; }
#trance-app[data-skin="warm"], #trance-app[data-skin="cold"] { --t-wait: #b76b00; --t-wait-rgb: 183, 107, 0; --t-dj: #6b45c9; --t-dj-rgb: 107, 69, 201; }

/* the conductor strip */
.tr-conductor { margin: 0 0 12px; padding: 12px 14px 10px; border-radius: 14px; background: var(--t-panel); border: 1px solid var(--t-line); font-family: var(--t-ui); }
.tr-cond-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.tr-phrase { --n: 16; position: relative; flex: 0 0 auto; width: 170px; height: 12px; border-radius: 3px; overflow: hidden;
    background: rgba(var(--t-ink-rgb), .1); box-shadow: inset 2px 0 0 rgba(var(--t-ink-rgb), .45); }
.tr-phrase b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--t-accent); }
/* a tick at every bar line (every 4 bars when the phrase is long) */
.tr-phrase::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 1px), rgba(0,0,0,.45) calc(100% / var(--n) - 1px) calc(100% / var(--n))); }
.tr-cond-text { font-size: .9rem; color: var(--t-ink); font-variant-numeric: tabular-nums; }
.tr-cond-next { flex: 1 1 220px; font-size: .8rem; color: var(--t-muted); text-align: right; }
.tr-ahead { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; margin: 10px 0 4px; }
.tr-ahead-bar { position: relative; height: 26px; border-radius: 3px; background: rgba(var(--t-ink-rgb), .05); overflow: hidden; }
.tr-ahead-bar.is-phrase { box-shadow: inset 2px 0 0 rgba(var(--t-ink-rgb), .4); }
.tr-ahead-bar.is-past { opacity: .45; }
.tr-ahead-bar.is-now { background: rgba(var(--t-accent-rgb), .12); }
.tr-ahead-bar b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(var(--t-accent-rgb), .25); }
.tr-ahead-bar em { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; font-style: normal; padding: 2px; }
.tr-ahead i { display: inline-grid; place-items: center; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 4px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1; color: #1a1206; }
.tr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.mk-q, .lg-q { background: var(--t-wait); box-shadow: 0 0 6px var(--t-wait); }
.mk-dj, .lg-dj { background: var(--t-dj); box-shadow: 0 0 6px var(--t-dj); color: #fff !important; }
.mk-stop, .lg-stop { background: var(--t-stop); }
.lg-phrase { width: 3px !important; height: 12px !important; border-radius: 1px !important; background: rgba(var(--t-ink-rgb), .45); }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .72rem; color: var(--t-muted); }
.tr-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tr-cond-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--t-line); }
.tr-cond-ctl .tr-field select { width: auto !important; }
.tr-dj { font-weight: 700; letter-spacing: .1em; }
.tr-dj[aria-pressed="true"] { background: var(--t-dj); border-color: var(--t-dj); color: #fff !important; box-shadow: 0 0 12px rgba(var(--t-dj-rgb), .55); }

/* queued: waiting for the bar line */
.tr-q { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font-family: var(--t-ui); font-size: .72rem; font-weight: 600; white-space: nowrap;
    color: var(--t-wait); background: rgba(var(--t-wait-rgb), .12); border: 1px dashed rgba(var(--t-wait-rgb), .8); }
.tr-q::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
    background: conic-gradient(var(--t-wait) calc(var(--k, 0) * 360deg), rgba(var(--t-wait-rgb), .2) 0); }
button.tr-q { cursor: pointer; font: inherit; font-family: var(--t-ui); font-size: .72rem; font-weight: 600; appearance: none; -webkit-appearance: none; }
button.tr-q:hover, button.tr-q:focus-visible { filter: brightness(1.15); text-decoration: line-through; }
.tr-lane-rest { cursor: pointer; appearance: none; -webkit-appearance: none; }
.tr-lane-rest:hover, .tr-lane-rest:focus-visible { animation: none; text-decoration: line-through; }
.tr-ahead-bar.has-dj { cursor: pointer; }
.tr-ahead-bar.has-dj:hover .mk-dj { box-shadow: 0 0 10px var(--t-dj), 0 0 0 2px rgba(var(--t-dj-rgb), .6); }
.tr-q.by-dj { color: var(--t-dj); background: rgba(var(--t-dj-rgb), .12); border-color: rgba(var(--t-dj-rgb), .8); }
.tr-q.by-dj::before { background: conic-gradient(var(--t-dj) calc(var(--k, 0) * 360deg), rgba(var(--t-dj-rgb), .2) 0); }
.tr-q-sample { color: var(--t-wait); border: 1px dashed rgba(var(--t-wait-rgb), .8); border-radius: 99px; padding: 0 6px; white-space: nowrap; }
.tr-part.is-queued { outline: 1.5px dashed rgba(var(--t-wait-rgb), .75); outline-offset: 1px; border-radius: 8px; animation: tr-await 1.1s ease-in-out infinite; }
.tr-part.is-queued.by-dj { outline-color: rgba(var(--t-dj-rgb), .8); }
.tr-lane.is-pending { outline: 1.5px dashed rgba(var(--t-wait-rgb), .75); outline-offset: 2px; }
.tr-lane.is-pending.by-dj { outline-color: rgba(var(--t-dj-rgb), .8); }
.tr-part.is-ghost { grid-template-columns: minmax(0, 1fr) auto auto; opacity: .85; }
.tr-part.is-ghost .tr-part-name { cursor: default; font-style: italic; }
.tr-part.is-ghost .tr-part-name::before { border-style: dashed; border-color: var(--t-wait); }
.tr-part.is-ghost.by-dj .tr-part-name::before { border-color: var(--t-dj); }
.tr-part { grid-template-columns: minmax(0, 1fr) auto minmax(80px, 170px) auto; }
.tr-part > .tr-q[hidden] { display: none !important; }
.tr-part.is-muted .tr-part-name::before { border-style: dotted; }
.tr-lane.is-off { opacity: .6; }
.tr-lane.is-off .tr-lane-info::before { content: "\263E  "; }
.tr-icon.is-mute[aria-pressed="true"] { color: var(--t-ink); background: rgba(var(--t-ink-rgb), .12); }
.tr-icon.is-mute svg, .tr-icon.is-next svg { fill: none; }
.tr-lane-plus { color: var(--t-ink) !important; border-color: color-mix(in srgb, var(--hue) 60%, transparent) !important; background: color-mix(in srgb, var(--hue) 14%, transparent) !important; }
.tr-lane-plus[aria-expanded="true"] { background: var(--hue) !important; color: var(--t-accent-ink) !important; }
.tr-skip { width: 30px !important; padding: 0 !important; }
.tr-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--hue) 10%, transparent); border: 1px solid color-mix(in srgb, var(--hue) 35%, transparent); }
.tr-picker select { flex: 1 1 220px; width: auto !important; }
.tr-empty-note p { margin-bottom: 12px !important; }
.tr-empty-lanes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tr-empty-lanes .tr-btn { border-color: color-mix(in srgb, var(--hue) 55%, transparent); }
.tr-lane-add { width: auto !important; flex: 0 0 auto; }

/* pausing and sleeping keys */
#tr-play.is-pausing .rk-led, #tr-sleep[aria-pressed="true"] .rk-led { animation: rk-blink .7s steps(2, start) infinite; background: var(--rk-led); box-shadow: 0 0 7px var(--rk-led); }
.trance.is-stopping .tr-lcd { box-shadow: inset 0 2px 9px rgba(0,0,0,.75), 0 0 0 1px rgba(var(--t-wait-rgb), .5); }

@media (max-width: 560px) {
    .tr-part { grid-template-columns: minmax(0, 1fr) auto auto; }
    .tr-ahead { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .tr-ahead-bar:nth-child(n+9) { display: none; }
    .tr-cond-next { text-align: left; }
    .tr-phrase { width: 130px; }
    .tr-lane-head { flex-wrap: wrap; }
    .tr-lane-info { flex-basis: 100%; order: 9; }
}
@media (prefers-reduced-motion: reduce) {
    .tr-part.is-queued, #tr-play.is-pausing .rk-led, #tr-sleep[aria-pressed="true"] .rk-led { animation: none; }
}
@media (max-width: 560px) { .tr-lane-head h3 { flex: 1 1 auto; } }

/* ==================================================================
   2.7: three steps (choose a mix, how it plays, the lanes) and breaks
================================================================== */
.tr-step { padding: 16px 0 6px; border-top: 1px solid var(--t-line); scroll-margin-top: 12px; border-radius: 14px; transition: box-shadow .6s ease, background .6s ease; }
.tr-step.tr-presets { border-top: 0; padding-top: 4px; }
.tr-step-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px !important; font-size: 1.2rem !important; }
.tr-step-h small { font-family: var(--t-ui); font-size: .8rem; color: var(--t-muted); }
.tr-step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--t-ui); font-size: .85rem; font-weight: 700;
    color: var(--t-accent-ink); background: var(--t-accent); box-shadow: 0 0 10px rgba(var(--t-accent-rgb), .45); transform: translateY(-2px); }
.tr-step.is-guided { box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), .55), 0 0 30px rgba(var(--t-accent-rgb), .25); background: rgba(var(--t-accent-rgb), .05); }
.tr-chips-inline { display: contents; }
.tr-chip.is-new { border-style: dashed; border-color: rgba(var(--t-accent-rgb), .6); color: var(--t-accent-hi); }
.tr-how .tr-console { padding-bottom: 6px; border-bottom: 0; }
.tr-how .tr-mixbar { border-top: 0; margin-top: 0; }
.trance.is-ready #tr-play { animation: tr-ready 1.4s ease-in-out infinite; }
.trance.is-ready #tr-play .rk-led { background: var(--rk-led); box-shadow: 0 0 8px var(--rk-led); }
@keyframes tr-ready { 50% { box-shadow: 0 5px 0 var(--rk-edge), 0 7px 10px rgba(0,0,0,.45), 0 0 22px rgba(var(--t-accent-rgb), .8); } }
.tr-deck svg path[d^="M4 12h3"] { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* breaks */
.lg-break { background: repeating-linear-gradient(135deg, rgba(var(--t-ink-rgb), .55) 0 2px, transparent 2px 4px) !important; width: 14px !important; }
.tr-ahead-bar.is-break { background: repeating-linear-gradient(135deg, rgba(var(--t-ink-rgb), .22) 0 3px, rgba(var(--t-ink-rgb), .04) 3px 7px); }
.tr-lane.is-break-soon .tr-lane-head h3::after { content: "  \2193 break"; font-family: var(--t-ui); font-size: .72rem; color: var(--t-muted); }
.tr-lane.is-break { background: repeating-linear-gradient(135deg, rgba(var(--t-ink-rgb), .06) 0 8px, transparent 8px 16px), var(--t-tile); }
.tr-lane.is-break .tr-part { opacity: .3; filter: saturate(.3); transition: opacity .15s ease; }
.tr-lane.is-break .tr-lane-info { color: var(--t-ink); font-weight: 600; letter-spacing: .04em; }
.trance.is-breaking .tr-lanes { position: relative; }
.trance.is-breaking .tr-lanes::before { content: ""; position: absolute; inset: -6px; border-radius: 16px; pointer-events: none; z-index: 1;
    background: linear-gradient(100deg, transparent 30%, rgba(var(--t-accent-rgb), .12) 50%, transparent 70%); background-size: 250% 100%; animation: tr-sweep 1.6s linear infinite; }
@keyframes tr-sweep { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.trance.is-breaking .tr-lcd { animation: tr-lcdflash .5s steps(2, start) infinite; }
@keyframes tr-lcdflash { 50% { filter: brightness(1.45); } }
.trance.is-breaking .tr-lane:not(.is-break):not(.is-off) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--hue) 70%, transparent), 0 0 22px -6px var(--hue); }
#tr-break[aria-pressed="true"] .rk-led { background: var(--rk-led); box-shadow: 0 0 7px var(--rk-led); }
.trance.is-breaking #tr-break .rk-led { animation: rk-blink .45s steps(2, start) infinite; }

@media (max-width: 560px) {
    .tr-deck { flex-wrap: wrap; justify-content: center; }
    .tr-step-h { font-size: 1.1rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    .trance.is-ready #tr-play, .trance.is-breaking .tr-lanes::before, .trance.is-breaking .tr-lcd, .trance.is-breaking #tr-break .rk-led { animation: none; }
    .tr-step { transition: none; }
}

/* ==================================================================
   2.8: the mix in the instrument, live changes, the sequence
================================================================== */
.tr-now { margin: -4px 0 12px; padding: 10px 14px; border-radius: 12px; background: rgba(var(--t-accent-rgb), .08); border: 1px solid rgba(var(--t-accent-rgb), .3); font-family: var(--t-ui); }
.tr-now-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tr-now-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--t-muted); }
.tr-now-name { font-family: Georgia, serif; font-weight: normal; font-size: 1.15rem; color: var(--t-ink); }
.tr-now-seq { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: rgba(var(--t-ink-rgb), .1); color: var(--t-ink); }
.tr-seq-now { margin-left: auto; }
.tr-now-state { margin-top: 2px; }
.tr-now-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(var(--t-wait-rgb), .6); font-size: .84rem; color: var(--t-wait); }
.tr-now-live span { flex: 1 1 260px; }
.trance.has-live .tr-now { border-color: rgba(var(--t-wait-rgb), .6); }
.tr-chips.is-mine .tr-chip { border-color: rgba(var(--t-ink-rgb), .3); }
.tr-chips.is-mine .tr-chip::before { content: "\2605  "; color: var(--t-accent); }
.tr-seq-name { all: unset; flex: 1 1 auto; min-width: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-seq-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.tr-seq-name:focus-visible { outline: 2px solid var(--t-accent); border-radius: 4px; }
@media (max-width: 560px) { .tr-seq-now { margin-left: 0; } }

/* ================= 2.9: tabs, sequence cards, this mix in the sequence ================= */
.tr-tabs-h { align-items: center; }
.tr-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--t-tile); border: 1px solid var(--t-line); }
.tr-tab { border: 0; background: transparent; color: var(--t-muted); font: inherit; font-size: 1rem; padding: 6px 14px; border-radius: 9px; cursor: pointer; }
.tr-tab:hover { color: var(--t-ink); }
.tr-tab[aria-selected="true"] { background: var(--t-accent); color: var(--t-accent-ink); }
.tr-tab:focus-visible { outline: 2px solid var(--t-accent-hi, var(--t-accent)); outline-offset: 2px; }
.tr-tab-n { font-family: var(--t-ui); font-size: .8em; opacity: .8; }


.tr-seq-track { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 14px 4px 16px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tr-card { position: relative; flex: 0 0 210px; display: flex; flex-direction: column; border-radius: 16px; background: var(--t-tile); border: 1px solid var(--t-line);
    scroll-snap-align: start; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tr-card-main { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 10px; cursor: pointer; flex: 1 1 auto; border-radius: 16px 16px 0 0; }
.tr-card-main:focus-visible { outline: 2px solid var(--t-accent); }
.tr-card:hover { border-color: rgba(var(--t-accent-rgb), .5); }
.tr-card-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.tr-card-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-family: var(--t-ui); font-size: .75rem; font-weight: 700;
    background: rgba(var(--t-ink-rgb), .1); color: var(--t-ink); }
.tr-card-tag { white-space: nowrap; font-family: var(--t-ui); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: rgba(var(--t-ink-rgb), .1); color: var(--t-muted); }
.tr-card-tag.is-now { background: var(--t-accent); color: var(--t-accent-ink); font-weight: 700; }
.tr-card-name { font-size: 1.05rem; line-height: 1.25; color: var(--t-ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tr-card-lanes { display: flex; gap: 4px; min-height: 10px; }
.tr-card-lanes i { width: 10px; height: 10px; border-radius: 50%; background: var(--h); box-shadow: 0 0 0 2px rgba(0, 0, 0, .12); }
.tr-card-meta { font-family: var(--t-ui); font-size: .76rem; color: var(--t-muted); }
.tr-card-prog { position: relative; display: flex; gap: 2px; height: 6px; margin-top: 4px; border-radius: 3px; overflow: hidden; background: rgba(var(--t-ink-rgb), .08); }
.tr-card-prog b { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--t-accent), var(--t-accent-hi, var(--t-accent))); transition: width .4s linear; }
.tr-card-prog em { position: relative; flex: 1; border-right: 2px solid rgba(0, 0, 0, .25); }
.tr-card-prog em:last-child { border-right: 0; }
.tr-card-tools { display: flex; justify-content: flex-end; gap: 2px; padding: 0 8px 8px; }
.tr-card-tool { border: 0; background: transparent; color: var(--t-muted); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tr-card-tool:hover { background: rgba(var(--t-ink-rgb), .1); color: var(--t-ink); }

.tr-card.is-now { border-color: var(--t-accent); background: rgba(var(--t-accent-rgb), .12);
    box-shadow: 0 0 0 1px var(--t-accent), 0 10px 28px rgba(var(--t-accent-rgb), .28); transform: translateY(-3px); }
#trance-app.is-playing .tr-card.is-now { animation: tr-card-glow 2.4s ease-in-out infinite; }
@keyframes tr-card-glow { 50% { box-shadow: 0 0 0 1px var(--t-accent), 0 12px 36px rgba(var(--t-accent-rgb), .45); } }
.tr-card.is-next { border-style: dashed; border-color: rgba(var(--t-accent-rgb), .55); }
.tr-card.is-mine .tr-card-name { color: var(--t-ink); }
.tr-card.is-missing { opacity: .55; }
.tr-card.is-missing .tr-card-name { text-decoration: line-through; }
.tr-card.is-add { flex-basis: 200px; gap: 10px; padding: 14px; justify-content: center; border-style: dashed; background: transparent; margin-left: 12px; }
.tr-card.is-add select { width: 100% !important; }
.tr-card.is-add .tr-card-name { color: var(--t-muted); }

.tr-card-link { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-family: var(--t-ui); font-size: .7rem; color: var(--t-muted); text-align: center; }
.tr-link-arrow { position: relative; width: 100%; height: 14px; }
.tr-link-arrow::before { content: ""; position: absolute; left: 6px; right: 10px; top: 6px; height: 2px; background: rgba(var(--t-ink-rgb), .3); }
.tr-link-arrow::after { content: ""; position: absolute; right: 6px; top: 2px; border: 5px solid transparent; border-left: 7px solid rgba(var(--t-ink-rgb), .4); border-right: 0; }
.tr-card-link.is-blend .tr-link-arrow::before { height: 10px; top: 2px; clip-path: polygon(0 0, 100% 40%, 100% 60%, 0 100%); background: linear-gradient(90deg, rgba(var(--t-accent-rgb), .7), rgba(var(--t-accent-rgb), .15)); }
.tr-card-link.is-cut .tr-link-arrow::before { background: repeating-linear-gradient(90deg, rgba(var(--t-ink-rgb), .4) 0 4px, transparent 4px 7px); }
.tr-card-link.is-loop { color: var(--t-accent); }

.tr-seq-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--t-line); }
@media (max-width: 560px) {
    .tr-card { flex-basis: 180px; }
    .tr-card-link { flex-basis: 44px; }
    .tr-tab { padding: 6px 10px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { .tr-card, #trance-app.is-playing .tr-card.is-now { animation: none; transition: none; } }


/* ================= 2.10: tiles, four tabs, my mixes, card settings, the sound ================= */
.tr-lead { font-family: var(--t-ui); font-size: .95rem; color: var(--t-muted); margin: -2px 0 14px !important; }
.tr-tiles-h { font-family: var(--t-ui) !important; font-size: .72rem !important; letter-spacing: .14em; text-transform: uppercase; color: var(--t-muted); margin: 18px 0 10px !important; font-weight: 700; }
.tr-step-h + .tr-lead + .tr-tiles-h, .tr-step-h + .tr-tiles-h { margin-top: 4px !important; }
.tr-chips.is-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.tr-tile { display: flex !important; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; border-radius: 14px !important; padding: 12px 14px !important; min-height: 84px; line-height: 1.2; }
.tr-tile-name { font-size: 15px; color: inherit; }
.tr-tile-dots { display: flex; flex-wrap: wrap; gap: 4px; min-height: 9px; }
.tr-tile-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--h); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .15); }
.tr-tile-meta { margin-top: auto; font-family: var(--t-ui); font-size: 12px; color: var(--t-muted); }
.tr-tile[aria-pressed="true"] .tr-tile-meta { color: inherit; opacity: .85; }
.tr-tile.is-new { justify-content: center; border-style: dashed !important; border-color: rgba(var(--t-accent-rgb), .6) !important; color: var(--t-accent); }
.tr-tile.is-new .tr-tile-name { font-size: 16px; font-weight: 600; }
.tr-chips.is-mine .tr-tile::before { content: none; }
.trance.is-unchosen .tr-presets { border-top: 0; }

.tr-now-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tr-now-btns .tr-seq-now { margin-left: 0; }
.tr-now .tr-panel { margin-top: 10px; background: transparent; }
.tr-now .tr-panel h3 { margin: 0 0 8px; font-size: 1rem; }
@media (max-width: 560px) { .tr-now-btns { margin-left: 0; } }

.tr-tabs { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 560px) { .tr-tabs-h { align-items: flex-start; } .tr-tabs { flex: 1 1 auto; } .tr-tab { flex: 1 1 40%; } }

.tr-mine .tr-list li { padding: 10px 0; flex-wrap: wrap; gap: 8px 12px; }
.tr-mine-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tr-mine-main .name { font-family: Georgia, serif; font-size: 1.05rem; color: var(--t-ink); white-space: normal; }
.tr-list li.is-current .name::after { content: none; }
.tr-mine-cur { font-family: var(--t-ui); font-style: normal; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 1px 8px; border-radius: 99px; background: var(--t-accent); color: var(--t-accent-ink); vertical-align: 2px; }
.tr-mine-meta { font-size: .8rem; color: var(--t-muted); }
.tr-mine-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-settings h3 { margin: 4px 0 6px; font-size: 1rem; }

.tr-card-set { display: grid; gap: 6px; padding: 0 14px 6px; }
.tr-card-field { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; font-family: var(--t-ui); font-size: .72rem; color: var(--t-muted); }
.tr-card-field select { width: 100% !important; min-width: 0; padding: 4px 6px !important; font-size: .78rem !important; }
.tr-card { flex-basis: 228px; }

.tr-lane-dj { color: var(--t-dj) !important; border-color: rgba(var(--t-dj-rgb), .5) !important; }
.tr-lane-dj:hover { background: rgba(var(--t-dj-rgb), .15) !important; }
.tr-lane-dj svg { fill: currentColor; stroke: none !important; }
.tr-dj-pick { border-color: rgba(var(--t-dj-rgb), .6) !important; color: var(--t-dj) !important; }

/* the sound */
.tr-fx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tr-fx-box { padding: 12px 14px; border-radius: 14px; background: var(--t-tile); border: 1px solid var(--t-line); display: flex; flex-direction: column; gap: 8px; }
.tr-fx-box h3 { margin: 0 !important; font-family: var(--t-ui) !important; font-size: .72rem !important; letter-spacing: .14em; text-transform: uppercase; color: var(--t-accent); font-weight: 700; }
.tr-fx-knob { display: flex; flex-direction: column; gap: 2px; font-family: var(--t-ui); font-size: .8rem; color: var(--t-muted); }
.tr-fx-knob b { color: var(--t-ink); font-weight: 600; }
.tr-fx-knob select { width: 100% !important; }
.tr-fx-scale { display: flex; justify-content: space-between; font-family: var(--t-ui); font-size: .66rem; color: var(--t-muted); margin-top: -6px; }
#tr-fx-filter { --fill: rgba(var(--t-hl-rgb), .13); }
.tr-fx-box.is-locked, .tr-fx-pads.is-locked .tr-pad { opacity: .55; }
.tr-fx-box.is-locked input, .tr-fx-box.is-locked select { cursor: not-allowed; }
.tr-fx-pads-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 18px 0 10px; }
.tr-fx-pads-h h3 { margin: 0 !important; font-family: var(--t-ui) !important; font-size: .72rem !important; letter-spacing: .14em; text-transform: uppercase; color: var(--t-accent); font-weight: 700; }
.tr-fx-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tr-pad { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; min-height: 76px; padding: 10px 12px; border-radius: 14px;
    border: 1px solid rgba(var(--t-accent-rgb), .35); cursor: pointer; text-align: left; color: var(--t-ink);
    background: linear-gradient(160deg, rgba(var(--t-accent-rgb), .18), rgba(var(--t-accent-rgb), .04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 4px 12px rgba(0, 0, 0, .18);
    transition: transform .08s, box-shadow .2s; }
.tr-pad b { font-family: var(--t-ui); font-size: .95rem; font-weight: 700; }
.tr-pad small { font-family: var(--t-ui); font-size: .72rem; color: var(--t-muted); }
.tr-pad:hover { border-color: var(--t-accent); }
.tr-pad:active { transform: translateY(2px) scale(.98); }
.tr-pad.is-hit { animation: tr-pad-hit .7s ease-out; }
@keyframes tr-pad-hit { 0% { box-shadow: 0 0 0 0 rgba(var(--t-accent-rgb), .8); background: rgba(var(--t-accent-rgb), .55); } 100% { box-shadow: 0 0 0 14px rgba(var(--t-accent-rgb), 0); } }
.tr-fx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.tr-fx.is-shaped #tr-fx-reset { color: var(--t-accent); }
@media (max-width: 560px) { .tr-fx-pads { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tr-pad.is-hit { animation: none; } }

/* ==================================================================
   Fullscreen (desktop only)
   Mixes run in a strip across the top; the deck (how it plays and the
   sound) scrolls on the left, the lanes and sequencer on the right.
   trance-app.js gathers the deck sections into .tr-fs-deck on the way in
   and puts them back on the way out, so the page itself never changes.
================================================================== */
.tr-top-r { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.tr-fs { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
    background: rgba(var(--t-ink-rgb), .05); border: 1px solid var(--t-line); color: var(--t-muted); transition: color .2s, border-color .2s, background .2s; }
.tr-fs:hover, .tr-fs:focus-visible { color: var(--t-accent); border-color: rgba(var(--t-accent-rgb), .5); background: rgba(var(--t-accent-rgb), .08); }
.tr-fs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr-fs .i-fs-off, .trance.is-fs .tr-fs .i-fs-on { display: none; }
.trance.is-fs .tr-fs .i-fs-off { display: block; }

#trance-app.is-fs { max-width: none; width: 100%; height: 100vh; height: 100dvh; margin: 0; border-radius: 0; overflow: hidden; box-shadow: none;
    padding: 14px 26px 8px; display: grid; grid-template-columns: minmax(540px, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, auto) minmax(0, 1fr) auto auto; column-gap: 26px; }
#trance-app.is-fs > .tr-top { grid-column: 1 / -1; grid-row: 1; margin-bottom: 6px; }
#trance-app.is-fs > #tr-il-note { grid-column: 1 / -1; grid-row: 2; margin-bottom: 10px; }
#trance-app.is-fs > #tr-shared { grid-column: 1 / -1; grid-row: 3; margin-bottom: 10px; }
#trance-app.is-fs > .tr-presets { grid-column: 1 / -1; grid-row: 4; max-height: 27vh; overflow-y: auto; margin-bottom: 10px; padding-right: 8px; }
#trance-app.is-fs .tr-presets .tr-chips.is-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
#trance-app.is-fs > .tr-fs-deck { grid-column: 1; grid-row: 5; }
#trance-app.is-fs > #tr-step-lanes { grid-column: 2; grid-row: 5; }
#trance-app.is-fs > .tr-fs-deck, #trance-app.is-fs > #tr-step-lanes { min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; padding-bottom: 18px; }
#trance-app.is-fs > .tr-fs-deck .tr-teaser { margin-top: 14px; }
#trance-app.is-fs > #tr-meta { grid-column: 1 / -1; grid-row: 7; margin-top: 6px; }
#trance-app.is-fs > .tr-presets, #trance-app.is-fs > .tr-fs-deck, #trance-app.is-fs > #tr-step-lanes {
    scrollbar-width: thin; scrollbar-color: rgba(var(--t-accent-rgb), .3) transparent; }
#trance-app.is-fs > .tr-presets::-webkit-scrollbar, #trance-app.is-fs > .tr-fs-deck::-webkit-scrollbar, #trance-app.is-fs > #tr-step-lanes::-webkit-scrollbar { width: 8px; }
#trance-app.is-fs > .tr-presets::-webkit-scrollbar-thumb, #trance-app.is-fs > .tr-fs-deck::-webkit-scrollbar-thumb, #trance-app.is-fs > #tr-step-lanes::-webkit-scrollbar-thumb { background: rgba(var(--t-accent-rgb), .3); border-radius: 8px; }
/* before any mix is chosen there is only step 1 to show, so it may have the room */
#trance-app.is-fs.is-unchosen > .tr-presets { max-height: none; }
#trance-app.is-fs.is-unchosen > .tr-fs-deck { grid-column: 1 / -1; }
#trance-app.is-fs.is-unchosen > #tr-step-lanes { grid-column: 1 / -1; grid-row: 6; }   /* never under the deck, whatever is open */
#trance-app:fullscreen::backdrop { background: var(--t-bg1, #1b120e); }
/* a narrower deck column: the dials drop under the keys */
@media (max-width: 1599px) {
    #trance-app.is-fs .tr-console { grid-template-columns: auto minmax(0, 1fr); }
    #trance-app.is-fs .tr-dials { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
    #trance-app.is-fs .tr-dial-row { grid-column: 1 / -1; }
}

/* ==================================================================
   2.12: tiles show the phrase, mix settings and the DJ live in
   Settings, section 3 folds away, always match tempo, louder toasts
================================================================== */
.tr-tile-phrase { opacity: .85; }
.tr-tile .tr-tile-meta { line-height: 1.45; }

.tr-settings h3 { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px !important; }
.tr-settings h3:first-child { margin-top: 4px !important; }
.tr-settings h3 small { font-family: var(--t-ui); font-size: .75rem; font-weight: 400; color: var(--t-muted); }
.tr-settings .tr-set-mix { padding: 4px 0 12px; margin: 0; border-top: 0; }
.tr-settings .tr-set-dj { margin-top: 0; padding: 0 0 12px; border-top: 0; }
.tr-settings .tr-set-mix + h3, .tr-settings .tr-set-dj + h3 { padding-top: 14px; border-top: 1px solid var(--t-line); }
.tr-field.is-locked { opacity: .55; }
.tr-field.is-locked input { cursor: not-allowed; }
.tr-field b { color: var(--t-ink); font-weight: 600; }
.tr-field .tr-lock { font-style: normal; }

/* section 3 folds away to its tab bar */
.tr-tabs-h { flex-wrap: wrap; }
.tr-fold { margin-left: auto; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
    background: rgba(var(--t-ink-rgb), .05); border: 1px solid var(--t-line); color: var(--t-muted); transition: color .2s, border-color .2s, background .2s; align-self: center; }
.tr-fold:hover, .tr-fold:focus-visible { color: var(--t-accent); border-color: rgba(var(--t-accent-rgb), .5); background: rgba(var(--t-accent-rgb), .08); }
.tr-fold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.tr-step.is-folded .tr-fold svg { transform: rotate(180deg); }
/* section 5: the help, folded into the app */
.tr-guide-body p { font-size: .95rem; line-height: 1.6; margin: 0 0 14px !important; padding: 0; color: var(--t-ink); }
.tr-guide-body p:last-child { margin-bottom: 4px !important; }
.tr-guide-body strong { font-weight: 600; }
.tr-guide-body kbd { font-family: var(--t-ui); font-size: .8em; padding: 0 5px; border-radius: 4px; border: 1px solid var(--t-line); background: var(--t-tile); }
.tr-guide .tr-fold-sum { display: none; }
.tr-guide.is-folded .tr-fold-sum { display: inline; }
#trance-app.is-fs > .tr-fs-deck .tr-guide { margin-top: 14px; }
.trance.is-tabs-min .tr-tab[aria-selected="true"] { background: transparent; color: var(--t-muted); }
.trance.is-tabs-min .tr-tab[aria-selected="true"]:hover { color: var(--t-ink); }
.trance.is-tabs-min #tr-step-lanes .tr-tabs-h { margin-bottom: 4px !important; }

/* always match tempo */
.tr-seq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 2px; }
.tr-seq-match { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem !important; }
.tr-seq-match[aria-pressed="true"] { background: var(--t-accent); border-color: var(--t-accent); color: var(--t-accent-ink) !important; box-shadow: 0 0 12px rgba(var(--t-accent-rgb), .5); }
.tr-card-field select:disabled { opacity: .5; cursor: not-allowed; }

/* fullscreen: with section 3 folded, its bar runs across and the deck takes the width */
#trance-app.is-fs.is-tabs-min > #tr-step-lanes { grid-column: 1 / -1; grid-row: 6; overflow: visible; padding-bottom: 0; }
#trance-app.is-fs.is-tabs-min > .tr-fs-deck { grid-column: 1 / -1; }
@media (max-width: 560px) {
    .tr-tabs-h { flex-wrap: nowrap; }
    .tr-tabs-h .tr-tabs { flex: 1 1 0; min-width: 0; }
    .tr-fold { flex: 0 0 auto; }
}

/* ==================================================================
   2.12: sections 1, 3 and 4 fold away; the tab bar is a retro slide
   switch; lanes choose solo, duet or more; parts can be heard alone
================================================================== */
.tr-fold-h { flex-wrap: wrap; }
.tr-fold-h .tr-fold { align-self: center; }
.tr-fold-sum { display: none; }
.tr-step.is-folded .tr-fold-open { display: none; }
.tr-step.is-folded .tr-fold-sum { display: inline; color: var(--t-accent) !important; }
.tr-step.is-folded > .tr-fold-h { cursor: pointer; margin-bottom: 0 !important; }
.tr-step.is-folded { padding-bottom: 12px; }
.tr-step.tr-presets.is-folded { padding-bottom: 8px; }
#trance-app.is-fs > .tr-presets.is-folded { overflow: visible; }
.tr-how-sum { display: none !important; }
.trance.is-unchosen .tr-step.is-folded .tr-how-sum { display: inline !important; color: var(--t-muted) !important; }

/* the slide switch */
.tr-tabs { position: relative; gap: 2px !important; padding: 5px !important; border-radius: 13px !important; border: 0 !important;
    background: var(--rk-tray) !important;
    box-shadow: inset 0 2px 7px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 255, 255, .06), 0 1px 0 rgba(255, 255, 255, .07); }
.tr-tab { position: relative; z-index: 1; font-family: var(--t-ui) !important; font-size: .74rem !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: 10px 16px 9px !important; border-radius: 8px !important; color: rgba(var(--rk-tray-ink-rgb), .72) !important; background: transparent !important;
    transition: color .25s ease; }
.tr-tab + .tr-tab::before { content: ""; position: absolute; left: -2px; top: 28%; bottom: 28%; width: 1px; background: rgba(255, 255, 255, .08); box-shadow: 1px 0 0 rgba(0, 0, 0, .35); }
.tr-tab:hover { color: rgba(var(--rk-tray-ink-rgb), 1) !important; }
.tr-tab[aria-selected="true"] { color: var(--rk-ink) !important; }
.tr-tab[aria-selected="true"]::before, .tr-tab[aria-selected="true"] + .tr-tab::before { opacity: 0; }
.tr-tab .tr-tab-n { letter-spacing: .04em; font-weight: 600; }
.tr-tab-thumb { position: absolute; z-index: 0; left: 5px; top: 5px; width: 0; height: 0; border-radius: 7px 7px 9px 9px; pointer-events: none;
    background: linear-gradient(180deg, var(--rk-face-hi) 0%, var(--rk-face) 58%, var(--rk-face-lo) 100%);
    box-shadow: 0 3px 0 var(--rk-edge), 0 5px 8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .75);
    transform: translateY(-2px); opacity: 0; }
.tr-tab-thumb.is-placed { opacity: 1; transition: left .32s cubic-bezier(.3, 1.3, .5, 1), top .32s cubic-bezier(.3, 1.3, .5, 1), width .32s ease, height .2s ease, opacity .2s; }
.tr-tab-led { position: absolute; top: 5px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--rk-led); box-shadow: 0 0 6px var(--rk-led), inset 0 0 1px #fff; }
.trance.is-tabs-min .tr-tab-thumb { opacity: .45; }
.trance.is-tabs-min .tr-tab-led { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .45); }
.trance.is-tabs-min .tr-tab[aria-selected="true"] { color: var(--rk-ink) !important; }
@media (prefers-reduced-motion: reduce) { .tr-tab-thumb.is-placed { transition: none; } }
@media (max-width: 560px) { .tr-tab { padding: 10px 8px 9px !important; letter-spacing: .08em; } }

/* solo, duet, trio, four */
.tr-voices { width: auto !important; flex: 0 0 auto; padding: 4px 24px 4px 8px !important; height: 30px; font-family: var(--t-ui); font-size: .74rem !important; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; border-radius: 9px !important; color: var(--hue, var(--t-accent)) !important;
    border: 1px solid color-mix(in srgb, var(--hue, #fff) 45%, transparent) !important; background-color: rgba(0, 0, 0, .18) !important; cursor: pointer; }
.tr-voices:disabled { opacity: .4; cursor: default; }
@media (max-width: 560px) { .tr-voices { order: 5; } }

/* hear one part on its own */
.tr-preview[aria-pressed="true"] { color: var(--t-accent-ink) !important; background: var(--t-accent) !important; border-color: var(--t-accent) !important; box-shadow: 0 0 10px rgba(var(--t-accent-rgb), .5); }
.tr-preview svg { fill: currentColor; stroke: none !important; width: 13px; height: 13px; }
.tr-preview[hidden], .tr-fold-body[hidden] { display: none !important; }

/* ==================================================================
   TELETEXT: the fifth look. A black screen in the eight Mode 7
   colours of the BBC Micro (black, red, green, yellow, blue,
   magenta, cyan, white), square blocks and a screen font.
================================================================== */
#trance-app[data-skin="teletext"] {
    --t-bg1: #000; --t-bg2: #000; --t-bg3: #000;
    --t-glow1: transparent; --t-glow2: transparent;
    --t-ink: #fff; --t-ink-rgb: 255, 255, 255; --t-muted: #0ff;
    --t-hl-rgb: 0, 0, 255;
    --t-accent: #ff0; --t-accent-rgb: 255, 255, 0; --t-accent-hi: #0ff; --t-accent-ink: #000;
    --t-panel: #000; --t-stop: #f00; --t-toast: #00f; --t-shadow: none;
    --t-line: #00f; --t-tile: #000; --t-tile-on: #00f;
    --t-wait: #ff0; --t-wait-rgb: 255, 255, 0; --t-dj: #f0f; --t-dj-rgb: 255, 0, 255;
    --t-hue-dark: 0%;
    --t-ui: "VT323", "Courier New", monospace;
    --rk-font: "VT323", "Courier New", monospace;
    --rk-tray: #000; --rk-tray-ink-rgb: 255, 255, 255;
    --rk-face-hi: #0ff; --rk-face: #0ff; --rk-face-lo: #0ff; --rk-edge: #008080;
    --rk-ink: #000; --rk-led: #f00; --rk-stop: #f00;
    --rk-lcd: #000; --rk-lcd-ink: #0f0; --rk-lcd-glow: transparent;
    font-family: "VT323", "Courier New", monospace;
    font-size-adjust: .62;
    background: #000; box-shadow: 0 0 0 4px #00f, 0 18px 40px rgba(0, 0, 0, .5);
    border-radius: 0;
}
#trance-app[data-skin="teletext"] *, #trance-app[data-skin="teletext"] *::before, #trance-app[data-skin="teletext"] *::after { border-radius: 0 !important; }
#trance-app[data-skin="teletext"] button, #trance-app[data-skin="teletext"] input,
#trance-app[data-skin="teletext"] select, #trance-app[data-skin="teletext"] textarea { font-family: var(--t-ui) !important; }
#trance-app[data-skin="teletext"] h2, #trance-app[data-skin="teletext"] h3 { font-family: var(--t-ui); color: #ff0; letter-spacing: .02em; }
#trance-app[data-skin="teletext"] h3 { color: #0ff; }
#trance-app[data-skin="teletext"] .tr-title { font-family: var(--t-ui); color: #000; background: #ff0; display: inline-block; padding: 0 10px; transform: scaleY(1.25); transform-origin: left; }
#trance-app[data-skin="teletext"] .tr-badge { background: #f00; color: #fff; }
#trance-app[data-skin="teletext"] .tr-step-n { background: #f00; color: #fff; box-shadow: none; }
#trance-app[data-skin="teletext"] .tr-step-h small { color: #0ff; }
#trance-app[data-skin="teletext"] .tr-step.is-folded .tr-fold-sum { color: #0f0 !important; }
#trance-app[data-skin="teletext"] .tr-step { border-top-width: 2px; }
#trance-app[data-skin="teletext"] .tr-tile { background: #00f; border: 0; }
#trance-app[data-skin="teletext"] .tr-tile .tr-tile-name { color: #ff0; }
#trance-app[data-skin="teletext"] .tr-tile .tr-tile-meta, #trance-app[data-skin="teletext"] .tr-tile span { color: #fff; }
#trance-app[data-skin="teletext"] .tr-tile[aria-pressed="true"] { background: #0ff; box-shadow: none; }
#trance-app[data-skin="teletext"] .tr-tile[aria-pressed="true"] span { color: #000; }
#trance-app[data-skin="teletext"] .tr-chip.is-new { background: #000; border: 2px dashed #f0f; }
#trance-app[data-skin="teletext"] .tr-chip.is-new span { color: #f0f; }
#trance-app[data-skin="teletext"] .tr-btn { background: #000; border: 2px solid #0ff; color: #0ff !important; }
#trance-app[data-skin="teletext"] .tr-btn:hover { background: #0ff; color: #000 !important; }
#trance-app[data-skin="teletext"] .tr-btn.is-accent { background: #ff0; border-color: #ff0; color: #000 !important; }
#trance-app[data-skin="teletext"] .tr-btn.is-quiet { border-color: transparent; color: #0f0 !important; }
#trance-app[data-skin="teletext"] select, #trance-app[data-skin="teletext"] input[type="text"] { background-color: #000 !important; color: #fff !important; border: 2px solid #00f !important; }
#trance-app[data-skin="teletext"] select option { color: #fff; background: #000; }
#trance-app[data-skin="teletext"] input[type="range"]::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(to right, var(--fill) var(--value, 0%), #00f var(--value, 0%)); }
#trance-app[data-skin="teletext"] input[type="range"]::-moz-range-track { height: 8px; background: #00f; }
#trance-app[data-skin="teletext"] input[type="range"]::-webkit-slider-thumb { width: 14px; height: 20px; margin-top: -6px; background: #fff; box-shadow: none; border-radius: 0; }
#trance-app[data-skin="teletext"] input[type="range"]::-moz-range-thumb { width: 14px; height: 20px; background: #fff; border-radius: 0; }
#trance-app[data-skin="teletext"] .tr-lane { background: #000; border: 2px solid var(--hue); border-left-width: 8px; }
#trance-app[data-skin="teletext"] .tr-panel, #trance-app[data-skin="teletext"] .tr-now, #trance-app[data-skin="teletext"] .tr-conductor,
#trance-app[data-skin="teletext"] .tr-card, #trance-app[data-skin="teletext"] .tr-mine-item { background: #000; border: 2px solid #00f; box-shadow: none; }
#trance-app[data-skin="teletext"] .tr-card.is-now { border-color: #ff0; }
#trance-app[data-skin="teletext"] .tr-teaser { border-color: #f0f; background: #000; }
#trance-app[data-skin="teletext"] .tr-teaser strong { color: #ff0; }
#trance-app[data-skin="teletext"] .tr-teaser ul { color: #0ff; }
#trance-app[data-skin="teletext"] .rk-key { background: var(--rk-face); box-shadow: 0 4px 0 var(--rk-edge); }
#trance-app[data-skin="teletext"] .rk-key[aria-pressed="true"] { background: #ff0; box-shadow: none; }
#trance-app[data-skin="teletext"] .rk-key.is-stop { color: #000; background: #f00; box-shadow: 0 4px 0 #800000; }
#trance-app[data-skin="teletext"] .rk-deck, #trance-app[data-skin="teletext"] .tr-tabs { box-shadow: none !important; border: 2px solid #00f !important; }
#trance-app[data-skin="teletext"] .rk-lcd { box-shadow: none; border: 2px solid #00f; text-shadow: none; font-family: var(--t-ui); font-size: 1.1em; }
#trance-app[data-skin="teletext"] .rk-lcd::after { display: none; }
#trance-app[data-skin="teletext"] .tr-tab-thumb { background: #0ff; box-shadow: none; transform: none; }
#trance-app[data-skin="teletext"] .tr-tab + .tr-tab::before { background: #00f; box-shadow: none; }
#trance-app[data-skin="teletext"] .tr-tab[aria-selected="true"] { color: #000 !important; }
#trance-app[data-skin="teletext"] .tr-toast { background: #00f; color: #ff0; border: 0; }
#trance-app[data-skin="teletext"] .tr-join span { color: #0f0; }
#trance-app[data-skin="teletext"] #tr-meta { color: #0ff; opacity: 1; }
.tr-skin[data-skin="teletext"] { background: conic-gradient(#f00 0 45deg, #0f0 0 90deg, #ff0 0 135deg, #00f 0 180deg, #f0f 0 225deg, #0ff 0 270deg, #fff 0 315deg, #000 0); }

/* ---------- mailing list (free edition) ---------- */
.tr-join { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-top: 14px !important; font-family: var(--t-ui); font-size: .9rem; color: var(--t-muted); text-align: center; }
.tr-join-btn { border-color: rgba(var(--t-accent-rgb), .55) !important; }
#trance-app[data-skin="teletext"] *:not(svg):not(path) { font-family: var(--t-ui) !important; }

/* ---------- saving the sequencer ---------- */
.tr-seq-saves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.tr-seq-saves .tr-btn { padding: 6px 12px; font-size: 14px !important; }
.tr-seq-saves .tr-btn:disabled { opacity: .45; cursor: default; }
.tr-seq-saves-gap { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--t-line); }
.tr-seq-saves select { width: auto !important; min-width: 12em; max-width: 100%; }
@media (max-width: 560px) { .tr-seq-saves-gap { display: none; } .tr-seq-saves select { flex: 1 1 100%; } }

/* 2.18: the DJ has moved the key */
.tr-key-dj { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-size: .62rem; letter-spacing: .08em; background: var(--t-dj); color: #fff; vertical-align: middle; }
.tr-voice-pads { margin-top: 4px; }
.tr-pad.is-loading { opacity: .55; }
.tr-voice-ctl { margin-top: 10px; }
