body:has(#view-portal-projects.active) .portal-atmosphere { visibility:hidden; }
body:has(#view-portal-projects.active) { background:#0b0d0d; }
#view-portal-projects { --project-lime:#b9fc40; --project-line:#50585a; min-height:75vh; color:#f8f9f8; }
#view-portal-projects #portalSeriesProjects { display:grid; gap:12px; justify-items:stretch; max-width:1050px; margin:auto; padding:4px 0 22px; }
#view-portal-projects h2,#view-portal-projects h3 { margin:0; line-height:1.13; font-family:inherit; font-style:normal; font-weight:800; letter-spacing:-.025em; }
#view-portal-projects h2 { font-size:clamp(1.42rem,5vw,2.28rem); }
#view-portal-projects h3 { font-size:clamp(1.25rem,4vw,1.68rem); }
.portal-heading,.portal-series-hero { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.portal-action { font:inherit; font-weight:750; font-size:.84rem; cursor:pointer; padding:8px 12px; border:1px solid transparent; border-radius:7px; color:inherit; background:transparent; min-height:36px; }
.portal-action:focus-visible { outline:2px solid #fff; outline-offset:3px; }
.portal-action:disabled { opacity:.6; cursor:wait; }
.portal-lime { background:var(--project-lime); color:#111700; white-space:nowrap; }
.portal-outline { border-color:var(--project-lime); }
.portal-muted { border-color:var(--project-line); color:#d4d8d8; }
.portal-back { justify-self:start; padding-left:0; }
.portal-edit { color:var(--project-lime); padding-inline:4px; }
.portal-edit:before { content:"✎"; margin-right:4px; }
.portal-note { color:#c1c6c4; margin:0; }
#view-portal-projects .portal-series-grid { gap:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(min-width:780px) { #view-portal-projects .portal-series-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; } }
#view-portal-projects .portal-series-card { padding:0; gap:0; align-content:end; justify-items:stretch; overflow:hidden; border:1px solid var(--project-line); border-radius:10px; color:#f8f9f8; background:#151918; min-height:56px; text-align:center; }
.portal-art { display:block; width:100%; object-fit:cover; }
.portal-cover { aspect-ratio:2/3; }
.portal-series-caption { padding:10px 8px; overflow-wrap:anywhere; font-weight:800; font-size:clamp(.94rem,3.7vw,1.13rem); }
.portal-series-hero { justify-content:start; border-block:1px solid var(--project-line); padding:12px 0; }
.portal-hero-thumb { width:76px; aspect-ratio:1.45; border-radius:8px; flex:none; }
#view-portal-projects select { justify-self:start; color:#f7f7f7; background:#191e1e; padding:5px 9px; border:1px solid var(--project-line); border-radius:6px; min-height:32px; }
#view-portal-projects .portal-episode-row { display:block; padding:9px; border:1px solid var(--project-line); border-radius:9px; background:#111514; }
#view-portal-projects .portal-episode-row.is-editing { border-color:var(--project-lime); }
.portal-episode-summary { display:flex; align-items:center; gap:9px; }
.portal-episode-thumb { width:clamp(56px,18vw,136px); aspect-ratio:16/9; border-radius:7px; flex:none; }
.portal-episode-text { display:grid; gap:2px; flex:1; min-width:0; line-height:1.22; overflow-wrap:anywhere; }
.portal-episode-text strong { font-size:clamp(.92rem,3.4vw,1.15rem); }
.portal-episode-title { color:#d8dcdb; font-size:clamp(.76rem,2.8vw,.96rem); }
.portal-episode-status { color:#d3e49a; font-size:.7rem; }
#view-portal-projects .portal-episode-actions { display:flex; gap:6px; flex:none; }
.portal-episode-form { display:grid; gap:10px; border:1px solid #394140; border-radius:8px; background:#171b1b; padding:10px; margin-top:9px; }
.portal-inline-fields { display:grid; grid-template-columns:minmax(80px,28%) minmax(0,1fr); align-items:center; gap:7px; font-size:.84rem; }
.portal-inline-fields :is(input,textarea) { min-width:0; width:100%; padding:6px 8px; border:1px solid #596060; border-radius:6px; background:#1d2121; color:#fff; font:inherit; }
.portal-inline-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.portal-inline-actions .portal-file { cursor:pointer; font-size:.78rem; color:var(--project-lime); margin-right:auto; }
.portal-file:focus-within { outline:2px solid #fff; outline-offset:3px; }
.portal-file input { position:absolute; opacity:0; width:1px; height:1px; }
.portal-clear { color:#bdc4c2; font-size:.73rem; display:flex; gap:4px; align-items:center; flex-basis:100%; }
#portalEpisodeError:empty { display:none; }
#portalEpisodeError { color:#ffb9ac; font-size:.85rem; }
@media(max-width:460px) {
  .portal-heading { gap:8px; }
  .portal-action { font-size:.77rem; padding-inline:8px; }
  #view-portal-projects .portal-episode-actions { gap:3px; }
  .portal-episode-actions .portal-action { min-height:40px; font-size:.72rem; padding-inline:5px; }
}
@media(max-width:345px) { .portal-episode-summary { flex-wrap:wrap; } .portal-episode-actions { margin-left:auto; } }
@media(max-width:460px) {
  .portal-episode-summary { gap:7px; }
  .portal-episode-thumb { width:54px; }
  .portal-episode-text strong { font-size:.84rem; white-space:nowrap; }
  .portal-episode-actions .portal-action { font-size:.68rem; padding-inline:5px; white-space:nowrap; }
  .portal-inline-actions { display:grid; grid-template-columns:minmax(0,1fr) auto auto; }
  .portal-inline-actions .portal-file { font-size:.67rem; width:max-content; max-width:100%; }
  .portal-inline-actions button { font-size:.69rem; padding-inline:6px; }
  .portal-clear { grid-column:1/-1; }
}
@media(max-width:355px) { .portal-episode-summary { flex-wrap:wrap; } }

#view-portal-projects .portal-order-tools { display:flex; gap:8px; align-items:center; justify-content:space-between; }
#view-portal-projects .portal-order-panel { border:1px solid var(--project-line); border-radius:8px; padding:10px; background:#151918; }
#view-portal-projects .portal-order-panel[hidden] {display:none;}
.portal-order-list { display:grid; gap:5px; margin:8px 0; padding:0; list-style:none; }
.portal-order-list li { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:5px; align-items:center; border:1px solid #3b4542; padding:5px; border-radius:6px; }
.portal-order-list li[draggable=true] { cursor:grab; }
.portal-order-panel>.portal-action+.portal-action { margin-left:6px; }
.portal-order-error:empty { display:none; }
.portal-order-error { color:#ffb6a7; }
