/* R22 Motion Lab — application shell styles. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.r22 {
  margin: 0; min-height: 100vh; background: var(--r22-black); color: var(--r22-white);
  font-family: var(--r22-font-body); font-size: 15px; line-height: 1.55; font-synthesis: none;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--r22-font-heading); font-weight: 700; margin: 0; letter-spacing: -.015em; line-height: 1.1; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--r22-white); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--r22-orange); color: #000; padding: .6rem 1rem; border-radius: .5rem; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.r22-i { flex-shrink: 0; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem 0 1.25rem; background: rgba(0,0,0,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--r22-graphite);
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1; min-width: 0; margin-right: .5rem; }
.brand-studio { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--r22-soft-grey); }
.brand-title { font-family: var(--r22-font-heading); font-weight: 700; font-size: 1.25rem; margin-top: .25rem; }
.brand-title::after { content: ''; display: inline-block; width: .38em; height: .38em; margin-left: .18em; border-radius: 50%; background: var(--r22-orange); }
.search { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; }
.search-icon { position: absolute; left: .85rem; color: var(--r22-soft-grey); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 2.5rem 0 2.6rem; border-radius: var(--r22-radius-pill);
  border: 1px solid #2c2c2c; background: #0b0b0b; color: var(--r22-white); outline-offset: 2px;
}
.search input::placeholder { color: var(--r22-neutral-grey); }
.search input:focus { border-color: var(--r22-neutral-grey); }
.search-kbd { position: absolute; right: .75rem; font: 400 .72rem/1 var(--r22-font-body); color: var(--r22-neutral-grey); border: 1px solid #333; border-radius: .3rem; padding: .2rem .4rem; }
.top-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tb-btn, .icon-btn {
  display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .9rem;
  border-radius: var(--r22-radius-pill); border: 1px solid #2c2c2c; background: transparent; color: var(--r22-white);
  transition: border-color var(--r22-duration), background-color var(--r22-duration);
  white-space: nowrap;
}
.icon-btn { width: 40px; padding: 0; justify-content: center; }
.tb-btn:hover, .icon-btn:hover { border-color: var(--r22-neutral-grey); }
.icon-btn[aria-pressed="true"], .tb-btn[aria-pressed="true"] { background: var(--r22-white); color: #000; border-color: var(--r22-white); }
.nav-toggle { display: none; }
.menu-wrap { position: relative; }
.app-menu {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 250px; padding: .4rem; z-index: 40;
  background: #0b0b0b; border: 1px solid #2c2c2c; border-radius: .9rem; box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.app-menu button { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; padding: .6rem .7rem; border: 0; background: none; border-radius: .55rem; }
.app-menu button:hover, .app-menu button:focus-visible { background: var(--r22-graphite); }
.app-menu hr { border: 0; border-top: 1px solid var(--r22-graphite); margin: .35rem 0; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 1.25rem .75rem 1.5rem;
  border-right: 1px solid var(--r22-graphite); scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.nav-group + .nav-group { margin-top: 1.5rem; }
.nav-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--r22-neutral-grey); padding: 0 .75rem .5rem; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 40px; padding: .45rem .75rem;
  border-radius: .6rem; border: 0; background: none; text-decoration: none; color: var(--r22-soft-grey); text-align: left;
  transition: background-color var(--r22-duration), color var(--r22-duration);
}
.nav-item:hover { background: #0d0d0d; color: var(--r22-white); }
.nav-item[aria-current="page"] { background: var(--r22-graphite); color: var(--r22-white); }
.nav-item[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--r22-orange); }
.nav-code { font-family: var(--r22-font-heading); font-weight: 700; font-size: .75rem; width: 2.4rem; color: var(--r22-white); letter-spacing: .02em; }
.nav-name { flex: 1; min-width: 0; font-size: .9rem; }
.nav-count { font-size: .75rem; color: var(--r22-neutral-grey); font-variant-numeric: tabular-nums; }
.side-foot { margin: 1.75rem .75rem 0; padding-top: 1rem; border-top: 1px solid var(--r22-graphite); font-size: .78rem; color: var(--r22-neutral-grey); line-height: 1.5; }
.side-foot strong { color: var(--r22-soft-grey); font-weight: 700; }
.scrim { display: none; }
.main { min-width: 0; outline: none; }

/* ---------- Gallery ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 2rem clamp(1rem, 3vw, 2.5rem) 1.25rem; }
.view-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--r22-orange); margin-bottom: .6rem; }
.view-title { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem); }
.view-sub { color: var(--r22-soft-grey); margin-top: .6rem; max-width: 60ch; }
.view-toggle { display: inline-flex; padding: 3px; border: 1px solid #2c2c2c; border-radius: var(--r22-radius-pill); }
.view-toggle button { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .8rem; border: 0; border-radius: var(--r22-radius-pill); background: none; color: var(--r22-soft-grey); }
.view-toggle button[aria-pressed="true"] { background: var(--r22-graphite); color: var(--r22-white); }
.gfilters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: 0 clamp(1rem, 3vw, 2.5rem) 1.25rem; }
.gfilter { position: relative; }
.gfilter select {
  appearance: none; height: 36px; padding: 0 2rem 0 .85rem; border-radius: var(--r22-radius-pill); max-width: 220px;
  border: 1px solid #2c2c2c; background: #0b0b0b; color: var(--r22-white); font-size: .85rem;
}
.gfilter select.is-set { border-color: var(--r22-orange); }
.gfilter::after { content: ''; position: absolute; right: .85rem; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--r22-soft-grey); border-bottom: 1.5px solid var(--r22-soft-grey); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.chip-btn { display: inline-flex; align-items: center; gap: .4rem; height: 36px; padding: 0 .85rem; border-radius: var(--r22-radius-pill); border: 1px solid #2c2c2c; background: none; font-size: .85rem; color: var(--r22-soft-grey); }
.chip-btn[aria-pressed="true"] { background: var(--r22-orange); color: #000; border-color: var(--r22-orange); }
.result-count { font-size: .85rem; color: var(--r22-neutral-grey); margin-left: auto; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; padding: 0 clamp(1rem, 3vw, 2.5rem) 3rem; }
.g-card { position: relative; border: 1px solid #222; border-radius: var(--r22-radius-card); background: #050505; overflow: hidden; transition: border-color var(--r22-duration), transform .3s var(--r22-ease); }
.g-card:hover { border-color: #444; }
.g-card:has(.card-link:focus-visible) { outline: 2px solid var(--r22-white); outline-offset: 3px; }
.card-link { display: block; text-decoration: none; outline: none; }
.g-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; border-bottom: 1px solid #191919; }
.thumb-art { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s; }
.thumb-art svg.glyph { width: 70%; height: 70%; }
.thumb-live { position: absolute; left: 0; top: 0; width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .35s; }
.g-thumb.is-live .thumb-live { opacity: 1; }
.g-thumb.is-live .thumb-art { opacity: 0; }
.thumb-hint { position: absolute; left: .75rem; bottom: .6rem; font-size: .7rem; color: var(--r22-neutral-grey); letter-spacing: .04em; }
.card-body { padding: .9rem 1rem 1.05rem; }
.card-id { display: inline-block; font-family: var(--r22-font-heading); font-weight: 700; font-size: .78rem; letter-spacing: .04em; color: var(--r22-orange); }
.card-title { font-size: 1.08rem; margin-top: .3rem; }
.card-sum { font-size: .85rem; color: var(--r22-soft-grey); margin-top: .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .75rem; color: var(--r22-neutral-grey); flex-wrap: wrap; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #444; }
.card-rating { color: var(--r22-orange); letter-spacing: .1em; }
.useful-mark { display: inline-flex; align-items: center; gap: .25rem; color: var(--r22-white); }
.fav-btn { position: absolute; right: .6rem; top: .6rem; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #2c2c2c; background: rgba(0,0,0,.7); color: var(--r22-soft-grey); }
.fav-btn:hover { color: var(--r22-white); border-color: var(--r22-neutral-grey); }
.fav-btn[aria-pressed="true"] { color: var(--r22-orange); border-color: var(--r22-orange); }
.fav-btn[aria-pressed="true"] svg { fill: var(--r22-orange); }
/* list view */
.g-list { padding: 0 clamp(1rem, 3vw, 2.5rem) 3rem; }
.g-list table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.g-list th { text-align: left; font-weight: 400; color: var(--r22-neutral-grey); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; padding: .6rem .75rem; border-bottom: 1px solid var(--r22-graphite); }
.g-list td { padding: .7rem .75rem; border-bottom: 1px solid #111; vertical-align: middle; }
.g-list tr:hover td { background: #070707; }
.g-list .l-id a { font-family: var(--r22-font-heading); font-weight: 700; color: var(--r22-orange); text-decoration: none; white-space: nowrap; }
.g-list .l-name a { text-decoration: none; }
.g-list .l-name a:hover { text-decoration: underline; }
.g-list .l-sub { color: var(--r22-neutral-grey); }
.g-empty { padding: 4rem 1rem; text-align: center; color: var(--r22-soft-grey); grid-column: 1 / -1; }
.g-empty h2 { font-size: 1.4rem; color: var(--r22-white); margin-bottom: .5rem; }

/* ---------- Backlog ---------- */
.backlog { padding: 0 clamp(1rem, 3vw, 2.5rem) 3rem; display: grid; gap: 1.5rem; }
.backlog section { border-top: 1px solid var(--r22-graphite); padding-top: 1rem; }
.backlog h2 { font-size: 1.05rem; margin-bottom: .75rem; }
.backlog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.backlog li { display: flex; gap: .75rem; padding: .6rem .8rem; border: 1px dashed #333; border-radius: .7rem; font-size: .88rem; color: var(--r22-soft-grey); }
.backlog li b { font-family: var(--r22-font-heading); color: var(--r22-white); min-width: 4.2rem; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 64px); }
.d-main { min-width: 0; padding: 1.25rem clamp(1rem, 2.5vw, 2rem) 2rem; display: flex; flex-direction: column; gap: 1rem; }
.crumbs { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--r22-soft-grey); flex-wrap: wrap; }
.crumbs a { text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.crumbs a:hover { color: var(--r22-white); }
.stage-wrap { position: relative; display: flex; flex-direction: column; border: 1px solid #222; border-radius: 1.1rem; background: #000; overflow: hidden; min-height: min(68vh, 680px); flex: 1; }
.stage-bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem .55rem 1rem; border-bottom: 1px solid #161616; flex-wrap: wrap; }
.stage-id { font-family: var(--r22-font-heading); font-weight: 700; color: var(--r22-orange); font-size: .85rem; letter-spacing: .03em; }
.stage-name { font-size: .9rem; color: var(--r22-soft-grey); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sb-btn { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .75rem; border-radius: var(--r22-radius-pill); border: 1px solid #2a2a2a; background: none; font-size: .82rem; color: var(--r22-white); }
.sb-btn:hover { border-color: var(--r22-neutral-grey); }
.sb-btn.icon { width: 34px; padding: 0; justify-content: center; }
.stage { position: relative; flex: 1; min-height: 420px; overflow: hidden; isolation: isolate; }
.stage-wrap:fullscreen { border-radius: 0; border: 0; min-height: 100vh; }
.stage-wrap.is-pseudo-full { position: fixed; inset: 0; z-index: 90; border-radius: 0; min-height: 100vh; }
.demo-root { position: absolute; inset: 0; }
.gsiblings { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sib-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--r22-neutral-grey); margin-right: .25rem; }
.gsib { font-family: var(--r22-font-heading); font-weight: 700; font-size: .78rem; text-decoration: none; padding: .35rem .65rem; border-radius: var(--r22-radius-pill); border: 1px solid #262626; color: var(--r22-soft-grey); }
.gsib:hover { color: var(--r22-white); border-color: var(--r22-neutral-grey); }
.gsib[aria-current="page"] { background: var(--r22-white); color: #000; border-color: var(--r22-white); }
.d-panel { border-left: 1px solid var(--r22-graphite); padding: 1.5rem 1.5rem 3rem; overflow-y: auto; position: sticky; top: 64px; height: calc(100vh - 64px); scrollbar-width: thin; scrollbar-color: #333 transparent; }
.p-head { display: flex; align-items: center; gap: .5rem; }
.p-id { font-family: var(--r22-font-heading); font-weight: 700; font-size: 1.6rem; letter-spacing: .01em; }
.p-id em { font-style: normal; color: var(--r22-orange); }
.p-actions { margin-left: auto; display: flex; gap: .4rem; }
.p-title { font-size: 1.55rem; margin-top: .5rem; }
.p-cat { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.ptag { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: var(--r22-radius-pill); border: 1px solid #333; font-size: .75rem; color: var(--r22-soft-grey); white-space: nowrap; }
.ptag--o { border-color: var(--r22-orange); color: var(--r22-orange); }
.p-sec { margin-top: 1.6rem; }
.p-sec h2 { font-size: .72rem; font-family: var(--r22-font-body); font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--r22-neutral-grey); margin-bottom: .65rem; }
.p-sec p, .p-sec li { color: var(--r22-soft-grey); font-size: .9rem; }
.p-sec ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.p-sec .lead { color: var(--r22-white); font-size: .98rem; }
.p-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.pkv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .88rem; }
.pkv dt { color: var(--r22-neutral-grey); }
.pkv dd { margin: 0; color: var(--r22-soft-grey); }
.kcode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: var(--r22-white); background: #0d0d0d; border: 1px solid #1e1e1e; border-radius: .4rem; padding: .1rem .35rem; word-break: break-all; }
/* params */
.pparams { display: grid; gap: .9rem; }
.pparam label, .pparam .plabel { display: flex; justify-content: space-between; gap: .5rem; font-size: .84rem; color: var(--r22-soft-grey); margin-bottom: .35rem; }
.pparam output { color: var(--r22-white); font-variant-numeric: tabular-nums; }
.pparam input[type=range] { width: 100%; accent-color: var(--r22-orange); height: 24px; }
.pparam select, .pparam input[type=text], .p-note {
  width: 100%; min-height: 40px; padding: .5rem .75rem; border-radius: .6rem; border: 1px solid #333; background: #050505; color: var(--r22-white);
}
.pparam select:focus, .pparam input[type=text]:focus, .p-note:focus { border-color: var(--r22-neutral-grey); }
.pswitch { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .88rem; color: var(--r22-soft-grey); cursor: pointer; min-height: 32px; }
.pswitch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: #2a2a2a; position: relative; transition: background-color var(--r22-duration); flex-shrink: 0; cursor: pointer; margin: 0; }
.pswitch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--r22-soft-grey); transition: transform var(--r22-duration) var(--r22-ease), background-color var(--r22-duration); }
.pswitch input:checked { background: var(--r22-orange); }
.pswitch input:checked::after { transform: translateX(16px); background: #000; }
.ppresets { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.ppreset { height: 32px; padding: 0 .75rem; border-radius: var(--r22-radius-pill); border: 1px solid #333; background: none; font-size: .8rem; color: var(--r22-soft-grey); }
.ppreset:hover { color: var(--r22-white); border-color: var(--r22-neutral-grey); }
.ppreset[aria-pressed="true"] { background: var(--r22-white); color: #000; border-color: var(--r22-white); }
/* review */
.rstars { display: inline-flex; gap: .15rem; }
.rstar { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: #444; border-radius: .4rem; }
.rstar.on { color: var(--r22-orange); }
.rstar.on svg { fill: var(--r22-orange); }
.rstar:hover { color: var(--r22-white); }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; flex-wrap: wrap; }
.p-note { min-height: 84px; resize: vertical; font-size: .88rem; line-height: 1.5; }
.psaved { font-size: .75rem; color: var(--r22-neutral-grey); margin-top: .35rem; min-height: 1.1em; }
.pmore { display: grid; gap: .35rem; }
.pmore a { display: flex; gap: .65rem; align-items: baseline; text-decoration: none; padding: .45rem .6rem; border-radius: .5rem; font-size: .88rem; color: var(--r22-soft-grey); }
.pmore a:hover { background: #0d0d0d; color: var(--r22-white); }
.pmore a b { font-family: var(--r22-font-heading); color: var(--r22-white); font-size: .78rem; min-width: 3.6rem; }

/* ---------- Presentation ---------- */
.pres { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.present-stage { position: relative; flex: 1; overflow: hidden; }
.present-bar { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.25rem; border-top: 1px solid var(--r22-graphite); }
.present-id { font-family: var(--r22-font-heading); font-weight: 700; font-size: 1.4rem; color: var(--r22-orange); }
.present-name { font-family: var(--r22-font-heading); font-size: 1.15rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.present-count { font-size: .85rem; color: var(--r22-neutral-grey); font-variant-numeric: tabular-nums; }
.present-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #111; z-index: 2; }
.present-progress i { display: block; height: 100%; background: var(--r22-orange); transition: width .4s var(--r22-ease); }

/* ---------- Modal + toast ---------- */
.modal { width: min(520px, calc(100vw - 2rem)); border: 1px solid #2c2c2c; border-radius: 1.1rem; background: #070707; color: var(--r22-white); padding: 1.6rem; }
.modal::backdrop { background: rgba(0,0,0,.75); }
.modal h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.modal p { color: var(--r22-soft-grey); font-size: .92rem; margin-bottom: .75rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }
.mbtn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .6rem 1.2rem; border-radius: var(--r22-radius-control); border: 1px solid var(--r22-orange); background: var(--r22-orange); color: #000; }
.mbtn--ghost { background: transparent; color: var(--r22-white); border-color: #3a3a3a; }
.mbtn:hover { text-decoration: underline; text-underline-offset: .2em; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; z-index: 100; background: var(--r22-white); color: #000; padding: .65rem 1.1rem; border-radius: var(--r22-radius-pill); font-size: .88rem; transition: opacity .2s, transform .3s var(--r22-ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .d-panel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--r22-graphite); padding: 1.5rem clamp(1rem, 2.5vw, 2rem) 3rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
  .d-panel > .p-intro { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 64px; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 45; background: #000; transform: translateX(-102%); transition: transform .3s var(--r22-ease); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 64px 0 0; z-index: 44; background: rgba(0,0,0,.6); }
  .tb-btn span { display: none; }
  .tb-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: 0 .6rem; }
  .brand-studio { display: none; }
  .brand-title { font-size: 1.05rem; margin: 0; }
  .search-kbd { display: none; }
  .search input { padding-right: .8rem; }
  .top-actions { gap: .3rem; }
  #btn-motion { display: none; }
  .d-panel { grid-template-columns: minmax(0, 1fr); }
  .stage-wrap { min-height: 72vh; }
  .stage { min-height: 380px; }
  .g-list .l-hide { display: none; }
  .result-count { width: 100%; margin-left: 0; }
}
@media (max-width: 420px) {
  .brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .g-card, .toast, .thumb-live, .thumb-art { transition: none !important; }
}

/* thumbnail art (static state; live preview replaces it on hover) */
.thumb-art { background:
  radial-gradient(120% 90% at 100% 0%, rgba(254,89,24,.10), transparent 55%),
  linear-gradient(#0a0a0a, #000); }
.ta-id { position: absolute; left: 1rem; bottom: .7rem; font-family: var(--r22-font-heading); font-weight: 700; font-size: clamp(1.9rem, 3.2vw, 2.6rem); letter-spacing: -.03em; color: #1f1f1f; -webkit-text-stroke: 1px #3a3a3a; }
.ta-icon { position: absolute; left: 1rem; top: 1rem; color: var(--r22-orange); opacity: .9; }
.g-card:hover .ta-id { -webkit-text-stroke-color: #555; }
