/* First Cut — studio recreation. Extended from site/shared/studio-demo.css.
   Mirrors the shipped Studio tokens. Everything is sized in em off a container-relative font size,
   so the whole screen scales as one object and its aspect ratio never changes (no layout shift). */
.st-host { container-type: inline-size; }
.st-host:empty { aspect-ratio: 100 / 51; }

.st {
  --bg: #120c17; --panel: #181020; --raised: #21172b; --sunk: #0c0810; --line: #2e2338; --line2: #3f3149;
  --fg: #efeae0; --muted: #a99bb4; --accent: #d9ff59; --partner: #bfa9d2; --ok: #7ddc9f;
  position: relative;
  font-size: 1cqw;
  display: grid; grid-template-rows: 3.4em auto;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-grotesk);
  border-radius: 1.2em; overflow: hidden;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--line2), 0 44px 80px -52px rgba(18, 12, 23, .6);
  user-select: none; -webkit-user-select: none;
  line-height: 1.35;
}
.st * { box-sizing: border-box; }
.st svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.st-k { display: block; font: 500 .72em/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Top bar */
.st-bar { display: flex; align-items: center; gap: 1.3em; padding: 0 1.3em; border-bottom: 1px solid var(--line); font-size: 1.02em; min-width: 0; }
.st-logo { width: 1.9em; height: auto; flex: none; }
.st-project { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-project i, .st-project span { color: var(--muted); font-style: normal; font-weight: 400; }
.st-tabs { display: flex; gap: 2.2em; margin: 0 auto; color: var(--muted); }
.st-tabs .on { color: var(--fg); position: relative; }
.st-tabs .on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1.05em; height: 2px; background: var(--accent); }
.st-revpill { display: inline-flex; align-items: center; gap: .45em; padding: .3em .85em; border: 1px solid var(--line2); border-radius: 99em; font: 400 .9em/1.2 var(--font-mono); white-space: nowrap; }
.st-dot { width: .5em; height: .5em; border-radius: 50%; background: var(--ok); }
.st-revnum { display: inline-block; overflow: hidden; vertical-align: bottom; height: 1.2em; font-weight: 500; }
.st-revnum span { display: inline-block; }
.st.st-revflash .st-revnum { color: var(--accent); }
.st-undo { display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; color: var(--muted); font-size: 1.05em; }
.st-undo.st-press { animation: st-press 800ms var(--ease) both; }
@keyframes st-press { 0% { color: var(--muted); transform: scale(1); } 12% { transform: scale(.86); color: var(--fg); background: var(--raised); } 40% { transform: scale(1); } 100% { color: var(--muted); background: transparent; } }
.st-export { padding: .5em 1.15em; border-radius: 99em; border: 1px solid var(--line2); font-weight: 600; white-space: nowrap; }

/* Body */
.st-body { display: grid; grid-template-columns: minmax(0, 1fr) 24em; min-height: 0; }
.st--cut .st-body { grid-template-columns: minmax(0, 1fr); }
.st-work { display: grid; gap: 1em; padding: 1.1em; min-width: 0; }
.st-top { display: grid; grid-template-columns: minmax(0, 1fr) 23em; gap: 1em; min-width: 0; }

.st-monitor { display: grid; grid-template-rows: 2.4em auto; background: var(--sunk); border: 1px solid var(--line); border-radius: .8em; overflow: hidden; min-width: 0; }
.st-mhead { display: flex; align-items: center; gap: .7em; padding: 0 .9em; border-bottom: 1px solid var(--line); }
.st-play { display: grid; place-items: center; color: var(--fg); font-size: .9em; }
.st-play svg { fill: currentColor; stroke-width: 1; }
.st-tag { font: 500 .72em/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.st-tc { margin-left: auto; font: 400 .82em/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.st-screen { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.st-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-titlecard { position: absolute; inset: 0; display: grid; place-items: center; background: #1b1f24; opacity: 0; transition: opacity 120ms linear; }
.st-titlecard span { font: 400 2.1em/1.2 var(--font-grotesk); color: #f3f3f3; text-align: center; padding: 0 1.5em; }
.st.st-on-card .st-titlecard { opacity: 1; }
.st-cap { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); max-width: 86%; padding: .35em .8em; background: #111; color: #fff; border-radius: .2em; font: 400 1.3em/1.25 var(--font-grotesk); text-align: center; }
.st-cap:empty { display: none; }
.st-emptycut { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .7em; text-align: center; background: radial-gradient(120% 90% at 50% 40%, #1c1424, #110b15); }
.st-emptycut strong { font-size: 2em; font-weight: 600; letter-spacing: -.01em; }
.st-emptysub { color: var(--muted); font-size: 1.05em; max-width: 30em; }
.st-emptyacts { display: flex; gap: .6em; margin-top: .4em; }
.st-emptyacts span { padding: .45em .9em; border: 1px solid var(--line2); border-radius: 99em; font-size: .95em; }
.st-emptyacts i { font-style: normal; font-family: var(--font-mono); color: var(--muted); margin-left: .4em; }
.st[data-cut="empty"] .st-emptycut { display: flex; }
.st[data-cut="empty"] .st-cap, .st[data-cut="empty"] .st-titlecard { display: none; }

/* Inspector */
.st-inspector { background: var(--panel); border: 1px solid var(--line); border-radius: .8em; padding: 1.1em; display: flex; flex-direction: column; gap: .5em; min-width: 0; overflow: hidden; }
.st-cutname { font-size: 1.2em; font-weight: 600; }
.st-meta { font: 400 .8em/1.3 var(--font-mono); color: var(--muted); }
.st-stats { display: grid; grid-template-columns: 1fr 1fr; margin: .5em 0 0; border: 1px solid var(--line2); border-radius: .5em; overflow: hidden; }
.st-stats div { padding: .65em .8em; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.st-stats div:nth-child(2n) { border-right: 0; }
.st-stats div:nth-child(n+3) { border-bottom: 0; }
.st-stats dt { font-size: .8em; color: var(--muted); }
.st-stats dd { margin: .25em 0 0; font: 400 1.25em/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.st-rows { margin: .4em 0 0; display: grid; }
.st-rows div { display: flex; justify-content: space-between; gap: 1em; padding: .55em 0; border-bottom: 1px solid var(--line); font-size: .84em; }
.st-rows dt { color: var(--muted); }
.st-rows dd { margin: 0; text-align: right; }
.st.st-locked .st-rows div:first-child dd { color: var(--partner); }
.st-under { margin-top: auto; padding-top: .9em; border-top: 1px solid var(--line); display: grid; gap: .35em; }
.st-under b { font-size: 1.05em; font-weight: 600; }
.st-under-intent { color: #d9d2e0; font-size: .92em; }
.st-under-src { font: 400 .76em/1.3 var(--font-mono); color: var(--muted); }
.st[data-cut="empty"] .st-under { visibility: hidden; }

/* Timeline */
.st-timeline { position: relative; display: grid; grid-template-columns: 5.4em minmax(0, 1fr); grid-template-rows: 1.8em 4.4em 2.5em 2.3em; background: var(--panel); border: 1px solid var(--line); border-radius: .8em; padding: .5em .9em .6em 0; }
.st-lab { display: flex; align-items: center; padding-left: .9em; font-size: .82em; color: var(--muted); border-top: 1px solid var(--line); }
.st-lab-ruler { border-top: 0; }
.st-ruler { position: relative; font: 400 .72em/1 var(--font-mono); color: var(--muted); }
.st-ruler span { position: absolute; top: .55em; transform: translateX(-50%); }
.st-ruler span:first-child { transform: none; }
.st-ruler span:last-child { transform: translateX(-100%); }
.st-track { position: relative; display: flex; align-items: center; border-top: 1px solid var(--line); min-width: 0; }
.st-clips, .st-caps { display: flex; gap: .22em; width: 100%; }
.st-clips { height: 3.4em; }
.st-clip { position: relative; flex: 1 1 0; min-width: 0; border-radius: .35em; overflow: hidden; background: var(--raised); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.st-clip img { width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: opacity var(--t-ui) var(--ease); }
.st-clip.live img { opacity: .95; }
.st-clip.live { box-shadow: inset 0 0 0 1px rgba(239,234,224,.5); }
.st-clip--card { background: #1b1f24; }
.st-cardmini { position: absolute; inset: 0; display: grid; place-items: center; padding: .2em .4em; font-size: .5em; line-height: 1.2; color: #c9c9c9; text-align: center; overflow: hidden; }
.st-clip em { position: absolute; left: .45em; bottom: .3em; right: .3em; font-style: normal; font-size: .72em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.st-clip--card em { bottom: auto; top: .3em; color: var(--muted); text-shadow: none; }
.st-delta { position: absolute; top: .3em; right: .35em; padding: .1em .4em; border-radius: .25em; background: var(--partner); color: #291b35; font: 500 .68em/1.3 var(--font-mono); opacity: 0; transform: translateY(-.3em); transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease); }
.st[data-phase="proposal"] .st-delta:not(:empty) { opacity: 1; transform: none; }
.st[data-phase="proposal"] .st-clip:is([data-i="2"], [data-i="4"]) { box-shadow: inset 0 0 0 2px var(--partner); }
.st-lanemsg { position: absolute; left: .6em; right: 0; top: 50%; transform: translateY(-50%); font-size: .86em; color: var(--muted); display: none; }
.st[data-cut="empty"] .st-lanemsg { display: block; }
.st-caps { height: 1.6em; }
.st-capblock { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .3em; padding: 0 .45em; border-radius: .3em; background: rgba(191,169,210,.18); color: var(--partner); font-size: .7em; overflow: hidden; }
.st-capblock span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-lock { display: none; flex: none; margin-left: auto; color: var(--fg); font-size: 1.15em; }
.st.st-locked .st-lock { display: grid; }
.st.st-locked .st-capblock[data-i="4"] { background: rgba(191,169,210,.3); box-shadow: inset 0 0 0 1px rgba(191,169,210,.6); }
.st-track-music { padding-right: 0; }
.st-dashed { width: 100%; height: 1.5em; display: flex; align-items: center; padding-left: .6em; border: 1px dashed var(--line2); border-radius: .3em; color: var(--muted); font-size: .72em; }
.st-headwrap { position: absolute; top: .5em; bottom: .6em; left: 5.4em; right: .9em; pointer-events: none; }
.st-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
.st-playhead::before { content: ""; position: absolute; top: 0; left: -.35em; width: calc(.7em + 2px); height: .6em; background: var(--accent); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.st[data-cut="empty"] .st-playhead { opacity: .5; }

/* Agent panel (mirrors the shipped partner panel; the site never calls it a partner) */
.st-agent { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.st-agent-h { display: flex; align-items: center; gap: .6em; padding: 1em 1.1em .7em; font-size: 1.05em; }
.st-agent-mark { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; border: 1px solid var(--line2); }
.st-agent-mark img { width: 1em; }
.st-via { margin-left: auto; display: inline-flex; align-items: center; gap: .4em; font-size: .78em; color: var(--muted); }
.st-via i { width: .45em; height: .45em; border-radius: 50%; background: var(--partner); }
.st-agent-tabs { display: flex; gap: 1.6em; padding: 0 1.1em; border-bottom: 1px solid var(--line); font-size: .92em; color: var(--muted); }
.st-agent-tabs span { padding: .55em 0; }
.st-agent-tabs .on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.st-feed { flex: 1; display: flex; flex-direction: column; gap: .7em; padding: .9em 1.1em; min-height: 0; overflow: hidden; }
.st-card { background: var(--raised); border: 1px solid var(--line); border-radius: .75em; padding: .8em .95em; }
.st-card p { margin: .35em 0 0; font-size: .92em; line-height: 1.45; color: #d9d2e0; }
.st-card p b { color: var(--fg); font-weight: 600; }
.st-okay { display: inline-block; margin-top: .35em; font-size: .78em; color: var(--ok); }
.st-hist ol { list-style: none; margin: .5em 0 0; padding: 0; display: grid; gap: .45em; }
.st-hist li { display: grid; grid-template-columns: 4em 1fr auto; gap: .5em; align-items: baseline; font-size: .82em; color: #d9d2e0; }
.st-hist li:first-child { color: var(--fg); }
.st-hist li:first-child .st-hrev { color: var(--accent); }
.st-hrev { font-family: var(--font-mono); color: var(--muted); }
.st-htitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-hwho { font-size: .9em; color: var(--muted); }
.st-proposal { border-color: var(--partner); opacity: 0; }
.st[data-phase="proposal"] .st-proposal, .st[data-phase="applied"] .st-proposal { opacity: 1; }
.st-diff { display: flex; gap: .5em; margin-top: .6em; font: 400 .76em/1 var(--font-mono); }
.st-diff span { padding: .4em .55em; border-radius: .35em; background: var(--sunk); border: 1px solid var(--line); }
.st-diff i { font-style: normal; color: var(--partner); margin-right: .3em; }
.st-acts { display: flex; gap: .5em; justify-content: flex-end; margin-top: .75em; }
.st-btn { padding: .5em 1.15em; border-radius: 99em; font-weight: 600; font-size: .9em; border: 1px solid var(--line2); }
.st-apply { background: var(--accent); color: #291b35; border-color: var(--accent); }
.st-receipt { display: none; margin-top: .7em; font: 400 .78em/1.2 var(--font-mono); color: var(--accent); }
.st[data-phase="applied"] .st-acts { display: none; }
.st[data-phase="applied"] .st-receipt { display: block; }
.st[data-phase="applied"] .st-proposal { border-color: var(--line2); }
.st-composer { margin: 0 1.1em 1.1em; padding: .8em .9em; border: 1px solid var(--line2); border-radius: .75em; display: grid; gap: 1.2em; font-size: .9em; color: var(--muted); }
.st-chip { justify-self: start; padding: .3em .6em; border-radius: 99em; background: var(--raised); font-size: .85em; }
.st-chip b { color: var(--fg); font-weight: 500; }

.st-cursor { position: absolute; left: 0; top: 0; z-index: 5; width: 1.9em; height: 1.9em; margin: -.25em 0 0 -.3em; opacity: 0; pointer-events: none; color: var(--fg); }
.st-cursor svg { width: 100%; height: 100%; fill: #efeae0; stroke: #120c17; stroke-width: 1.4; }

/* History variant: no agent panel, a slightly larger scale */
.st--cut { font-size: 1.26cqw; }
.st--cut .st-top { grid-template-columns: minmax(0, 1fr) 18em; }

/* Compact (phones / narrow columns): monitor, two lanes and the agent's newest card */
@container (max-width: 640px) {
  .st, .st--cut { font-size: min(2.75cqw, 12.5px); border-radius: 1em; }
  .st-host:empty { aspect-ratio: auto; }
  .st-bar { gap: .8em; padding: 0 .9em; }
  .st-tabs, .st-export, .st-project span, .st-project i { display: none; }
  .st-revpill { margin-left: auto; }
  .st-body { grid-template-columns: minmax(0, 1fr); }
  .st-work { padding: .8em; gap: .7em; }
  .st-top, .st--cut .st-top { grid-template-columns: minmax(0, 1fr); }
  .st-inspector { display: none; }
  .st-cap { font-size: 1.05em; }
  .st-titlecard span { font-size: 1.4em; }
  .st-emptycut strong { font-size: 1.5em; }
  .st-emptysub { font-size: .9em; padding: 0 1em; }
  .st-emptyacts { display: none; }
  .st-timeline { grid-template-columns: 4.6em minmax(0, 1fr); grid-template-rows: 1.8em 4.2em 2.5em; padding-right: .7em; }
  .st-lab-music, .st-track-music { display: none; }
  .st-headwrap { left: 4.6em; right: .7em; }
  .st-clip em { font-size: .66em; }
  .st-clip--card em { display: none; }
  .st-cardmini { font-size: .42em; }
  .st-capblock span { display: none; }
  .st-agent { border-left: 0; border-top: 1px solid var(--line); }
  .st-agent-h { padding: .8em .9em .5em; }
  .st-agent-tabs, .st-composer, .st-grant { display: none; }
  .st-feed { display: grid; padding: .3em .9em .9em; height: 12.6em; }
  .st-feed > .st-card { grid-area: 1 / 1; align-self: start; }
  .st-proposal { margin-top: 0; }
  .st-hist { transition: opacity var(--t-enter) var(--ease); }
  .st[data-phase="proposal"] .st-hist { opacity: 0; }
  .st[data-phase="applied"] .st-proposal { opacity: 0 !important; transition: opacity var(--t-enter) var(--ease) .9s; }
  .st[data-phase="applied"] .st-hist { opacity: 0; animation: st-in var(--t-enter) var(--ease) 1.2s forwards; }
  .st-card p { font-size: 1em; }
}
@keyframes st-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) { .st * { transition: none !important; animation: none !important; } }
