/* Director Studio (/director). Values from Sume's director, home-hero, composer-split and
   studio-create-controls modules (ds tokens: radius-sm 12, radius-md 18, control-md 36, space-* 4/8/12/16/24/32). */
body { overflow: hidden; }
.app { --side: 240px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100dvh; background: var(--bg); color: var(--ink); overflow: hidden; transition: grid-template-columns .22s var(--ease); }
.app[data-collapsed=true] { --side: 0px; }
.app[data-collapsed=true] .sidebar { visibility: hidden; }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 13px 13px 9px; overflow: hidden; }
.side-top { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.switcher { flex: 1; min-width: 0; height: 36px; padding: 0 6px; border-radius: 12px; background: var(--wash); display: flex; align-items: center; gap: 8px; font-size: 14px; transition: background-color .15s var(--ease); }
.switcher:hover { background: var(--hover); }
.switcher-mark { width: 24px; height: 24px; display: inline-grid; place-items: center; flex: none; }
.switcher-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher svg { color: var(--ink-2); }
.icon-button { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink-2); flex: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.icon-button:hover { background: var(--hover); color: var(--ink); }
.side-top > .icon-button { background: var(--wash); }
.nav-item { width: 100%; height: 36px; padding: 6px; border-radius: 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; text-align: left; overflow: hidden; transition: background-color .15s var(--ease); }
.nav-item:hover { background: var(--hover); }
.nav-item[data-active=true] { background: var(--wash); }
.nav-icon { width: 24px; height: 24px; display: inline-grid; place-items: center; flex: none; color: var(--ink-2); transition: color .15s var(--ease); }
.nav-item:hover .nav-icon, .nav-item[data-active=true] .nav-icon { color: var(--ink); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-pill { margin-left: auto; color: var(--ink-2); }
.pill { height: 18px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: #000; font-size: 10px; font-weight: 600; line-height: 18px; }
.section-head { height: 32px; margin-top: 24px; margin-bottom: 6px; padding: 0 6px; display: flex; align-items: center; gap: 2px; color: var(--ink-3); font-size: 12px; }
.section-head-label { flex: 1; }
.project-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: none; }
.project-list > * { flex: none; }
.rec { font-weight: 400; }
.rec .nav-label { color: color-mix(in srgb, var(--ink) 85%, transparent); }
.new-project { color: var(--ink-3); }
.new-project:hover { color: var(--ink); background: none; }
.new-project .nav-icon { border: 1px solid var(--line-2); border-radius: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.dot.ok { background: #6fcf97; } .dot.bad { background: #ff6764; } .dot.run { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.side-bottom { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-rule { height: 1px; margin: 6px -13px; border: 0; background: var(--line); }
.account-row { position: relative; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 12px; font-weight: 500; display: grid; place-items: center; flex: none; }
.bal { margin-left: auto; color: var(--ink-2); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.acct-pop { position: absolute; left: 0; right: 0; bottom: 44px; top: auto !important; }
.acct-pop.show { display: flex; }

/* frame */
.frame { position: relative; min-width: 0; min-height: 0; margin: 4px 4px 4px 0; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); overflow: hidden; }
.app[data-collapsed=true] .frame { margin-left: 4px; }
.side-open { position: absolute; left: 12px; top: 12px; z-index: 5; background: var(--wash); display: none; }
.app[data-collapsed=true] .side-open { display: inline-grid; }
.scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.home { min-height: 100%; padding: 54px 32px 96px; display: flex; flex-direction: column; align-items: center; }

/* hero (home-hero) */
.hh { align-self: stretch; display: flex; flex-direction: column; align-items: center; margin-bottom: 36px; color: var(--ink); }
.hh-title { width: min(380px, 70%); margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .86; }
.hh-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 500; letter-spacing: -.3px; line-height: 1.3; }
.hh-brand .mark { width: 22px; height: 22px; }
.hh-a { font: 400 clamp(40px, 4.3vw, 60px)/.86 'Anton', Impact, sans-serif; transform: scaleY(1.14); white-space: nowrap; margin-top: 4px; }
.hh-b { font: 400 clamp(40px, 4.3vw, 60px)/.86 'Anton', Impact, sans-serif; transform: scaleY(1.14); margin-top: .2em; }
.hh-line { margin: 20px 0 0; color: var(--ink-2); font-size: 18px; line-height: 1.5; text-align: center; }
.hh-reel { align-self: stretch; margin: 32px -32px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #0000, #000 10% 90%, #0000); mask-image: linear-gradient(90deg, #0000, #000 10% 90%, #0000); }
.hh-track { display: flex; gap: 12px; width: max-content; animation: reelSlide var(--reel-seconds, 100s) linear infinite; animation-play-state: paused; }
.hh-reel[data-moving] .hh-track { animation-play-state: running; }
.hh-reel[data-moving]:hover .hh-track { animation-play-state: paused; }
@keyframes reelSlide { to { transform: translateX(calc(-50% - 6px)); } }
.hh-card { position: relative; aspect-ratio: 16/9; width: clamp(180px, 22vw, 280px); border-radius: 12px; overflow: hidden; background: var(--s-wash); flex: none; }
.hh-card video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* composer (composer-split) */
.home-composer { width: min(1120px, 100%); }
.split { --split-fill: color-mix(in srgb, var(--s-wash) 50%, transparent); width: min(100%, 876px); margin-inline: auto; display: flex; align-items: flex-end; gap: 4px; }
.mode-rail { position: relative; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 24px; background: var(--elev); box-shadow: 0 4px 6px #00000029, 0 4px 16px #00000014; }
.mode-indicator { position: absolute; top: 4px; left: 4px; width: 64px; height: 52px; border-radius: 20px; background: var(--split-fill); transition: transform .2s var(--ease); pointer-events: none; }
.mode-rail[data-mode=video] .mode-indicator { transform: translateY(56px); }
.mode-tab { position: relative; z-index: 1; width: 64px; height: 52px; padding: 6px 4px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); transition: color .2s var(--ease); }
.mode-tab:hover, .mode-tab[aria-selected=true] { color: var(--ink); }
.mode-label { font-size: 11px; font-weight: 500; line-height: 1.25; }
.card { flex: 1; min-width: 0; padding: 4px; border-radius: 24px; background: var(--elev); }
.cards { display: flex; gap: 4px; padding: 4px; margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.setting-card { flex: 1 1 0; min-width: 128px; height: 48px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--split-fill); display: flex; align-items: center; gap: 8px; text-align: left; color: var(--ink); transition: background-color .15s var(--ease); }
.setting-card.refs-card { flex-grow: .8; min-width: 112px; }
.setting-card:hover, .setting-card[data-state=open] { background: var(--s-wash); }
.card-thumb { position: relative; width: 32px; height: 32px; border-radius: 8px; background: var(--s-wash); color: var(--ink-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.refs-card .card-thumb { background: var(--bg); color: var(--ink); }
.card-thumb svg { width: 18px; height: 18px; }
/* thumbnails: placeholders until we have our own preset art */
.t-film { background: radial-gradient(60% 60% at 30% 30%, #7fd3e8, transparent 70%), linear-gradient(135deg, #0c3a4a, #1f7a8c); }
.t-camera { background: radial-gradient(50% 50% at 60% 50%, #3a3f46, transparent 70%), linear-gradient(135deg, #15181c, #2a6fa8); }
.t-palette { background: linear-gradient(135deg, #e85d3c, #f2c14e 35%, #4ec9b0 65%, #6c5ce7); }
.t-light { background: radial-gradient(60% 60% at 40% 30%, #e9eef2, transparent 70%), linear-gradient(135deg, #5d6b63, #2c3530); }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-label, .card-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-label { font-size: 11px; font-weight: 500; line-height: 16px; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(to top, color-mix(in srgb, var(--ink) 80%, transparent), color-mix(in srgb, var(--ink) 60%, transparent)); }
.card-value { font-size: 14px; font-weight: 500; line-height: 20px; }

.inner { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: var(--hover); }
.resize-handle { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; color: color-mix(in srgb, var(--ink) 20%, transparent); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.refs:empty { display: none; }
.ref { position: relative; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: #000; }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref .tag { position: absolute; left: 2px; bottom: 2px; font-size: 9px; line-height: 13px; background: #000000b3; padding: 0 3px; border-radius: 3px; }
.ref .x { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #000000b3; font-size: 10px; line-height: 16px; }
.ref.audio { display: grid; place-items: center; font-size: 10px; color: var(--ink-2); padding: 3px; text-align: center; background: var(--s-wash); }
.prompt { width: 100%; min-height: 52px; max-height: 332px; padding: 4px 0; margin: 0; resize: none; border: 0; outline: 0; background: none; color: var(--ink); font: 14px/20px var(--sans); field-sizing: content; }
.prompt::placeholder { color: var(--ink-3); }
.controls { display: flex; align-items: center; gap: 4px; min-width: 0; height: 28px; }
.strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.control { flex: none; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--hover); display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background-color .15s cubic-bezier(0, 0, .2, 1), scale .15s cubic-bezier(0, 0, .2, 1); }
.control:hover, .control[data-state=open] { background: var(--active); }
.control:active:not(:disabled) { scale: .96; }
.control svg { width: 14px; height: 14px; }
.add-pair { flex: none; height: 28px; display: inline-flex; align-items: center; border-radius: 9999px; }
.add-pair .control { width: 28px; padding: 0; background: none; transition: background-color .2s var(--ease); }
.add-pair .control:hover, .add-pair .control[data-state=open] { background: var(--active); }
.add-pair .control:active:not(:disabled) { scale: none; background: color-mix(in srgb, var(--ink) 20%, transparent); }
.control.model { justify-content: flex-start; }
.model-mark { color: var(--accent); display: inline-flex; }
.control-text { text-align: left; overflow: hidden; text-overflow: ellipsis; }
.stepper { gap: 8px; padding: 0 6px; cursor: default; }
.stepper:hover { background: var(--hover); }
.stepper:active { scale: none !important; }
.stepper button { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.stepper button:hover:not(:disabled) { color: var(--ink); }
.stepper button:disabled { opacity: .4; cursor: default; }
.count-max { color: var(--ink-3); }
.aside { flex: none; align-self: flex-end; display: flex; align-items: center; gap: 12px; }
.generate { --fill: color-mix(in srgb, var(--accent) 66%, #131517); width: 128px; height: 80px; padding: 0 12px; border-radius: 12px; background: var(--fill); color: var(--on-accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent), inset 0 -3px 0 color-mix(in srgb, var(--fill) 72%, #131517), 0 10px 24px -10px color-mix(in srgb, var(--fill) 60%, transparent);
  transition: filter .2s var(--ease), opacity .2s var(--ease); }
.generate:hover:not(:disabled) { filter: brightness(.9); }
.generate:active:not(:disabled) { filter: brightness(.8); }
.generate:disabled { box-shadow: none; background: var(--s-wash-2); color: var(--ink-3); filter: none; }
.generate-label { font-size: 12px; font-weight: 600; line-height: 16px; }
.generate-cost { font-size: 12px; font-weight: 500; line-height: 16px; font-variant-numeric: tabular-nums; }

/* My generations (director section / projectGrid) */
.section { width: min(1132px, 100%); margin-top: 72px; }
.section-title { position: relative; margin: 0 0 16px 8px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: 16px; line-height: 1.5; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.project-card { padding: 4px 4px 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--ink); transition: background-color .2s cubic-bezier(0, 0, .2, 1); }
.project-card:hover { background: var(--s-wash); }
.project-cover { position: relative; aspect-ratio: 16/9; border-radius: 12px; background: var(--s-wash); display: grid; place-items: center; overflow: hidden; color: var(--ink-3); }
.cover-circle { width: 58px; height: 58px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--s-wash); color: var(--ink); display: grid; place-items: center; transition: scale .2s cubic-bezier(0, 0, .2, 1); }
.project-card:hover .cover-circle { scale: 1.05; }
.cover-circle svg { width: 20px; height: 20px; }
.project-meta { height: 24px; padding: 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.25; }
.project-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* job cards from common.js, shaped like project cards */
.job { padding: 4px 4px 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; transition: background-color .2s cubic-bezier(0, 0, .2, 1); scroll-margin: 80px; }
.job:hover { background: var(--s-wash); }
.job .media { position: relative; aspect-ratio: 16/9; border-radius: 12px; background: #000; display: grid; place-items: center; overflow: hidden; }
.job video { width: 100%; height: 100%; object-fit: contain; }
.job .meta { padding: 0 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.job .meta p { margin: 0; color: var(--ink); font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .meta > div:first-child { display: none; }
.job .acts { display: flex; gap: 4px; flex-wrap: wrap; }
.job .acts button, .job .acts a { height: 24px; padding: 0 8px; border-radius: 8px; background: var(--hover); display: inline-flex; align-items: center; font-size: 12px; color: var(--ink); }
.job .acts button:hover, .job .acts a:hover { background: var(--active); }
.spin { width: 22px; height: 22px; border: 2px solid #444; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* style preset dialog (Film style etc.) */
.style-modal { background: #000000b3; }
.style-sheet { width: min(616px, 100%); border-radius: 16px; background: var(--elev); box-shadow: var(--dd-edge); overflow: hidden; }
.style-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 14px; }
.style-head h2 { margin: 0; font-size: 14px; font-weight: 500; line-height: 20px; }
.spacer { flex: 1; }
.small-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.close-x { width: 28px; height: 28px; border-radius: 999px; background: var(--s-wash-2); color: var(--ink); font-size: 16px; line-height: 1; }
.style-body { display: grid; grid-template-columns: 140px minmax(0, 1fr); margin: 0 4px 4px; border-radius: 12px; background: #ffffff08; min-height: 360px; }
.style-tabs { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--line); }
.style-tab { height: 30px; padding: 0 8px; border-radius: 8px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; text-align: left; }
.style-tab:hover { color: var(--ink); }
.style-tab[aria-selected=true] { background: var(--s-wash-2); color: var(--ink); }
.style-tab small { margin-left: auto; color: var(--accent); font-size: 11px; }
.style-stage { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.style-copy { display: flex; flex-direction: column; padding: 12px 12px 0; }
.style-copy b { font-size: 12px; font-weight: 500; }
.style-copy span { color: var(--ink-2); font-size: 10px; }
.style-carousel { flex: 1; position: relative; min-height: 190px; margin-top: 16px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 70% at 50% 100%, #ffffff0a, transparent 70%); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.style-slot { position: absolute; width: 190px; aspect-ratio: 16/10; border-radius: 18px; overflow: hidden; border: 3px solid #111; transition: transform .3s var(--ease), opacity .3s; }
.style-slot.c { transform: translateY(-8px); z-index: 2; }
.style-slot.l { transform: translateX(-220px) translateY(40px) rotate(-40deg) scale(.8); opacity: .8; }
.style-slot.r { transform: translateX(220px) translateY(40px) rotate(40deg) scale(.8); opacity: .8; }
.style-nav { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 0 20px; }
.round { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--elev); display: inline-grid; place-items: center; }
.round:hover { background: var(--s-wash-2); }
.style-name { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--elev); display: inline-flex; align-items: center; font-size: 12px; }

/* media library */
.lib-float { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 32px)); z-index: 950; padding: 6px; border-radius: 16px; background: var(--dd-surface); box-shadow: var(--dd-edge); display: flex; flex-direction: column; }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.lib-filter { display: flex; gap: 4px; }
.lib-filter button { height: 30px; padding: 0 12px; border-radius: 9999px; color: var(--dd-muted); }
.lib-filter button.on { background: var(--dd-wash); color: var(--dd-ink); }
.lib-x { width: 30px; height: 30px; border-radius: 8px; color: var(--dd-muted); font-size: 20px; }
.lib-body { overflow-y: auto; padding: 4px; }
.lib { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lib .item { aspect-ratio: 1; border-radius: 10px; background: var(--dd-wash); overflow: hidden; display: grid; place-items: center; text-align: center; color: var(--dd-muted); font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.lib .item:hover { border-color: var(--accent); }
.lib .item img, .lib .item video { width: 100%; height: 100%; object-fit: cover; }
.lib .item.blank { cursor: default; background: color-mix(in srgb, var(--dd-wash) 50%, transparent); } .lib .item.blank:hover { border-color: transparent; }
.lib .up svg { width: 18px; height: 18px; margin-bottom: 6px; }

.scrim { display: none; }
@media (max-width: 1100px) { .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(300px, 86vw); background: var(--bg); transform: translate(-100%); visibility: hidden; transition: transform .2s, visibility 0s linear .2s; box-shadow: 0 20px 60px #0009; }
  .app[data-drawer=open] .sidebar { visibility: visible; transform: none; transition: transform .2s; }
  .app[data-drawer=open] ~ .scrim { display: block; position: fixed; inset: 0; z-index: 59; background: #0006; }
  .sidebar .nav-item { height: 44px; }
  .frame { margin: 0; border: 0; border-radius: 0; }
  .side-open { display: inline-grid; }
  .home { padding: 64px 16px 160px; }
  .hh { margin-bottom: 24px; } .hh-line { font-size: 16px; } .hh-reel { margin: 24px -16px 0; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .section { margin-top: 32px; }
}
@media (max-width: 640px) {
  .split { flex-direction: column; align-items: stretch; }
  .mode-rail { flex-direction: row; align-self: flex-start; }
  .mode-indicator { width: 88px; height: 36px; }
  .mode-rail[data-mode=video] .mode-indicator { transform: translate(92px); }
  .mode-tab { flex-direction: row; gap: 6px; width: 88px; height: 36px; padding: 0 12px; }
  .mode-label { font-size: 12px; }
  .card { padding: 2px; }
  .cards { flex-wrap: wrap; overflow: visible; }
  .setting-card { flex: calc(50% - 2px); min-width: 0; height: 40px; padding: 4px 12px 4px 4px; }
  .setting-card.refs-card { flex-basis: 100%; }
  .inner { flex-direction: column; align-items: stretch; }
  .controls { flex-wrap: wrap; height: auto; }
  .strip { flex-wrap: wrap; overflow: visible; }
  .control, .add-pair { height: 36px; border-radius: 10px; }
  .add-pair .control { width: 36px; }
  .prompt { font-size: 16px; line-height: 22px; }
  .aside { width: 100%; }
  .generate { flex: 1; flex-direction: row; gap: 12px; width: auto; height: 48px; }
  .style-body { grid-template-columns: 1fr; }
  .style-tabs { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .lib { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .hh-track { animation: none; } }
/* audio references as pills (play + length), as on the Video page; red = breaks the model's limit */
.ref.audio-pill { width: 96px; padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; background: var(--s-wash); color: var(--ink-2); border-radius: 10px; }
.audio-pill .wave { height: 12px; }
.audio-pill .play { position: absolute; left: 6px; bottom: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--s-wash-2); display: grid; place-items: center; }
.audio-pill .play svg { width: 8px; height: 8px; fill: currentColor; stroke: none; }
.audio-pill .rdur { position: absolute; right: 7px; bottom: 6px; font-size: 10px; line-height: 12px; }
.audio-pill .tag { display: none; }
.ref .rdur { position: absolute; right: 2px; bottom: 2px; font-size: 9px; background: #000000b3; padding: 0 3px; border-radius: 3px; }
.ref.bad { box-shadow: inset 0 0 0 2px #ff5a5f; }
.ref-warn { flex-basis: 100%; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.generate .gen-vs { font-size: 10px; line-height: 14px; font-weight: 600; padding: 0 6px; border-radius: 9999px; background: color-mix(in srgb, var(--on-accent) 14%, transparent); white-space: nowrap; }
