/* ==========================================================================
   TUR-135 (owner 03.12, Fable's design). The studio in two layouts built from one set of parts, plus the result popup.
     Studio column  (html.lay-left, 1200 px+)  .composer.cmp-col  - Image / Video / Audio switch on top, the labelled
                    PROMPT box, Settings as a form list, References tiles, Tools, Generate pinned at the bottom.
     Wide dock      (html.lay-bottom, 641 px+) .composer.cmp-dock - full width, two rows: switch + one-line prompt
                    (grows upward) + Generate; then every setting, the references and the tools.
     Result popup   .stg - one split modal for both layouts (views/stage.js); phones keep a full-screen sheet.
   Phones (<= 640 px) keep the TUR-90 bar + sheet (studio2.css). Loaded after studio2.css / variants.css.
   ========================================================================== */
html.rd-v6 {
  --s3-g: #16a34a; --s3-gd: #15803d;
  --s3-line: color-mix(in srgb, var(--text) 20%, var(--panel));
  --s3-canvas: color-mix(in srgb, var(--panel-2) 62%, var(--bg));
}
html.rd-v6[data-theme="dark"] {
  --s3-gd: #4ade80;
  --s3-line: color-mix(in srgb, var(--text) 26%, var(--panel));
}

/* ---------- the results header: "Recent videos  20 results   [Video guide] [View all] [layout]" ---------- */
.fh-title, .fh-guide { display: none; }
.lay-b { width: 32px; height: 26px; border-radius: 7px; }
.lay-sw { border-radius: 10px; }
.lay-b .ico { width: 17px; height: 17px; }

@media (min-width: 641px) {
  html.rd-v6.has-composer, html.rd-v6.has-composer body { background: var(--s3-canvas); }
  html.rd-v6.has-composer .bg-glow { display: none; }
  html.rd-v6 .studio2 > .feed-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; min-height: 34px; flex-wrap: nowrap; }
  html.rd-v6 .studio2 > .feed-head > .kind-tabs { display: none; }
  html.rd-v6 .studio2 > .feed-head .fh-title { display: flex; align-items: baseline; gap: 14px; min-width: 0; flex: 0 0 auto; margin-right: auto; }
  html.rd-v6 .studio2 > .feed-head .fh-title h1 { display: block; margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.2px; line-height: 1.3; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .studio2 > .feed-head .fh-n { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
  html.rd-v6 .studio2 > .feed-head .fh-n[hidden] { display: none; }
  html.rd-v6 .studio2 > .feed-head .fh-guide { display: inline-flex; flex: none; }
  html.rd-v6 .studio2 > .feed-head .fh-guide:empty { display: none; }
  html.rd-v6 .studio2 > .feed-head .btn.view-all { display: inline-flex; align-items: center; gap: 6px; flex: none; width: auto; height: 32px; min-height: 0; padding: 0 12px;
    border: 1px solid var(--line-strong) !important; border-radius: 999px; background: var(--panel) !important; color: var(--text); font-size: 13px; font-weight: 650; box-shadow: none !important; }
  html.rd-v6 .studio2 > .feed-head .btn.view-all[hidden] { display: none; }
  html.rd-v6 .studio2 > .feed-head .view-all::after { content: none; }
  html.rd-v6 .studio2 > .feed-head .view-all .ico { width: 14px; height: 14px; margin: 0; }
  html.rd-v6 .studio2 > .feed-head .btn.view-all:hover { border-color: var(--s3-g) !important; }
  html.rd-v6 .studio2 .lay-wrap { margin-left: 0; flex: none; }
  /* the guide chip: a quiet link (header in the dock layout, the SETTINGS label row in the column) */
  html.rd-v6 .studio2 .tut-btn { height: 24px; padding: 0 2px; gap: 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 650;
    letter-spacing: 0; text-transform: none; }
  html.rd-v6 .studio2 .tut-btn:hover { background: none; color: var(--text); }
  html.rd-v6 .studio2 .tut-btn .ico { width: 15px; height: 15px; color: currentColor; }
  html.rd-v6 .studio2 .tut-btn .tb-d { font-size: 11.5px; font-weight: 600; opacity: .75; color: inherit; }
  /* the slot above the grid: the "Compare engines" nudge is a pill in the header row, so it costs the grid no row
     (the site notice bar keeps its own line above the page) */
  html.rd-v6 .studio2 > .feed-head .nudge-slot { flex: 0 1 auto; min-width: 0; }
  html.rd-v6 .studio2 > .feed-head .nudge-slot:empty { display: none; }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge { margin: 0; height: 34px; box-sizing: border-box; padding: 0 3px 0 12px; gap: 8px; border-radius: 999px; font-size: 13px; }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge > .ico { width: 15px; height: 15px; }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge .icon-btn { width: 28px; height: 28px; margin: 0; border: 0; border-radius: 50%; background: transparent; }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge .icon-btn:hover { background: var(--cmp-chip); }
  html.rd-v6 .studio2 > .feed-head .cmp-nudge .icon-btn .ico { width: 14px; height: 14px; }

  /* the grid: fixed column counts (studio.js shows only the rows that fit) */
  html.rd-v6 .studio2 { max-width: none; padding-bottom: 0; }
  html.rd-v6 .studio2 > .grid { grid-template-columns: repeat(var(--s3-cols, 4), minmax(0, 1fr)); gap: 12px; min-height: 0; padding-bottom: 0; margin: 0; }
  html.rd-v6 .studio2 > .grid:has(> .starters) { grid-template-columns: minmax(0, 1fr); }

  /* ---------- shared parts ---------- */
  html.rd-v6 .composer.cmp-col, html.rd-v6 .composer.cmp-dock { --pp: 8px; }
  html.rd-v6 .composer .cmp-kinds { flex: none; padding: 4px; gap: 0; border-radius: 14px; background: var(--cmp-chip); }
  html.rd-v6 .composer .cmp-kinds .kt-plate { top: 4px; bottom: 4px; border-radius: 10px; background: var(--cmp-pill); box-shadow: var(--cmp-pill-sh); }
  html.rd-v6 .composer .cmp-kinds a { height: 38px; padding: 0 14px; gap: 8px; border-radius: 10px; font-size: 14px; font-weight: 700; white-space: nowrap; box-sizing: border-box; }
  html.rd-v6 .composer .cmp-kinds a .ico { width: 17px; height: 17px; }
  html.rd-v6 .composer .cmp-kinds a.on { color: var(--cmp-ink); }
  html.rd-v6 .composer .cmp-kinds a.on .ico { color: var(--s3-g); }
  html.rd-v6 .composer .cmp-kinds a:focus-visible { outline: 2px solid var(--s3-g); outline-offset: -2px; }

  /* section labels: PROMPT / SETTINGS / REFERENCES / TOOLS */
  html.rd-v6 .composer .cp-lab, html.rd-v6 .composer.cmp-col .cmp-lab { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 0;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; color: var(--muted); }
  html.rd-v6 .composer .cp-lab .char-count { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .85; font-variant-numeric: tabular-nums; }

  /* the prompt box: a bordered field that reads as an input, a clear focus ring */
  html.rd-v6 .composer .cmp-prompt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  html.rd-v6 .composer .cmp-prompt > .composer-main { box-sizing: border-box; border: 1.5px solid var(--s3-line); border-radius: 16px; background: var(--panel); cursor: text;
    transition: border-color .15s, box-shadow .15s; }
  html.rd-v6 .composer .cmp-prompt > .composer-main:hover { border-color: color-mix(in srgb, var(--text) 34%, var(--panel)); }
  html.rd-v6 .composer .cmp-prompt > .composer-main:focus-within { border-color: var(--s3-g); box-shadow: 0 0 0 4px color-mix(in srgb, var(--s3-g) 16%, transparent); }
  html.rd-v6 .composer .cmp-prompt.is-drop > .composer-main { border: 0; background: none; box-shadow: none; cursor: default; }
  html.rd-v6 .composer .cmp-prompt .composer-input:not(.lyrics) { min-height: 0; margin: 0; background: transparent; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text);
    scrollbar-width: thin; }
  html.rd-v6 .composer .cmp-prompt .composer-input::placeholder { color: color-mix(in srgb, var(--muted) 82%, var(--panel)); opacity: 1; }
  html.rd-v6 .composer .cp-ico { display: none; flex: none; color: var(--muted); }
  html.rd-v6 .composer .cp-ico .ico { display: block; width: 17px; height: 17px; }
  html.rd-v6 .composer .cp-bar { display: flex; align-items: center; gap: 6px; min-width: 0; }
  html.rd-v6 .composer .cp-sp { flex: 1; }
  html.rd-v6 .composer .cp-bar .pz-bar { flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; gap: 6px; overflow: hidden; }
  html.rd-v6 .composer .cp-bar .pz-open { height: 28px; padding: 0 11px; gap: 5px; font-size: 12.5px; font-weight: 650; }
  html.rd-v6 .composer .cp-bar .pz-open .ico { width: 14px; height: 14px; }
  html.rd-v6 .composer .cp-bar .pz-chip { height: 28px; padding: 0 11px; font-size: 12.5px; font-weight: 650; background: var(--cmp-chip); color: var(--cmp-ink); }
  html.rd-v6 .composer .cp-bar .icon-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 28px; margin: 0; padding: 0 9px; border-radius: 999px;
    color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; white-space: nowrap; cursor: pointer; }
  html.rd-v6 .composer .cp-bar .icon-btn:hover { color: var(--text); }
  html.rd-v6 .composer .cp-bar .icon-btn .ico { width: 16px; height: 16px; }

  /* chips, segments, reference buttons, tools: one height, one weight */
  html.rd-v6 .composer.cmp-col .pill .caret, html.rd-v6 .composer.cmp-dock .pill .caret { flex: none; width: 6px; height: 6px; margin: 0 2px 0 1px; border: 0; border-right: 1.8px solid var(--muted);
    border-bottom: 1.8px solid var(--muted); transform: translateY(-2px) rotate(45deg); opacity: .8; }
  html.rd-v6 .composer.cmp-col .pill-wrap.open > .pill .caret, html.rd-v6 .composer.cmp-dock .pill-wrap.open > .pill .caret { transform: translateY(2px) rotate(225deg); }
  html.rd-v6 .composer.cmp-col .seg-inline button, html.rd-v6 .composer.cmp-dock .seg-inline button { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
  html.rd-v6 .composer .cmp-vr { flex: none; width: 1px; height: 20px; margin: 0 5px; background: var(--line-strong); }
  html.rd-v6 .composer .mo-chip, html.rd-v6 .composer .t74-tool, html.rd-v6 .composer .chr-pill .pill { height: 34px; padding: 0 12px; gap: 6px; border: 1px solid var(--line-strong);
    border-radius: 999px; background: transparent; color: var(--cmp-ink); font-size: 13px; font-weight: 650; box-sizing: border-box; white-space: nowrap; }
  html.rd-v6 .composer .mo-chip:hover, html.rd-v6 .composer .t74-tool:hover, html.rd-v6 .composer .chr-pill .pill:hover,
  html.rd-v6 .composer .chr-pill.open .pill { border: 1px solid var(--s3-g); background: transparent; }
  html.rd-v6 .composer .mo-chip svg, html.rd-v6 .composer .t74-tool .ico, html.rd-v6 .composer .t74-tool svg, html.rd-v6 .composer .chr-pill .pill .ico { width: 15px; height: 15px;
    color: var(--cmp-ink); flex: none; }
  html.rd-v6 .composer .mo-chip span, html.rd-v6 .composer .t74-tool span { display: inline; }
  html.rd-v6 .composer .frames-box { padding: 0; gap: 0; border-radius: 999px; }
  html.rd-v6 .composer .frame-slot { height: 31px; border-radius: 999px; font-size: 13px; }
  html.rd-v6 .composer .cmp-tools, html.rd-v6 .composer .cmp-adds { flex-wrap: nowrap; }
  html.rd-v6 .composer .composer-note:empty { display: none; }

  /* Generate + the line under it */
  html.rd-v6 .composer.cmp-col .composer-go .btn, html.rd-v6 .composer.cmp-dock .composer-go .btn { height: 50px; padding: 0 22px; justify-content: center; font-size: 16px; font-weight: 800; }
  html.rd-v6 .composer.cmp-col .composer-go .btn.go .btn-cost, html.rd-v6 .composer.cmp-dock .composer-go .btn.go .btn-cost { margin-left: 11px; padding-left: 11px;
    border-left: 1px solid rgba(255, 255, 255, .4); font-size: 16px; font-weight: 700; opacity: 1; }
  html.rd-v6 .composer .composer-go .btn.go > .ico { width: 17px; height: 17px; margin-left: 11px; }
  html.rd-v6 .composer .go-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
}

/* ==========================================================================
   V3 "Wide dock" (bottom layout; also every width from 641 px that has no room for the column)
   ========================================================================== */
@media (min-width: 641px) {
  html.rd-v6 { --s3-cols: 3; }
  html.rd-v6 .composer.cmp-dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; top: auto; box-sizing: border-box; width: auto; max-width: none; max-height: none; margin: 0;
    padding: 12px 28px 14px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; overflow: visible;
    border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: var(--cmp-bg); box-shadow: 0 -10px 30px -18px rgba(15, 17, 21, .18); }
  html.rd-v6 .composer.cmp-dock:focus-within { border: 0; border-top: 1px solid var(--line-strong); box-shadow: 0 -10px 30px -18px rgba(15, 17, 21, .18); }
  html.rd-v6 .composer.cmp-dock.drag { border-top-color: var(--s3-g); box-shadow: inset 0 3px 0 var(--s3-g); }
  html.rd-v6 .composer.cmp-dock > * { flex: none; min-width: 0; }
  html.rd-v6 .composer.cmp-dock > .srv-notes, html.rd-v6 .composer.cmp-dock .cp-lab, html.rd-v6 .composer.cmp-dock .cmp-lab, html.rd-v6 .composer.cmp-dock .go-sub,
  html.rd-v6 .composer.cmp-dock .cp-bar .pz-chip, html.rd-v6 .composer.cmp-dock .eb-l { display: none; }
  html.rd-v6 .composer.cmp-dock > .composer-extra { padding: 0; }
  html.rd-v6 .composer.cmp-dock > .low-bal, html.rd-v6 .composer.cmp-dock > .maint-card { margin: 0; }

  /* row 1 */
  html.rd-v6 .composer.cmp-dock .cmp-r1 { display: flex; align-items: stretch; gap: 12px; height: 52px; }
  html.rd-v6 .composer.cmp-dock .cmp-kinds { border-radius: 16px; }
  html.rd-v6 .composer.cmp-dock .cmp-kinds .kt-plate { border-radius: 12px; }
  html.rd-v6 .composer.cmp-dock .cmp-kinds a { height: 44px; padding: 0 15px; border-radius: 12px; }
  html.rd-v6 .composer.cmp-dock .cmp-prompt { position: relative; flex: 1 1 auto; min-width: 0; height: 52px; }
  /* the field is anchored to the row's bottom edge: more text makes it grow upward, over the grid, never under the fold */
  html.rd-v6 .composer.cmp-dock .cmp-prompt > .composer-main { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: flex-end; gap: 8px;
    min-height: 52px; padding: 0 8px 0 14px; }
  html.rd-v6 .composer.cmp-dock .cmp-prompt > .composer-main:has(.composer-input:focus), html.rd-v6 .composer.cmp-dock .cmp-prompt > .composer-main.is-tall {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--s3-g) 16%, transparent), 0 -12px 28px -14px rgba(15, 17, 21, .3); }
  html.rd-v6 .composer.cmp-dock .cmp-prompt > .composer-main.is-tall:not(:focus-within) { box-shadow: 0 -12px 28px -14px rgba(15, 17, 21, .3); }
  html.rd-v6 .composer.cmp-dock .cp-ico { display: block; align-self: flex-end; margin-bottom: 16px; }
  html.rd-v6 .composer.cmp-dock .cmp-prompt .composer-input:not(.lyrics) { flex: 1 1 auto; min-width: 0; height: 22px; max-height: 70px; padding: 0; margin: 13px 0; overflow-y: auto; }
  /* an empty field stays one line (a long placeholder is cut, it never grows the field over the grid) */
  html.rd-v6 .composer.cmp-dock .cmp-prompt .composer-input:not(.lyrics):placeholder-shown { height: 22px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .composer.cmp-dock .cp-bar { flex: none; align-self: flex-end; height: 49px; }
  html.rd-v6 .composer.cmp-dock .cp-bar .char-count { padding: 0 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); opacity: .85; white-space: nowrap; font-variant-numeric: tabular-nums; }
  html.rd-v6 .composer.cmp-dock:not(.has-text) .cp-bar .char-count { display: none; }
  html.rd-v6 .composer.cmp-dock .cp-bar .icon-btn { padding: 0 7px; }
  html.rd-v6 .composer.cmp-dock .cmp-prompt.is-drop > .composer-main { position: static; min-height: 52px; padding: 0; align-items: stretch; }
  html.rd-v6 .composer.cmp-dock .composer-drop, html.rd-v6 .composer.cmp-dock .composer-drop2 { min-height: 52px; border-radius: 16px; }
  html.rd-v6 .composer.cmp-dock .composer-go { flex: none; margin: 0; align-items: stretch; }
  html.rd-v6 .composer.cmp-dock .composer-go .btn { height: 52px; min-width: 210px; border-radius: 16px; }
  html.rd-v6 .composer.cmp-dock .composer-go .go-guest, html.rd-v6 .composer.cmp-dock .composer-go .go-bf { position: relative; display: flex; }
  html.rd-v6 .composer.cmp-dock .go-guest-note, html.rd-v6 .composer.cmp-dock .go-bf-note { position: absolute; left: 0; right: 0; bottom: calc(100% + 16px); padding: 3px 10px; border-radius: 999px;
    background: var(--cmp-bg); box-shadow: var(--cmp-pill-sh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

  /* row 2 */
  html.rd-v6 .composer.cmp-dock .cmp-r2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 34px; }
  html.rd-v6 .composer.cmp-dock .composer-opts { display: contents; }
  html.rd-v6 .composer.cmp-dock .cmp-adds, html.rd-v6 .composer.cmp-dock .cmp-tools { gap: 6px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .pill, html.rd-v6 .composer.cmp-dock .cmp-r2 .add-btn, html.rd-v6 .composer.cmp-dock .cmp-r2 .mo-chip, html.rd-v6 .composer.cmp-dock .cmp-r2 .t74-tool,
  html.rd-v6 .composer.cmp-dock .cmp-r2 .free-pill, html.rd-v6 .composer.cmp-dock .cmp-r2 .bulk-pill, html.rd-v6 .composer.cmp-dock .cmp-r2 .opt-toggle { height: 32px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .pill b { font-weight: 650; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .seg-inline { height: 32px; padding: 3px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .seg-inline button { height: 26px; padding: 0 10px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .add-btn { padding: 0 10px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .frames-box { height: 32px; box-sizing: border-box; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .frame-slot { height: 29px; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 > .composer-note { flex: 1 1 120px; text-align: right; }
  html.rd-v6.lay-bottom .composer.cmp-dock .pop, html.rd-v6 .composer.cmp-dock .pop { bottom: calc(100% + 14px); }

  /* the page: full width, the bottom reserved for the dock (studio.js keeps --composer-h) */
  html.rd-v6.lay-bottom main { max-width: none; margin: 0; padding: 16px 28px 8px; }
  html.rd-v6.lay-bottom.has-composer body { padding-bottom: calc(var(--composer-h, 128px) + 2px); }
  html.rd-v6.lay-bottom .studio2 > .feed-head { margin-bottom: 12px; }
}
/* compact tiles (owner 03.12 "fit more on the screen"): a card stays about 172-200 px wide at every width */
@media (min-width: 800px) { html.rd-v6 { --s3-cols: 4; } }
@media (min-width: 980px) { html.rd-v6 { --s3-cols: 5; } }
@media (min-width: 1160px) { html.rd-v6 { --s3-cols: 6; } }
@media (min-width: 1340px) { html.rd-v6 { --s3-cols: 7; } }
@media (min-width: 1520px) { html.rd-v6 { --s3-cols: 8; } }
@media (min-width: 1760px) { html.rd-v6 { --s3-cols: 9; } }
@media (min-width: 2000px) { html.rd-v6 { --s3-cols: 10; } }
@media (min-width: 2300px) { html.rd-v6 { --s3-cols: 11; } }
@media (min-width: 2560px) { html.rd-v6 { --s3-cols: 12; } }
/* labels fold away on narrower desktops so row 2 stays one line */
@media (min-width: 641px) and (max-width: 1699px) {
  html.rd-v6 .composer.cmp-dock .cmp-r2 .add-btn .ab-l { display: none; }
  html.rd-v6 .composer.cmp-dock .cmp-r2 .frame-slot .fs-l { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 641px) and (max-width: 1499px) {
  html.rd-v6 .composer.cmp-dock .cmp-tools > .mo-chip span, html.rd-v6 .composer.cmp-dock .cmp-tools > .t74-tool span { display: none; }
  html.rd-v6 .composer.cmp-dock .cmp-tools > .mo-chip, html.rd-v6 .composer.cmp-dock .cmp-tools > .t74-tool { width: 34px; padding: 0; justify-content: center; }
}
@media (min-width: 641px) and (max-width: 1099px) {
  html.rd-v6 .composer.cmp-dock { padding: 10px 16px 12px; }
  html.rd-v6.lay-bottom main { padding-left: 16px; padding-right: 16px; }
  html.rd-v6 .composer.cmp-dock .cmp-kinds a span { display: none; }
  html.rd-v6 .composer.cmp-dock .cmp-kinds a { padding: 0 13px; }
  html.rd-v6 .composer.cmp-dock .composer-go .btn { min-width: 0; padding: 0 16px; }
  html.rd-v6 .composer.cmp-dock .cmp-vr { display: none; }
}

/* ==========================================================================
   V1 "Studio column" (left layout, 1200 px+)
   ========================================================================== */
@media (min-width: 1200px) {
  html.rd-v6 .studio2 .lay-wrap { display: flex; }
  html.rd-v6.lay-left { --cmp-w: 392px; --s3-cols: 4; }
  html.rd-v6.lay-left .composer.cmp-col { position: fixed; z-index: 5; left: 0; right: auto; top: var(--lay-top, 64px); bottom: 0; box-sizing: border-box; width: var(--cmp-w);
    max-width: none; max-height: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; overflow: visible;
    border: 0; border-right: 1px solid var(--line-strong); border-radius: 0; background: var(--cmp-bg); box-shadow: none; }
  html.rd-v6.lay-left .composer.cmp-col:focus-within { border: 0; border-right: 1px solid var(--line-strong); box-shadow: none; }
  html.rd-v6.lay-left .composer.cmp-col.drag { box-shadow: inset 0 0 0 3px var(--s3-g); }
  html.rd-v6 .composer.cmp-col > .srv-switch { position: static; flex: none; margin: 12px 20px 0; }
  html.rd-v6 .composer.cmp-col .cmp-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 15px; padding: 18px 20px 14px; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: thin; }
  html.rd-v6 .composer.cmp-col .cmp-body > * { flex: none; min-width: 0; margin: 0; }
  html.rd-v6 .composer.cmp-col .cmp-sec { display: flex; flex-direction: column; gap: 8px; }

  /* switch: the whole width, three equal parts */
  html.rd-v6 .composer.cmp-col .cmp-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* prompt box */
  html.rd-v6 .composer.cmp-col .cmp-prompt > .composer-main { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 140px; padding: 0; }
  html.rd-v6 .composer.cmp-col .cmp-prompt .composer-input:not(.lyrics) { flex: 1 1 auto; width: 100%; box-sizing: border-box; min-height: 88px; max-height: 240px; padding: 12px 14px 4px; }
  html.rd-v6 .composer.cmp-col .cp-bar { flex: none; padding: 6px 8px 8px; }
  html.rd-v6 .composer.cmp-col .cp-bar .pz-chip:nth-of-type(n + 3) { display: none; }
  html.rd-v6 .composer.cmp-col .cp-bar .pz-chip { display: block; flex: 0 1 auto; min-width: 0; line-height: 28px; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .composer.cmp-col .cp-sp { min-width: 2px; }
  html.rd-v6 .composer.cmp-col .cmp-prompt.is-drop > .composer-main { min-height: 0; }
  html.rd-v6 .composer.cmp-col .composer-drop, html.rd-v6 .composer.cmp-col .composer-drop2 { min-height: 96px; border-radius: 16px; }
  html.rd-v6 .composer.cmp-col .composer-drop2 { grid-template-columns: 1fr; }
  html.rd-v6 .composer.cmp-col .composer-extra { padding: 0; }

  /* settings: label | control */
  html.rd-v6 .composer.cmp-col .composer-opts { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 7px 10px; padding: 0; border: 0; }
  html.rd-v6 .composer.cmp-col .cmp-f { display: contents; }
  html.rd-v6 .composer.cmp-col .cmp-fl { min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.rd-v6 .composer.cmp-col .cmp-f.no-l > * { grid-column: 2; justify-self: start; }
  html.rd-v6 .composer.cmp-col .cmp-f > .pill-wrap { display: block; min-width: 0; }
  html.rd-v6 .composer.cmp-col .cmp-f > .pill-wrap > .pill { display: flex; width: 100%; height: 36px; justify-content: flex-start; padding: 0 12px; border-radius: 11px; box-sizing: border-box; }
  html.rd-v6 .composer.cmp-col .cmp-f > .pill-wrap > .pill b { flex: 0 1 auto; min-width: 0; max-width: none; font-weight: 650; }
  html.rd-v6 .composer.cmp-col .cmp-f > .pill-wrap > .pill .caret { margin-left: auto; width: 7px; height: 7px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; height: 36px; padding: 3px; border-radius: 11px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline button { height: 30px; padding: 0 4px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline .seg-thumb { border-radius: 8px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline .seg-k { display: none; }
  html.rd-v6 .composer.cmp-col .cmp-f > .vgender { display: grid; grid-template-columns: 1fr 1fr; border-radius: 11px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .vgender button { border-radius: 8px; }
  html.rd-v6 .composer.cmp-col .srv-notes { display: flex; gap: 6px; align-items: flex-start; padding: 0; font-size: 12px; line-height: 1.4; color: var(--muted); white-space: normal; overflow: visible;
    -webkit-line-clamp: unset; line-clamp: unset; }

  /* references: tiles */
  html.rd-v6 .composer.cmp-col .cmp-adds { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .cmp-lab, html.rd-v6 .composer.cmp-col .cmp-tools > .cmp-lab { grid-column: 1 / -1; flex: 0 0 100%; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .add-btn { flex-direction: column; justify-content: center; gap: 3px; height: 62px; padding: 0 4px; border-radius: 12px; font-size: 12px; min-width: 0; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .add-btn .ab-l { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .add-btn .ab-n { font-size: 11px; font-weight: 600; opacity: .75; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .frames-box { display: flex; height: 62px; padding: 3px; gap: 3px; border-radius: 12px; box-sizing: border-box; min-width: 0; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .frames-box:has(.frame-slot + .frame-slot), html.rd-v6 .composer.cmp-col .cmp-adds > .frames-box:has(.fs-sep) { grid-column: span 2; }
  html.rd-v6 .composer.cmp-col .frames-box .frame-slot { flex: 1 1 0; min-width: 0; height: 100%; flex-direction: column; justify-content: center; gap: 3px; padding: 0 4px; border-radius: 9px; font-size: 12px; }
  html.rd-v6 .composer.cmp-col .frames-box .frame-slot .fs-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .composer.cmp-col .frames-box .frame-slot.has { flex-direction: row; padding: 0 20px 0 4px; }
  html.rd-v6 .composer.cmp-col .frames-box .fs-sep { height: 28px; margin: 0; align-self: center; }

  /* tools */
  html.rd-v6 .composer.cmp-col .cmp-tools { display: flex; flex-wrap: wrap; gap: 6px; }
  html.rd-v6 .composer.cmp-col .cmp-tools > .mo-chip, html.rd-v6 .composer.cmp-col .cmp-tools > .t74-tool, html.rd-v6 .composer.cmp-col .cmp-tools > .chr-pill { flex: 1 1 auto; }
  html.rd-v6 .composer.cmp-col .cmp-tools > .mo-chip, html.rd-v6 .composer.cmp-col .cmp-tools > .t74-tool, html.rd-v6 .composer.cmp-col .cmp-tools .chr-pill .pill { height: 32px; padding: 0 9px; gap: 5px;
    justify-content: center; font-size: 12.5px; }
  html.rd-v6 .composer.cmp-col .cmp-tools .chr-pill .pill { width: 100%; }
  html.rd-v6 .composer.cmp-col .cmp-tools .chr-pill .pill .caret { display: none; }
  html.rd-v6 .composer.cmp-col .cmp-tools .chr-pill .pill b { max-width: 96px; font-weight: 650; }

  /* Generate: pinned to the bottom of the column */
  html.rd-v6 .composer.cmp-col > .composer-foot { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 20px 16px; border-top: 1px solid var(--line);
    background: var(--cmp-bg); }
  html.rd-v6 .composer.cmp-col .composer-go { display: flex; margin: 0; }
  html.rd-v6 .composer.cmp-col .composer-go > * { flex: 1; min-width: 0; }
  html.rd-v6 .composer.cmp-col .composer-go .btn { width: 100%; }
  /* popovers open beside the column (studio.js places them, fixed) */
  html.rd-v6.lay-left .composer.cmp-col .pop { position: fixed; bottom: auto; }

  /* the results: the rest of the width */
  html.rd-v6.lay-left main { max-width: none; margin: 0 0 0 var(--cmp-w); padding: 22px 28px 16px; }
  html.rd-v6.lay-left.has-composer body { padding-bottom: 0; }
  html.rd-v6.lay-left body > .site-notice { width: auto; max-width: none; margin-left: calc(var(--cmp-w) + 28px); margin-right: 28px; }
}
@media (min-width: 1400px) { html.rd-v6.lay-left { --s3-cols: 5; } }
@media (min-width: 1680px) { html.rd-v6.lay-left { --s3-cols: 6; } }
@media (min-width: 1900px) { html.rd-v6.lay-left { --s3-cols: 7; } }
@media (min-width: 2200px) { html.rd-v6.lay-left { --s3-cols: 8; } }
@media (min-width: 2560px) { html.rd-v6.lay-left { --s3-cols: 9; } }

/* a video poster fills its thumbnail box: a portrait poster grew past it, showed its top and pushed the play badge out of sight */
.tile .media .vthumb { position: absolute; inset: 0; width: auto; height: auto; }

/* ==========================================================================
   Compact result tiles in the studio grid (owner 03.12: "fit more tiles on the screen, make them a bit smaller").
   16:9 thumbnail (studio.js stretches it up to 4:3 with --s3-mh when the rows leave height over), two text lines
   (model + price, one line of the prompt), the time and the retry offer as chips on the thumbnail. Every card has one height.
   The "View all" drawer and the phone grid keep their own cards.
   ========================================================================== */
@media (min-width: 641px) {
  html.rd-v6 .studio2 > .grid > .tile { min-width: 0; border-radius: 12px; }
  html.rd-v6 .studio2 > .grid > .tile .media { aspect-ratio: 16 / 9; height: var(--s3-mh, auto); }
  html.rd-v6 .studio2 > .grid > .tile .meta { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 7px 9px 8px; }
  html.rd-v6 .studio2 > .grid > .tile .meta .row { gap: 6px; font-size: 12.5px; line-height: 16px; }
  html.rd-v6 .studio2 > .grid > .tile .meta .row > .sp { font-size: 11.5px; }
  html.rd-v6 .studio2 > .grid > .tile .meta .row > .status { padding: 0 6px; font-size: 10.5px; line-height: 16px; }
  html.rd-v6 .studio2 > .grid > .tile .meta .row > .cmp-tag { height: 16px; padding: 0 6px; font-size: 10.5px; }
  html.rd-v6 .studio2 > .grid > .tile .meta .prompt { display: block; font-size: 11.5px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .studio2 > .grid > .tile .meta .tile-moved { margin-top: 1px; padding: 1px 7px; font-size: 10.5px; }
  /* the time: a chip in the thumbnail's bottom left corner */
  html.rd-v6 .studio2 > .grid > .tile .meta .tile-time { position: absolute; left: 6px; bottom: calc(100% + 6px); max-width: calc(100% - 12px); box-sizing: border-box; padding: 1px 7px;
    border-radius: 999px; background: rgba(10, 10, 12, .62); color: #fff; font-size: 10.5px; font-weight: 650; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  html.rd-v6 .studio2 > .grid > .tile:has(.failcard, .failnote) .meta .tile-time { background: none; color: #6b7280; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-theme="dark"].rd-v6 .studio2 > .grid > .tile:has(.failcard, .failnote) .meta .tile-time { color: #aab0b9; }
  html.rd-v6 .studio2 > .grid > .tile:has(.gen-loading, .gen-wait) .meta .tile-time { display: none; }
  html.rd-v6 .studio2 > .grid > .tile:has(.audio-tile) { position: relative; }
  html.rd-v6 .studio2 > .grid > .tile:has(.audio-tile) .meta { position: static; }
  html.rd-v6 .studio2 > .grid > .tile:has(.audio-tile) .meta .tile-time { top: 6px; bottom: auto; }
  html.rd-v6 .studio2 > .grid > .tile.starred:has(.audio-tile) .meta .tile-time { left: 34px; max-width: calc(100% - 40px); }
  /* badges and hover buttons, one step smaller */
  html.rd-v6 .studio2 > .grid > .tile .media .vthumb-play { width: 38px; height: 38px; padding-left: 2px; font-size: 14px; }
  html.rd-v6 .studio2 > .grid > .tile .tile-star { top: 6px; left: 6px; width: 22px; height: 22px; }
  html.rd-v6 .studio2 > .grid > .tile .tile-star .ico { width: 12px; height: 12px; }
  html.rd-v6 .studio2 > .grid > .tile .tile-actions { top: 6px; right: 6px; gap: 3px; }
  html.rd-v6 .studio2 > .grid > .tile .tile-btn { width: 24px; height: 24px; border-radius: 7px; }
  html.rd-v6 .studio2 > .grid > .tile .tile-btn .ico { width: 12px; height: 12px; }
  /* failed / generating / waiting cards in the small thumbnail */
  html.rd-v6 .studio2 > .grid > .tile .failcard { gap: 4px; padding: 8px 10px; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-title { max-width: 100%; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-why, html.rd-v6 .studio2 > .grid > .tile .failcard .fc-alt, html.rd-v6 .studio2 > .grid > .tile .failcard .fc-hint { font-size: 11px; line-height: 1.35; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-back { margin-top: 1px; padding: 1px 8px; font-size: 10.5px; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-back .ico { width: 11px; height: 11px; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-ico { width: 26px; height: 26px; }
  html.rd-v6 .studio2 > .grid > .tile .failcard .fc-ico .ico { width: 13px; height: 13px; }
  @container (max-height: 124px) { html.rd-v6 .studio2 > .grid > .tile .failcard .fc-ico { display: none; } }
  html.rd-v6 .studio2 > .grid > .tile .gen-loading { gap: 5px !important; }
  html.rd-v6 .studio2 > .grid > .tile .gen-loading .gen-ring { width: 28px; height: 28px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-loading .gen-label { font-size: 13px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-loading .gen-left { font-size: 11.5px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-loading .gen-busy { font-size: 10.5px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait { gap: 3px; padding: 6px 8px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-title { font-size: 13px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-title .ico { width: 14px; height: 14px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-sub { font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-row { gap: 5px; margin-top: 2px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-pos { padding: 2px 7px; font-size: 10.5px; }
  html.rd-v6 .studio2 > .grid > .tile .gen-wait .gw-cancel { min-height: 22px; height: 22px; padding: 0 9px; font-size: 11px; }
  html.rd-v6 .studio2 > .grid > .tile .audio-tile { padding: 8px; gap: 4px; }
  html.rd-v6 .studio2 > .grid > .tile .audio-tile audio { height: 28px; }
  /* "Retry 300 210 cr" on a fresh result: a pill over the thumbnail's bottom edge in place of the time (the card keeps its height) */
  html.rd-v6 .studio2 > .grid > .tile .meta .rt-slot { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 6px); }
  html.rd-v6 .studio2 > .grid > .tile .meta:has(.rt-btn) .tile-time { display: none; }
  html.rd-v6 .studio2 > .grid > .tile .rt-btn { height: 24px; min-height: 0; margin: 0; padding: 0 9px; gap: 6px; border-radius: 999px; font-size: 11.5px;
    background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 1px 5px rgba(10, 10, 12, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  html.rd-v6 .studio2 > .grid > .tile .rt-btn:hover { background: var(--panel); }
  html.rd-v6 .studio2 > .grid > .tile .rt-btn .ico { width: 12px; height: 12px; }
  html.rd-v6 .studio2 > .grid > .tile .rt-btn .rt-x { display: none; }
  /* the "View all" tile */
  html.rd-v6 .studio2 > .grid > .all-tile { min-height: 0; }
  html.rd-v6 .studio2 > .grid > .all-tile .all-over { gap: 5px; padding: 8px; }
  html.rd-v6 .studio2 > .grid > .all-tile .all-ico { width: 34px; height: 34px; }
  html.rd-v6 .studio2 > .grid > .all-tile .all-ico .ico { width: 17px; height: 17px; }
  html.rd-v6 .studio2 > .grid > .all-tile b { font-size: 15px; }
  html.rd-v6 .studio2 > .grid > .all-tile .all-n { padding: 1px 9px; font-size: 12px; }
  html.rd-v6 .studio2 > .grid > .all-tile .all-arrow { font-size: 16px; line-height: 1; }
}
/* a short window (a laptop at 125 %): everything still fits without scrolling the column */
@media (min-width: 1200px) and (max-height: 800px) {
  html.rd-v6 .composer.cmp-col .cmp-body { gap: 11px; padding-top: 14px; }
  html.rd-v6 .composer.cmp-col .cmp-prompt .composer-input:not(.lyrics) { min-height: 54px; }
  html.rd-v6 .composer.cmp-col .composer-opts { gap: 5px 10px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .pill-wrap > .pill, html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline { height: 34px; }
  html.rd-v6 .composer.cmp-col .cmp-f > .seg-inline button { height: 28px; }
  html.rd-v6 .composer.cmp-col .cmp-adds { display: flex; flex-wrap: wrap; gap: 6px; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .add-btn { flex: 1 1 0; flex-direction: row; gap: 5px; height: 34px; padding: 0 8px; border-radius: 999px; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .add-btn .ab-l { display: none; }
  html.rd-v6 .composer.cmp-col .cmp-adds > .frames-box { flex: 1.6 1 auto; height: 34px; padding: 0; gap: 0; border-radius: 999px; }
  html.rd-v6 .composer.cmp-col .frames-box .frame-slot { flex-direction: row; gap: 5px; padding: 0 9px; border-radius: 999px; }
  html.rd-v6 .composer.cmp-col .frames-box .fs-sep { height: 16px; }
  html.rd-v6 .composer.cmp-col .cmp-prompt > .composer-main { min-height: 100px; }
  html.rd-v6 .composer.cmp-col .srv-notes, html.rd-v6 .composer.cmp-col .go-sub { display: none; }
  html.rd-v6 .composer.cmp-col > .composer-foot { padding: 10px 20px 12px; }
  html.rd-v6 .composer.cmp-col .composer-go .btn { height: 46px; }
}

/* ==========================================================================
   Result popup (views/stage.js)
   ========================================================================== */
.stg { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(15, 17, 21, .58); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  color: var(--text); opacity: 0; transition: opacity var(--stg-ms, 200ms) ease-out; }
.stg.in { opacity: 1; }
.stg-card { display: flex; height: var(--stg-h, min(800px, calc(100vh - 56px))); max-width: calc(100vw - 32px); border-radius: 24px; background: var(--panel); overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55); transform: translateY(8px) scale(.985); transition: transform var(--stg-ms, 200ms) cubic-bezier(.2, .8, .2, 1); }
.stg.in .stg-card { transform: none; }
.stg-card:focus { outline: none; }
.stg-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; box-sizing: border-box; width: var(--stg-w, 720px); min-width: 0; padding: 52px 0 16px;
  background: var(--s3-canvas, var(--panel-2)); }
.stg-top { position: absolute; left: 20px; right: 20px; top: 14px; display: flex; align-items: center; gap: 12px; min-height: 26px; }
.stg-count { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stg-sp { flex: 1; }
.stg kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin: 0 2px; border-radius: 6px; background: var(--cmp-chip, var(--panel-2)); color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 650; line-height: 17px; text-align: center; box-sizing: border-box; }
.stg-keys { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stg-space { display: none; margin-left: 4px; }
.stg.is-playable .stg-space { display: inline; }
.stg-esc { margin-left: 4px; }
.stg-x { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--cmp-chip, var(--panel-2)); color: var(--text); cursor: pointer; }
.stg-x:hover { background: var(--cmp-chip-hover, var(--line)); }
.stg-x .ico { width: 18px; height: 18px; }
.stg-x-top { display: none; }
.stg-ready { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 4px; border-radius: 999px; background: #0f1115; color: #fff; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45); white-space: nowrap; }
.stg-ready[hidden] { display: none; }
.stg-ready img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.stg-ready b { font-size: 13.5px; font-weight: 700; padding-left: 4px; }
.stg-view { height: 28px; padding: 0 14px; border: 0; border-radius: 999px; background: #16a34a; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.stg-view:hover { background: #15803d; }
.stg-pill-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: #d4d4d8; cursor: pointer; }
.stg-pill-x .ico { width: 14px; height: 14px; }
.stg-pill-x:hover { color: #fff; background: rgba(255, 255, 255, .12); }

.stg-media { position: relative; flex: 1 1 auto; min-height: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; }
.stg-frame { display: grid; place-items: center; min-width: 0; min-height: 0; }
.stg-box { position: relative; display: block; line-height: 0; }
.stg-m { display: block; max-width: 100%; max-height: 100%; border-radius: 16px; object-fit: contain; background: #0b0c0e; box-shadow: 0 18px 40px -18px rgba(15, 17, 21, .5); }
img.stg-m { background: var(--panel-2); }
.stg-aud { display: flex; flex-direction: column; justify-content: center; gap: 18px; box-sizing: border-box; padding: 26px; line-height: normal; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(15, 17, 21, .35); }
.stg-aud .audio-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 96px; }
.stg-aud .audio-wave i { display: block; width: 6px; border-radius: 3px; background: color-mix(in srgb, var(--s3-g, #16a34a) 70%, var(--panel)); }
.stg-aud audio { width: 100%; }
.stg-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; padding: 0;
  border: 1px solid var(--line-strong, var(--line)); border-radius: 50%; background: var(--panel); color: var(--text); cursor: pointer; box-shadow: 0 6px 18px -8px rgba(15, 17, 21, .35); }
.stg-nav.prev { left: 16px; }
.stg-nav.next { right: 16px; }
.stg-nav .ico { width: 22px; height: 22px; }
.stg-nav:hover:not(:disabled) { border-color: #16a34a; color: #16a34a; }
.stg-nav:disabled { opacity: .4; cursor: default; }
.stg-nav:focus-visible, .stg-x:focus-visible, .stg-th:focus-visible, .stg-btn:focus-visible, .stg-link:focus-visible, .stg-up-o:focus-visible { outline: 2px solid #16a34a; outline-offset: 2px; }

.stg-strip { flex: none; display: flex; gap: 8px; max-width: calc(100% - 44px); overflow-x: auto; padding: 3px; scrollbar-width: none; }
.stg-strip::-webkit-scrollbar { display: none; }
.stg-th { position: relative; flex: none; width: 56px; height: 40px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: visible; background: var(--panel-2); cursor: pointer;
  opacity: .75; transition: opacity .15s, border-color .15s; }
.stg-th img, .stg-th video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.stg-th-a { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.stg-th-a .ico { width: 18px; height: 18px; }
.stg-th:hover { opacity: 1; }
.stg-th.on { border-color: var(--s3-g, #16a34a); opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--s3-g, #16a34a) 25%, transparent); }
.stg-th.is-new::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 2px var(--panel); }

/* the details column */
.stg-info { display: flex; flex-direction: column; flex: none; width: var(--stg-info-w, 384px); box-sizing: border-box; min-height: 0; border-left: 1px solid var(--line-strong, var(--line)); background: var(--panel); }
.stg-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.stg-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; line-height: 1.3; }
.stg-head h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-head h2 .ico { flex: none; width: 18px; height: 18px; }
.stg-head .status.done { flex: none; display: inline-block; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, #16a34a 14%, var(--panel)); color: var(--s3-gd, #15803d);
  font-size: 12px; font-weight: 750; line-height: 1.5; }
.stg-head .status.done::first-letter { text-transform: uppercase; }
.stg-head .stg-x { margin-left: auto; }
.stg-ib { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; gap: 16px; padding: 18px 22px; }
.stg-ib > * { flex: none; margin: 0; }
.stg-ib > .stg-fill { flex: 1 1 0; min-height: 0; }
.stg-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.stg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 42px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--line-strong, var(--line)); border-radius: 999px; background: var(--panel); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.stg-btn.primary, .stg-btn.full { grid-column: span 2; }
.stg-btn.primary { height: 46px; border-color: var(--cmp-ink, #0f1115); background: var(--cmp-ink, #0f1115); color: var(--cmp-bg, #fff); }
.stg-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stg-btn .ico { width: 16px; height: 16px; flex: none; }
.stg-btn small { flex: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.stg-btn:hover { border-color: #16a34a; }
.stg-btn.primary:hover { border-color: #16a34a; background: #16a34a; color: #fff; }
.stg-btn.go { border-color: #16a34a; background: #16a34a; color: #fff; }
.stg-btn.go small { color: #fff; opacity: .92; padding-left: 9px; border-left: 1px solid rgba(255, 255, 255, .4); font-size: 13px; font-weight: 700; }
.stg-btn.go:hover:not(:disabled) { background: #15803d; border-color: #15803d; }
.stg-btn.go:disabled { opacity: .7; cursor: progress; }
.stg-btn.warn { border-color: #f59e0b; color: #b45309; }
.stg-up-btn.on { border-color: #16a34a; background: color-mix(in srgb, #16a34a 9%, var(--panel)); }
.stg-up-btn .ico { color: #16a34a; }
/* owner 03.12: the 2K / 4K hint sits on the label's centre line */
.stg-btn > span, .stg-btn > small { line-height: 1; display: inline-flex; align-items: center; }
.stg-btn > small { height: 1em; }
.stg-up { grid-column: span 2; display: grid; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, #16a34a 38%, var(--line)); border-radius: 18px;
  background: color-mix(in srgb, #16a34a 5%, var(--panel)); }
.stg-up-opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.stg-up-o { display: grid; justify-items: center; align-content: center; gap: 1px; min-width: 0; min-height: 62px; padding: 6px 4px; border: 1.5px solid var(--line-strong, var(--line)); border-radius: 12px;
  background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.stg-up-o b { font-size: 15px; font-weight: 800; }
.stg-up-o small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.stg-up-o .stg-up-p { font-size: 12.5px; font-weight: 700; color: var(--s3-gd, #15803d); font-variant-numeric: tabular-nums; }
.stg-up-o:hover:not(:disabled) { border-color: #16a34a; }
.stg-up-o.on { border-color: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 16%, transparent); }
.stg-up-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.stg-up-note .ico { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.stg-up { grid-template-columns: minmax(0, 1fr); }
.stg-up .stg-btn, .stg-up .stg-btn.full { grid-column: 1; width: 100%; }
.stg-up .btn-spin { width: 14px; height: 14px; border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
.stg-links { grid-column: span 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding-top: 4px; }
.stg-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.stg-link .ico { width: 15px; height: 15px; }
.stg-link:hover { color: var(--text); }
.stg-link.on { color: #b45309; }
.stg-link.on .ico { fill: currentColor; }
.stg-info .sheet-block { margin: 0; padding: 0; border: 0; background: none; }
.stg-info .sheet-label { display: flex; justify-content: space-between; align-items: center; margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stg-info .sheet-label .link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--s3-gd, #15803d); font: inherit; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0; text-transform: none; text-decoration: none; cursor: pointer; }
.stg-info .sheet-label .link-btn .ico { width: 13px; height: 13px; }
.stg-info .sheet-prompt { margin: 8px 0 0; padding: 12px 14px; max-height: none; overflow: visible; overflow-wrap: anywhere; white-space: pre-wrap; border: 0; border-radius: 14px; background: var(--panel-2);
  font-size: 14px; line-height: 1.5; color: var(--text); }
.stg-info .sheet-rows { display: flex; flex-direction: column; }
.stg-info .sheet-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-top: 1px solid var(--line); }
.stg-info .sheet-row:first-child { border-top: 0; }
.stg-info .sheet-row b { font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.stg-info .ai-note { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
html[data-theme="dark"] .stg-m { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .stg-card { box-shadow: 0 40px 100px -30px #000, 0 0 0 1px var(--line); }
html[data-theme="dark"] .stg-btn.warn { color: #fbbf24; }

@media (min-width: 980px) and (max-width: 1179.98px) {
  .stg-nav.prev { left: 10px; } .stg-nav.next { right: 10px; }
  .stg-btn { padding: 0 8px; gap: 6px; font-size: 13px; }
  .stg-ib { padding-left: 18px; padding-right: 18px; }
  .stg-esc { display: none; }
}
@media (min-width: 980px) and (max-height: 800px) {
  .stg-stage { padding-top: 46px; gap: 12px; }
  .stg-top { top: 10px; }
  .stg-th { width: 50px; height: 36px; }
  .stg-head { padding: 12px 14px 11px 22px; }
  .stg-ib { gap: 11px; padding: 14px 22px; }
  .stg-btn { height: 38px; }
  .stg-btn.primary { height: 42px; }
  .stg-info .sheet-row { padding: 5px 0; }
  .stg-info .sheet-prompt { padding: 10px 12px; }
  .stg-up-o { min-height: 54px; }
}
@media (prefers-reduced-motion: reduce) { .stg, .stg-card { transition: none; } }

/* phones and small tablets: a full-screen sheet (media, actions, prompt, rows, then the strip) */
@media (max-width: 979.98px) {
  .stg { display: block; place-items: normal; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .stg-card { display: flex; flex-direction: column; justify-self: stretch; box-sizing: border-box; width: 100%; height: auto; min-height: 100%; max-width: none; border-radius: 0; background: var(--bg); box-shadow: none; overflow: visible; transform: translateY(14px); }
  .stg-stage { display: contents; }
  .stg-top { position: sticky; top: 0; left: auto; right: auto; z-index: 4; order: 0; padding: max(8px, env(safe-area-inset-top)) 8px 8px 16px; background: var(--bg); flex-wrap: wrap; }
  .stg-keys { display: none; }
  .stg-x-top { display: grid; }
  .stg-x-side { display: none; }
  .stg-ready { position: static; transform: none; order: 5; flex-basis: 100%; justify-content: space-between; }
  .stg-media { order: 1; flex: none; display: block; padding: 0 12px; }
  .stg-frame { display: block; }
  .stg-box { line-height: normal; }
  .stg-m { width: 100%; height: auto; max-height: 68vh; max-height: 68dvh; border-radius: 12px; }
  .stg-aud { height: 220px; }
  .stg-nav { width: 36px; height: 36px; margin-top: -18px; }
  .stg-nav.prev { left: 18px; } .stg-nav.next { right: 18px; }
  .stg-nav:disabled { display: none; }
  .stg-info { order: 2; width: auto; margin: 12px 12px 0; border: 1px solid var(--line); border-radius: 18px; }
  .stg-head { padding: 14px 14px 12px; }
  .stg-ib { overflow: visible; padding: 14px; gap: 14px; }
  .stg-strip { order: 3; max-width: none; padding: 12px 12px max(16px, env(safe-area-inset-bottom)); }
  .jc-esc { display: none; }
}

/* ---------- TUR-135 (owner 04.12): the phone composer is one flush section sitting on the tab bar - full width, no side
   margins, no gap below, square corners (top ones too, owner 04.12), tighter rows; the freed height goes to the results ---------- */
@media (max-width: 640px) {
  html.rd-v6 .composer.cmp-b:not(.is-open), html.rd-v6 .composer.cmp-b:not(.is-open):focus-within { left: 0; right: 0; bottom: 0; width: 100vw; margin: 0; gap: 4px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid var(--line, #e6e9ea); border-radius: 0;
    box-shadow: 0 -8px 22px -14px rgba(15, 17, 21, .28); }
  html.rd-v6.has-tabbar .composer.cmp-b:not(.is-open) { bottom: var(--tabbar-h, 58px); padding-bottom: 8px; }
  html.rd-v6.cmp-typing .composer.cmp-b:not(.is-open) { bottom: var(--kb-off, 0px); padding-bottom: 8px; }
  html.rd-v6[data-theme="dark"] .composer.cmp-b:not(.is-open) { box-shadow: 0 -10px 26px -14px rgba(0, 0, 0, .8); }
  html.rd-v6.has-composer .tabbar:not([hidden]) { border-top-color: transparent; }
  html.rd-v6.has-composer.has-tabbar body { padding-bottom: calc(var(--composer-h, 64px) + var(--tabbar-h) + 12px); }
  /* chips: 32 px tall, the tap area reaches 40 px inside the bar's own padding */
  html.rd-v6 .composer.cmp-b:not(.is-open) .pz-bar { padding: 4px 0; margin: -4px 0 -2px; gap: 6px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .pz-open, html.rd-v6 .composer.cmp-b:not(.is-open) .pz-chip { position: relative; height: 32px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .pz-open::after, html.rd-v6 .composer.cmp-b:not(.is-open) .pz-chip::after { content: ""; position: absolute; inset: -4px 0; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .composer-main { padding: 6px 8px 6px 12px; border-radius: 14px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .composer-input:not(.lyrics) { min-height: 44px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .cmp-sum { padding: 0 2px 0 4px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .cs-t, html.rd-v6 .composer.cmp-b:not(.is-open) .cs-chg { min-height: 40px; }
  html.rd-v6 .composer.cmp-b:not(.is-open) .composer-go .btn { height: 46px; border-radius: 14px; }
}

/* TUR-150: the supplier-queue line stays amber in every layout and theme, and stays visible on short screens */
html.rd-v6 .composer .relaxed-bar.srv-notes.srv-queue { color: #b45309; }
html.rd-v6[data-theme="dark"] .composer .relaxed-bar.srv-notes.srv-queue { color: #fcd34d; }
@media (min-width: 1200px) and (max-height: 800px) {
  html.rd-v6 .composer.cmp-col .relaxed-bar.srv-notes.srv-queue { display: flex; }
}
