/* Append after styles.css. Only screen routes and inherited TV dialogs.
   No permission, visibility or dialog open/closed behavior is changed here. */
.screen-shell {
  --desk-bg: #f5f2ea;
  --desk-surface: #fffdf7;
  --desk-line: #d8d2c5;
  --desk-muted: #596259;
  --desk-accent: #a83b29;
  background: var(--desk-bg);
}
.screen-shell .main-content { max-width: 1480px; }
.screen-shell .screen-header { padding: 10px 0 16px; gap: 16px; }
.screen-shell .screen-header h1 { font-size: 29px; line-height: 1.25; }
.screen-shell .screen-nav { gap: 5px; padding: 10px 0 17px; }
.screen-shell .screen-nav a { min-height: 38px; padding: 8px 12px; }
.screen-shell .screen-panel {
  border-color: var(--desk-line);
  border-radius: 7px;
  background: var(--desk-surface);
  box-shadow: none;
}
.screen-shell .screen-panel-heading h2, .screen-shell .screen-panel > h2 {
  font: 700 20px/1.4 var(--sans);
  letter-spacing: -.025em;
}
.screen-shell .screen-list-row { min-height: 64px; }
.screen-shell .screen-status { border-radius: 4px; }
.screen-shell .desk-thumb { height: 112px; border-radius: 4px; background: #eee9dd; }
.screen-shell .desk-toolbar { margin-top: 16px; }
.screen-shell .desk-toolbar h2 { font-size: 20px; }
.screen-shell .desk-grid { gap: 12px; }
.screen-shell .screen-review-card { padding-block: 15px; }
.screen-shell .desk-review, .screen-shell .desk-impact, .screen-shell .desk-confirm {
  background: var(--desk-surface);
  border-color: var(--desk-line);
  border-radius: 6px;
}
.screen-shell .screen-actions { gap: 8px; margin-top: 16px; }
.screen-shell :is(summary, button, a, input, textarea, select):focus-visible,
:is(.legacy-plan-dialog, .legacy-media-lightbox) :is(summary, button, a, input, textarea, select):focus-visible {
  outline: 3px solid #315b73;
  outline-offset: 3px;
}
:is(.legacy-plan-dialog, .legacy-media-lightbox) {
  box-sizing: border-box;
  width: min(880px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid #d8d2c5;
  border-radius: 8px;
  background: #fffdf7;
  color: #202923;
  font: 14px/1.6 var(--sans, "PingFang SC", "Microsoft YaHei", sans-serif);
  box-shadow: 0 18px 65px #17211d33;
  overflow-wrap: anywhere;
}
:is(.legacy-plan-dialog, .legacy-media-lightbox)::backdrop { background: #17211d70; }
.legacy-plan-dialog h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.4; }
.legacy-plan-dialog h3 { font-size: 17px; }
.legacy-plan-dialog p { margin: 10px 0; }
.legacy-plan-dialog ul { padding-left: 22px; }
.legacy-plan-dialog li + li { margin-top: 8px; }
.legacy-plan-dialog label { display: grid; gap: 6px; margin: 10px 0; font-size: 13px; }
.legacy-plan-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.legacy-plan-dialog input:not([type="checkbox"]):not([type="radio"]),
.legacy-plan-dialog textarea, .legacy-plan-dialog select {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid #b9b2a4;
  border-radius: 4px;
  padding: 10px 11px;
  background: #fffef9;
  color: #202923;
  font: inherit;
}
.legacy-plan-dialog textarea { resize: vertical; min-height: 90px; }
.legacy-plan-dialog input[readonly] { background: #eee9dd; }
.legacy-plan-dialog label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 9px; }
.legacy-plan-dialog input[type="checkbox"] { flex: 0 0 auto; margin-top: 5px; accent-color: #a83b29; }
.legacy-plan-dialog .desk-fields { gap: 8px 16px; }
:is(.legacy-plan-dialog, .legacy-media-lightbox) button {
  min-height: 40px;
  margin: 4px 6px 4px 0;
  padding: 9px 13px;
  border: 1px solid #b9b2a4;
  border-radius: 4px;
  color: #202923;
  background: #fffdf7;
  font: 600 13px/1.45 var(--sans, sans-serif);
  cursor: pointer;
}
:is(.legacy-plan-dialog, .legacy-media-lightbox) button:hover:not(:disabled) { background: #eee9dd; }
:is(.legacy-plan-dialog, .legacy-media-lightbox) button:disabled { opacity: .5; cursor: not-allowed; }
.legacy-plan-dialog button[data-plan-action="publish"],
.legacy-plan-dialog form[data-registration-save] button,
.legacy-plan-dialog form[data-legacy-plan-save] button {
  border-color: #a83b29;
  background: #a83b29;
  color: #fff;
}
.legacy-plan-dialog button[data-plan-action="publish"]:hover:not(:disabled),
.legacy-plan-dialog form[data-registration-save] button:hover:not(:disabled),
.legacy-plan-dialog form[data-legacy-plan-save] button:hover:not(:disabled) { background: #8d3021; }
.legacy-plan-dialog .legacy-plan-close {
  position: sticky;
  top: -22px;
  z-index: 2;
  margin: -22px -22px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #d8d2c5;
  background: #fffdf7;
  text-align: right;
}
.legacy-plan-dialog .legacy-plan-close button { margin: 0; min-height: 36px; font-weight: 500; }
.legacy-plan-dialog details { margin: 14px 0; padding-top: 10px; border-top: 1px solid #d8d2c5; }
.legacy-plan-dialog summary { min-height: 34px; color: #596259; font-size: 13px; cursor: pointer; }
.legacy-plan-dialog [role="status"]:not(:empty) {
  padding: 10px 12px;
  background: #eee9dd;
  border-left: 3px solid #315b73;
}
.legacy-plan-dialog .screen-panel { margin-top: 16px; padding: 16px; background: #f5f2ea; box-shadow: none; }
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-item { padding: 12px; border-color: #d8d2c5; border-radius: 5px; }
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-list { gap: 12px; }
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-media { max-width: 280px; }
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-media :is(img, video) {
  max-height: 180px;
  object-fit: contain;
}
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview[data-fit="cover"] .snapshot-preview-media :is(img, video) { object-fit: cover; }
:is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-identity dd {
  color: #596259;
  font: 12px/1.6 var(--mono, monospace);
}
.legacy-media-lightbox > :is(img, video) {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(65dvh, 720px);
  margin: 14px auto;
  background: #202923;
  object-fit: contain;
}
.legacy-media-lightbox > audio { max-width: 100%; width: 100%; margin-block: 14px; }
@media (max-width: 620px) {
  .screen-shell .screen-header h1 { font-size: 24px; }
  .screen-shell .screen-header { gap: 10px; }
  .screen-shell .screen-nav { flex-wrap: nowrap; padding-bottom: 14px; }
  .screen-shell .screen-nav a { min-height: 44px; }
  .screen-shell .screen-button { min-height: 44px; }
  :is(.legacy-plan-dialog, .legacy-media-lightbox) {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
    border-radius: 6px;
  }
  .legacy-plan-dialog .legacy-plan-close { top: -16px; margin: -16px -16px 12px; padding: 8px 12px; }
  .legacy-plan-dialog .legacy-plan-close button { min-height: 44px; }
  .legacy-plan-dialog .desk-fields { grid-template-columns: 1fr; gap: 0; }
  .legacy-plan-dialog :is(input, textarea, select) { font-size: 16px; }
  :is(.legacy-plan-dialog, .legacy-media-lightbox) button { min-height: 44px; max-width: 100%; }
  .legacy-plan-dialog .screen-panel { padding: 12px; }
  .legacy-plan-dialog h2 { font-size: 20px; }
  :is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-facts,
  :is(.screen-shell, .legacy-plan-dialog) .snapshot-preview-settings { grid-template-columns: 1fr; gap: 8px; }
}
.screen-shell .workbench-todos{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 16px}
.screen-shell .workbench-todos a{padding:8px 12px;border:1px solid var(--line);border-radius:6px;color:var(--ink);text-decoration:none;font-size:13px;background:var(--paper)}
.screen-shell .workbench-todos strong{font-size:18px;color:var(--rust);margin-right:5px}
.screen-shell .screen-review-card summary{cursor:pointer;line-height:1.7;min-height:44px}
.screen-shell .screen-review-card:not(:has(details[open])){padding-block:10px}
.legacy-plan-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:200px;overflow:auto}
.screen-shell .screen-header-meta {max-width:420px;display:grid;gap:6px;font-size:13px;line-height:1.6;overflow-wrap:anywhere;white-space:normal;min-width:0}
.screen-shell .screen-page-purpose {margin:0 0 18px;color:var(--desk-muted);font-size:13px;line-height:1.7}
.screen-shell .screen-cross-links {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.screen-shell .screen-cross-links a {padding:7px 10px;border:1px solid var(--desk-line);border-radius:5px;color:var(--desk-accent);text-decoration:none}
.screen-shell details.screen-panel {padding:16px;margin-top:20px}
@media(max-width:620px){.screen-shell .screen-header{flex-direction:column;align-items:stretch}.screen-shell .screen-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));white-space:normal}.screen-shell .screen-nav a{padding:8px 5px;text-align:center}.screen-shell .screen-header-meta{max-width:100%}.screen-shell .workbench-todos{gap:5px}.screen-shell .workbench-todos a{padding:6px 8px}}

/* One task surface, not a document of consecutive forms. The document remains
   scrollable for zoom/short viewports; only genuine queues/history scroll locally. */
.screen-shell .main-content{padding:10px 18px 18px}
.screen-shell .screen-admin{max-width:none}
.screen-shell .screen-header{padding:0;margin:0;min-height:0;align-items:center}
.screen-shell .screen-header h1{font:700 20px/1.3 var(--sans);margin:0}
.screen-shell .screen-header .screen-kicker,.screen-shell .screen-header>div>p:last-child{display:none}
.screen-shell .screen-header-meta{display:none}
.screen-shell .screen-nav{display:flex;gap:4px;padding:7px 0;margin:0;flex-wrap:wrap}
.screen-shell .screen-nav a{min-height:36px;padding:7px 10px;font-size:14px}
.screen-project-selector{display:flex;align-items:center;gap:8px;margin:4px 0;font-size:14px}
.screen-project-selector select{min-height:36px;max-width:min(420px,75vw);font:inherit}
.screen-shell .screen-workbench-todos{display:inline-block;margin:4px 14px 6px 0;font-size:14px;vertical-align:top}
.screen-shell .screen-workbench-todos[open]{display:block}
.screen-shell details.screen-project-settings:not([open]){display:inline-block;margin:2px 12px 4px 0;padding:4px 8px;background:transparent;border:0;font-size:14px}
.screen-shell details.screen-project-settings:not([open])>summary{min-height:28px}
.screen-task-tabs{display:flex;gap:6px;margin:4px 0 8px;flex-wrap:wrap}
.screen-task-tabs button{min-height:38px;padding:7px 12px;background:#fffdf7;border:1px solid #d8d2c5;border-radius:6px;color:inherit;font:inherit;cursor:pointer}
.screen-task-tabs button[aria-pressed=true]{background:#e8eddf;border-color:#42644b}
.screen-place-workspace>.screen-columns{grid-template-columns:minmax(220px,.7fr) minmax(320px,1.3fr);gap:12px;margin-bottom:10px}
.screen-place-workspace .screen-panel{padding:14px}
.screen-place-workspace .screen-panel-heading{padding-bottom:8px}
.screen-place-workspace .screen-subhead{padding-top:12px}
.screen-place-workspace .screen-panel-heading h2{font-size:20px}
.screen-place-workspace .screen-place-summary{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:4px;gap:0 12px}
.screen-place-summary .screen-fact{padding:7px 0}
.screen-place-workspace .screen-cross-links{margin:8px 0;gap:8px}
.screen-place-bind{margin:10px 0}
.screen-place-bind>summary{width:fit-content;cursor:pointer;list-style:none}
.screen-place-bind>summary::-webkit-details-marker{display:none}
.screen-place-bind .screen-bind-form{margin:10px 0 0;padding:10px 0 0;gap:10px}
.screen-place-bind .screen-bind-form button{grid-column:1/-1;justify-self:start}
.screen-place-technical{margin:10px 0 0;font-size:13px}
.screen-place-technical>summary{cursor:pointer;min-height:32px;display:flex;align-items:center}
.screen-place-history{font-size:13px;margin-top:8px}.screen-place-history>summary{cursor:pointer;min-height:32px;display:flex;align-items:center}.screen-place-history .screen-cross-links{display:grid;gap:8px;max-height:30dvh;overflow:auto}
.screen-place-list{max-height:350px;overflow:auto}
.screen-place-list .screen-list-row{min-height:58px}
.screen-mobile-screen-picker{display:none}
@media(max-width:700px){
 .screen-place-workspace>.screen-columns{grid-template-columns:1fr;gap:8px}
 .screen-place-workspace .screen-panel{padding:10px}
 .screen-place-workspace .screen-subhead,.screen-place-list{display:none}
 .screen-mobile-screen-picker{display:grid}
 .screen-place-workspace>.screen-columns>section:first-child{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .screen-place-workspace>.screen-columns>section:first-child>p{display:none}
 .screen-place-workspace select{max-width:100%;min-height:40px;width:100%}
 .screen-place-bind .screen-bind-form{grid-template-columns:1fr;gap:8px}
 .screen-place-bind .screen-bind-form label{gap:3px}
 .screen-place-bind .screen-bind-form input{min-height:40px}
 .screen-place-workspace .screen-forms{grid-template-columns:1fr 1fr;align-items:start}
 .screen-place-workspace .screen-forms details[open]{grid-column:1/-1}
}
.screen-task-pane[hidden]{display:none}
.screen-place-workspace>.screen-columns{grid-template-columns:minmax(200px,.75fr) minmax(0,1.7fr);gap:12px;margin:0}
.screen-place-workspace .screen-panel{padding:14px;margin:0}
.screen-place-workspace .screen-list{max-height:42dvh;overflow:auto}
.screen-place-workspace .screen-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.screen-place-workspace .screen-form{gap:10px}
.screen-place-workspace>.screen-forms{display:flex;align-items:start;flex-wrap:wrap;margin-top:10px}
.screen-place-workspace>.screen-forms>details{flex:1;min-width:180px;padding:10px}
.screen-place-workspace select{font:inherit;max-width:100%;min-height:38px}
.screen-place-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 14px}
.screen-place-actions .screen-cross-links{margin:0}
@media(max-width:620px){
 .screen-shell .main-content{padding:8px 10px 16px}
 .screen-shell .screen-header{display:none}
 .screen-shell .screen-nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:0;padding:2px 0 6px}
 .screen-shell .screen-nav a{flex:0 0 auto;min-height:40px;padding:8px;font-size:14px}
 .screen-project-selector{margin:3px 0}.screen-project-selector select{max-width:calc(100vw - 105px)}
 .screen-place-workspace>.screen-columns{display:block}
 .screen-place-workspace .screen-list{display:flex;overflow:auto;max-height:115px;gap:8px}
 .screen-place-workspace .screen-list-row{flex:0 0 180px}
 .screen-place-workspace .screen-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
 .screen-task-tabs button{min-height:44px}
}
.screen-task-dialog{padding:0;border:1px solid #c9c5b4;border-radius:16px;background:#fcfaf1;color:#283f36;width:min(600px,calc(100vw - 28px));max-height:calc(var(--screen-task-vh,100dvh) - 32px);box-shadow:0 20px 80px #182b3540}
.screen-task-dialog::backdrop{background:#1b2d3659}
.screen-task-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid #d7d3c5;background:#fcfaf1;position:sticky;top:0;z-index:1}
.screen-task-dialog>header h2{font-size:19px;margin:0}
.screen-task-dialog-body{padding:18px 20px;overflow:auto}
.screen-task-dialog .screen-form,.screen-task-dialog .screen-withdraw-form{margin:0;display:grid;gap:16px;grid-template-columns:1fr}
.screen-task-dialog label{display:grid;gap:7px;font-size:15px}
.screen-task-dialog input,.screen-task-dialog select,.screen-task-dialog textarea{font:inherit;min-height:42px;width:100%;box-sizing:border-box}
.screen-task-dialog [type=submit],.screen-task-dialog .album-policy-editor footer{position:sticky;bottom:0;z-index:1;background:#2c5144;color:#fff;margin-top:12px;min-height:44px}
.screen-task-dialog .album-policy-editor{border:0;padding:0;background:transparent}
.screen-task-dialog .album-policy-editor h2{display:none}
.task-operation-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.task-operation-actions .screen-button[data-task-dialog-open^=withdraw]{color:#a33b28;border-color:#bd705e}
.album-material-picker{border:1px solid #c9c5b4;border-radius:12px;padding:14px;margin:14px 0;background:#f4f1e7}
.album-material-picker>header{display:flex;justify-content:space-between;gap:12px;align-items:center}.album-material-picker h3{margin:0}
.album-material-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin:12px 0;max-height:34dvh;overflow:auto}
.album-material-results article{display:grid;grid-template-columns:64px minmax(0,1fr);align-content:start;gap:5px 12px;padding:12px;background:#fffdf5;border:1px solid #dad6c6;border-radius:10px}
.album-material-results article>img,.album-material-results article>video{grid-row:1/4;width:64px;height:80px;object-fit:cover;border-radius:5px}
.album-material-results article>strong,.album-material-results article>small,.album-material-results article>button{grid-column:2;min-width:0;margin:0}
.album-material-results article>button{justify-self:start;min-height:36px}
.album-material-results strong{overflow-wrap:anywhere}.album-material-results small{color:#647064}
.album-item [data-album-action=remove-material]{color:#a33b28}
@media(max-width:600px){.screen-task-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.screen-task-dialog>header,.screen-task-dialog-body{padding:14px}.album-material-results{grid-template-columns:1fr}.task-operation-actions{display:grid;grid-template-columns:1fr 1fr}}
.album-dialog-body:has(>.album-editor){display:flex;overflow:hidden;min-height:0}
.album-dialog .album-editor{display:flex;flex-direction:column;width:100%;min-height:0;height:min(640px,calc(100dvh - 148px - var(--screen-keyboard-inset,0px)));padding:12px 0 0}
.album-editor-toolbar{display:flex;align-items:end;gap:12px;flex:none;padding-bottom:10px;border-bottom:1px solid #ddd3c2}
.album-dialog .album-editor-toolbar>label{flex:1;min-width:0;margin:0;font-size:15px}
.album-editor-toolbar-actions{display:flex;align-items:center;gap:8px;flex:none}
@media(max-width:600px){.album-editor-toolbar-actions{flex-wrap:wrap}.album-dialog .album-editor-toolbar-actions [data-album-action="return-arrangement"]{flex:1 0 100%;white-space:normal}}
.album-dialog .album-editor-toolbar-actions button{margin:0;white-space:nowrap}
.album-editor form,.album-editor fieldset{display:flex;flex-direction:column;min-height:0;flex:1;margin:0}
.album-editor-content{overflow:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:4px 3px 12px 0}
.album-editor-content>.album-items[hidden]{display:none}
.album-editor-content>.album-items{margin:10px 0}
.album-editor-content>details{margin:10px 0;padding:10px 0;border-top:1px solid #ded5c5}
.album-editor-content summary{cursor:pointer;min-height:30px;line-height:1.6}
.album-dialog .album-editor-actions{position:static;flex:none;margin:0;padding:12px 0;background:#fffaf0}
.album-dialog .album-editor-actions button{margin:0}
@media(max-width:600px){.album-editor-toolbar{display:grid;grid-template-columns:1fr;gap:8px}.album-editor-toolbar-actions{justify-content:space-between}.album-editor-toolbar-actions button{flex:1}.album-dialog .album-item{grid-template-columns:100px minmax(0,1fr)}.album-dialog .album-item img,.album-dialog .album-item video{max-height:140px}.album-dialog .album-editor-actions{gap:8px}.album-dialog .album-editor-actions button{flex:1}}
