
/* Browser studio */
.studio-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:16px; margin-top:14px; }
.studio-line-card { display:flex; flex-direction:column; min-width:0; padding:18px; }
.studio-line-card .button { margin-top:auto; align-self:flex-start; }
.studio-passport,.studio-jobs,.studio-legacy { margin-top:14px; }
.studio-passport h2,.studio-jobs h2 { font-size:18px; }
.studio-profile { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; }
.studio-profile>div { display:grid; gap:4px; border:1px solid var(--line); border-radius:12px; padding:10px; overflow-wrap:anywhere; }
.studio-rules { white-space:pre-wrap; }
.studio-file { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:8px 0; border-bottom:1px solid var(--line); }
.studio-file>div,.studio-file>span { flex:1 1 180px; overflow-wrap:anywhere; min-width:0; }
.studio-legacy summary { cursor:pointer; font-weight:700; }
.studio-legacy>p { margin:12px 0; }
.studio-result { display:grid; gap:6px; }
.studio-result .content-preview { max-height:420px; object-fit:contain; }
[data-job-state="ready"] { color:var(--mint,#68d8bc); }
[data-job-state="failed"] { color:#ffb9ae; }
@media (max-width:540px) {
  .studio-profile { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .studio-grid { gap:10px; }
}

.studio-source[hidden] { display:none; }

.library-thumb { width:100%; height:200px; object-fit:contain; background:#111923; border-radius:.55rem; }
.calendar-release-count { color:#ffda8e; }
.calendar-agenda-day { border-top:1px solid var(--line,#344155); padding:.65rem 0; }
.calendar-agenda-day > summary { cursor:pointer; font-weight:650; padding:.25rem 0; }
.calendar-agenda-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:.6rem; align-items:center; }
.calendar-agenda-row p { margin:.2rem 0 0; }
@media(max-width:650px) { .calendar-agenda-row { grid-template-columns:auto minmax(0,1fr); } }

.generator-logo {width:40px;height:40px;object-fit:contain;border-radius:10px;background:#fff;padding:3px;}

.library-thumb-button {display:block;width:100%;padding:0;border:0;border-radius:.55rem;background:#111923;cursor:pointer;}
.library-thumb-button .library-thumb {display:block;}
.library-card h3 {overflow-wrap:anywhere;}
.library-original {display:block;max-width:100%;max-height:60vh;object-fit:contain;margin:auto;border-radius:.5rem;}

.format-preview {
  width: min(100%, 14rem);
  margin: 0;
}
.format-preview > img,
.format-preview > video {
  display: block;
  width: 100%;
  background: #060709;
  object-fit: contain;
  border-radius: .65rem;
}
.format-vertical > :is(img,video) { aspect-ratio: 9 / 16; }
.format-portrait > :is(img,video) { aspect-ratio: 4 / 5; }
.format-preview figcaption {
  margin-top: .35rem;
  color: var(--dim, #a6afbb);
  font-size: .8rem;
}

/* Stream bank: keep selection and production settings within reach. */
.stream-bank{display:grid;gap:8px;max-height:420px;overflow-y:auto;padding:2px 8px 2px 2px;scrollbar-color:var(--gold,#d9ad62) transparent}
.stream-bank .workbench-card{min-height:58px;padding:12px 16px;margin:0}
.stream-bank .workbench-card p{margin:4px 0 0;overflow-wrap:anywhere}


/* A grid item must shrink below the original media and action row width. */
.library-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)); }
.library-card { min-width:0; max-width:100%; overflow:hidden; }
.library-card > * { min-width:0; max-width:100%; box-sizing:border-box; }
.library-card .library-thumb-button { min-width:0; overflow:hidden; }
.library-card .library-thumb { width:100%; max-width:100%; min-width:0; height:200px; object-fit:contain; }
.library-card .form-actions { display:flex; flex-wrap:wrap; gap:8px; }
.library-card .form-actions > * { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.library-card h3, .library-card p { overflow-wrap:anywhere; }
.site-home { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.site-home img { width:32px; height:32px; object-fit:contain; }

.theme-card {min-width:0;overflow-wrap:anywhere;}
.theme-passport {overflow-wrap:anywhere;}
.theme-passport a {max-width:100%;overflow-wrap:anywhere;}

.library-card { display:flex; flex-direction:column; gap:12px; align-items:stretch; }
.library-card .library-thumb-button { flex:none; }
.library-card h3, .library-card p { margin:0; }
.library-card h3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.library-card .form-actions { margin-top:auto; padding-top:8px; justify-content:flex-start; }

.step-link {text-decoration:none;color:var(--muted,#aab7c8);cursor:pointer;}
.step-link:hover {color:var(--gold);}
.step-link:focus-visible {outline:2px solid var(--gold);outline-offset:5px;border-radius:5px;}
.step.has-data {color:var(--teal,#68d8bc);}
.step.has-data span {background:var(--teal,#68d8bc);border-color:var(--teal,#68d8bc);}
.step.current.has-data {color:var(--gold);}
.step.current.has-data span {background:var(--gold);border-color:var(--gold);}

/* Long montage forms must stay inside the dialog at every viewport width. */
#dialog .stack{grid-template-columns:minmax(0,1fr);min-width:0}
#dialog .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
#dialog :is(details,fieldset,.workbench-card,.field){min-width:0;max-width:100%}
#dialog :is(input,select,textarea){min-width:0;max-width:100%;box-sizing:border-box}
#dialog .inline-check{display:flex;align-items:flex-start;gap:9px;white-space:normal}
#dialog .inline-check input{flex:none;width:17px;margin-top:4px}
#dialog .form-actions{flex-wrap:wrap}
#dialog button{white-space:normal;max-width:100%}
@media(max-width:720px){#dialog .form-grid{grid-template-columns:minmax(0,1fr)}#dialog{padding:18px}}
