/* The studio app (/, /create, /ads) in the kit (pk.css). Loaded last: it re-lays the older sheets (app.css,
   studio.css) out to the approved screens: the island nav, the featured film and the picked rows on explore, the
   kit cards, the studio's stage with the composer panel on the right (a sheet on phones), the viewers, the sign-in
   panel and the menus. Spacing is on the 8px scale; the page gutter is 48 (20 on phones). */

:root { --side: 400px; --top: 80px; --pad: var(--gutter); }

body { font-size: 15px; line-height: 1.5; font-family: var(--f-text); font-stretch: 100%; }
button, input, textarea, select { font-family: var(--f-text); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 999px; }
textarea:focus-visible, input:focus-visible { outline: none; }

/* which page shows what */
body:not(.view-explore) .hero, body:not(.view-explore) .rows { display: none; }
body:not(.view-library) .dock { display: none !important; }
.hero-slot { position: static; width: auto; min-height: 0 !important; }

/* ---------- the island nav */
.top, .top.solid, body.view-library .top {
  position: fixed; top: 24px; left: 0; right: 0; z-index: 50; height: auto;
  display: flex; justify-content: center; padding: 0 16px; grid-template-columns: none; gap: 0;
  background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
}
.top::before { display: none; }
.top .island { pointer-events: auto; max-width: 100%; }
.top .brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 10px; color: var(--bone); }
.top .brand .mark, .foot .brand .mark { width: 26px; height: 26px; color: var(--bone); }
.brand .wm { font-family: var(--f-mark); font-size: 19px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.045em; line-height: 1; padding: 0; }
.views, body.view-library .views { display: flex; gap: 4px; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
.view-tab { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 550; color: var(--bone-2); }
.view-tab:hover { background: var(--control); color: var(--bone); }
.view-tab.on, .view-tab.on:hover { background: var(--raised); color: var(--bone); font-weight: 550; }
.view-tab .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); }
.top-right { display: flex; align-items: center; gap: 4px; margin-left: 8px; justify-self: auto; }
.top .btn-nav.light { height: 40px; padding: 0 18px; margin-left: 4px; border: 0; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 15px; font-weight: 600; box-shadow: none; }
.top .btn-nav.light:hover { background: #fbf6ee; }
.top .bal, .top .bal:hover { height: 36px; margin: 0 0 0 4px; padding: 0 14px; gap: 8px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone); font-size: 14px; font-weight: 550; box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
.top .bal:hover { background: var(--raised); }
.top .bal svg { color: var(--bone-2); }
.top .bal.low .bal-n { color: var(--accent); }
.top .bal-cta { color: var(--bone-2); }
.top .me, .top .me:hover { width: 36px; height: 36px; margin: 0 4px; border: 0; background: var(--raised); color: var(--bone); font-size: 14px; font-weight: 650; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top .me:hover { background: #38332d; }
@media (max-width: 1180px) {
  .view-tab { padding: 0 12px; }
  .top .brand { padding-right: 10px; }
}
@media (max-width: 1040px) {
  .top .brand .wm { display: none; }
}

/* ---------- explore: the featured film */
.hero { position: relative; display: block; min-height: 0; padding: 120px var(--gutter) 0; overflow: visible; overflow-x: clip; align-items: initial; }
@supports (min-height: 1svh) { .hero { min-height: 0; } }
.feat { position: relative; display: flex; align-items: stretch; justify-content: space-between; gap: 64px; max-width: 1784px; margin: 0 auto; }
.feat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding-bottom: 8px; }
.feat-meta { margin: 0; }
.feat-copy { display: flex; flex-direction: column; gap: 24px; }
.feat-title { margin: 0; }
.feat-title a { color: inherit; text-decoration: none; }
.feat-lead { margin: 0; max-width: 460px; }
.feat-acts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.feat-film { position: relative; flex: none; width: min(50vw, calc((100svh - 212px) * 1.7778), 960px); min-width: 520px; }
.feat-glow { position: absolute; left: -7%; top: 8%; width: 114%; height: 104%; object-fit: cover; filter: blur(56px) saturate(1.5); opacity: 0.72; pointer-events: none; transform: translateZ(0); }
.feat-shell { position: relative; }
.feat-core { aspect-ratio: 16 / 9; }
.feat-poster, .feat-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feat-video { opacity: 0; transition: opacity .6s var(--ease); }
.feat-core.live .feat-video { opacity: 1; }
.feat-hit { position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 22px; }
.feat-core .pk-scrim { z-index: 1; }
.feat-ctl { position: absolute; left: 24px; right: 24px; bottom: 22px; z-index: 2; display: flex; align-items: center; gap: 16px; }
.feat-ctl .pk-label { color: var(--bone-2); }
.feat-bar { flex: 1; }
.feat-bar i { width: 100%; transform: scaleX(0.45); transition: transform .3s linear; }

/* the picked rows */
.rows { position: relative; display: flex; flex-direction: column; gap: 40px; max-width: 1880px; margin: 0 auto; padding: 64px var(--gutter) 0; }
.row { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.row-all { display: inline-flex; align-items: center; gap: 8px; color: var(--bone-3); transition: color .2s; }
.row-all:hover { color: var(--bone); }
.row-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.rcard .pk-thumb img { transform-origin: 50% 50%; }

/* ---------- explore: the whole library, as kit cards */
.explore { position: relative; max-width: 1880px; margin: 0 auto; padding: 64px var(--gutter) 160px; }
.x-head { align-items: center; margin-bottom: 16px; gap: 16px; }
.x-title { align-items: baseline; gap: 12px; }
.sec-h.pk-h2, .explore .sec-h { font-family: var(--f-text); font-size: 18px; font-weight: 650; font-stretch: 100%; letter-spacing: 0; line-height: 1.3; text-transform: none; }
.sec-n { font-size: 14px; color: var(--bone-3); }
.x-tools { gap: 12px; }
.x-chips { gap: 8px; margin: 0 0 24px; }

/* segments everywhere: the kit's */
.seg, .x-tools .seg, .lib-head .tabs { flex: none; display: flex; gap: 4px; padding: 4px; border: 0; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); }
.seg button, .lib-head .tab { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--bone-2); }
.seg button:hover, .lib-head .tab:hover { color: var(--bone); background: transparent; }
.seg button.on, .lib-head .tab.on { background: var(--raised); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.lib-head .tab .n { color: var(--bone-3); }
.find, .lib-find { height: 44px; gap: 10px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone-3); box-shadow: inset 0 0 0 1px var(--line); }
.find:focus-within { background: var(--control); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px rgba(242, 236, 226, 0.3); }
.find input { font-size: 15px; color: var(--bone); }
.find input::placeholder { color: var(--bone-3); }
.xchip { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone-2); font-size: 14px; font-weight: 550; box-shadow: inset 0 0 0 1px var(--line); }
.xchip:hover { color: var(--bone); background: var(--control); }
.xchip.on, .xchip.on:hover { background: var(--bone); color: var(--ink); box-shadow: none; font-weight: 600; }
.x-empty { color: var(--bone-3); }
.x-end { margin: 48px auto 0; display: flex; width: fit-content; }

.ecard { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 10px; overflow: visible; border-radius: 0; background: none; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 320px; outline-offset: 4px; border-radius: 16px; }
.ec-media { position: relative; flex: none; height: var(--ih, 200px); overflow: hidden; border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.ecard .ec-media img, .ecard .ec-media .ec-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ecard .ec-media img { opacity: 0; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.ecard .ec-media img.on { opacity: 1; }
.ecard:hover .ec-media img { transform: scale(1.035); }
.ec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; height: 24px; padding: 0 2px; }
.ec-title { display: block; flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--bone); -webkit-line-clamp: none; }
.ec-model { flex: none; position: static; height: auto; padding: 0; border: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; opacity: 1; font-size: 14px; font-weight: 500; color: var(--bone-3); }
.ec-go { position: absolute; right: 10px; bottom: 10px; z-index: 2; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity .25s var(--ease), transform .3s var(--ease), background .2s; }
.ec-go:hover { background: #fbf6ee; }
.ecard:hover .ec-go, .ecard:focus-within .ec-go { opacity: 1; transform: none; }
@media (hover: none) { .ec-go { display: none; } }

/* ---------- the footer */
.foot { position: relative; max-width: 1880px; margin: 0 auto; padding: 32px var(--gutter) 64px; border-top: 1px solid var(--line); color: var(--bone-3); font-size: 14px; gap: 16px 24px; }
.foot .brand { display: inline-flex; align-items: center; gap: 10px; }
.foot .brand .wm { font-size: 17px; }
.foot nav a { color: var(--bone-3); }
.foot nav a:hover { color: var(--bone); }

/* ---------- the studio (/create): the stage, your takes, the composer panel on the right */
body.view-library .library { display: block; max-width: none; padding: 120px var(--gutter) 96px; }
.stage-wrap { margin: 0 0 48px; }
.stage { position: relative; }
.stage-core { height: clamp(280px, calc(100svh - 320px), 680px); cursor: zoom-in; }
.stage.st-empty .stage-core { height: auto; min-height: clamp(360px, calc(100svh - 280px), 640px); display: grid; place-items: center; cursor: default; }
.stage:not(.has-take) .stage-core, .stage[data-phase='dev'] .stage-core, .stage[data-phase='fail'] .stage-core { cursor: default; }
.stage-media { position: absolute; inset: 0; }
.stage.st-empty .stage-media { display: none; }
.st-fill { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(40px) saturate(1.2) brightness(0.5); }
.st-main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.st-dev { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 40%, #1d1a16 0%, var(--well) 70%); }
.st-dev-in { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 0 24px; }
.st-dev-in .pk-live { margin-bottom: 4px; }
.st-dev-t { font-size: 18px; font-weight: 650; color: var(--bone); }
.st-err { max-width: 46ch; }
.st-line { position: absolute; left: 24px; right: 24px; bottom: 22px; }
.st-line i { width: 100%; transform: scaleX(0.02); transition: transform 1s linear; }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 8px 0; }
.stage-bar[hidden] { display: none; }
.st-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-model { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-acts { display: flex; align-items: center; gap: 8px; }

.lib-head { align-items: center; margin-bottom: 24px; gap: 16px; }
.lib-head .sec-h { font-family: var(--f-text); font-size: 18px; font-weight: 650; font-stretch: 100%; letter-spacing: 0; text-transform: none; }
.lib-tools { gap: 12px; }
.wall { padding: 0; }

/* the empty studio: the welcome sits in the stage */
.library .none { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 480px; margin: 48px auto; padding: 0 24px; text-align: center; font-size: 15px; line-height: 1.55; color: var(--bone-2); }
.stage-core .none { margin: 40px auto; }
.none-mark { width: 40px; height: 40px; margin-bottom: 8px; color: var(--bone-2); }
.none-h { font-family: var(--f-display); font-stretch: 75%; font-weight: 800; letter-spacing: -0.02em; font-size: 28px; line-height: 1.05; text-transform: lowercase; color: var(--bone); }
.none-acts { gap: 8px; margin-top: 16px; }
.none-acts .pk-btn { height: 48px; }
.none-try { gap: 8px; margin-top: 32px; }
.none-try-h { font-size: 13px; color: var(--bone-3); }
.try { min-height: 48px; padding: 0 20px; gap: 12px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.try:hover { background: var(--raised); color: var(--bone); border: 0; }
.try svg { color: var(--bone-3); }

/* your takes */
.tile { border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.tile .veil { background: var(--scrim); }
.tile .cap { font-size: 13px; color: var(--bone); }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 999px; background: rgba(26, 24, 21, 0.78); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.icon-btn:hover { background: rgba(45, 41, 36, 0.92); }
.tile.liked .like-mark { color: var(--bone); }
.dur { color: var(--bone); font-size: 13px; }
.tile.dev { background: radial-gradient(120% 90% at 50% 40%, #1d1a16 0%, var(--well) 70%); }
.dev-state { font-size: 14px; font-weight: 600; color: var(--bone); }
.dev-model { font-size: 13px; color: var(--bone-3); }
.dev-spin { border-color: rgba(242, 236, 226, 0.16); border-top-color: var(--accent); }
.dev-bar { left: 16px; right: 16px; bottom: 14px; height: 3px; border-radius: 999px; background: rgba(242, 236, 226, 0.16); overflow: hidden; }
.dev-bar i { border-radius: 999px; background: var(--accent); }
.tile.fail { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.fail-head { font-size: 13px; color: var(--bone-3); }
.fail-msg { font-size: 14px; color: var(--bone-2); }
.btn-sm { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone); font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.btn-sm:hover { background: var(--raised); }
.btn-sm.light { background: var(--bone); color: var(--ink); box-shadow: none; }
.btn-sm.ghost { background: none; box-shadow: none; color: var(--bone-3); }

/* ---------- the composer: the studio's panel (desktop) */
.composer { font-size: 15px; }
.c-label { display: none; }
.go { height: 48px; margin-left: 4px; gap: 10px; padding: 0 6px 0 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; font-stretch: 100%; letter-spacing: 0; }
.go:hover:not(:disabled) { background: #f37f4c; }
.go .cost { color: var(--on-accent); opacity: 0.72; font-weight: 500; }
.go .pk-btn__icon { width: 36px; height: 36px; }
.go:disabled, .go:disabled:hover { background: var(--control); color: var(--bone-3); box-shadow: inset 0 0 0 1px var(--line); }
.go:disabled .cost { color: var(--bone-3); }
.go:disabled .pk-btn__icon { background: var(--raised); color: var(--bone-3); }
.shape { border-width: 1.5px; border-radius: 3px; }

@media (min-width: 900px) {
  body.view-library .library { padding-right: calc(var(--gutter) + var(--side) + 24px); }
  body.view-library.docked .dock {
    position: fixed; top: 120px; right: var(--gutter); left: auto; bottom: auto; z-index: 40;
    width: var(--side); max-height: calc(100svh - 144px);
    display: flex; flex-direction: column; padding: 0; overflow: hidden; pointer-events: auto;
    border: 0; border-radius: 24px; background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body.view-library.docked .dock .composer, body.view-library .composer {
    flex: 0 1 auto; min-height: 0; width: 100%; overflow-y: auto;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 16px 12px;
    padding: 24px; border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    scrollbar-width: thin; scrollbar-color: var(--raised) transparent;
  }
  body.view-library .composer:focus-within { border-color: transparent; }
  body.view-library .composer .c-bar, body.view-library .composer .c-chips, body.view-library .composer .c-field { display: contents; }

  /* image / video */
  body.view-library .composer .seg { grid-column: 1 / -1; order: 1; }
  body.view-library .composer .seg button, body.view-library .composer .seg button.on { flex: 1; height: 36px; font-size: 14px; font-weight: 550; }
  body.view-library .composer .seg button.on { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); }

  /* the prompt, in a well; look / camera sit inside it */
  body.view-library .composer .c-box { grid-column: 1 / -1; order: 2; display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 16px; border: 0; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s; }
  body.view-library .composer .c-box:focus-within { border-color: transparent; box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px rgba(242, 236, 226, 0.28); }
  body.view-library .composer .c-label { display: block; font-size: 13px; font-weight: 500; color: var(--bone-3); }
  body.view-library .composer .c-box textarea { min-height: 128px; max-height: 280px; padding: 0; border: 0; background: none; font-size: 16px; line-height: 1.6; color: var(--bone); }
  body.view-library .composer .c-inline { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
  body.view-library .composer .c-inline:empty { display: none; }
  body.view-library .composer .c-inline .chip { height: 32px; gap: 6px; padding: 0 12px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 550; color: var(--bone-2); }
  body.view-library .composer .c-inline .chip:hover, body.view-library .composer .c-inline .chip[aria-expanded='true'], body.view-library .composer .c-inline .chip.set { background: var(--raised); color: var(--bone); }

  /* references */
  body.view-library .composer .c-refs { grid-column: 1 / -1; order: 3; padding: 0; gap: 8px; }
  body.view-library .composer .c-add { grid-column: 1 / -1; order: 3; width: auto; height: 44px; margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 550; color: var(--bone-2); }
  body.view-library .composer .c-add::after { content: 'add a reference'; }
  body.view-library .composer .c-add:hover { background: var(--raised); color: var(--bone); border: 0; }
  body.view-library .composer .ref { width: 56px; height: 56px; border-radius: 16px; }
  body.view-library .composer .ref.frame { width: 80px; }
  body.view-library .composer .slot { height: 56px; border-radius: 16px; border: 1px dashed var(--line-2); color: var(--bone-2); }
  body.view-library .composer .slot-hint { flex-basis: 100%; padding: 4px 0 0; font-size: 13px; color: var(--bone-3); }
  body.view-library .composer .slot-hint.warn { color: var(--bone-2); }

  /* the model, as a select */
  body.view-library .composer .c-model { grid-column: 1 / -1; order: 4; position: relative; display: flex; align-items: center; gap: 12px; height: 52px; margin: 0; padding: 0 16px 0 14px; overflow: hidden; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); text-align: left; cursor: pointer; isolation: auto; transition: background .3s var(--ease); }
  body.view-library .composer .c-model:hover, body.view-library .composer .c-model[aria-expanded='true'] { background: var(--raised); }
  body.view-library .composer .c-model[aria-expanded='true'] { box-shadow: 0 0 0 2px var(--bone); }
  body.view-library .composer .c-model::after { display: none; }
  body.view-library .composer .c-model .cm-logo { position: static; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 999px; background: var(--raised); -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 12px; font-weight: 700; }
  body.view-library .composer .c-model .cm-logo img { width: 16px; height: 16px; }
  body.view-library .composer .c-model .cm-text { position: static; flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; }
  body.view-library .composer .c-model .cm-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: var(--bone); text-transform: lowercase; }
  body.view-library .composer .c-model .cm-note { flex: none; font-size: 14px; font-weight: 500; color: var(--bone-3); }
  body.view-library .composer .c-model .cm-change { position: static; flex: none; display: grid; height: auto; padding: 0; border: 0; border-radius: 0; background: none; color: var(--bone-3); -webkit-backdrop-filter: none; backdrop-filter: none; }

  /* settings: a small name over each value */
  body.view-library .composer .c-chips > .chip { order: 5; height: 60px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 8px; row-gap: 2px; padding: 0 16px; overflow: hidden; border: 0; border-radius: 18px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone); font-size: 15px; font-weight: 600; text-align: left; white-space: nowrap; }
  body.view-library .composer .c-chips > .chip:hover, body.view-library .composer .c-chips > .chip[aria-expanded='true'] { background: var(--raised); }
  body.view-library .composer .c-chips > .chip.fixed, body.view-library .composer .c-chips > .chip.fixed:hover { background: transparent; color: var(--bone-2); }
  body.view-library .composer .c-chips > .chip > svg { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--bone-3); }
  body.view-library .composer .chip .c-k { grid-column: 1; grid-row: 1; font-size: 13px; font-weight: 500; color: var(--bone-3); }
  body.view-library .composer .chip .c-v { grid-column: 1; grid-row: 2; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
  body.view-library .composer .c-chips > .chip.c-sound { grid-column: 1 / -1; height: 52px; grid-template-columns: 1fr auto auto; grid-template-rows: auto; column-gap: 12px; border-radius: 999px; }
  body.view-library .composer .c-sound .c-k { grid-row: 1; font-size: 15px; font-weight: 600; color: var(--bone); }
  body.view-library .composer .c-sound .c-v { grid-column: 2; grid-row: 1; font-size: 14px; font-weight: 500; color: var(--bone-3); }
  body.view-library .composer .c-sound .pk-toggle { grid-column: 3; grid-row: 1; }

  body.view-library .composer .c-chips > .chip[data-k='model'] { display: none; }
  body.view-library .composer .c-chips > .chip.c-wide { grid-column: 1 / -1; }
  /* short screens (his 663px laptop): a shorter prompt box, so the settings sit above generate without scrolling */
  @media (max-height: 760px) {
    body.view-library.docked .dock { top: 104px; max-height: calc(100svh - 120px); }
    body.view-library .composer { gap: 12px; padding: 16px 20px 20px; }
    body.view-library .composer .c-box textarea { min-height: 56px; max-height: 160px; }
    body.view-library .composer .c-chips > .chip { height: 52px; }
    body.view-library .composer .slot { height: 44px; }
    body.view-library .composer .slot-hint:not(.warn) { display: none; }
    body.view-library .library { padding-top: 104px; }
  }

  /* generate: always in reach at the bottom of the panel */
  body.view-library .composer .go { grid-column: 1 / -1; order: 6; position: sticky; bottom: 0; z-index: 2; height: 56px; margin: 8px 0 0; padding: 0 6px 0 22px; justify-content: flex-start; border-radius: 999px; font-size: 16px; box-shadow: 0 -16px 24px 8px var(--panel), 0 28px 0 24px var(--panel); }
  body.view-library .composer .go .cost { margin-left: auto; }
  body.view-library .composer .go .pk-btn__icon { width: 44px; height: 44px; }
  body.view-library .composer .go:disabled { box-shadow: inset 0 0 0 1px var(--line), 0 -16px 24px 8px var(--panel), 0 28px 0 24px var(--panel); }
}

/* ---------- menus */
.pop {
  min-width: 220px; padding: 8px; border: 0; border-radius: 24px; background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  scrollbar-color: var(--raised) transparent;
}
.pop.sheet { border-radius: 28px; background: var(--panel); }
.pop-label { padding: 12px 12px 8px; font-size: 13px; font-weight: 500; color: var(--bone-3); }
.opt { padding: 12px; border-radius: 18px; font-size: 15px; color: var(--bone-2); }
.opt.hl, .pop .opt.hl { background: var(--control); color: var(--bone); }
.opt.sel { color: var(--bone); }
.opt-side { font-size: 14px; color: var(--bone-3); }
.pop-search { height: 48px; margin-bottom: 8px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; color: var(--bone); }
.pop-search:focus-visible { background: var(--control); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px rgba(242, 236, 226, 0.28); }
.pop-search::placeholder { color: var(--bone-3); }
.pop-more { border-top-color: var(--line); color: var(--bone-2); }
.look-art, .cam-view { border-radius: 16px; }
.look-opt, .cam-opt { border-radius: 18px; }
.look-name, .cam-name { font-size: 13px; text-transform: lowercase; }
.dur-val { font-family: var(--f-display); font-stretch: 75%; font-size: 28px; letter-spacing: -0.02em; }
.dur-quick button { height: 36px; border-radius: 999px; background: var(--control); font-size: 14px; }
.dur-quick button.on { background: var(--bone); color: var(--ink); }
.range::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--bone) var(--p, 0%), rgba(242, 236, 226, 0.16) var(--p, 0%)); }
.range::-webkit-slider-thumb { background: var(--bone); }
.ratio-opt { border-radius: 18px; }

/* the model picker: name and maker, what it's best at, what it can do; a check disc on the current one */
.pop-models { padding: 8px; }
.pop-models .pop-list { max-height: min(64vh, 600px); }
.pop-models .mrow-h, .pop-models .mrow-h:first-child { padding: 16px 12px 8px; font-size: 13px; font-weight: 500; color: var(--bone-3); text-transform: lowercase; }
.mrow { align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 18px; }
.mrow-ico { width: 40px; height: 40px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); }
.mrow.sel .mrow-ico { box-shadow: inset 0 0 0 1px var(--line-2); }
.pop .mrow.sel, .pop .mrow.sel.hl { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); }
.mrow-main { gap: 2px; }
.mrow-name { gap: 8px; font-size: 15px; font-weight: 650; color: var(--bone); }
.mrow-maker { flex: none; font-size: 13px; font-weight: 500; color: var(--bone-3); text-transform: lowercase; }
.mrow-tag { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: lowercase; }
.mrow-tag.t-top { background: var(--raised); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.mrow-tag.t-new { background: var(--raised); color: var(--bone-2); }
.mrow-note { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--bone-2); }
.mrow-caps { gap: 0 12px; margin-top: 2px; }
.mrow-caps i { height: auto; padding: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 500; color: var(--bone-3); }
.mrow .tick { flex: none; width: 28px; height: 28px; margin: 0; border-radius: 999px; display: grid; place-items: center; background: var(--bone); color: var(--ink); }
.opt .tick { opacity: 0; }
.opt.sel .tick { opacity: 1; }
.opt:not(.mrow) .tick { background: none; color: var(--bone); width: auto; height: auto; }

/* ---------- the account menu */
.acct-head { padding: 12px 12px 14px; margin-bottom: 4px; border-bottom-color: var(--line); }
.acct-email { font-size: 14px; color: var(--bone); }
.acct-cr { font-size: 13px; color: var(--bone-3); }
.acct-plan { font-size: 13px; color: var(--bone-2); }
.acct-plan.warn { color: var(--bone); }
.pop-acct .opt { padding: 10px 12px; font-size: 14px; }

/* ---------- your take, big */
.viewer::before { background: var(--room); }
.viewer { grid-template-columns: minmax(0, 1fr) 416px; }
.v-media { border-radius: 22px; background: var(--well); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.v-close, .v-nav { width: 44px; height: 44px; border-radius: 999px; background: var(--control); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line); }
.v-close:hover, .v-nav:hover:not(:disabled) { background: var(--raised); color: var(--bone); }
.v-close { top: 24px; left: 24px; }
.v-nav.prev { left: 24px; }
.v-nav.next { right: 24px; }
.v-side { gap: 24px; padding: 32px 24px 24px; border-left: 0; background: var(--panel); box-shadow: inset 1px 0 0 var(--line); }
.v-prompt { padding: 16px 20px; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.6; color: var(--bone); max-height: 40vh; overflow: auto; }
.v-copy { font-size: 13px; color: var(--bone-3); }
.v-meta { padding: 16px 20px; gap: 10px 16px; border: 0; border-radius: 24px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.v-meta dt { color: var(--bone-3); }
.v-meta dd { color: var(--bone); }
.v-used-label { font-size: 13px; color: var(--bone-3); }
.v-used-row img { border-radius: 16px; }
.v-acts { gap: 8px; }
.v-tools { gap: 8px; }
.btn { height: 48px; gap: 8px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--control); color: var(--bone); font-size: 15px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.btn:hover { background: var(--raised); }
.btn.primary, .btn.primary:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; padding: 0 6px 0 22px; justify-content: space-between; }
.btn.primary:hover { background: #f37f4c; }
.btn.icon { padding: 0; color: var(--bone-2); }
.btn.icon.on { color: var(--bone); background: var(--raised); }
.btn.danger:hover { color: var(--bone); background: var(--raised); }

/* ---------- one prompt, big: the t-viewer screen */
.xviewer { padding: 0; display: block; overflow-y: auto; overscroll-behavior: contain; }
.xv-scrim { position: fixed; background: var(--room); -webkit-backdrop-filter: none; backdrop-filter: none; }
.xviewer.on .xv-scrim { opacity: 1; }
.xv-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 416px; align-items: start; gap: 48px; width: auto; max-width: 1880px; height: auto; min-height: 100%; margin: 0 auto; padding: 120px var(--gutter) 64px; border: 0; border-radius: 0; overflow: visible; background: none; box-shadow: none; }
.xv-main { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.xv-stage { position: relative; min-height: 0; overflow: visible; background: var(--panel); }
.xv-core { position: relative; aspect-ratio: 16 / 9; max-height: calc(100svh - 168px); width: 100%; }
.xv-fill { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(40px) saturate(1.2) brightness(0.55); }
.xv-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.xv-side { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 24px; min-height: 0; padding: 0; border: 0; overflow: visible; }
.xv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; }
.xv-model { height: auto; padding: 0; border-radius: 0; background: none; font-size: 14px; font-weight: 500; color: var(--bone-3); }
.xv-nav { display: flex; gap: 8px; }
.xv-btn { color: var(--bone); }
.xv-btn:disabled { opacity: 0.35; }
.xv-title { margin: -8px 0 0; text-wrap: balance; overflow-wrap: anywhere; }
.xv-by { margin: -12px 0 0; font-size: 13px; color: var(--bone-3); }
.xv-by a { color: var(--bone-2); font-weight: 600; }
.xv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.xv-acts .btn { flex: none; height: 56px; font-size: 16px; }
.xv-acts .btn.primary { padding: 0 6px 0 24px; gap: 16px; }
.xv-acts .btn.primary .pk-btn__icon { width: 44px; height: 44px; }
.xv-acts .btn.pk-btn--ghost { padding: 0 22px; }
.xv-acts .btn:disabled { opacity: 0.55; }
.xv-well { padding: 16px 20px 4px; }
.xv-h { margin: 0 0 8px; font-size: 15px; font-weight: 650; color: var(--bone); }
.xv-prompt { max-height: min(40vh, 360px); margin: 0; padding: 0 0 12px; border: 0; border-radius: 0; background: none; overflow: auto; font: 400 15px/1.6 var(--f-text); color: var(--bone-2); white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }
.xv-skel { background: var(--raised); border-radius: 999px; }
.xv-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; padding: 20px; }
.xv-specs dt { font-size: 13px; color: var(--bone-3); }
.xv-specs dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--bone); }
.xv-more { display: flex; flex-direction: column; gap: 16px; }
.xv-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.xv-more-grid .pk-thumb { aspect-ratio: 16 / 9; }

/* ---------- sheets: sign in, plans, keys */
.modal { padding: 16px; }
.m-scrim { background: var(--dim); -webkit-backdrop-filter: blur(6px) saturate(0.8); backdrop-filter: blur(6px) saturate(0.8); }
.m-card, .m-card.wide { padding: 32px 28px 24px; border: 0; border-radius: 28px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 120px rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: none; backdrop-filter: none; }
.m-card.wide { width: min(680px, 100%); }
.m-x { top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 999px; background: var(--control); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line); }
.m-x:hover { background: var(--raised); color: var(--bone); }
.m-title { margin: 0 0 8px; font-family: var(--f-display); font-stretch: 75%; font-weight: 800; font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; text-transform: lowercase; }
.m-sub { margin: 0 0 24px; font-size: 15px; color: var(--bone-2); }
.m-fine { margin: 16px 0 0; font-size: 13px; color: var(--bone-3); }
.m-fine a { color: var(--bone-2); }
.m-go { height: 48px; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 15px; font-weight: 600; }
.m-go:hover:not(:disabled) { background: #fbf6ee; }
.m-input { height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.m-input:focus { background: var(--control); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px rgba(242, 236, 226, 0.28); }
.m-err { color: var(--bone); }

/* sign in: the featured still, one line, Google */
.m-card.m-auth { width: min(440px, 100%); padding: 12px; }
.m-auth .m-x { top: 24px; right: 24px; background: rgba(26, 24, 21, 0.78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.m-pic { overflow: hidden; border-radius: 22px; aspect-ratio: 16 / 9; background: var(--well); }
.m-pic img { width: 100%; height: 100%; object-fit: cover; }
.m-in { padding: 24px 16px 12px; }
.m-auth .m-title { margin-bottom: 8px; }
.m-auth .m-sub { margin-bottom: 24px; }
.m-google, .m-google:hover { width: 100%; height: 56px; margin: 0; gap: 12px; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 16px; font-weight: 600; }
.m-google:hover { background: #fbf6ee; }
.m-google .g { display: inline-flex; width: auto; height: auto; }
.m-google .g svg { width: 20px; height: 20px; }

/* the plans sheet: one row per plan, the picked one raised; the price is on the row you press */
.cu-range::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--bone) var(--fill), rgba(242, 236, 226, 0.16) var(--fill)); }
.cu-range::-moz-range-track { background: linear-gradient(to right, var(--bone) var(--fill), rgba(242, 236, 226, 0.16) var(--fill)); }
.cu-range::-webkit-slider-thumb { background: var(--bone); }
.m-head-t { font-size: 15px; font-weight: 600; }
.m-back { width: 36px; height: 36px; border-radius: 999px; background: var(--control); }
.m-check { background: var(--bone); color: var(--ink); }
.kx-row { border-radius: 18px; background: var(--control); }
.kx-fresh { border-radius: 18px; border: 0; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-2); }
.kx-code { border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.kx-del, .kx-copy { border-radius: 999px; }

/* ---------- toast, drop */
.toast { bottom: 32px; padding: 12px 20px; border: 0; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 48px rgba(0, 0, 0, 0.45); font-size: 14px; }
body.view-library .toast { bottom: 32px; }
.toast button { color: var(--bone); font-weight: 650; }
.drop { background: var(--dim); }
.drop div { border-radius: 28px; border-color: var(--line-2); font-family: var(--f-display); font-stretch: 75%; font-size: 28px; text-transform: lowercase; }

/* ---------- the phone tab bar's "you" and studio */
.tab-you { color: var(--bone-2); }
body.view-library .pk-tabbar, body.view-library .pk-tabbar-fade { display: none; }

/* ---------- tablets and phones */
@media (max-width: 1240px) {
  .row-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row-grid > :nth-child(n + 5) { display: none; }
  .feat { gap: 40px; }
  .feat-film { min-width: 440px; }
}
@media (max-width: 1100px) {
  .xv-panel { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
}
@media (max-width: 899px) {
  :root { --side: 100%; }
  /* the top: brand on the left, search and sign in (or credits and you) on the right; pages live in the tab bar */
  .top, .top.solid, body.view-library .top { top: 0; padding: 12px 20px; }
  .top::after { content: ''; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(180deg, var(--room) 40%, rgba(15, 14, 12, 0)); opacity: 0; transition: opacity .3s; pointer-events: none; }
  .top.solid::after { opacity: 1; }
  .top .island { width: 100%; justify-content: space-between; padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top .brand { padding: 0; }
  .top .brand .wm { display: inline; }
  .views { display: none !important; }
  .hide-sm { display: none !important; }

  .hero { padding: 76px 20px 0; }
  .feat { flex-direction: column-reverse; gap: 24px; }
  .feat-film { width: 100%; min-width: 0; }
  .feat-text { gap: 16px; padding: 0; }
  .feat-copy { gap: 16px; }
  .feat-title { font-size: 56px; }
  .feat-br { display: none; }
  .feat-lead { display: none; }
  .feat-acts { gap: 8px; margin-top: 8px; }
  .feat-acts .pk-btn { flex: 1 1 auto; }
  .feat-ctl { left: 16px; right: 16px; bottom: 14px; gap: 12px; }
  .feat-ctl .pk-play { width: 44px; height: 44px; }
  .feat-ctl .pk-play--sm { width: 40px; height: 40px; }

  .rows { padding: 40px 0 0; gap: 32px; }
  .row-h { padding: 0 20px; }
  .row-grid, .row-grid.tall { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%; gap: 12px; overflow-x: auto; padding: 0 20px; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; }
  .row-grid.tall { grid-auto-columns: 42%; }
  .row-grid::-webkit-scrollbar { display: none; }
  .row-grid > *, .row-grid > :nth-child(n + 5) { display: flex; scroll-snap-align: start; }

  .explore { padding: 40px 20px 140px; }
  .x-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .x-tools { justify-content: space-between; }
  .x-tools .find { flex: 1; }
  .ec-title { font-size: 14px; }
  .ec-model { font-size: 13px; }
  .foot { padding: 32px 20px 132px; }

  /* the studio on a phone: the stage, your takes, the composer as a sheet at the bottom */
  body.view-library .library { padding: 76px 20px 240px; }
  .stage-core { height: auto; aspect-ratio: 16 / 9; }
  .stage.st-empty .stage-core { aspect-ratio: auto; min-height: 0; }
  .stage-wrap { margin-bottom: 32px; }
  .stage-bar { padding: 16px 4px 0; }
  .st-acts .pk-btn { display: none; }
  .lib-head { flex-direction: column; align-items: stretch; gap: 12px; }
  body.docked .dock, body.view-library.docked .dock { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: none; padding: 0; display: block; z-index: 40; background: none; box-shadow: none; border-radius: 0; }
  body.docked .dock .composer, body.view-library .composer { width: 100%; padding: 22px 16px calc(14px + env(safe-area-inset-bottom)); border: 0; border-radius: 28px 28px 0 0; background: var(--panel); box-shadow: inset 0 1px 0 var(--line-2), 0 -24px 60px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.view-library .composer::before { content: ''; position: absolute; top: 8px; left: calc(50% - 20px); width: 40px; height: 5px; border-radius: 999px; background: var(--bone-3); opacity: 0.5; }
  .c-field { align-items: center; gap: 8px; padding: 4px 4px 8px 16px; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
  .c-field textarea { min-height: 48px; padding: 12px 0 10px; font-size: 16px; }
  .c-add { width: 40px; height: 40px; margin: 0; border-radius: 999px; background: var(--control); order: 2; }
  .c-bar { flex-wrap: wrap; gap: 8px; padding: 12px 0 0; }
  .c-bar .seg { order: 1; }
  .c-chips, .c-bar .c-chips { order: 2; flex: 1 1 0; flex-basis: 0; min-width: 0; gap: 8px; overflow-x: auto; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
  .c-bar .go { order: 3; flex: 1 1 100%; margin: 4px 0 0; justify-content: flex-start; height: 52px; }
  .c-bar .go .cost { margin-left: auto; }
  .lib-tools { flex-wrap: wrap; }
  .lib-find { flex: 1 1 100%; }
  .chip { height: 44px; padding: 0 14px; border-radius: 999px; background: var(--control); color: var(--bone-2); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); }
  .chip:hover, .chip[aria-expanded='true'] { background: var(--raised); color: var(--bone); }
  .chip.strong { color: var(--bone); }
  .chip.fixed, .chip.fixed:hover { background: transparent; box-shadow: none; }
  .seg button { height: 36px; }
  .go { height: 48px; }
  .toast, body.view-library .toast { bottom: 248px; }
  body.view-explore .toast { bottom: 112px; }

  .xv-panel { display: flex; flex-direction: column; align-items: stretch; gap: 24px; padding: 16px 0 0; min-height: 100%; }
  .xv-main { gap: 32px; order: 1; }
  .xv-stage { margin: 0 12px; }
  .xv-core { aspect-ratio: auto; height: min(56vw, 42svh); max-height: none; }
  .xv-more { display: none; }
  .xv-side { position: relative; top: 0; order: 2; gap: 16px; padding: 0 20px; }
  .xv-title.pk-l { font-size: 40px; }
  .xv-title.pk-m { font-size: 24px; }
  .xv-top { position: sticky; top: 0; }
  .xv-acts { order: 9; position: sticky; bottom: 0; z-index: 2; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--room); box-shadow: 0 -1px 0 var(--line); flex-wrap: nowrap; }
  .xv-acts .btn { height: 48px; font-size: 15px; }
  .xv-acts .btn.primary { flex: 1; }
  .xv-acts .btn.primary .pk-btn__icon { width: 36px; height: 36px; }
  .xv-prompt { max-height: none; overflow: visible; }

  .viewer { grid-template-columns: 1fr; }
  .v-side { box-shadow: inset 0 1px 0 var(--line); padding: 20px 20px 0; }
  .v-close { top: 12px; left: 12px; }
  .m-card, .m-card.wide { padding: 28px 20px 20px; }
  .m-card.m-auth { padding: 10px; }
}
@media (max-width: 420px) {
  .feat-title { font-size: 48px; }
  .feat-acts .pk-btn { padding-left: 18px; }
  .feat-acts .pk-btn--ghost { padding: 0 18px; }
  .xv-acts .btn.pk-btn--ghost { padding: 0 16px; }
}

/* ---------- the ad studio (/ads, make.js + make.css): the formats as kit cards, one panel per format.
   Names stay mk-*: ad blockers hide anything called ad-*, .ads or view-ads. */
.mk { max-width: 1440px; padding: 120px var(--gutter) 120px; }
.mk-hero { margin-top: 0; }
.mk-hero::before { display: none; }
.mk-badge { display: none; }
.mk-fan { margin: 0 0 40px; }
.mk-fc { border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line), 0 26px 60px -30px rgba(0, 0, 0, 0.9); }
.mk-fc.mid { box-shadow: 0 0 0 1px var(--line-2), 0 34px 90px -30px rgba(0, 0, 0, 0.95); }
.mk-fc::after { background: rgba(15, 14, 12, 0.42); }
.mk-fc-tag { display: none; }
.mk-h { display: block; margin: 0; font-size: 56px; text-transform: lowercase; }
.mk-lead { margin: 16px 0 0; max-width: 560px; }
.mk-bar { width: min(100%, 980px); margin-top: 40px; padding: 8px; gap: 8px; border: 0; border-radius: 24px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: none; backdrop-filter: none; }
.mk-kind { gap: 4px; padding: 4px; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.mk-kind-b { border-radius: 14px; font-size: 13px; font-weight: 550; color: var(--bone-3); text-transform: lowercase; }
.mk-kind-b.on { background: var(--raised); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.mk-bar-main { padding: 8px 4px 4px 8px; }
.mk-bar-line { font-size: 16px; color: var(--bone); }
.mk-bar-line::placeholder { color: var(--bone-3); }
.mk-chip-b { height: 36px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 550; color: var(--bone); }
.mk-chip-b:hover { background: var(--raised); }
.mk-slot { border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone-2); }
.mk-slot:hover { background: var(--control); }
.mk-slot-l { font-size: 13px; font-weight: 550; letter-spacing: 0; text-transform: lowercase; }
.go.mk-bar-go, .go.mk-go, .go.mk-dock-go { position: relative; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 6px 0 22px; border-radius: 999px; font-size: 15px; }
.go.mk-bar-go { align-self: end; width: auto; min-width: 232px; height: 56px; }
.go.mk-go { height: 56px; font-size: 16px; }
.go.mk-dock-go { height: 44px; }
.mk-bar-go > span:first-child, .mk-go > span:first-child, .mk-dock-go > span:first-child { text-transform: lowercase; }
.mk-bar-go .cost, .mk-go .cost, .mk-dock-go .cost { margin-left: auto; font-size: 15px; font-weight: 500; color: var(--on-accent); opacity: 0.72; }
.go.mk-bar-go::after, .go.mk-go::after, .go.mk-dock-go::after {
  content: ''; flex: none; width: 44px; height: 44px; border-radius: 999px; transition: transform .35s var(--ease);
  background: var(--on-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23f0703a'%3E%3Cpath d='M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.go.mk-dock-go::after { width: 34px; height: 34px; }
.go.mk-bar-go:hover::after, .go.mk-go:hover::after { transform: translateX(2px); }
.go.mk-bar-go:disabled::after, .go.mk-go:disabled::after { background-color: var(--raised); }
.mk-dock { border: 0; border-radius: 999px; padding: 6px; background: rgba(26, 24, 21, 0.86); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 48px rgba(0, 0, 0, 0.42); }
.mk-dock-t { border-radius: 999px; background: var(--control); }
.mk-dock-line { color: var(--bone); }

.mk-sec-h, .mk-tpl-h { margin: 0 0 16px; font-family: var(--f-text); font-size: 18px; font-weight: 650; font-stretch: 100%; letter-spacing: 0; color: var(--bone); text-transform: lowercase; }
.mk-tpl-h { margin: 0; }
.mk-tpls { margin-top: 64px; }
.mk-tpl-head { margin-bottom: 24px; }
.mk-pills { gap: 8px; }
.mk-pill { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 550; color: var(--bone-2); text-transform: lowercase; }
.mk-pill:hover { background: var(--control); color: var(--bone); }
.mk-pill.on { background: var(--bone); color: var(--ink); box-shadow: none; }

/* a format card: its example, then the name and one line under it (nothing laid over the picture) */
.mk-grid { gap: 32px 16px; }
.mk-card { display: flex; flex-direction: column; gap: 14px; aspect-ratio: auto; overflow: visible; border-radius: 0; background: none; }
.mk-card::after { display: none; }
.mk-card .mk-media { position: relative; inset: auto; aspect-ratio: var(--ar, .75); border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.mk-card:focus-visible { box-shadow: none; }
.mk-card:focus-visible .mk-media { box-shadow: 0 0 0 2px var(--bone); }
.mk-card:hover .mk-media img, .mk-card:hover .mk-media video { transform: scale(1.035); }
.mk-cap { position: static; gap: 2px; padding: 0 2px; }
.mk-kind-l { display: none; }
.mk-name { font-size: 15px; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: var(--bone); text-transform: lowercase; }
.mk-card .mk-note, .mk-card:hover .mk-note { max-height: none; opacity: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--bone-3); }
.mk-mine .mk-media { border-radius: 16px; }
.mk-mine .mk-note { font-size: 14px; color: var(--bone-2); text-transform: lowercase; }
.mk-wait { background: var(--well); color: var(--bone-3); }
.mk-spin { border-top-color: var(--accent); }

/* one format: the example in a shell on the left, the panel with the few decisions on the right */
.mk-page { grid-template-columns: minmax(0, 1fr) 440px; gap: 48px; max-width: 1344px; }
.mk-stage-col { top: 120px; }
.mk-stage { width: min(100%, calc((100svh - 168px) * var(--ar)), 620px); border-radius: 22px; background: var(--well); box-shadow: 0 0 0 6px var(--panel), 0 0 0 7px var(--line-2), 0 30px 80px rgba(0, 0, 0, 0.45); }
.mk-chip { border: 0; background: rgba(26, 24, 21, 0.78); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; color: var(--bone); }
.mk-switch { border: 0; background: rgba(26, 24, 21, 0.78); box-shadow: inset 0 0 0 1px var(--line-2); }
.mk-switch button { font-size: 13px; color: var(--bone-3); }
.mk-switch button.on { background: var(--raised); color: var(--bone); }
.mk-form { padding: 24px; border-radius: 24px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.mk-back { margin-bottom: 24px; font-size: 14px; color: var(--bone-3); }
.mk-back:hover { color: var(--bone); }
.mk-title { font-family: var(--f-display); font-stretch: 75%; font-weight: 800; font-size: 56px; letter-spacing: -0.02em; line-height: 0.92; text-transform: lowercase; }
.mk-lede { margin-top: 12px; font-size: 16px; color: var(--bone-2); }
.mk-off { color: var(--bone); }
.mk-field { margin-top: 24px; }
.mk-label { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--bone-3); text-transform: lowercase; }
.mk-script-h .mk-label { color: var(--bone); font-size: 15px; font-weight: 600; }
.mk-pair { gap: 0 16px; }
.mk-input { padding: 14px 18px; border: 0; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; color: var(--bone); }
.mk-input:hover { background: var(--well); }
.mk-input:focus { border: 0; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px rgba(242, 236, 226, 0.28); }
.mk-input::placeholder { color: var(--bone-3); }
.mk-tile { border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone-3); }
.mk-tile:hover { background: var(--control); color: var(--bone); }
.mk-tile-add { font-size: 12px; text-transform: lowercase; }
.mk-tile-x { border: 0; background: rgba(26, 24, 21, 0.78); box-shadow: inset 0 0 0 1px var(--line-2); }
.mk-person .mk-tile { border-radius: 16px; }
.mk-person-name { color: var(--bone-3); text-transform: lowercase; }
.mk-hint { font-size: 13px; color: var(--bone-3); }
.mk-seg { gap: 4px; padding: 4px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); }
.mk-seg button { height: 36px; border-radius: 999px; font-size: 14px; color: var(--bone-2); }
.mk-seg button.on { background: var(--raised); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 550; }
.mk-script { margin-top: 24px; border-radius: 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.mk-script-h { padding: 16px 20px; }
.mk-script-state { font-size: 13px; color: var(--bone-3); }
.mk-script-body { padding: 0 20px 20px; }
.mk-line-h { font-size: 13px; color: var(--bone-3); }
.mk-line .mk-input { border-radius: 16px; background: var(--control); font-size: 14px; }
.mk-line.see p { border-radius: 16px; background: var(--control); color: var(--bone-3); }
.mk-link { color: var(--bone-2); }
.mk-go-wrap { margin-top: 24px; }
.mk-after { font-size: 13px; color: var(--bone-3); }
@media (max-width: 899px) {
  .mk { padding: 76px 20px 140px; }
  .mk-h { font-size: 40px; }
  .mk-fan { margin-bottom: 24px; }
  .mk-bar { margin-top: 24px; }
  .go.mk-bar-go { min-width: 0; height: 52px; }
  .mk-page { grid-template-columns: 1fr; gap: 24px; }
  .mk-stage { width: min(100%, calc(46svh * var(--ar)), 380px); }
  .mk-form { padding: 20px; }
  .mk-title { font-size: 40px; }
  .mk-grid { gap: 24px 12px; }
  .mk-card .mk-media { aspect-ratio: 3 / 4; }
  .mk-go-wrap { bottom: 104px; }
}

/* ---------- takes: view menu, select, delete, list and grid layouts */
.view-wrap { position: relative; flex: none; }
.view-btn { height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: var(--control); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone); font-size: 14px; font-weight: 550; }
.view-btn:hover, .view-btn[aria-expanded="true"] { background: var(--raised); }
.view-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 260px; padding: 10px; display: flex; flex-direction: column; gap: 2px; border-radius: 20px; background: rgba(26, 24, 21, .96); backdrop-filter: blur(24px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 60px rgba(0, 0, 0, .5); }
.view-pop[hidden] { display: none; }
.vp-h { margin: 6px 8px 4px; font-size: 13px; font-weight: 500; color: var(--bone-3); }
.vp-opt { height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 12px; border-radius: 12px; font-size: 15px; font-weight: 550; color: var(--bone-2); text-align: left; }
.vp-opt span { flex: 1; }
.vp-opt:hover { background: var(--control); color: var(--bone); }
.vp-opt.on { color: var(--bone); }
.vp-rule { border: 0; height: 1px; background: var(--line); margin: 6px 4px; }
.vp-row { height: 40px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 550; color: var(--bone); }
.vp-switch { width: 44px; height: 26px; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); position: relative; flex: none; }
.vp-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: var(--bone-3); transition: transform .25s var(--ease), background .25s; }
.vp-switch.on { background: var(--bone); }
.vp-switch.on i { transform: translateX(18px); background: var(--ink); }
.vp-size { display: flex; align-items: center; gap: 10px; padding: 4px 10px 8px; color: var(--bone-3); }
.vp-size.off { opacity: .4; pointer-events: none; }
.vp-range { flex: 1; accent-color: var(--bone); height: 4px; }

.day-h { position: absolute; left: 0; top: 0; height: 40px; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; color: var(--bone); transition: transform .45s var(--ease); }
.day-h .day-n { font-size: 14px; font-weight: 500; color: var(--bone-3); }
.grid.still .day-h { transition: none !important; }

.pick { position: absolute; z-index: 4; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--bone); }
.pick svg:last-child { display: none; }
.picked > .pick svg:first-child, .day-h.picked .pick svg:first-child { display: none; }
.picked > .pick svg:last-child, .day-h.picked .pick svg:last-child { display: block; }
.tile > .pick { top: 10px; left: 10px; background: rgba(15, 14, 12, .55); backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s; }
.day-h .pick { position: static; width: 26px; height: 26px; color: var(--bone-2); }
.day-h .pick:hover { color: var(--bone); }
.tile:hover > .pick, .tile:focus-within > .pick, .grid.selecting .tile > .pick, .tile.picked > .pick { opacity: 1; }
.grid.selecting .tile { cursor: pointer; }
.grid.selecting .tile.done .acts, .grid.selecting .tile.done .cap { opacity: 0 !important; }
.tile.picked { box-shadow: 0 0 0 2px var(--bone); }
.tile.picked::after { content: ""; position: absolute; inset: 0; background: rgba(242, 236, 226, .08); pointer-events: none; border-radius: inherit; }
.tile .acts .del:hover { color: #ff8a6a; }

.lasso { position: absolute; left: 0; top: 0; z-index: 6; border-radius: 6px; background: rgba(242, 236, 226, .08); box-shadow: inset 0 0 0 1px rgba(242, 236, 226, .5); pointer-events: none; }

.selbar { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 18px; border-radius: 999px; background: rgba(26, 24, 21, .94); backdrop-filter: blur(24px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 48px rgba(0, 0, 0, .5); }
.selbar[hidden] { display: none; }
.sel-n { margin-right: 10px; font-size: 15px; font-weight: 600; color: var(--bone); white-space: nowrap; }
.sel-btn { height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--bone-2); white-space: nowrap; }
.sel-btn:hover { background: var(--control); color: var(--bone); }
.sel-btn.danger { background: var(--bone); color: var(--ink); }
.sel-btn.danger:hover { background: #fff; color: var(--ink); }
.sel-x { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--bone-2); }
.sel-x:hover { background: var(--control); color: var(--bone); }

/* grid: every take in an even square, shown whole */
.tile.fit { background: var(--panel); }
.tile.fit > img, .tile.fit > video { object-fit: contain; }

/* list: thumb, prompt, details, actions in one row */
.tile .meta { display: none; }
.tile.row { background: var(--panel); }
.tile.row > img, .tile.row > video { position: absolute; left: 0; top: 0; width: 160px; height: 100%; object-fit: cover; border-radius: 16px 0 0 16px; }
.tile.row .veil { display: none; }
.tile.row > .pick { left: auto; right: auto; top: 50%; margin-top: -15px; left: 172px; opacity: 1; background: transparent; backdrop-filter: none; }
.tile.row .cap { opacity: 1 !important; transform: none !important; position: absolute; left: 214px; right: 300px; top: 20px; bottom: auto; margin: 0; padding: 0; background: none; font-size: 15px; line-height: 1.45; color: var(--bone); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile.row .meta { display: flex; gap: 16px; position: absolute; left: 214px; bottom: 16px; font-size: 13px; color: var(--bone-3); }
.tile.row .meta .meta-m { color: var(--bone-2); font-weight: 600; }
.tile.row .acts { opacity: 1 !important; transform: none !important; top: 50%; bottom: auto; right: 16px; left: auto; margin-top: -18px; }
.tile.row .like-mark, .tile.row .dur { display: none; }
.tile.row.dev .dev-info, .tile.row.fail .fail-body { left: 214px; }
.grid.selecting .tile.row .cap { opacity: 1 !important; }

@media (max-width: 700px) {
  .view-pop { right: auto; left: 0; }
  .tile > .pick { opacity: 1; }
  .tile.row > img, .tile.row > video { width: 96px; }
  .tile.row > .pick { left: 104px; }
  .tile.row .cap, .tile.row .meta { left: 140px; right: 16px; }
  .tile.row .acts { display: none; }
  .selbar { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
  .selbar .sel-btn:first-of-type { display: none; }
}

/* the studio is your takes, like a gallery: no giant stage once you have work (it stays as the empty-state welcome) */
.stage-wrap:has(.stage.has-take) { display: none; }
body.view-library .library .lib-head { margin-top: 0; }
.library:has(.stage:not(.has-take)) .lib-head, .library:has(.stage:not(.has-take)) .wall { display: none; }

/* the composer lives on the left, like Higgsfield; your takes fill the rest */
@media (min-width: 900px) {
  body.view-library .library { padding-right: var(--gutter); padding-left: calc(var(--gutter) + var(--side) + 24px); }
  body.view-library.docked .dock { right: auto; left: var(--gutter); }
}

/* the same band in the app (explore, studio, ad studio) */
.top::before { display: block; content: ''; position: fixed; left: 0; right: 0; top: 0; height: 124px; z-index: -1; pointer-events: none; opacity: 1;
  background: linear-gradient(to bottom, rgba(15, 14, 12, .98) 0%, rgba(15, 14, 12, .96) 64%, rgba(15, 14, 12, 0) 100%);
  -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }

/* the prompt box: tall enough to read a real prompt. It had a pill radius from the field styles,
   which clipped the text into a capsule: square it off */
.composer .c-box textarea, .c-field textarea { border-radius: 0; }
@media (min-width: 900px) {
  body.view-library .composer .c-box textarea { min-height: 120px; max-height: 300px; }
}
@media (min-width: 900px) and (max-height: 760px) {
  body.view-library .composer .c-box textarea { min-height: 96px; max-height: 200px; }
}

/* ad studio: every format card the same shape so the rows line up */
@media (min-width: 721px) {
  .mk-grid .mk-card .mk-media { aspect-ratio: 3 / 4; }
}

/* the plans sheet: wide enough for four plan columns, a soft warm glow at the top */
.m-card.wide.m-plans { width: min(1200px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 20px 22px; background: radial-gradient(60% 260px at 50% 0, rgba(240, 112, 58, 0.08), rgba(240, 112, 58, 0)), var(--panel); scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }
.m-plans .pw-head { position: relative; overflow: hidden; margin: 0 0 20px; padding: 26px 28px 24px; border-radius: 22px; isolation: isolate;
  background: linear-gradient(90deg, #221a15 0%, #221a15 42%, rgba(34, 26, 21, 0.55) 62%, rgba(34, 26, 21, 0) 82%), url(/assets/feature/umbrella-640.webp) right center / auto 100% no-repeat, #221a15;
  box-shadow: inset 0 0 0 1px rgba(240, 112, 58, 0.28); }
.m-plans .pw-head > * { position: relative; max-width: 620px; }
.m-plans .m-title { margin: 12px 0 10px; font-size: 52px; line-height: 0.92; }
.m-plans .m-sub { margin: 0; }
.pw-keep { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0; font-size: 13px; color: var(--bone-2); }
.pw-keep span { display: inline-flex; align-items: center; gap: 8px; }
.pw-keep svg { color: var(--bone-3); }
@media (max-width: 640px) {
  .m-card.wide.m-plans { padding: 12px 12px 16px; border-radius: 24px; }
  .m-plans .pw-head { padding: 22px 18px 20px; background: linear-gradient(180deg, rgba(240, 112, 58, 0.22), rgba(240, 112, 58, 0) 70%), #1d1713; }
  .m-plans .m-title { font-size: 38px; }
  .m-plans .pw-head { margin-bottom: 20px; }
}
.m-plans .m-x { top: 32px; right: 32px; z-index: 3; background: rgba(20, 17, 14, 0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@media (max-width: 640px) { .m-plans .m-x { top: 22px; right: 22px; } }

/* ================= studio v2: a tool, not a toy. Tighter corners (10-14px, no pills), a picture card for the model,
   a drop zone for references, and the takes in one workspace panel of even cells, like Higgsfield's create page. */
.c-model .cm-pic, .c-model .cm-change-t { display: none; }

@media (min-width: 900px) {
  /* the workspace: one panel to the right of the composer, as tall as the screen */
  body.view-library .library { position: relative; isolation: isolate; min-height: 100svh; padding: 136px calc(var(--gutter) + 18px) 72px calc(var(--gutter) + var(--side) + 34px); }
  body.view-library .library::before { content: ''; position: absolute; z-index: -1; top: 120px; bottom: 24px; left: calc(var(--gutter) + var(--side) + 16px); right: var(--gutter); border-radius: 20px; background: #13110f; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
  body.view-library .library:has(.stage:not(.has-take))::before { display: none; }

  /* toolbar: small, square-ish controls */
  body.view-library .lib-head { margin-bottom: 18px; }
  body.view-library .lib-head .sec-h { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; font-weight: 650; }
  body.view-library .lib-tools .seg.tabs { padding: 3px; gap: 2px; border-radius: 11px; background: #1b1916; box-shadow: inset 0 0 0 1px var(--line); }
  body.view-library .lib-tools .seg.tabs .tab { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; }
  body.view-library .lib-tools .seg.tabs .tab.on { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); }
  body.view-library .lib-find { height: 36px; border-radius: 10px; background: #1b1916; box-shadow: inset 0 0 0 1px var(--line); }
  body.view-library .view-btn { height: 36px; padding: 0 12px; border-radius: 10px; background: #1b1916; box-shadow: inset 0 0 0 1px var(--line); }

  /* cells */
  body.view-library .tile { border-radius: 12px; }
  body.view-library .tile.fit { background: #1d1b18; box-shadow: inset 0 0 0 1px rgba(242, 236, 226, 0.06); }
  body.view-library .day-h { font-size: 14px; }

  /* ---- the composer panel */
  body.view-library .composer { gap: 10px; border-radius: 20px; }
  /* image / video: tabs on a line, not a pill switch */
  body.view-library .composer .seg { order: 1; display: flex; justify-content: flex-start; gap: 20px; height: auto; padding: 0 4px; border-radius: 0; background: none; box-shadow: inset 0 -1px 0 var(--line); }
  body.view-library .composer .seg button, body.view-library .composer .seg button.on { flex: none; height: 40px; padding: 0 2px; border-radius: 0; background: none; box-shadow: none; font-size: 15px; font-weight: 650; color: var(--bone-3); }
  body.view-library .composer .seg button.on { color: var(--bone); box-shadow: inset 0 -2px 0 var(--bone); }
  body.view-library .composer .seg button:hover { color: var(--bone); }

  /* the model: a picture card with a real result from it */
  body.view-library .composer .c-model { order: 2; display: block; height: 118px; padding: 0; border-radius: 14px; background: #1d1b18; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; isolation: isolate; }
  body.view-library .composer .c-model:hover { background: #1d1b18; }
  body.view-library .composer .c-model .cm-pic { display: block; position: absolute; inset: 0; z-index: -1; }
  body.view-library .composer .c-model .cm-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
  body.view-library .composer .c-model:hover .cm-pic img { transform: scale(1.04); }
  body.view-library .composer .c-model .cm-pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12, 11, 10, 0.92) 0%, rgba(12, 11, 10, 0.45) 48%, rgba(12, 11, 10, 0.05) 100%); }
  body.view-library .composer .c-model .cm-logo { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 8px; background: rgba(20, 17, 14, 0.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  body.view-library .composer .c-model .cm-text { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; }
  body.view-library .composer .c-model .cm-name { max-width: 100%; font-family: var(--f-display); font-stretch: 75%; font-weight: 800; font-size: 28px; line-height: 0.95; letter-spacing: -0.01em; color: #fff; }
  body.view-library .composer .c-model .cm-note { font-size: 13px; color: rgba(242, 236, 226, 0.72); }
  body.view-library .composer .c-model .cm-change { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; background: rgba(20, 17, 14, 0.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--bone); font-size: 13px; font-weight: 600; }
  body.view-library .composer .c-model .cm-change-t { display: inline; }

  /* references: a drop zone */
  body.view-library .composer .c-refs { order: 3; }
  body.view-library .composer .c-add { order: 3; height: 76px; flex-direction: column; gap: 6px; border-radius: 14px; background: transparent; box-shadow: none; border: 1.5px dashed rgba(242, 236, 226, 0.16); color: var(--bone-2); font-size: 13.5px; font-weight: 600; }
  body.view-library .composer .c-add svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--raised); color: var(--bone); }
  body.view-library .composer .c-add::after { content: 'add references · drop or paste images'; }
  body.view-library .composer .c-add:hover { background: rgba(242, 236, 226, 0.03); border: 1.5px dashed rgba(242, 236, 226, 0.3); color: var(--bone); }
  body.view-library .composer .ref, body.view-library .composer .slot { border-radius: 12px; }

  /* the prompt and the settings */
  body.view-library .composer .c-box { order: 4; padding: 14px 16px; border-radius: 14px; background: #121110; }
  body.view-library .composer .c-inline .chip { height: 30px; border-radius: 8px; }
  body.view-library .composer .c-chips > .chip { height: 56px; padding: 0 14px; border-radius: 12px; background: #1d1b18; }
  body.view-library .composer .c-chips > .chip:hover, body.view-library .composer .c-chips > .chip[aria-expanded='true'] { background: #24211d; }
  body.view-library .composer .c-chips > .chip.c-sound { height: 50px; border-radius: 12px; }

  /* generate: a slab, not a pill */
  body.view-library .composer .go { height: 58px; border-radius: 14px; padding: 0 7px 0 20px; font-size: 16px; font-weight: 700; }
  body.view-library .composer .go .pk-btn__icon { width: 44px; height: 44px; border-radius: 10px; }
}
@media (min-width: 900px) and (max-height: 760px) {
  body.view-library .library { padding-top: 120px; }
  body.view-library .library::before { top: 104px; }
  body.view-library .composer .c-model { height: 96px; }
  body.view-library .composer .c-add { height: 60px; flex-direction: row; }
}

/* ---- library ideas under a few takes */
.ideas { margin-top: 40px; }
.ideas-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.ideas-t { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--bone); }
.ideas-t svg { color: var(--bone-3); }
.ideas-all { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--bone-3); text-decoration: none; }
.ideas-all:hover { color: var(--bone); }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.idea { position: relative; display: block; aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #1d1b18; box-shadow: inset 0 0 0 1px rgba(242, 236, 226, 0.06); cursor: pointer; isolation: isolate; text-align: left; }
.idea img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.idea:hover img { transform: scale(1.04); }
.idea-k { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(20, 17, 14, 0.65); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.idea-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 36px 12px 12px; background: linear-gradient(0deg, rgba(12, 11, 10, 0.9), rgba(12, 11, 10, 0)); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease); }
.idea:hover .idea-cap, .idea:focus-visible .idea-cap { opacity: 1; transform: none; }
.idea-n { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: #fff; }
.idea-go { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--bone); color: var(--ink); font-size: 12.5px; font-weight: 700; }
@media (hover: none) { .idea-cap { opacity: 1; transform: none; padding-top: 28px; } .idea-go { display: none; } }
@media (max-width: 899px) { .ideas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
