:root { color-scheme: light; font: 16px/1.7 system-ui, -apple-system, "PingFang SC", sans-serif; color: #24313d; background: #f6f8fa; }
* { box-sizing: border-box; }
body { margin: 0; }
header, nav, main, footer, .notice, #feedback { padding: 16px 28px; }
header { display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid #d4dae1; }
header strong { font-size: 23px; letter-spacing: 1px; }
header #reset { margin-left: auto; }
.notice { background: #fff8e6; padding-block: 10px; border-bottom: 1px solid #e6d7ad; font-size: 14px; }
nav { display: flex; gap: 10px; padding-block: 12px; background: #fff; border-bottom: 1px solid #d4dae1; }
button, input, select, textarea { font: inherit; border: 1px solid #a5b0bb; border-radius: 4px; background: #fff; color: inherit; }
button { cursor: pointer; padding: 9px 16px; min-height: 44px; }
button:hover { background: #edf2f6; }
button.primary, nav button[aria-current="page"] { background: #284e6a; color: white; border-color: #284e6a; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #c28220; outline-offset: 3px; }
input, select { padding: 7px; }
input[type="checkbox"] { width: 18px; height: 18px; vertical-align: middle; }
textarea { width: 100%; min-height: 65px; padding: 8px; }
label { display: inline-flex; flex-direction: column; gap: 8px; font-size: 15px; margin: 8px 16px 12px 0; max-width: 100%; }
label:has(textarea) { display: flex; margin-right: 0; }
h1 { font-size: 24px; margin: 0 0 6px; } h2 { font-size: 19px; margin: 0 0 12px; } h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 6px 0 12px; } .muted { color: #5b6975; font-size: 14px; }
main { max-width: 1120px; margin: auto; padding-top: 30px; min-height: 65vh; }
.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 18px 0; }
.toolbar input[type="search"] { min-width: 260px; }
.panel { background: #fff; border: 1px solid #dce3e9; border-radius: 6px; padding: 28px; margin: 24px 0; }
.panel .panel { border: 0; border-top: 1px solid #dce3e9; border-radius: 0; padding: 24px 0 0; margin-bottom: 0; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.columns > .panel { margin-top: 12px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #d4dae1; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #e1e5e9; vertical-align: top; }
th { background: #eef1f4; white-space: nowrap; font-size: 14px; }
td .muted { display: block; margin-top: 5px; }
td button { text-align: left; }
.tag { display: inline-block; padding: 1px 7px; margin: 2px 4px 2px 0; border: 1px solid #c7d0d8; border-radius: 3px; font-size: 13px; background: #f4f6f8; }
.warn { background: #fff3dc; color: #754b09; border-color: #dbc18c; }
.ok { background: #edf5ee; color: #355e3d; border-color: #b4ccb9; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin: 20px 0 12px; }
.source-text, .quote { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid #b4c2ce; padding: 10px 14px; background: #f5f7f9; font: inherit; margin: 8px 0; }
dl { display: grid; grid-template-columns: 135px 1fr; gap: 6px 15px; margin: 10px 0; }
dt { color: #5b6975; } dd { margin: 0; overflow-wrap: anywhere; }
#processing-results-panel { min-width: 0; overflow-wrap: anywhere; }
#processing-results-panel .processing-value { min-width: 0; white-space: pre-wrap; }
#operations-workbench td { overflow-wrap: anywhere; }
#operations-workbench .field-section > summary { color: #243e54; }
#operations-workbench #operations-detail-title { margin-top: 18px; }
#operations-workbench .operations-field-edit { margin-top: 10px; }
#operations-workbench .source-text { max-height: 35rem; overflow: auto; }
#operations-track-dialog { width: min(32rem, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; color: inherit; border: 1px solid #dce3e9; border-radius: 6px; overflow-wrap: anywhere; }
#operations-track-dialog::backdrop { background: rgb(36 49 61 / 40%); }
#operations-track-dialog label { display: flex; margin-right: 0; }
#material-workspace td, .material-dialog { overflow-wrap: anywhere; }
#material-workspace table[aria-label="黑名单"] :is(th, td):not(:first-child) { white-space: nowrap; }
.material-dialog { width: min(36rem, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; color: inherit; border: 1px solid #b7c7d4; border-radius: 6px; }
.material-dialog::backdrop { background: rgb(36 49 61 / 40%); }
.material-dialog label { display: flex; margin-right: 0; }
.material-folders { list-style: none; padding-left: 0; }
.material-folders li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 0; }
.material-menu { gap: 8px; margin-top: 8px; }
#material-workspace [aria-pressed="true"] { background: #284e6a; color: white; border-color: #284e6a; }
#feedback { display: none; margin: 12px 28px 0; border: 1px solid #9db3c5; background: #eff5fa; }
#feedback.visible { display: block; position: sticky; top: 0; z-index: 2; }
#feedback p:last-child { margin-bottom: 0; }
details { margin: 10px 0; } summary { cursor: pointer; color: #284e6a; }
summary { padding: 10px 0; }
summary:focus-visible { outline: 3px solid #c28220; outline-offset: 3px; }
.operation-status { margin: 24px 0 30px; border: 1px solid #d2dfe8; background: #f0f5f9; border-radius: 6px; padding: 18px 22px; }
.status-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.more-actions { margin-bottom: 0; }
.assisted { display: inline-grid; grid-template-columns: 32px minmax(0,1fr); align-items: start; gap: 4px 6px; min-width: 0; max-width: 100%; vertical-align: top; margin: 4px 0; }
.help-target { grid-column: 2; min-width: 0; line-height: 32px; }
.help-target > label { margin: 0; line-height: 32px; }
label.filter-choice { flex-direction: row; align-items: center; line-height: 32px; margin: 0; }
.help-target > button { max-width: 100%; }
.assisted-button > .help-trigger { margin-top: 7.6px; }
.help-target > h2, .help-target > h3 { margin: 0; line-height: 32px; }
.assisted-group > .actions { margin-top: 4px; }
button.help-trigger { display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: #47647d; line-height: 1; }
.help-icon { display: grid; place-items: center; border: 1px solid #607a91; border-radius: 50%; width: 9.375px; height: 9.375px; font-size: 5.25px; line-height: 1; }
.help-trigger[aria-expanded="true"] .help-icon { background: #e4edf5; }
.help-content { grid-column: 1 / -1; position: static; width: 280px; max-width: 100%; margin-top: 8px; padding: 16px; border: 1px solid #b7c7d4; border-radius: 6px; background: #fff; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.help-content[hidden] { display: none; }
.evidence-item { padding: 20px 0; border-bottom: 1px solid #e4e9ee; }
.evidence-item:last-of-type { border-bottom: 0; }
.field-section { border: 1px solid #dce3e9; border-radius: 6px; padding: 12px 24px; margin: 18px 0; background: #fff; }
.field-section > summary { font-weight: 600; }
.field-section > .panel { border: 0; padding: 18px 0; margin: 0; }
p.warn { padding: 12px 16px; border-radius: 4px; }
pre, select { max-width: 100%; }
footer { border-top: 1px solid #d4dae1; color: #5b6975; font-size: 13px; }
.skip { position: absolute; left: -1000px; } .skip:focus { left: 10px; top: 10px; background: white; padding: 10px; z-index: 1; }
.empty { padding: 24px; }
.library-filters { align-items: start; }
.library-filters label { flex: 1 1 190px; min-width: 0; }
.library-filters input { width: 100%; min-width: 0 !important; }
.candidate-list .panel { overflow-wrap: anywhere; }
.scope-summary ul { padding-left: 22px; margin-block: 8px; }
@media (max-width: 800px) { header, nav, main, footer, .notice { padding-inline: 14px; } .columns { grid-template-columns: 1fr; gap: 0; } nav { flex-wrap: wrap; } header { flex-wrap: wrap; } .toolbar input[type="search"] { min-width: 170px; } dl { grid-template-columns: 100px 1fr; } #feedback { margin-inline: 14px; } }
@media (max-width: 600px) { .panel { padding: 20px; } }

/* F-E: a small identity panel; instructions expand in normal layout. */
.identity-panel{margin:1rem auto;padding:1rem;max-width:74rem;border:1px solid #bbb;border-radius:.35rem;overflow-wrap:anywhere}
.identity-panel form{display:flex;flex-wrap:wrap;align-items:end;gap:.75rem;margin:.75rem 0}
.identity-panel label{display:flex;flex-direction:column;gap:.35rem;max-width:100%}
.identity-panel input{width:22rem;max-width:100%;box-sizing:border-box}
.identity-panel button{min-height:2.5rem}
.identity-panel[hidden]{display:none}

/* Authenticated catalog. The older task-workbench demo keeps its own layout. */
.catalog-shell {
  --catalog-paper: #f6f5f0;
  --catalog-surface: #fffefa;
  --catalog-edit: #eaf0eb;
  --catalog-ink: #202e29;
  --catalog-muted: #52635b;
  --catalog-line: #cdd7d0;
  --catalog-accent: #235647;
  --catalog-accent-hover: #194437;
  --catalog-danger: #922c2a;
  --catalog-focus: #165d9c;
  color: var(--catalog-ink);
  background: var(--catalog-paper);
  font-size: 15px;
  line-height: 1.6;
}
.catalog-shell:not(.single-task-shell) { scroll-padding-block-start: 12px; }
.catalog-shell ::selection { background: #c6e4d7; color: #12392d; }
.catalog-shell [hidden] { display: none !important; }
.catalog-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 3vw, 38px);
  min-height: 68px;
  border-color: var(--catalog-line);
  background: var(--catalog-surface);
}
.catalog-brand { display: flex; align-items: baseline; gap: 15px; white-space: nowrap; }
.catalog-brand strong { font-size: 22px; font-weight: 750; letter-spacing: .12em; }
.catalog-brand span { color: var(--catalog-muted); font-size: 14px; }
.catalog-hosted-brand { white-space: normal; overflow-wrap: anywhere; }
.catalog-site-registration { font-size: 13px; color: var(--catalog-muted); text-align: center; }
.catalog-site-registration a { color: inherit; text-underline-offset: .18em; }
.catalog-shell .catalog-header:has(#identity-logout) .catalog-site-registration { display: none; }
.catalog-shell body[data-catalog-state="locked"] .catalog-layout { display: none; }
.catalog-shell body[data-catalog-state="locked"] .catalog-header {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  background: var(--catalog-paper);
}
.catalog-shell body[data-catalog-state="locked"] .catalog-header:has(.catalog-site-registration) {
  grid-template-rows: auto 1fr auto;
}
.catalog-shell body[data-catalog-state="locked"] .catalog-brand {
  padding-block: 5px 15px;
  border-bottom: 1px solid var(--catalog-line);
}
.catalog-shell #vigil-identity {
  border: 0;
  padding: 0;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}
.catalog-shell #vigil-identity:has(#identity-logout) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 6px 12px;
}
.catalog-shell #vigil-identity:has(#identity-logout) #identity-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}
.catalog-shell #vigil-identity:has(#identity-logout) #identity-status:empty { display: none; }
.catalog-shell #identity-current {
  color: var(--catalog-muted);
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.catalog-shell #identity-current strong {
  color: var(--catalog-ink);
  font: inherit;
  font-weight: 650;
  letter-spacing: normal;
}
.catalog-shell body[data-catalog-state="locked"] #vigil-identity {
  margin: clamp(36px, 8vh, 104px) auto 0;
  width: min(100%, 470px);
  border: 1px solid var(--catalog-line);
  background: var(--catalog-surface);
  padding: clamp(20px, 5vw, 34px);
  border-radius: 12px;
}
.catalog-shell #vigil-identity h2 { font-size: 24px; line-height: 1.3; }
.catalog-shell #vigil-identity form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-block: 16px;
}
.catalog-shell #vigil-identity label { margin: 0; }
.catalog-shell #vigil-identity input { width: 100%; }
.catalog-shell #identity-send, .catalog-shell #identity-verify { justify-self: start; }
.catalog-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.catalog-sidebar {
  border-right: 1px solid var(--catalog-line);
  background: #eef0ea;
  padding: 24px 12px 16px;
  min-width: 0;
}
.catalog-sidebar-inner { position: sticky; top: 16px; }
.catalog-sidebar nav { display: grid; gap: 4px; border: 0; padding: 0; background: transparent; }
.catalog-sidebar button { width: 100%; text-align: left; min-height: 42px; }
.catalog-sidebar nav button { border-color: transparent; background: transparent; }
.catalog-sidebar nav button:hover { background: #e0e7df; }
.catalog-sidebar nav button[aria-current="page"] {
  background: #dce9df;
  color: #173e32;
  border-color: #b9cfc2;
  font-weight: 680;
}
.catalog-shell #reload { width: auto; min-height: 38px; margin: 16px 0 0 2px; color: var(--catalog-muted); }
.catalog-content { min-width: 0; }
.catalog-shell main {
  padding: 16px clamp(18px, 3.8vw, 54px) 54px;
  max-width: 1260px;
  margin: 0 auto;
  min-height: 60vh;
  min-width: 0;
}
.catalog-shell .notice {
  background: transparent;
  border: 0;
  color: var(--catalog-muted);
  max-width: 1260px;
  font-size: 13px;
  margin: 0 auto;
  padding: 17px clamp(18px, 3.8vw, 54px) 0;
}
.catalog-shell :is(#catalog-feedback,#pending) { margin: 12px clamp(18px, 3.8vw, 54px) 0; }
.catalog-shell #catalog-feedback:empty { display: none; }
.catalog-shell #catalog-feedback { padding: 8px 12px; font-size: 14px; background: #eaf1eb; border-color: var(--catalog-line); }
.catalog-shell #pending { background: #fff4db; border-color: #ceb581; max-width: 78ch; overflow-wrap: anywhere; }
.catalog-shell :is(h1,h2,h3,h4) { line-height: 1.35; text-wrap: pretty; }
.catalog-shell :is(h1,#operations-detail-title) { font-size: clamp(25px, 3.2vw, 37px); letter-spacing: -.02em; font-weight: 680; }
.catalog-shell :is(.muted,dt) { color: var(--catalog-muted); }
.catalog-shell :is(button,input,select,textarea) { border-color: #a7b8ae; border-radius: 7px; }
.catalog-shell button { background: var(--catalog-surface); min-height: 39px; padding: 7px 13px; }
.catalog-shell button:not(:disabled):hover { background: #e5eee8; }
.catalog-shell button:not(:disabled):active { background: #d3e4da; }
.catalog-shell button:disabled { opacity: 1; color: #58645e; background: #e7eae6; border-color: #c0cbc4; cursor: default; }
.catalog-shell :is(button,a,input,select,textarea,summary,pre,h1[tabindex],h2[tabindex],h3[tabindex]):focus-visible {
  outline: 2px solid var(--catalog-focus);
  outline-offset: 3px;
}
.catalog-shell :is(button.primary,#operations-review-submit,#identity-send,#identity-verify) {
  background: var(--catalog-accent);
  color: #fff;
  border-color: var(--catalog-accent);
  font-weight: 650;
}
.catalog-shell :is(button.primary,#operations-review-submit,#identity-send,#identity-verify):not(:disabled):hover {
  background: var(--catalog-accent-hover);
}
.catalog-shell :is(button.primary,#operations-review-submit,#identity-send,#identity-verify):not(:disabled):active {
  background: #123228;
}
.catalog-shell :is(button.primary,#operations-review-submit,#identity-send,#identity-verify):disabled {
  background: #e7eae6;
  color: #58645e;
  border-color: #a7b8ae;
}
.catalog-shell #operations-review-submit[aria-busy="true"] {
  color: #21493c;
  background: #dcebe1;
  border-color: #9bb8aa;
  cursor: progress;
}
.catalog-shell button.help-trigger { min-height: 32px; padding: 0; background: transparent; }
.catalog-shell :is(.panel,.field-section,.table-wrap,.evidence-item) { border-color: var(--catalog-line); }
.catalog-shell :is(.panel,.field-section,.table-wrap) { background: var(--catalog-surface); }
.catalog-shell :is(code,time,table,dd,.tag,#operations-list-count,.operation-status,.evidence-item summary) { font-variant-numeric: tabular-nums; }
.catalog-shell :is(.source-text,.quote) {
  border: 0;
  border-radius: 6px;
  background: #f4f2ea;
  color: var(--catalog-ink);
}
.catalog-shell :is([data-material-action="permanent_delete"],[data-material-action="force_delete"],[data-backup-remove],#material-commit.warn) {
  color: var(--catalog-danger);
  border-color: #c79893;
}
.catalog-shell :is([data-material-action="permanent_delete"],[data-material-action="force_delete"],[data-backup-remove],#material-commit.warn):not(:disabled):hover { background: #faeae6; }
.catalog-shell #material-commit.warn { color: #fff; background: var(--catalog-danger); }
.catalog-shell #material-commit.warn:not(:disabled):hover { background: #72211f; }
.catalog-shell :is([data-backup-prepare],#backup-confirm-apply) { border-color: #b59b6a; color: #684711; background: #fbf3df; }
.catalog-shell :is([data-backup-prepare],#backup-confirm-apply):not(:disabled):hover { background: #f6e5be; }

#operations-workbench { max-width: 970px; overflow-wrap: anywhere; }
.review-list-heading, .review-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.review-list-heading h1, .review-section-heading h3 { margin: 0; }
.review-filters {
  display: grid;
  grid-template-columns: minmax(14rem, 1.25fr) minmax(10rem, 1fr) auto;
  align-items: end;
  gap: 12px 18px;
  margin: 20px 0;
}
.review-filters label { margin: 0; gap: 4px; color: var(--catalog-muted); }
.review-filters :is(input,select) { width: 100%; min-width: 0; color: var(--catalog-ink); }
#operations-list-count { color: var(--catalog-muted); white-space: nowrap; padding-bottom: 7px; }
.review-list {
  border: 1px solid var(--catalog-line);
  border-radius: 10px;
  background: var(--catalog-surface);
}
.review-list-item + .review-list-item { border-top: 1px solid var(--catalog-line); }
.catalog-shell .review-list-item button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.catalog-shell .review-list-item:first-child button { border-radius: 9px 9px 0 0; }
.catalog-shell .review-list-item:last-child button { border-radius: 0 0 9px 9px; }
.catalog-shell .review-list-item:only-child button { border-radius: 9px; }
.review-list-name { line-height: 1.4; font-size: 16px; font-weight: 660; }
.review-list-context, .review-excluded { grid-column: 1 / -1; grid-row: 2; color: var(--catalog-muted); font-size: 13px; }
.review-excluded { grid-row: 3; color: #684711; }
.review-list-item .tag { grid-column: 2; grid-row: 1; }
.catalog-shell .tag {
  background: #eaf0ea;
  color: #3f554a;
  border-color: #c8d5cb;
  border-radius: 4px;
  font-size: 12px;
}
#operations-detail #operations-detail-title { margin: 14px 0 3px; }
#operations-detail .review-scope { margin-bottom: 12px; }
.review-shortcuts, .review-links, .review-quote-actions, .review-save-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.review-shortcuts { margin-bottom: 16px; }
.review-links { margin-block: 10px; }
#operations-detail .field-section {
  padding: 0 clamp(12px, 2vw, 18px);
  margin: 8px 0;
  border-radius: 8px;
}
#operations-detail .field-section > summary { padding: 12px 0; color: var(--catalog-ink); }
#operations-detail :is(#operations-sources-panel,#operations-fields,.review-field) { scroll-margin-top: 14px; }
#operations-detail .evidence-item { padding: 4px 0 10px; }
#operations-detail pre.source-text { max-height: 22rem; max-width: 100%; }
#operations-detail .review-field summary :is(.review-field-name,.tag,.review-field-value) { margin-inline-end: 8px; }
.review-field-value { color: var(--catalog-muted); font-weight: 500; }
#operations-fields { margin: 20px 0 28px; }
#operations-fields-title { font-size: 20px; }
.catalog-shell #operations-workbench .operations-field-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 4px 0 12px;
}
.review-controls, .review-evidence { min-width: 0; padding: 13px; border-radius: 7px; }
.review-controls { background: var(--catalog-edit); }
.review-evidence { border: 1px solid var(--catalog-line); background: var(--catalog-surface); }
.review-controls h4, .review-evidence h4 { margin: 0 0 6px; }
.review-controls label, .review-evidence label { display: flex; margin: 8px 0; width: 100%; gap: 4px; }
.review-controls input, .review-evidence select { width: 100%; }
.review-evidence .source-text { min-height: 46px; max-height: 17rem !important; white-space: pre-wrap; tab-size: 4; }
.review-inline-note { margin-block: 8px 0; color: var(--catalog-accent-hover); }
.review-inline-note:empty, #operations-review-progress:empty { display: none; }
.review-save { border-top: 1px solid var(--catalog-line); padding-top: 12px; margin-top: 15px; }
#operations-review-form:has(.review-field[open]) .review-save {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  background: var(--catalog-paper);
}
.review-save-action { gap: 12px; }
#operations-review-progress { font-size: 13px; color: var(--catalog-accent-hover); }
.review-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  border: 1px solid #a5bca9;
  border-radius: 7px;
  padding: 10px 13px;
  margin-top: 10px;
}
.review-secondary { margin-top: 24px; border-top: 1px solid var(--catalog-line); padding-top: 16px; }
#operations-track-panel h3 { padding-top: 12px; }

@media (max-width: 860px) {
  .catalog-layout { grid-template-columns: 154px minmax(0, 1fr); }
  .catalog-sidebar { padding-inline: 9px; }
  .review-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #operations-list-count { padding-bottom: 0; }
}
@media (max-width: 710px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr); }
  .catalog-sidebar { padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--catalog-line); }
  .catalog-sidebar-inner { position: static; }
  .catalog-sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .catalog-sidebar nav button { align-content: center; text-align: center; padding-inline: 4px; font-size: 13px; }
  .catalog-shell #reload { margin-block: 6px 0; min-height: 32px; font-size: 13px; }
  .catalog-header { align-items: flex-start; gap: 7px; }
  .catalog-shell main { padding-inline: 14px; }
}
@media (max-width: 530px) {
  .catalog-shell #identity-current { font-size: 12px; }
  .catalog-shell #identity-logout { min-height: 34px; padding-inline: 7px; font-size: 12px; }
  .review-filters, .catalog-shell #operations-workbench .operations-field-edit { grid-template-columns: minmax(0, 1fr); }
  .review-list-item .tag { white-space: nowrap; }
  .review-save-action { align-items: flex-start; }
  .catalog-shell .toolbar input[type="search"] { min-width: 0; }
}

.catalog-sidebar #catalog-more { margin: 0; }
.catalog-sidebar #catalog-more > summary { display: none; }
.catalog-sidebar .catalog-more-links { display: grid; gap: 4px; }
.catalog-page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.catalog-page-heading h1 { margin: 0; }
.catalog-directory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 14px;
  margin-block: 15px;
}
.catalog-directory label { margin: 0; gap: 4px; }
.catalog-directory input, .catalog-directory select { width: 100%; min-width: 0; }
#catalog-directory-count { padding-bottom: 7px; color: var(--catalog-muted); white-space: nowrap; }
.catalog-facts { margin-bottom: 12px; }
.catalog-section-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.catalog-task-summary .catalog-section-nav { margin-bottom: 12px; }
.catalog-budget {
  display: flow-root;
  max-width: 65ch;
  margin-block: 14px;
  padding: 11px 14px;
  border: 1px solid var(--catalog-line);
  background: var(--catalog-edit);
  border-radius: 7px;
}
.catalog-budget :is(h3,p) { margin-block: 3px; }
.catalog-shell main { overflow-wrap: anywhere; }
.catalog-shell :is(fieldset,label,pre,select,.columns,.table-wrap) { min-inline-size: 0; }
.catalog-shell :is(.catalog-record-note, dl dd, pre, td, fieldset) { overflow-wrap: anywhere; }
.catalog-shell pre.source-text { max-height: 32rem; overflow: auto; }
.catalog-shell :is(#task-form,#source-form) { max-width: 1040px; }
.catalog-shell :is(#task-form,#source-form) > h2 { scroll-margin-top: 12px; }
.catalog-shell .table-wrap:focus-visible { outline: 2px solid var(--catalog-focus); outline-offset: 2px; }
.catalog-shell #catalog-feedback { background: #eff0ec; }
.catalog-shell :is(#impact,.catalog-action-status) { margin-block: 8px; overflow-wrap: anywhere; }
.catalog-shell :is(#impact,.catalog-action-status):empty { display: none; }
.catalog-action-status { font-size: 14px; padding: 7px 10px; border: 1px solid var(--catalog-line); border-radius: 6px; }
.catalog-action-status[data-tone="warn"] { color: #754b09; background: #fff3dc; }
.catalog-action-status[data-tone="ok"] { color: #27533b; background: #e5f0e8; }
.p007-original { max-width: 69ch; margin-bottom: 12px; }
.single-task-shell #nav { padding-inline: clamp(14px, 3vw, 38px); flex-wrap: wrap; border-color: var(--catalog-line); background: var(--catalog-edit); }
.single-task-shell #nav button[aria-current="page"] { background: var(--catalog-accent); }
.single-task-shell #vigil-identity { margin: 12px auto; padding-inline: 16px; width: min(900px, 100%); }
.single-task-shell #feedback { background: var(--catalog-edit); border-color: var(--catalog-line); }
.single-task-shell #feedback:not(.visible):empty { display: none; }

@media (max-width: 710px) {
  .catalog-shell:not(.single-task-shell) .catalog-header { min-height: 54px; padding-block: 8px; }
  .catalog-shell .catalog-brand strong { font-size: 18px; }
  .catalog-shell .catalog-brand span { font-size: 12px; }
  .catalog-shell .catalog-header #vigil-identity:has(#identity-logout) { gap: 4px 8px; }
  .catalog-sidebar nav { display: flex; flex-wrap: wrap; align-items: start; gap: 4px; }
  .catalog-sidebar nav > button { width: auto; flex: 1 1 auto; min-height: 34px; }
  .catalog-sidebar #catalog-more { width: 100%; }
  .catalog-sidebar #catalog-more > summary { display: list-item; padding: 4px 6px; font-size: 13px; line-height: 1.55; }
  .catalog-sidebar #catalog-more:not([open]) > .catalog-more-links { display: none; }
  .catalog-sidebar .catalog-more-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-sidebar .catalog-more-links button { text-align: left; }
  .catalog-shell .catalog-directory { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #catalog-directory-count { padding-bottom: 0; }
  .catalog-shell:not(.single-task-shell) .notice { padding-top: 8px; }
  .catalog-shell main { padding-top: 9px; }
}
@media (max-width: 440px) {
  .catalog-shell .catalog-directory { grid-template-columns: minmax(0, 1fr); }
  .catalog-shell .catalog-section-nav { gap: 5px; }
  .catalog-shell .catalog-section-nav button { padding-inline: 9px; }
}

#followup-workspace > section { margin-block: 18px; }
#followup-workspace > section > h3 { margin-bottom: 8px; }
#material-detail .status-row { align-items: start; }
#material-detail .status-row > h2 { margin-block: 0; }
@media (max-width: 710px) {
  .catalog-sidebar { position: sticky; top: 0; z-index: 3; align-self: start; }
  .catalog-shell:not(.single-task-shell) { scroll-padding-block-start: calc(var(--catalog-sticky-height, 0px) + 12px); }
}
.catalog-shell #catalog-feedback[data-inline] { display: none; }
.catalog-content:has(#operations-review-result) #catalog-feedback { display: none; }

/* Task editing keeps the same workbench palette and screen-order controls. */
.task-editor {
  padding: clamp(16px, 3vw, 32px);
  border-radius: 12px;
}
.task-editor [hidden] { display: none !important; }
.task-editor :is(section,div,fieldset,details,label) { min-inline-size: 0; }
.task-editor label {
  display: flex;
  inline-size: 100%;
  margin: 6px 0 10px;
  gap: 5px;
}
.task-editor :is(input:not([type="radio"],[type="checkbox"],[type="hidden"]), textarea, select) {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.task-editor select { min-block-size: 40px; }
.task-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}
.task-editor-section, .task-preparation-section {
  margin-block-start: 24px;
  padding-block-start: 20px;
  border: 0;
  border-block-start: 1px solid var(--catalog-line);
}
.task-editor-section > h3, .task-preparation-section > h3 { margin-block-end: 7px; }
.task-editor .task-condition, .task-editor .task-source-list, .task-editor .task-preparation-query {
  border: 0;
  padding: 0;
  margin: 14px 0 16px;
}
.task-editor .task-condition + .task-condition {
  border-block-start: 1px solid var(--catalog-line);
}
.task-editor :is(.task-condition, .task-source-list, .task-preparation-query, .task-target-list) > legend {
  max-inline-size: 100%;
  margin-block-end: 6px;
  padding: 0 8px 0 0;
  font-weight: 675;
}
.task-editor .task-condition-modes, .task-editor .task-condition-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-editor :is(.task-condition-modes, .task-condition-picks) > label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  inline-size: auto;
  min-block-size: 40px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--catalog-line);
  border-radius: 6px;
  cursor: pointer;
}
.task-editor :is(.task-condition-modes, .task-condition-picks) > label:has(:checked) {
  background: var(--catalog-edit);
  border-color: var(--catalog-accent);
}
.task-editor :is(input[type="checkbox"], input[type="radio"]) {
  flex: 0 0 auto;
  accent-color: var(--catalog-accent);
  margin: 0;
}
.task-editor .task-condition-picks > label { overflow-wrap: anywhere; }
.task-editor .task-condition-summary { color: var(--catalog-muted); margin: 8px 0 0; }
.task-editor .task-condition-summary:empty { display: none; }
.task-editor .task-condition-picks { margin-block-start: 8px; }
.task-editor .task-condition-values { margin-block: 8px; }
.task-condition-selected { list-style: none; margin: 8px 0; padding: 0; }
.task-condition-selected:empty { display: none; }
.task-condition-selected li, .task-condition-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 8px;
  margin-block: 6px;
}
.task-condition-custom > :is(label,p) { grid-column: 1 / -1; margin-block: 0; }
.task-condition-custom > textarea { min-height: 46px; }
.task-editor .task-condition-note-preview, .task-editor .task-condition-note { margin-block-start: 10px; }
.task-editor .task-condition-note-preview > p { margin-block-end: 4px; }
.task-editor .task-option-list { display: grid; gap: 4px; }
.task-editor :is(.task-check-row, .filter-choice) {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  min-block-size: 36px;
  padding-block: 5px;
  margin: 0;
}
.task-editor .task-check-row input, .task-editor .filter-choice input { margin-block-start: 4px; }
.task-editor .task-check-row small { display: block; font-size: 13px; color: var(--catalog-muted); }
.task-editor .task-editor-more, .task-editor .task-preparation-more { margin-block: 10px; }
.task-editor :is(.task-editor-more, .task-preparation-more) > summary {
  padding-block: 5px;
  font-weight: 630;
  color: var(--catalog-accent);
}
.task-editor .task-preparation-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}
.task-editor .task-preparation-controls > label { inline-size: min(100%, 22rem); }
.task-editor .task-preparation-query {
  padding-inline: 12px;
  border-inline-start: 1px solid var(--catalog-line);
}
.task-date-controls {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 30rem);
  align-items: end;
  gap: 8px 14px;
}
.task-date-controls label { margin-block-end: 0; }
.task-editor .task-source-scope { inline-size: min(100%, 17rem); }
.task-editor #date-preview-output { margin-block: 8px 0; }
.task-settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-block: 10px 18px;
}
.task-settings-nav button[aria-pressed="true"] {
  border-color: var(--catalog-accent);
  background: var(--catalog-edit);
  color: var(--catalog-ink);
  font-weight: 650;
}
.task-match-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.task-editor [data-task-settings-panel] > h3 { margin-block: 14px 6px; }
.task-editor #task-advanced > [data-task-settings-panel] + [data-task-settings-panel] {
  padding-block-start: 0;
}
.task-editor #task-advanced > summary .muted { margin-inline-start: .5rem; font-weight: 400; }
.task-editor-footer .actions { margin: 10px 0; }

@media (max-width: 650px) {
  .task-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .task-match-fields { grid-template-columns: minmax(0, 1fr); }
  .task-date-controls { grid-template-columns: minmax(0, 1fr); }
  .task-date-controls > select { inline-size: min(100%, 12rem); }
  .task-date-controls .task-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-editor :is(.task-condition-modes, .task-condition-picks) > label { min-block-size: 44px; }
  .task-editor .task-condition-custom { grid-template-columns: minmax(0, 1fr); }
  .task-condition-custom > button { justify-self: start; }
}

.task-editor-footer .catalog-action-status { flex-basis: 100%; order: 1; }

/* The neutral gutter separates editable sections. Keep each legend inside its group. */
.catalog-shell #task-form {
  --section-pad: clamp(14px, 2vw, 24px);
  background: #edf0eb;
  border-color: #c8d1c9;
  padding: var(--section-pad);
}
#task-form > .task-editor-grid,
#task-form .task-condition,
#task-form > :is(.task-target-list,section.task-editor-section,#task-advanced) {
  margin: 0 0 14px;
  padding: 16px var(--section-pad);
  border: 1px solid #c6d0c8;
  border-radius: 9px;
  background: var(--catalog-surface);
}
#task-form :is(.task-condition,.task-target-list) > legend {
  float: left;
  width: 100%;
  padding: 0 0 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dce3dd;
}
#task-form :is(.task-condition,.task-target-list) > legend ~ * { clear: both; }
#task-form :is(.task-condition legend,.task-target-list legend,#task-sources-title,#task-advanced > summary) {
  color: #234e40;
  font-size: 1.125rem;
  font-weight: 680;
}
#task-form > .task-editor-grid label { font-weight: 650; margin-block: 0; }
#task-form > .task-editor-grid :is(input,select) { font-weight: 400; min-height: 44px; }
#task-form .task-editor-footer { padding: 0; margin: 0; border: 0; }
#task-form .task-editor-footer .actions { margin-bottom: 0; }
#task-form .task-settings-nav { padding-block: 12px; border-block: 1px solid var(--catalog-line); }
#task-form .legacy-limits { margin-bottom: 16px; padding: 12px 16px; background: var(--catalog-surface); border-left: 3px solid var(--catalog-accent); overflow-wrap: anywhere; }
#task-form .task-city-condition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 8px 20px;
}
#task-form .task-city-condition > legend, #task-form [data-city-existing-note] { grid-column: 1 / -1; }
#task-form .task-city-picker { margin: 0; }
.task-editor .task-city-selected > strong { font-size: 15px; font-weight: 500; }
.task-editor .task-city-selected > p { margin: 5px 0 0; }
.task-editor .task-city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
}
.task-editor .task-city-list > li {
  position: relative;
  max-inline-size: 100%;
  padding: 5px 18px;
  border: 1px solid #adc5b7;
  border-radius: 6px;
  background: #e6f0e9;
  color: #204b3d;
  overflow-wrap: anywhere;
}
#task-form .task-city-list button {
  position: absolute;
  inset: -11px -11px auto auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--catalog-surface);
  border-radius: 50%;
  background: #315445;
  color: white;
  font: 21px/1 Arial, sans-serif;
}
#task-form .task-city-list button:hover { background: #162e25; }
@media (hover:hover) and (pointer:fine) {
  .task-city-list li:not(:hover):not(:focus-within) [data-city-remove] { opacity: 0; pointer-events: none; }
}
@media (any-pointer:coarse) {
  #task-form .task-city-list [data-city-remove] { opacity: 1; pointer-events: auto; width: 34px; height: 34px; }
  #task-form .task-city-list li { padding-inline-end: 32px; }
}
@media (max-width: 700px) {
  #task-form .task-city-condition { grid-template-columns: minmax(0,1fr); }
  .catalog-shell #task-form { padding: 10px; }
}
#task-form #task-arrangement-title {
  color: #234e40;
  font-size: 1.125rem;
  border-bottom: 1px solid var(--catalog-line);
  padding-bottom: 9px;
  margin-bottom: 14px;
}
#task-schedule .task-condition-modes { margin-top: 8px; }
#task-schedule #run-interval { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 7rem); gap: 12px; }
#task-schedule #run-summary, #history-control p { margin-bottom: 0; }
#history-control { margin-top: 12px; }
#history-control p { flex-basis: 100%; }
@media (max-width: 680px) {
  #task-schedule .task-editor-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
}

/* Keep the receipt readable at the request control, including narrow screens. */
#preparation-status { overflow-wrap: anywhere; padding: .6rem .8rem; background: #eef3ef; border-inline-start: 3px solid #476759; }
#preparation-status:empty { display: none; }
#preparation-result ol.source-text { padding-inline-start: 2.4rem; }
#preparation-result li + li { margin-top: .7rem; }
#preparation-result, #preparation-select { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
