/* Play — the front door (play-page.js). House tokens only; the macro tracks wear the Compose ruler's thumb and
   rail (face.css) so a control looks the same on every page. Amber = the current patch and the Play button. */

.play-card { display: none; }
.play-workspace-mode > .card:not(.play-card):not(.welcome-card),
.play-workspace-mode > .research-note,
.play-workspace-mode .dash-vsplit { display: none; }
.play-workspace-mode .play-card {
  display: block; position: absolute; top: 44px; left: 4px; right: 4px; bottom: var(--ws-bottom); z-index: 2;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 18px clamp(16px, 2.2vw, 32px) 28px; background: none; border: 0; box-shadow: none;
}
.play-card * , .play-card *::before, .play-card *::after { box-sizing: border-box; }
.play-card > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
.play-card h3 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--face-quiet); }

/* ── the hero: one well holding the patch and its disc; the macros beside it ── */
.pl-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 16px; align-items: stretch; }
.pl-stage { position: relative; display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); border-radius: var(--radius); background: var(--ae-well); box-shadow: var(--elev-1);
  min-height: clamp(440px, calc(100vh - 340px), 620px); overflow: hidden; }
.pl-disc-wrap { position: relative; min-width: 0; }
.pl-disc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.pl-disc:focus-visible { outline: 2px solid var(--face-sel); outline-offset: -4px; border-radius: var(--radius); }

.pl-side { display: flex; flex-direction: column; min-width: 0; }
.pl-now { display: flex; flex-direction: column; padding: 26px 0 22px 28px; min-width: 0; }
.pl-now-tags { display: flex; gap: 6px; min-height: 22px; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--text2); background: var(--surface2); }
.pl-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--chip, var(--text3)); }
.pl-chip-quiet::before { display: none; }
.pl-name { margin: 12px 0 0; font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -0.015em; color: var(--text); text-wrap: balance; }
.pl-desc { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pl-go, .pl-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 42px; padding: 0 20px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease; }
.pl-go svg, .pl-btn svg { width: 17px; height: 17px; flex: none; }
.pl-go { min-width: 108px; color: var(--bg); background: var(--accent); border: 1px solid var(--accent); }
.pl-go:hover { background: var(--accent2); border-color: var(--accent2); }
.pl-go.on { color: var(--accent); background: none; }
.pl-go.on:hover { background: var(--ae-accent-15); }
.pl-btn { color: var(--text); background: var(--surface2); border: 1px solid var(--border2); }
.pl-btn:hover { border-color: var(--text3); }
.pl-go:focus-visible, .pl-btn:focus-visible, .pl-link:focus-visible, .pl-mood:focus-visible, .pl-tile:focus-visible, .pl-door:focus-visible { outline: 2px solid var(--face-sel); outline-offset: 3px; }
.pl-key { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--face-quiet); }
.pl-key span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pl-key i { width: 14px; height: 4px; border-radius: 2px; background: var(--ae-walk-60); }
.pl-key i.k-home { background: var(--rootc); }
.pl-key i.k-surp { background: var(--surp); }

/* ── the macros ── */
.pl-macs { flex: 1; display: flex; flex-direction: column; padding: 14px 22px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.pl-macs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; min-height: 28px; }
.pl-link { position: relative; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; color: var(--text2); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.pl-link::before { content: ""; position: absolute; inset: -12px -6px; }
.pl-link svg { width: 14px; height: 14px; }
.pl-link:hover:not(:disabled) { color: var(--text); }
.pl-link:disabled { color: var(--face-quiet); cursor: default; opacity: 0.6; }

.pl-mac { --m: 0; padding: 8px 0 4px; }
.pl-mac + .pl-mac { border-top: 1px solid var(--face-line); }
.pl-mac-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pl-mac-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pl-mac-word { font-size: 12px; color: var(--face-quiet); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-mac.moved .pl-mac-word { color: var(--text2); }
.pl-mac-track { position: relative; height: 28px; margin: 0 calc(var(--face-thumb-w) / 2); cursor: ew-resize; touch-action: pan-y; outline: none; -webkit-user-select: none; user-select: none; }
.pl-mac-track::before { content: ""; position: absolute; inset: 0 calc(var(--face-thumb-w) / -2); }   /* the whole row is the hit area */
.pl-mac-rail { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--face-base); }
.pl-mac-mid { position: absolute; left: 50%; top: calc(50% - 7px); width: 1px; height: 14px; background: var(--face-tick-major); }
.pl-mac-fill { position: absolute; top: calc(50% - 1.5px); height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ae-walk) 55%, transparent);
  left: calc(50% + min(0, var(--m)) * 50%); width: calc(max(var(--m), -1 * var(--m)) * 50%); }
.pl-mac-thumb { position: absolute; top: calc(50% - 8px); left: calc(50% + var(--m) * 50%); width: var(--face-thumb-w); height: 16px; margin-left: calc(var(--face-thumb-w) / -2); border-radius: 8px;
  background: var(--ae-walk); box-shadow: 0 0 0 2px var(--knob-ring); transition: transform 120ms ease; }
.pl-mac-thumb::before, .pl-mac-thumb::after { content: ""; position: absolute; top: 5px; width: 1.5px; height: 6px; border-radius: 1px; background: var(--knob-ring); }
.pl-mac-thumb::before { left: 9px; } .pl-mac-thumb::after { left: 13.5px; }
.pl-mac:hover .pl-mac-thumb, .pl-mac.dragging .pl-mac-thumb { transform: scale(1.08); }
.pl-mac-track:focus-visible .pl-mac-thumb { outline: 2px solid var(--face-sel); outline-offset: 3px; }
.pl-mac.dragging .pl-mac-track { cursor: grabbing; }
.pl-mac-ends { display: flex; justify-content: space-between; margin-top: -3px; font-size: 11px; line-height: 14px; color: var(--face-quiet); }

/* what the last macro moved, value by value */
.pl-moved { margin-top: auto; padding-top: 12px; min-height: 124px; border-top: 1px solid var(--face-line); }   /* room for four rows, so the first move never pushes the patches down */
.pl-moved:empty::after { content: "Drag a control. Each one moves several settings at once."; font-size: 12px; color: var(--face-quiet); }
.pl-moved-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.pl-moved ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pl-moved li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: 7px; align-items: baseline; font-size: 12px; color: var(--face-quiet); }
.pl-moved li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-moved li b { font: 400 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--text2); text-align: right; }
.pl-moved li b.to { color: var(--text); }
.pl-moved li i { font-style: normal; color: var(--face-quiet); }
.pl-moved li.same b { color: var(--face-quiet); }

/* ── the patches ── */
.pl-lib { margin-top: 26px; }
.pl-lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-moods { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-mood { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; font: inherit; font-size: 13px; color: var(--text2); background: none; border: 1px solid var(--border2); cursor: pointer; }
.pl-mood::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--chip); }
.pl-mood[data-mood="all"]::before { display: none; }
.pl-mood:hover { color: var(--text); border-color: var(--text3); }
.pl-mood.on { color: var(--text); background: var(--surface2); border-color: var(--text3); font-weight: 600; }
.pl-n { font: 400 11px var(--mono); font-variant-numeric: tabular-nums; color: var(--face-quiet); }

.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.pl-tile { position: relative; display: grid; grid-template-rows: 46px auto auto; gap: 2px; padding: 10px 12px 11px; text-align: left; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; font: inherit; color: var(--text); transition: border-color 120ms ease, background 120ms ease; }
.pl-tile[hidden] { display: none; }
.pl-tile:hover { border-color: var(--text3); background: var(--surface2); }
.pl-tile.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pl-art { width: 100%; height: 40px; color: var(--chip); margin-bottom: 4px; }
.pl-tile-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-tile-mood { font-size: 11.5px; color: var(--face-quiet); }

/* ── further ── */
.pl-doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.pl-door { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  padding: 13px 16px; border-radius: var(--radius-sm); background: none; border: 1px solid var(--border); font: inherit; cursor: pointer; color: var(--text); }
.pl-door b { font-size: 14px; font-weight: 600; }
.pl-door span { grid-row: 2; font-size: 12px; color: var(--face-quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-door svg { grid-row: 1 / 3; grid-column: 2; width: 16px; height: 16px; color: var(--face-quiet); transition: transform 120ms ease; }
.pl-door:hover { border-color: var(--text3); }
.pl-door:hover svg { transform: translateX(2px); color: var(--text); }

/* ── narrower ── */
@media (max-width: 1279px) {
  .pl-hero { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  .pl-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(300px, 1fr); }
  .pl-now { padding: 22px 22px 0; }
  .pl-name { font-size: 26px; }
  .pl-key { margin-top: 14px; }
  .pl-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .pl-hero { grid-template-columns: minmax(0, 1fr); }
  .pl-stage { grid-template-rows: auto min(78vw, 440px); min-height: 0; }
}
@media (max-width: 699px) {
  .play-workspace-mode .play-card { padding: 12px 12px 24px; }
  .pl-now { padding: 18px 16px 0; }
  .pl-macs { padding-left: 16px; padding-right: 16px; }
  .pl-name { font-size: 24px; }
  .pl-acts > * { flex: 1; }
  .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-doors { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse), (max-width: 699px) {
  .pl-mac-track { height: 44px; }
  .pl-mood { height: 40px; }
  .pl-go, .pl-btn { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-mac-thumb, .pl-door svg, .pl-tile, .pl-go, .pl-btn { transition: none; }
  .pl-mac:hover .pl-mac-thumb, .pl-mac.dragging .pl-mac-thumb, .pl-door:hover svg { transform: none; }
}
/* phone: the page scrolls as Compose's does, under the sticky two-row bar (review PLAY-1 M5: a fixed top: 44px sat under it) */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  body.explore-mode:has(.play-workspace-mode) { overflow-y: auto; height: auto; }
  body.explore-mode:has(.play-workspace-mode) #app,
  body.explore-mode:has(.play-workspace-mode) .view { height: auto; min-height: 100dvh; }
  .explore-dashboard.play-workspace-mode { display: block; min-height: 0; height: auto; overflow: visible; }
  .play-workspace-mode .play-card { position: static; overflow: visible; margin-top: 8px; }
  .pl-grid { content-visibility: visible; }
}
