/* Shared by the authenticated workspace and its sign-in page. */
:root {
  color-scheme: dark;
  --page: #0c171b;
  --panel: #152529;
  --well: #102024;
  --cover: #203537;
  --ink: #f2efe6;
  --text: #dee7e4;
  --soft: #b4c4c4;
  --muted: #96aaa9;
  --line: #344a4d;
  --aqua: #a2dfd5;
  --gold: #e9cb93;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  margin: 0; color: var(--text); font: 14px/1.55 var(--sans);
  background: radial-gradient(ellipse at 52% 6%, #182a2d 0, #0e1c20 42%, var(--page) 85%);
  min-height: 100vh; min-height: 100svh;
}
[hidden] { display: none !important; }
h1, h2, h3, p, form { margin: 0; }
h1, h2 { color: var(--ink); font-family: var(--serif); font-weight: 650; line-height: 1.25; }
h1 { font-size: clamp(28px, 3vw, 37px); letter-spacing: .035em; }
h2 { font-size: 23px; letter-spacing: .025em; }
h3 { font-size: 14px; }
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .22em; }
button, input, select, textarea { color: inherit; font: inherit; }
button, .upload-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 36px; padding: 6px 13px; border: 1px solid #475f61; border-radius: 7px;
  background: #203336; color: var(--text); font-size: 13px; font-weight: 550; cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
button.primary { background: var(--gold); color: #2e3025; border-color: transparent; }
:where(button, a, input, textarea, select):focus-visible, .upload-button:focus-within {
  outline: 2px solid var(--aqua); outline-offset: 3px;
}
:where(h2):focus { outline: none; }
input:not([type=file], [type=radio], [type=checkbox]), select, textarea {
  width: 100%; min-width: 0; min-height: 38px; padding: 7px 11px;
  background: var(--well); border: 1px solid #41585a; border-radius: 6px;
  color: var(--ink); font-size: 14px; line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: #95a9a9; opacity: 1; }
textarea { display: block; resize: vertical; min-height: 76px; }
select { cursor: pointer; }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mobile-only { display: none; }

html, #titles, textarea { scrollbar-width: thin; scrollbar-color: #597973 #101f23; }
@supports selector(::-webkit-scrollbar) {
  html, #titles, textarea { scrollbar-width: auto; scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: #101f23; }
  ::-webkit-scrollbar-thumb { background: #597973; border: 2px solid #101f23; border-radius: 12px; }
  ::-webkit-scrollbar-thumb:hover { background: #90bcb2; }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}

.shell { max-width: 1232px; padding: 22px clamp(16px, 3vw, 34px) 36px; margin: 0 auto; }
.masthead { position: relative; isolation: isolate; overflow: hidden; background: #142429; }
.shell > .masthead { border: 1px solid var(--line); border-radius: 12px; }
.mast-art {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #142429 3%, #142429ed 26%, #14242940 62%, #1120273d),
              linear-gradient(0deg, #10202392, transparent 80%),
              url("/assets/station-evening-small.webp?rev=7f23c65a21b07997") center 58% / cover;
}
.mast-inner { position: relative; padding: 20px 26px 21px; }
.brand { display: inline-flex; align-items: center; gap: 6px; color: #c5dfd9; font-size: 13px; }
.masthead h1 { margin-top: 6px; }
.logout { position: absolute; top: 18px; right: 22px; }
.quiet-button { background: #15282be8; color: #d2dfdd; }
.studio-nav { display: flex; align-items: stretch; gap: 24px; margin: 3px 2px 16px; border-bottom: 1px solid var(--line); }
.studio-nav button {
  position: relative; min-height: 48px; border: 0; border-radius: 0; padding: 0 4px;
  background: transparent; color: var(--soft); font-size: 14px; gap: 7px;
}
.studio-nav button[aria-pressed=true] { color: var(--aqua); }
.studio-nav button[aria-pressed=true]::after {
  position: absolute; content: ""; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--aqua);
}
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 18px; padding: 0 6px; border-radius: 99px;
  background: var(--gold); color: #24261c; font: 600 11px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.workspace { display: grid; grid-template-columns: minmax(268px, .87fr) minmax(0, 1.91fr); gap: 18px; align-items: start; }
.panel {
  min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; box-shadow: 0 6px 22px #00000015;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 14px; }
.count {
  display: inline-block; margin-left: 4px; vertical-align: .12em;
  font: 500 13px/1.4 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: 0;
}
.add-button { min-height: 33px; padding: 4px 10px; background: #25423f; border-color: #40645d; color: #c5eee1; }
.add-button .icon { width: 15px; height: 15px; }
.list-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
/* Short, exclusive choices stay visible while browsing or editing. */
.choice-field { min-width: 0; margin: 0; border: 0; padding: 0; }
.choice-field legend:not(.sr-only) { padding: 0; margin: 0 0 5px; color: #d3deda; font-size: 13px; font-weight: 550; }
.choice-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; padding: 3px; border: 1px solid #405658; border-radius: 7px; background: var(--well); }
.choice-strip label { position: relative; min-width: 0; cursor: pointer; }
.choice-strip input { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; }
.choice-strip span { display: grid; place-items: center; min-height: 29px; padding: 2px; border: 1px solid transparent; border-radius: 4px; color: var(--soft); font-size: 12px; line-height: 1.35; }
.choice-strip input:checked + span { color: #b5ece1; background: #284341; border-color: #537873; font-weight: 600; }
.choice-strip input:focus-visible + span { outline: 2px solid var(--aqua); outline-offset: -2px; }
.choice-strip input:disabled + span { opacity: .65; }
@media (hover:hover) { .choice-strip label:hover span { background: #253c3c; color: var(--ink); } }
@media (forced-colors:active) { .choice-strip input:checked + span { border-color: Highlight; } }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 33px; }
#titles {
  margin-top: 13px; max-height: clamp(330px, 56vh, 620px); overflow-y: auto; overscroll-behavior-y: contain;
  padding-right: 3px; scrollbar-gutter: stable;
}
.library-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%;
  min-height: 57px; padding: 6px 9px; border: 1px solid transparent; border-bottom-color: #2b4143;
  border-radius: 0; background: transparent; text-align: left;
}
.library-item img { width: 32px; height: 43px; flex: none; object-fit: cover; border-radius: 4px; background: var(--well); }
.library-label { min-width: 0; flex: 1; }
.library-item strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 550; line-height: 1.5; }
.library-item small, .item-state { color: var(--muted); font-size: 12px; font-weight: 400; }
.library-item small { display: block; font-variant-numeric: tabular-nums; }
.library-item[aria-current=true] {
  background: #233d3c; border-color: #486862; border-radius: 6px; box-shadow: inset 2px 0 var(--aqua);
}
.library-item:focus-visible { outline-offset: -3px; }
.item-state { flex: none; }
.item-state[data-visibility=draft] { color: var(--gold); }
.more-button { width: 100%; margin-top: 12px; background: transparent; border-color: var(--line); color: var(--soft); }
#library-status:not(:empty), #file-status:not(:empty), #add-result:not(:empty), #login [role=status]:not(:empty) { margin-top: 9px; font-size: 13px; color: var(--aqua); }
.session-notice {
  padding: 10px 14px; margin: 0 0 12px; border-inline-start: 2px solid var(--gold); background: var(--panel);
}
.session-notice a { text-decoration: underline; text-underline-offset: .2em; }
#reload-work { margin-top: 8px; }
.state-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--aqua); }
.state-tag:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state-tag[data-visibility=draft] { color: var(--gold); }
.cover-tools {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 13px 15px;
  background: linear-gradient(115deg, #253b3a, #1b3032 70%);
  border: 1px solid #344e4c; border-radius: 8px;
}
.cover-tools img { width: 65px; height: 88px; flex: none; object-fit: cover; border: 1px solid #6c83784d; border-radius: 4px; }
.cover-info { min-width: 0; }
.cover-info h3 { display: inline; margin-right: 9px; color: var(--ink); font-size: 14px; font-weight: 600; }
.cover-info small { display: block; margin-top: 6px; color: var(--soft); font-size: 12px; line-height: 1.6; }
.upload-button { position: relative; overflow: hidden; min-height: 31px; padding: 3px 9px; vertical-align: middle; color: #c9e4dc; border-color: #546d66; background: #18302d; font-size: 12px; }
.upload-button .icon { width: 14px; height: 14px; }
.upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: #d3deda; }
.field :is(input, select, textarea) { font-weight: 400; }
.field small { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.full { grid-column: 1 / -1; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.editor-actions a { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 13px; }
.editor-actions a.button-link { margin-left: 0; min-height: 36px; padding: 7px 14px; border-radius: 7px; text-decoration: none; font-weight: 600; }
.editor-actions .icon { width: 14px; height: 14px; }
.movie-delete { color: #ffb4ac; border-color: #955550; background: #382627; }
.movie-delete:hover, .movie-delete:focus-visible { color: #ffdad5; border-color: #ec938b; background: #512f30; }
.movie-delete-dialog { box-sizing: border-box; width: min(400px, calc(100% - 32px)); margin: auto; padding: 23px; border: 1px solid #685053; border-radius: 13px; background: var(--panel); color: var(--text); box-shadow: 0 18px 55px #0007; }
.movie-delete-dialog::backdrop { background: #061114bf; }
.movie-delete-dialog h2 { font-size: 21px; }
#movie-delete-name { margin: 16px 0 6px; font-weight: 650; overflow-wrap: anywhere; }
#movie-delete-scope { color: var(--soft); line-height: 1.6; font-size: 14px; }
.movie-delete-dialog form { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.movie-delete-dialog button { min-height: 42px; }
#movie-delete-confirm { background: #a63d40; color: white; border-color: #c75a59; }
#movie-delete-confirm:hover { background: #bb4648; }
.moderation { grid-column: 1 / -1; }
.queue-tabs { display: flex; gap: 6px; }
.queue-tabs button { background: transparent; border-color: var(--line); }
.queue-tabs [aria-pressed=true] { background: #25423f; border-color: #537870; color: #caf0e6; }
#queue-status:not(:empty) { margin-top: 16px; padding: 30px 14px; text-align: center; background: var(--well); border-radius: 7px; color: var(--soft); }
#queue article { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
#queue article:last-child { border-bottom: 0; padding-bottom: 0; }
#queue article h3 { color: var(--ink); }
#queue article small { color: var(--muted); }
#queue article p { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 4px; }
#queue .action-approve { background: #2b4540; color: #c7eee0; }
#queue .action-reject { color: #e3c4b3; }
.admin-login { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 416px); overflow: hidden; border: 1px solid #3a5052; border-radius: 13px; background: var(--panel); box-shadow: 0 18px 55px #03090a55; }
.login-card .mast-inner { padding: 26px; }
.login-card .mast-art { background-position: center 54%; }
.login-card form { display: grid; gap: 16px; padding: 24px 26px 28px; }
.login-card input, .login-card .primary { min-height: 42px; }
.login-card .remember-device { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 28px; color: #c7d4d1; font-size: 13px; cursor: pointer; }
.login-card .remember-device input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: #e7cb96; }
.login-card [role=status]:empty { display: none; }
@media (hover:hover) {
  button:not(:disabled):hover, .upload-button:hover { border-color: #77998f; }
  .library-item:hover { background: #1d3436; }
  .studio-nav button:hover { color: var(--ink); }
  .primary:not(:disabled):hover { background: #f0d6a5; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .shell { padding-inline: 16px; }
  .workspace { gap: 12px; grid-template-columns: 255px minmax(0, 1fr); }
  .panel { padding: 15px; }
  .library-item { gap: 8px; padding-inline: 5px; }
}
@media (max-width: 700px) {
  .shell { padding: 0 12px max(22px, env(safe-area-inset-bottom)); }
  .shell > .masthead { margin-inline: -12px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
  .mast-inner { padding: 13px 17px 14px; }
  .masthead h1 { font-size: 27px; margin-top: 2px; }
  .mast-art { background-position: center, center, 56% 57%; }
  .logout { top: 19px; right: 15px; }
  .quiet-button { min-height: 38px; }
  .studio-nav { gap: 13px; margin: 0 1px 11px; overflow-x: auto; scrollbar-width: none; }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav button { min-height: 44px; flex: none; font-size: 13px; gap: 5px; padding: 0 2px; }
  .workspace { display: block; }
  .panel { border-radius: 9px; padding: 15px; }
  .panel-heading { margin-bottom: 12px; }
  h2 { font-size: 21px; }
  body[data-mobile-pane=library] #editor, body[data-mobile-pane=editor] #library { display: none; }
  .mobile-only { display: inline-flex; }
  .choice-strip span { min-height: 37px; }
  input:not([type=file], [type=radio], [type=checkbox]), select, textarea { min-height: 41px; font-size: 16px; }
  .add-button, .more-button { min-height: 40px; }
  #titles { max-height: none; overflow: visible; padding: 0; margin-top: 10px; }
  .library-item { min-height: 59px; padding: 6px 5px; }
  .library-item img { width: 34px; height: 46px; }
  .back-button, .resume { background: transparent; color: var(--aqua); }
  .editor-heading { justify-content: flex-start; gap: 8px; }
  .back-button { padding: 0 1px 0 5px; margin-left: auto; min-height: 38px; border: 0; font-weight: 400; }
  .back-button .icon { width: 14px; height: 14px; }
  .resume { width: 100%; margin-top: 9px; white-space: normal; overflow-wrap: anywhere; }
  .cover-tools { padding: 10px; gap: 12px; margin-bottom: 14px; }
  .cover-tools img { width: 58px; height: 79px; }
  .upload-button { min-height: 35px; }
  .form-grid { gap: 11px 10px; }
  .field:has([name=title], [name=aliases], [name=year], [name=genres], [name=version], [name=url], [name=portalLabel]), .rating-field { grid-column: 1 / -1; }
  .editor-actions { margin-top: 15px; padding-top: 13px; }
  .editor-actions button, .queue-tabs button { min-height: 41px; }
  .editor-actions a { min-height: 40px; }
  .login-card .mast-inner { padding: 22px; }
  .login-card form { padding: 21px; }
}
@media (max-width: 700px) and (min-height: 580px) {
  #editor .editor-actions,
  #movie-editor .editor-actions {
    position: sticky; bottom: 0; z-index: 1;
    margin-inline: -15px; padding: 10px 15px max(10px, env(safe-area-inset-bottom)); background: var(--panel);
  }
  #add-work :is(input, textarea, select),
  #movie-editor form :is(input, textarea, select) { scroll-margin-block: 12px 7.5rem; }
}
@media (forced-colors: active) {
  html, #titles, textarea { scrollbar-color: auto; }
  .studio-nav button[aria-pressed=true], .library-item[aria-current=true] { border: 2px solid Highlight; }
}

.curator-choice { display:inline-flex; align-items:center; gap:7px; min-height:32px; width:fit-content; cursor:pointer; color:var(--soft); }
.curator-choice input { margin:0; accent-color:var(--aqua); }

#state-filter .choice-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Bangumi 1-Click Auto-Fetcher inside Editor */
.bgm-fetcher {
  margin-bottom: 16px; padding: 12px 14px;
  border-radius: 9px; border: 1px solid #486b68;
  background: linear-gradient(125deg, #1a3134, #122327);
}
.bgm-bar { display: flex; gap: 8px; align-items: center; }
.bgm-bar input { flex: 1; min-width: 0; background: #0d1a1d; border-color: #3e5b5d; }
.bgm-btn {
  flex: none; min-height: 38px; padding: 0 15px;
  background: linear-gradient(125deg, #a2dfd5, #7ec9bf);
  color: #0d2729; border-color: transparent; font-weight: 650;
  white-space: nowrap;
}
.bgm-btn:not(:disabled):hover { background: #b7ede4; }
.bgm-status { margin-top: 8px; font-size: 12.5px; color: var(--gold); }
.bgm-results {
  margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; max-height: 290px; overflow-y: auto; padding-right: 3px;
}
.bgm-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  text-align: left; border-radius: 7px; border: 1px solid #385355;
  background: #102024; min-height: 74px; justify-content: flex-start;
}
.bgm-item:hover { background: #193136; border-color: var(--aqua); }
.bgm-item img { width: 42px; height: 58px; flex: none; object-fit: cover; border-radius: 4px; background: #0a1518; }
.bgm-meta { min-width: 0; flex: 1; display: grid; gap: 2px; }
.bgm-meta strong { font-size: 13.5px; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bgm-meta small { font-size: 11.5px; color: var(--aqua); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bgm-meta span {
  font-size: 11.5px; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Tools & Anti-Link-Rot Panel */
.tools-panel { grid-column: 1 / -1; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tool-card {
  padding: 18px; border-radius: 10px; border: 1px solid #354f52;
  background: var(--well); display: grid; gap: 12px;
}
.tool-card h3 { font-size: 16px; color: var(--ink); font-family: var(--serif); }
.tool-desc { font-size: 13px; color: var(--soft); line-height: 1.6; }
.tool-desc code { padding: 1px 5px; border-radius: 4px; background: #1a2f33; color: var(--gold); font-size: 12px; }
.tool-status:not(:empty) { font-size: 13px; color: var(--aqua); }
.tool-hint { font-size: 12px; color: var(--muted); }
.domain-sample {
  margin: 0; padding: 10px 14px 10px 28px; border-radius: 7px;
  background: #0c181b; border: 1px solid #2e4548;
  font-size: 12px; color: var(--soft); display: grid; gap: 4px;
  max-height: 180px; overflow-y: auto;
}
.button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 38px; padding: 7px 16px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; text-decoration: none !important;
}
.button-link.primary { background: var(--gold); color: #26271c; }
.button-link.primary:hover { background: #f2d9a8; }

@media (max-width: 780px) {
  .bgm-results, .tools-grid { grid-template-columns: 1fr; }
  .bgm-bar { flex-direction: column; align-items: stretch; }
}

/* Editorial Changelog & Live Audit Chronicle */
.changelog-panel { grid-column: 1 / -1; display: grid; gap: 18px; }
.changelog-panel[hidden] { display: none !important; }
.cl-hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr);
  gap: 18px; align-items: center; padding: 20px 22px; border-radius: 11px;
  border: 1px solid #456869;
  background:
    radial-gradient(ellipse at 12% 0%, #a2dfd51f, transparent 58%),
    radial-gradient(ellipse at 92% 100%, #e5ca981a, transparent 55%),
    linear-gradient(128deg, #1b3337 0%, #112125 60%, #16282c 100%);
  box-shadow: inset 0 1px 0 #ffffff12, 0 10px 28px #040c0e38;
}
.cl-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font: 600 11px/1.2 var(--sans); letter-spacing: .1em; color: var(--aqua);
}
.cl-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #76e8c7;
  box-shadow: 0 0 0 3px #76e8c72b, 0 0 10px #76e8c7;
}
.cl-version-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 8px;
}
.cl-version-row h2 { margin: 0; font-size: 24px; color: var(--ink); }
.cl-ver-pill {
  display: inline-flex; align-items: center; height: 25px; padding: 0 10px;
  border-radius: 99px; background: linear-gradient(125deg, #ead1a2, #cfa96e);
  color: #1f2218; font: 700 12.5px/1 Consolas, var(--sans);
}
.cl-hash-pill {
  display: inline-flex; align-items: center; height: 25px; padding: 0 9px;
  border-radius: 6px; border: 1px solid #4c6e70; background: #0b171a;
  color: #b7e8df; font: 600 12px/1 Consolas, "Courier New", monospace;
}
.cl-built-at { font-size: 12px; color: var(--muted); }
.cl-hero-desc { margin: 0; font-size: 13px; line-height: 1.65; color: var(--soft); max-width: 64ch; }

.cl-kpi-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
}
.cl-kpi {
  padding: 11px 13px; border-radius: 9px; border: 1px solid #395558;
  background: #0d1b1fcc; display: flex; flex-direction: column; gap: 3px;
}
.cl-kpi strong {
  font: 700 20px/1.15 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums;
}
.cl-kpi.is-gold strong { color: var(--gold); }
.cl-kpi span { font-size: 11.5px; color: var(--muted); }

.cl-columns {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 18px; align-items: start;
}
.cl-card {
  padding: 18px 19px; border-radius: 11px; border: 1px solid #334c4f;
  background: var(--well); display: grid; gap: 14px; min-width: 0;
}
.cl-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid #2e4548;
}
.cl-card-head h3 { margin: 0 0 3px; font: 600 16.5px/1.3 var(--serif); color: var(--ink); }
.cl-card-head small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.cl-head-actions { display: flex; gap: 6px; flex: none; }
.cl-mini-btn { min-height: 31px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.cl-mini-btn .icon { width: 13px; height: 13px; }

/* Release Timeline Spine */
.cl-release-timeline {
  position: relative; display: grid; gap: 16px; padding-left: 18px;
}
.cl-release-timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1.5px;
  background: linear-gradient(180deg, #e5ca98aa 0%, #56858288 45%, #2b444733 100%);
}
.cl-rel-node {
  position: relative; padding: 14px 15px; border-radius: 9px;
  border: 1px solid #31494c; background: #102024; display: grid; gap: 9px;
}
.cl-rel-node.is-latest {
  border-color: #c8ab7570;
  background: linear-gradient(145deg, #172b2f, #101f23);
  box-shadow: 0 8px 22px #00000028;
}
.cl-rel-node::before {
  content: ""; position: absolute; left: -17.5px; top: 18px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #14282c; border: 2px solid var(--aqua);
}
.cl-rel-node.is-latest::before {
  background: var(--gold); border-color: #fff3d1;
  box-shadow: 0 0 0 3px #e5ca9833, 0 0 10px #e5ca98aa;
}
.cl-rel-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px;
}
.cl-rel-ver { font: 700 13.5px/1 Consolas, var(--sans); color: var(--ink); }
.cl-rel-tag {
  padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
  background: #1e383b; color: var(--aqua); border: 1px solid #3e6466;
}
.cl-rel-node.is-latest .cl-rel-tag {
  background: #383222; color: #f5deb0; border-color: #8c764c;
}
.cl-rel-date { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-rel-title { margin: 0; font: 600 14.5px/1.45 var(--sans); color: #f1efe7; }
.cl-rel-list {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 6px;
}
.cl-rel-list li {
  position: relative; padding-left: 13px; font-size: 12.5px; line-height: 1.6; color: #c4d5d4;
}
.cl-rel-list li::before {
  content: "✦"; position: absolute; left: 0; top: 1px; font-size: 9px; color: var(--gold);
}
.cl-rel-list b { color: #e8dec5; font-weight: 600; }

/* Manual Note Form & Filter Strip */
.cl-note-form {
  display: grid; gap: 8px; padding: 12px; border-radius: 8px;
  background: #0e1c20; border: 1px solid #446668;
}
.cl-note-form[hidden] { display: none !important; }
.cl-note-row { display: flex; gap: 8px; }
.cl-note-row input { flex: 1; min-width: 0; }
.cl-filter-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cl-filter-tabs button {
  min-height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12px;
  background: #0f1e22; border-color: #324b4e; color: var(--soft);
}
.cl-filter-tabs button[aria-pressed=true] {
  background: #22403f; border-color: #659992; color: #d6f7ee; font-weight: 600;
}

/* Live Operations Feed */
.cl-feed-status {
  margin: 0; padding: 16px 14px; border-radius: 8px; text-align: center;
  background: #0f1e22; border: 1px dashed #365255; color: var(--soft); font-size: 12.5px; line-height: 1.6;
}
.cl-feed { display: grid; gap: 10px; }
.cl-day-group { display: grid; gap: 8px; }
.cl-day-label {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
  font: 600 11.5px/1.2 var(--sans); color: var(--gold); letter-spacing: .04em;
}
.cl-day-label::after { content: ""; flex: 1; height: 1px; background: #2c4346; }
.cl-event {
  padding: 11px 13px; border-radius: 8px; border: 1px solid #2d4548;
  background: #102024; display: grid; gap: 5px; transition: border-color .16s ease;
}
.cl-event:hover { border-color: #4d7376; }
.cl-event-top {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.cl-kind-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.cl-kind-badge[data-kind="publish_new"] { background: #193d35; color: #9af0d4; border: 1px solid #357566; }
.cl-kind-badge[data-kind="update_work"] { background: #193340; color: #a7dff5; border: 1px solid #36647a; }
.cl-kind-badge[data-kind="save_draft"] { background: #3a3120; color: #f0d399; border: 1px solid #75613c; }
.cl-kind-badge[data-kind="replace_domain"] { background: #332640; color: #dec2fa; border: 1px solid #664d80; }
.cl-kind-badge[data-kind="moderate"] { background: #1d3638; color: #b5ebe6; border: 1px solid #3f6d70; }
.cl-kind-badge[data-kind="note"] { background: #383021; color: #f4dca8; border: 1px solid #7c6842; }
.cl-event-time {
  margin-left: auto; font: 500 11.5px/1 Consolas, var(--sans); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cl-event-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.cl-event-title strong { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.cl-jump-btn {
  flex: none; min-height: 23px; padding: 0 7px; border-radius: 4px;
  font-size: 11.5px; background: #172e32; border-color: #3d5f63; color: var(--aqua);
}
.cl-event-detail { margin: 0; font-size: 12px; color: var(--soft); line-height: 1.55; }
.cl-diff-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.cl-diff-chip {
  padding: 1px 7px; border-radius: 4px; font-size: 11px;
  background: #172b30; border: 1px solid #355257; color: #cbe3e1;
}

/* Custom Expanded Archive Showcase */
.cl-custom-shelf {
  margin-top: 4px; padding-top: 14px; border-top: 1px solid #2d4447; display: grid; gap: 10px;
}
.cl-custom-shelf[hidden] { display: none !important; }
.cl-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cl-subhead h4 { margin: 0; font-size: 13.5px; color: var(--ink); }
.cl-subhead small { font-size: 11.5px; color: var(--muted); }
.cl-custom-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
}
.cl-custom-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 7px; border: 1px solid #2d4548; background: #0f1e22;
  text-align: left; justify-content: flex-start; min-height: 50px;
}
.cl-custom-item:hover { border-color: var(--aqua); background: #162b30; }
.cl-custom-item img { width: 28px; height: 38px; object-fit: cover; border-radius: 3px; flex: none; }
.cl-custom-copy { min-width: 0; flex: 1; display: grid; gap: 1px; }
.cl-custom-copy strong {
  font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cl-custom-copy small {
  font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 880px) {
  .cl-hero, .cl-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cl-hero { padding: 15px; gap: 13px; }
  .cl-kpi { padding: 10px 11px; }
  .cl-kpi strong { font-size: clamp(15px, 4.3vw, 19px); }
  .cl-card { padding: 14px; }
  .cl-custom-grid { grid-template-columns: 1fr; }
  .cl-note-row { flex-direction: column; }
}

/* Unified Multi-Channel Admin Switcher & Movie Check-In Workbench */
.mast-title-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px;
}
.mast-title-row h1 { margin-top: 0; }
.channel-switcher {
  display: inline-flex; padding: 3px; border-radius: 99px;
  background: rgba(11, 22, 26, .78); border: 1px solid #3c585c; gap: 3px;
}
.channel-switcher .ch-btn {
  min-height: 30px; padding: 0 13px; border: 0; border-radius: 99px;
  background: transparent; color: var(--soft); font-size: 12.5px; gap: 6px;
}
.channel-switcher .ch-btn b {
  font-size: 11px; opacity: .82; font-variant-numeric: tabular-nums;
}
.channel-switcher .ch-btn[aria-pressed=true] {
  background: #234241; color: #daf8ef; font-weight: 600;
}
body[data-admin-active-channel="movie"] .channel-switcher .ch-btn[aria-pressed=true] {
  background: linear-gradient(135deg, #3c321f, #2e281a); color: #f5dba5;
  box-shadow: inset 0 0 0 1px #8c703c;
}
body[data-admin-active-channel="movie"] .studio-nav button[aria-pressed=true] { color: var(--gold); }
body[data-admin-active-channel="movie"] .studio-nav button[aria-pressed=true]::after { background: var(--gold); }
body[data-admin-active-channel="novel"] .channel-switcher .ch-btn[aria-pressed=true] {
  background: linear-gradient(135deg, #1b3f33, #172f26); color: #f4dfae;
  box-shadow: inset 0 0 0 1px #6da88d;
}
body[data-admin-active-channel="novel"] .studio-nav button[aria-pressed=true] { color: #8ad6b4; }
body[data-admin-active-channel="novel"] .studio-nav button[aria-pressed=true]::after { background: #ddb974; }
#novel-titles { display: grid; gap: 6px; max-height: 68vh; overflow: auto; padding-right: 2px; }
#novel-parts-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
#novel-parts-bar button[aria-pressed=true] { border-color: #ddb974; color: #f6e0ae; }
#novel-checkin-bar { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: #10211d; border: 1px solid #355449; min-width: 0; max-width: 100%; }
#novel-editor,
#novel-editor .form-grid,
#novel-editor .form-grid > *,
#novel-editor .field,
#novel-editor .field small,
#novel-editor .field code {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#novel-editor .field code {
  font-family: Consolas, ui-monospace, monospace;
  font-size: 11px;
  color: #b7d7cc;
}

.movie-progress-card {
  margin-bottom: 10px; padding: 10px 12px; border-radius: 8px;
  background: #101f23; border: 1px solid #344d4f; display: grid; gap: 7px;
}
.mp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.mp-top strong { color: var(--gold); font-size: 12.5px; }
.mp-top span { color: var(--muted); font-size: 11.5px; }
.mp-track { height: 6px; border-radius: 99px; background: #1c3135; overflow: hidden; }
.mp-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #d7b16a, #f2d598); transition: width .25s ease; }

.movie-view-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  border-radius: 8px; background: var(--well); border: 1px solid #3a5154; margin-bottom: 9px;
}
.movie-view-switch button {
  min-height: 30px; border: 0; border-radius: 5px; background: transparent;
  color: var(--soft); font-size: 12px; padding: 2px 8px;
}
.movie-view-switch button[aria-pressed=true] {
  background: #2c382e; color: #f2dca8; font-weight: 600;
}

.movie-filter-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.movie-filter-pills button {
  min-height: 27px; padding: 0 9px; border-radius: 99px; font-size: 11.5px;
  background: #0f1e22; border-color: #324a4d; color: var(--soft);
}
.movie-filter-pills button[aria-pressed=true] {
  background: #362e1e; border-color: #8b703d; color: #f6dfad; font-weight: 600;
}

#movie-titles { display: grid; gap: 6px; max-height: 62vh; overflow-y: auto; padding-right: 3px; margin-top: 8px; }
.item-state.movie-ws[data-ws="watched"] { background: #1d3c31; color: #9cf0cd; border-color: #3a7560; }
.item-state.movie-ws[data-ws="watching"] { background: #3b301c; color: #f3d598; border-color: #7d6639; }
.item-state.movie-ws[data-ws="unwatched"] { background: #192b2f; color: var(--muted); }

.part-tabs-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
  padding: 8px; border-radius: 8px; background: #0f1e22; border: 1px solid #324a4d;
}
.part-tab {
  min-height: 30px; padding: 3px 10px; border-radius: 6px; font-size: 12px;
  background: #172a2e; border-color: #375357; color: var(--soft);
}
.part-tab[aria-pressed=true] {
  background: #382f1e; border-color: #9b7d45; color: #f7e1b2; font-weight: 600;
}
.part-tab.is-add { border-style: dashed; color: var(--aqua); }

.checkin-bar {
  margin-bottom: 14px; padding: 13px 14px; border-radius: 10px;
  background: linear-gradient(145deg, #1b2824, #142226); border: 1px solid #6b5c3b;
  display: grid; gap: 10px;
}
.checkin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.checkin-head strong { color: var(--gold); font-size: 13.5px; }
.checkin-head small { color: var(--soft); font-size: 12px; }
.checkin-grid { display: grid; grid-template-columns: 1.2fr .9fr .8fr; gap: 10px; }
.checkin-grid .full { grid-column: 1 / -1; }
.checkin-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checkin-actions span { font-size: 12.5px; color: var(--aqua); }

.conflict-box {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 8px;
  background: #2b2117; border: 1px solid #9e7538; color: #f6e4c1;
  display: grid; gap: 8px; font-size: 13px;
}
.conflict-box ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12.5px; }
.bgm-item.tmdb-in-lib { opacity: .72; border-style: dashed; }
.portal-detect-bar {
  padding: 11px 13px; border-radius: 9px;
  background: linear-gradient(135deg, #16282c, #101e22);
  border: 1px solid #3c595c;
  display: grid; gap: 7px;
}
.portal-detect-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.portal-detect-head > div { display: grid; gap: 2px; min-width: 0; }
.portal-detect-head strong { font-size: 13px; color: var(--gold); }
.portal-detect-head small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.portal-detect-btn {
  flex: none; min-height: 33px; padding: 4px 12px; font-size: 12.5px;
  border-color: #6a8d8f; color: #dff7f2; background: #1a3438;
  white-space: nowrap;
}
.portal-detect-btn:not(:disabled):hover { border-color: var(--gold); color: #fff6dc; background: #29382e; }
.portal-detect-status { margin: 0; font-size: 12px; color: var(--aqua); }
.cl-kind-badge[data-kind="checkin"] { background: #183b2e; color: #9df0cd; border: 1px solid #377a61; }
.cl-kind-badge[data-kind="import_batch"] { background: #262e42; color: #c4d7ff; border: 1px solid #4e628f; }
.cl-kind-badge[data-kind="update_card"], .cl-kind-badge[data-kind="add_entry"] { background: #362c1e; color: #f3d79e; border: 1px solid #755f38; }

@media (max-width: 700px) {
  .mast-inner { padding: 12px 14px 13px; }
  .logout { top: 9px; right: 12px; }
  .logout .quiet-button { min-height: 31px; padding: 3px 9px; font-size: 12px; }
  .mast-title-row { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 8px; }
  .channel-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .channel-switcher .ch-btn { width: 100%; justify-content: center; padding: 0 6px; font-size: 11.5px; }
  .checkin-grid,
  #tools-panel .form-grid,
  #movie-entry-form .form-grid,
  #movie-card-form .form-grid,
  #novel-entry-form .form-grid,
  #novel-checkin-bar .form-grid { grid-template-columns: 1fr; }
  #movie-titles, #novel-titles { max-height: none; overflow: visible; padding: 0; }
  body[data-mobile-pane="library"] #movie-editor,
  body[data-mobile-pane="library"] #novel-editor { display: none; }
  body[data-mobile-pane="editor"] #movie-library,
  body[data-mobile-pane="editor"] #novel-library { display: none; }
}
@media (max-width: 440px) {
  .editor-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
  .editor-heading h2 { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .editor-heading .state-tag, .editor-heading .back-button { white-space: nowrap; }
  .studio-nav { gap: 4px; justify-content: space-between; }
  .studio-nav button { font-size: 12px; gap: 4px; padding: 0 2px; }
  .studio-nav button .icon { width: 14px; height: 14px; }
}
