:root {
  --login-bg: #050505;
  --brand-yellow: #f2c33d;
  --page: #eef3f8;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #66717e;
  --blue: #326cad;
  --green: #347d47;
  --danger: #9d4038;
  --border: #39424e;
  --soft-border: #d8dee6;
  --column: 1160px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

/* Controlled report correction workspace */
.work-editor label:first-child,
.work-editor label:nth-child(2),
.work-editor label:nth-child(3),
.immutable-note,
.work-editor .form-error { grid-column: 1 / -1; }
.work-editor select,
.work-editor textarea { width: 100%; border: 1px solid #aeb8c3; border-radius: 7px; background: #fff; padding: 7px; }
.field-hint { color: var(--muted); font-weight: 500; }
.derived-field { padding: 7px; border-radius: 7px; background: #eef3f5; }
.derived-field input:disabled { background: #e6ecef; color: #34434b; opacity: 1; }
.immutable-note { margin: 0; padding: 8px; border-left: 3px solid #8d9aa5; background: #f1f4f6; color: #52606c; font-size: 0.68rem; }
.correction-preview { margin: 0 0 10px; padding: 10px; border: 1px solid #c9d3dc; border-radius: 10px; background: #f8fafb; }
.correction-preview h3 { margin: 0 0 7px; font-size: 0.88rem; }
.correction-preview > p { margin: 5px 0; font-size: 0.72rem; }
.preview-row { padding: 8px; border: 1px solid #d7dee4; border-radius: 8px; background: #fff; }
.preview-row + .preview-row { margin-top: 6px; }
.preview-row p { display: grid; grid-template-columns: minmax(88px, 1fr) 1fr auto 1fr; align-items: baseline; gap: 7px; margin: 5px 0 0; font-size: 0.7rem; }
.preview-row del { color: #8f3530; }
.preview-row ins { color: #226a3a; font-weight: 800; text-decoration: none; }
.preview-row small { grid-column: 2 / -1; color: var(--muted); }
.preview-total { font-weight: 900; }
.reload-report { width: 100%; border: 1px solid #c49b1e; border-radius: 8px; background: #fff7d6; color: #604b0a; font-weight: 800; }
.mobile-decision-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.preview-corrections { border: 1px solid #a78316; border-radius: 9px; background: #ffca0a; color: #181a1b; font-weight: 900; }

@media (max-width: 767px) {
  .work-editor { grid-template-columns: 1fr; }
  .work-editor > * { grid-column: 1 !important; }
  .mobile-decision-actions { position: sticky; bottom: calc(var(--manager-mobile-nav) + env(safe-area-inset-bottom)); z-index: 20; grid-template-columns: 1fr; padding: 8px; border-top: 1px solid #d3dade; background: #fff; }
  .preview-row p { grid-template-columns: 1fr auto 1fr; }
  .preview-row p span { grid-column: 1 / -1; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { min-height: 44px; font: inherit; }
:focus-visible { outline: 3px solid #75a9e2; outline-offset: 2px; }

.login-page { min-height: 100vh; background: var(--login-bg); color: #fff; }
.login-shell {
  display: flex;
  min-height: 100vh;
  width: min(100% - 32px, 980px);
  margin: auto;
  padding: 72px 0 40px;
  flex-direction: column;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 16px; font-style: italic; }
.brand-mark {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand-yellow);
}
.brand-mark::after { content: ""; position: absolute; inset: -8px 27px; background: #1c1f22; transform: rotate(10deg); }
.brand strong { display: block; font-size: 2.6rem; line-height: 0.9; }
.brand small { display: block; margin-top: 8px; font-size: 1.15rem; font-weight: 800; }
.login-card {
  display: grid;
  gap: 10px;
  width: min(100%, 354px);
  padding: 14px;
  border: 1px solid #8c7736;
  border-radius: 16px;
}
.login-card label { font-size: 0.78rem; color: #d8dadd; }
.login-card input, .login-card button { border-radius: 12px; }
.login-card input { border: 1px solid #8c7736; background: #171a1d; color: #fff; padding: 10px 14px; }
.login-card button { border: 0; background: var(--brand-yellow); color: #151515; font-weight: 800; }
.login-card .secondary { border: 1px solid #4d5258; background: #171a1d; color: #fff; }
.form-error { margin: 2px 0 0; color: #ffaaa2; font-size: 0.82rem; }

.review-page { min-height: 100vh; background: var(--page); }
.review-shell { width: min(100% - 32px, var(--column)); margin: 0 auto; padding: 16px 0 56px; }
.queue-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid #17212b;
  border-bottom: 3px solid var(--brand-yellow);
  border-radius: 14px 14px 0 0;
  background: #17212b;
  color: #fff;
}
.queue-header h1 { margin: 0; font-size: 1.18rem; line-height: 1.1; }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.test-contour { padding: 3px 7px; border: 1px solid #d5aa2d; border-radius: 999px; background: #f2c33d; color: #17130a; font-size: 0.62rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.queue-header p { margin: 3px 0 0; color: #c8d0d8; font-size: 0.74rem; font-weight: 700; }
.count-badge { padding: 5px 10px; border: 1px solid #b8d3ea; border-radius: 999px; background: #edf6fd; color: #245d91; font-size: 0.78rem; }
.header-actions { display: grid; justify-items: end; gap: 6px; }
.header-actions button { padding: 4px 9px; border: 1px solid #596574; border-radius: 8px; background: #202d39; color: #fff; font-size: 0.7rem; font-weight: 700; }
.notice { padding: 18px; text-align: center; color: var(--muted); }
.notice.error { color: var(--danger); }
.reports-workspace { display: grid; grid-template-columns: minmax(280px, 36%) minmax(0, 64%); min-height: 620px; margin-top: 12px; overflow: hidden; border: 1px solid #cbd3dc; border-radius: 12px; background: var(--surface); }
.queue-pane { padding: 10px; border-right: 1px solid #cbd3dc; background: #f6f8fa; }
.diagnostic-filter { width: 100%; margin-bottom: 8px; border: 1px solid #c2ccd6; border-radius: 8px; background: #fff; color: #43505e; font-size: 0.7rem; font-weight: 800; }
.diagnostic-archive { align-self: start; margin-left: auto; padding: 3px 7px; border-radius: 999px; background: #fff2c7; color: #745d13; font-size: 0.62rem; font-weight: 900; white-space: nowrap; }
.archived-report { border-style: dashed; background: #fffdf7; }
.detail-placeholder { display: grid; place-content: center; gap: 6px; min-height: 480px; padding: 24px; color: var(--muted); text-align: center; }
.detail-placeholder strong { color: var(--ink); font-size: 1.05rem; }
.report-list { display: grid; gap: 7px; }
.report-card { display: block; width: 100%; overflow: hidden; padding: 0; border: 1px solid #cbd3dc; border-radius: 9px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.report-card:focus-visible { outline: 3px solid #75a9e2; outline-offset: 2px; }
.report-list .report-card.active { border-color: var(--blue); box-shadow: inset 3px 0 var(--blue); background: #f2f7fb; }
.report-heading { display: flex; gap: 9px; padding: 10px 10px 4px; }
.team-code { display: grid; place-items: center; width: 47px; height: 37px; border-radius: 11px; background: #414b5c; color: white; font-size: 1.15rem; }
.report-heading h2 { margin: 1px 0 0; font-size: 1rem; line-height: 1.1; }
.report-heading p { margin: 3px 0 0; color: var(--muted); font-size: 0.69rem; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 3px 10px 7px; }
.metric { min-width: 0; padding: 5px 7px; border: 1px solid #e1e5ea; border-radius: 8px; background: #f7f8fa; }
.metric strong, .metric span { display: block; }
.metric strong { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 0.58rem; font-weight: 800; }
.materials { padding: 0 10px 8px; }
.section-label { margin: 0 0 4px; color: #485361; font-size: 0.66rem; font-weight: 800; }
.material-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 7px; border: 1px solid #e1e5ea; border-radius: 8px; background: #f7f8fa; font-size: 0.72rem; }
.material-row + .material-row { margin-top: 4px; }
.material-row span { color: var(--muted); font-weight: 700; }
.report-card-action { display: flex; justify-content: space-between; min-height: 44px; margin: 5px 10px 10px; padding: 9px; border: 1px solid #a9c7e1; border-radius: 8px; background: #edf5fc; color: #285f94; text-align: left; }

.detail-view { min-width: 0; padding: 12px; background: #eef3f8; }
.detail-pane { min-width: 0; }
.detail-card { padding-bottom: 10px; border-color: #cbd3dc; }
.approve-report,
.return-report,
.back-to-reports,
.mobile-back-to-queue {
  width: calc(100% - 20px);
  margin: 6px 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-weight: 800;
}
.mobile-back-to-queue { display: none; border: 1px solid #bfc7cf; background: #f7f8fa; color: #46515e; }
.approve-report { border: 1px solid #8bb597; background: #eaf5ed; color: #286039; }
.approve-report:disabled,
.return-report:disabled { cursor: not-allowed; opacity: 0.58; }
.detail-label { margin: 10px 10px 5px; font-size: 0.76rem; }
.report-table-toggle { width: calc(100% - 20px); margin: 6px 10px; padding: 9px 12px; border: 1px solid #9fc1df; border-radius: 9px; background: #edf5fc; color: #285f94; font-weight: 800; }
.object-card { margin: 0 8px 9px; overflow: hidden; border: 1px solid #aeb8c3; border-radius: 10px; background: #fbfcfd; }
.object-summary { padding: 9px 10px 5px; }
.object-summary h3 { margin: 0; font-size: 0.9rem; }
.object-summary p { margin: 3px 0 0; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.object-summary .responsibility { color: #46515e; }
.object-materials { padding-inline: 10px; }
.object-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 10px 9px; }
.object-toggle { width: calc(100% - 20px); margin: 3px 10px 9px; padding: 7px; border: 1px solid #b9cde0; border-radius: 8px; background: #eef5fb; color: #285f94; font-size: 0.72rem; font-weight: 800; }
.works-panel,
.media-panel { display: grid; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--soft-border); background: #f4f7fa; }
.works-panel h4,
.media-panel h4 { margin: 0 0 2px; font-size: 0.76rem; }
.work-row,
.media-item { padding: 8px; border: 1px solid #d5dce3; border-radius: 8px; background: var(--surface); }
.work-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.work-heading p { margin: 0; font-size: 0.75rem; font-weight: 800; }
.edit-work { min-width: 54px; padding: 4px 8px; border: 1px solid #c5ced7; border-radius: 7px; background: #f7f8fa; color: #46515e; font-size: 0.69rem; font-weight: 800; }
.work-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.work-chips span { padding: 3px 6px; border-radius: 999px; background: #e9edf2; color: #4b5663; font-size: 0.64rem; font-weight: 700; }
.work-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--soft-border); }
.work-editor label { display: grid; gap: 3px; color: var(--muted); font-size: 0.66rem; font-weight: 800; }
.work-editor input { width: 100%; padding: 6px; border: 1px solid #aeb8c3; border-radius: 7px; }
.editor-actions { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 7px; }
.save-draft, .cancel-edit { min-height: 44px; border-radius: 8px; font-weight: 800; }
.save-draft { border: 1px solid #8bb597; background: #eaf5ed; color: #286039; }
.cancel-edit { border: 1px solid #c5ced7; background: #f7f8fa; color: #46515e; }
.draft-note { margin: 7px 0 0; color: #80640e; font-size: 0.67rem; font-weight: 800; }
.draft-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.revert-draft { margin-top: 7px; padding: 4px 7px; border: 1px solid #d7c489; border-radius: 7px; background: #fff9e8; color: #715910; font-size: 0.65rem; font-weight: 800; }
.media-item { display: grid; grid-template-columns: minmax(140px, 240px) minmax(0, 1fr); align-items: center; gap: 10px; }
.media-preview { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; max-height: 240px; border: 1px solid #c4ced8; border-radius: 7px; background: #111820; object-fit: contain; }
.media-copy { display: grid; gap: 3px; min-width: 0; }
.media-copy small { overflow-wrap: anywhere; color: var(--muted); font-size: 0.64rem; }
.media-action-label { display: inline-flex; min-height: 44px; align-items: center; color: #285f94; font-size: 0.7rem; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; touch-action: manipulation; }
.technical-data { margin: 10px; padding: 8px 10px; border: 1px solid #d5dce3; border-radius: 8px; background: #f7f8fa; color: var(--muted); font-size: 0.68rem; }
.technical-data summary { cursor: pointer; color: #46515e; font-weight: 800; }
.technical-data dl { display: grid; grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr); gap: 4px 8px; }
.technical-data dt { font-weight: 800; }
.technical-data dd { margin: 0; overflow-wrap: anywhere; }
.decision-panel { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 0; border-top: 1px solid #cbd3dc; background: var(--surface); }
.decision-panel .comment-label,
.decision-panel .decision-note { grid-column: 1 / -1; }
.decision-panel .approve-report,
.decision-panel .return-report { width: auto; margin-block: 0; }
.decision-action { display: grid; min-width: 0; align-content: start; gap: 4px; }
.decision-action > button { width: 100%; margin-inline: 0; }
.decision-action > small { padding-inline: 4px; color: #68747c; font-size: 0.62rem; line-height: 1.35; }
.comment-label { display: grid; gap: 5px; margin: 12px 10px 7px; color: #46515e; font-size: 0.72rem; font-weight: 800; }
.comment-label textarea { min-height: 96px; resize: vertical; padding: 9px; border: 1px solid #aeb8c3; border-radius: 9px; color: var(--ink); }
.return-report { border: 1px solid #d4a8a4; background: #f9eceb; color: var(--danger); }
.decision-note { margin: 5px 10px 8px; color: var(--muted); font-size: 0.67rem; text-align: center; }
.back-to-reports { border: 1px solid #bfc7cf; background: var(--surface); color: #46515e; }

.workspace-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--soft-border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #dfe6ed;
}
.workspace-switch button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #52606e;
  font-size: 0.78rem;
  font-weight: 800;
}
.workspace-switch button.active { background: var(--surface); color: #245d91; box-shadow: 0 1px 2px rgb(31 41 55 / 12%); }

.registry-view { display: grid; gap: 9px; margin-top: 10px; }
.registry-blocking-error { margin: 0; border: 1px solid #d4a8a4; background: #f9eceb; }
.registry-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 10px; border: 1px solid #aeb8c3; background: var(--surface); }
.registry-filters > label,
.registry-date-pair label { display: grid; gap: 4px; color: #52606e; font-size: 0.68rem; font-weight: 800; }
.registry-filters > label:first-child { grid-column: 1 / -1; }
.registry-filters input,
.registry-filters select { width: 100%; padding: 8px; border: 1px solid #aeb8c3; border-radius: 8px; background: var(--surface); color: var(--ink); }
.registry-date-pair { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.registry-filter-actions { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.registry-filter-actions button,
.registry-pagination button,
.registry-export-row a { padding: 8px 10px; border: 1px solid #9fc1df; border-radius: 8px; background: #edf5fc; color: #285f94; font-size: 0.72rem; font-weight: 800; text-align: center; text-decoration: none; }
.registry-export-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.archive-note, .archive-pending { color: #66717e; font-size: 0.68rem; font-weight: 700; }
.archive-link { color: #285f94; font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.registry-table-wrap { overflow-x: auto; border: 1px solid #aeb8c3; background: var(--surface); }
.registry-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 0.68rem; }
.registry-table th,
.registry-table td { padding: 7px; border-bottom: 1px solid #d8dee6; text-align: left; white-space: nowrap; }
.registry-table th { position: sticky; top: 0; background: #edf1f5; color: #46515e; }
.registry-table td a { color: #285f94; font-weight: 800; }
.registry-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.registry-pagination span { color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.registry-pagination button:disabled { cursor: not-allowed; opacity: 0.5; }

.catalog-view { display: grid; gap: 10px; margin-top: 10px; }
.notice.compact { margin: 0; padding: 10px 12px; border: 1px solid var(--soft-border); background: var(--surface); font-size: 0.74rem; }
.catalog-section { padding: 12px; border: 1px solid #aeb8c3; background: var(--surface); }
.catalog-section:first-of-type { border-top: 3px solid var(--blue); }
.catalog-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-section h2 { margin: 0 0 9px; font-size: 1rem; }
.catalog-count { min-width: 28px; padding: 3px 7px; border-radius: 999px; background: #edf1f5; color: #485361; font-size: 0.7rem; font-weight: 800; text-align: center; }
.search-label,
.catalog-form > label,
.catalog-import > label,
.form-pair label { color: #52606e; font-size: 0.68rem; font-weight: 800; }
.catalog-section input,
.catalog-section select { width: 100%; padding: 8px 10px; border: 1px solid #aeb8c3; border-radius: 8px; background: var(--surface); color: var(--ink); }
.catalog-list { display: grid; max-height: 390px; margin-top: 8px; overflow-y: auto; border-block: 1px solid #d8dee6; }
.catalog-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 2px; }
.catalog-row + .catalog-row { border-top: 1px solid #e5e9ee; }
.catalog-row.archived { color: var(--muted); background: #f7f8fa; }
.catalog-row.selected { background: #fff8d8; box-shadow: inset 3px 0 #d5a900; }
.catalog-row-select { width: 100%; min-height: 44px; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; }
.catalog-row-select:hover { background: rgb(255 255 255 / 68%); }
.catalog-row strong,
.catalog-row small { display: block; overflow-wrap: anywhere; }
.catalog-row strong { font-size: 0.78rem; }
.catalog-row small { margin-top: 2px; color: var(--muted); font-size: 0.65rem; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
.row-actions button { min-height: 44px; padding: 7px 10px; border: 1px solid #bdc7d1; border-radius: 7px; background: var(--surface); color: #46515e; font-size: 0.66rem; font-weight: 800; }
.row-actions .edit-action { border-color: #9cb4c3; background: #e8f0f4; color: #284858; }
.row-actions .archive-action { border-color: #e2b8b8; background: #fff4f3; color: var(--danger); }
.row-actions .restore-action { color: var(--green); }
.empty-note { margin: 10px 0; color: var(--muted); font-size: 0.7rem; }

.catalog-form { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--soft-border); }
.catalog-form[hidden], .catalog-detail[hidden] { display: none; }
.catalog-form-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.catalog-form-actions .secondary-action { border-color: #cbd4d8; background: #fff; color: #52606e; }
.catalog-form button,
.import-actions button { padding: 8px 10px; border: 1px solid #9fc1df; border-radius: 8px; background: #edf5fc; color: #285f94; font-size: 0.74rem; font-weight: 800; }
.catalog-form fieldset { display: grid; gap: 4px; max-height: 230px; margin: 2px 0; padding: 8px; overflow-y: auto; border: 1px solid #c7d0d9; border-radius: 8px; }
.catalog-form legend { padding: 0 4px; color: #52606e; font-size: 0.68rem; font-weight: 800; }
.member-choice { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 0.72rem; }
.member-choice input { width: 20px; min-height: 20px; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 7px; }
.form-pair label { display: grid; gap: 5px; }
.catalog-import p { margin: -3px 0 10px; color: var(--muted); font-size: 0.7rem; }
.import-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.import-actions button:disabled { cursor: not-allowed; opacity: 0.5; }
.import-preview { margin-top: 8px; padding: 9px; border: 1px solid #d5dce3; background: #f7f8fa; color: #485361; font-size: 0.7rem; line-height: 1.45; white-space: pre-line; }
.catalog-section button { touch-action: manipulation; }

@media (max-width: 899px) {
  .review-shell { width: min(100% - 16px, var(--column)); padding-top: 8px; }
  .reports-workspace { grid-template-columns: 1fr; min-height: 0; }
  .queue-pane { border-right: 0; }
  .detail-placeholder { display: none; }
  .reports-workspace.detail-open .queue-pane { display: none; }
  .detail-view { padding: 0; }
  .detail-card { border: 0; border-radius: 0; }
  .media-item { grid-template-columns: 1fr; }
  .media-preview { max-height: 70vh; }
  .decision-panel { position: static; grid-template-columns: 1fr; }
  .decision-panel .comment-label,
  .decision-panel .decision-note { grid-column: auto; }
  .mobile-back-to-queue { display: block; }
}

@media (max-width: 380px) {
  .review-shell { width: min(100% - 12px, var(--column)); }
  .metrics { gap: 3px; padding-inline: 6px; }
  .material-row { align-items: start; flex-direction: column; gap: 2px; }
  .catalog-section { padding: 10px 8px; }
  .catalog-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: start; }
  .form-pair { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Operations Headquarters — approved responsive direction A. */
:root {
  --manager-nav: #182126;
  --manager-action: #ffca0a;
  --manager-page: #f3f5f6;
  --manager-surface: #ffffff;
  --manager-ink: #18232d;
  --manager-success: #17643f;
  --manager-danger: #933d38;
  --manager-sidebar: 240px;
  --manager-mobile-nav: 72px;
}

html { background: var(--manager-page); }
body { overflow-x: hidden; color: var(--manager-ink); }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: rgb(24 33 38 / 12%); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.manager-shell { min-height: 100vh; background: var(--manager-page); }
.manager-sidebar { background: #141c20; color: #fff; box-shadow: 8px 0 28px rgb(11 17 20 / 14%); }
.manager-brand { display: flex; align-items: center; gap: 12px; padding: 28px; }
.manager-brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: var(--manager-action); color: #171d20; font-weight: 950; }
.manager-brand strong, .manager-brand small { display: block; }
.manager-brand small { margin-top: 3px; color: #9eaaaf; font-size: 0.68rem; font-weight: 700; }
.manager-contour-note { display: grid; gap: 7px; margin: auto 18px 28px; padding-top: 18px; border-top: 1px solid #364248; }
.manager-contour-note strong { color: var(--manager-action); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.manager-contour-note span { color: #aeb9be; font-size: 0.72rem; line-height: 1.35; }
.manager-main { width: auto; max-width: 1440px; padding: 32px 38px 72px; }
.queue-header { padding: 0 0 22px; border: 0; border-radius: 0; background: transparent; color: var(--manager-ink); }
.queue-header h1 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -0.035em; text-wrap: balance; }
.queue-header p { margin-top: 6px; color: #69757e; font-size: 0.78rem; }
.header-actions { grid-auto-flow: column; align-items: center; }
.header-actions button { min-height: 44px; padding-inline: 14px; border-color: #cfd7db; background: var(--manager-surface); color: var(--manager-ink); }
.test-contour { background: var(--manager-action); border-color: var(--manager-action); }

.workspace-switch { padding: 0 18px; border: 0; border-radius: 0; background: transparent; }
.mobile-workspace-nav { display: contents; }
.workspace-switch button { display: flex; align-items: center; gap: 10px; justify-content: start; min-height: 48px; padding: 0 12px; color: #b9c3c8; text-align: left; }
.workspace-switch button span { width: 18px; color: #91a0a6; text-align: center; }
.workspace-switch button.active { background: #2b363b; color: #fff; box-shadow: inset 3px 0 var(--manager-action); }
.workspace-switch button.active span { color: var(--manager-action); }

.dashboard-view { display: grid; gap: 20px; }
.dashboard-view > .notice { padding: 8px 0; border: 0; background: transparent; text-align: left; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dashboard-kpi { display: grid; min-height: 112px; padding: 18px; border: 1px solid #d5dce0; border-radius: 11px; background: var(--manager-surface); }
.dashboard-kpi.attention { border-top: 3px solid var(--manager-action); }
.dashboard-kpi.success { border-top: 3px solid #2b9a63; }
.dashboard-kpi span, .dashboard-kpi small { color: #6e7981; font-size: 0.72rem; font-weight: 750; }
.dashboard-kpi strong { margin-block: 8px 2px; font-size: 1.85rem; line-height: 1; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 18px; }
.dashboard-queue, .dashboard-shift { overflow: hidden; border: 1px solid #d5dce0; border-radius: 11px; background: var(--manager-surface); }
.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #e0e5e8; }
.dashboard-section-heading h3 { margin: 0; font-size: 1rem; }
.dashboard-section-heading button { border: 0; background: transparent; font-size: 0.72rem; font-weight: 850; }
.dashboard-report-list { min-height: 260px; }
.dashboard-report-row { display: flex; width: 100%; min-height: 74px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border: 0; border-bottom: 1px solid #e5e9eb; background: transparent; text-align: left; }
.dashboard-report-row:hover { background: #fff9da; }
.dashboard-report-row strong, .dashboard-report-row small { display: block; }
.dashboard-report-row small { margin-top: 4px; color: #68747c; }
.dashboard-status-badge { padding: 6px 10px; border-radius: 999px; background: #fff0a8; color: #735b00; font-size: 0.68rem; font-weight: 850; }
.dashboard-empty { margin: 0; padding: 32px 20px; color: #69757e; }
.dashboard-side { display: grid; align-content: start; gap: 18px; }
.dashboard-shift { display: grid; padding: 20px; }
.dashboard-shift > span { color: #69757e; font-size: 0.75rem; }
.dashboard-shift > strong { margin: 14px 0 10px; font-size: 2.75rem; letter-spacing: -0.06em; }
.dashboard-shift dl { margin: 0; }
.dashboard-shift dl div { display: contents; }
.dashboard-shift dt, .dashboard-shift dd { margin: 0; padding: 11px 0; border-top: 1px solid #e4e8ea; font-size: 0.76rem; }
.dashboard-shift dt { float: left; color: #69757e; }
.dashboard-shift dd { text-align: right; font-weight: 850; }
.launch-note { display: grid; gap: 8px; padding: 20px; border-radius: 11px; background: #222d32; color: #fff; }
.launch-note span { color: #c4cdd1; font-size: 0.74rem; line-height: 1.45; }

.reports-workspace { grid-template-columns: minmax(320px, 34%) minmax(0, 66%); margin-top: 0; border-color: #cbd4d8; box-shadow: 0 18px 48px rgb(24 33 38 / 10%); }
.report-card { box-shadow: 0 5px 16px rgb(24 33 38 / 6%); }
.detail-card { box-shadow: 0 14px 38px rgb(24 33 38 / 10%); }
.object-card { border-color: #c7d0d5; box-shadow: 0 5px 14px rgb(24 33 38 / 6%); }
.work-row { border-left: 3px solid #d7dee2; }
.report-edit-toggle { width: calc(100% - 20px); min-height: 48px; margin: 10px 10px 6px; padding: 10px 14px; border: 1px solid #d9ad00; border-radius: 9px; background: var(--manager-action); color: #171d20; font-weight: 900; box-shadow: 0 5px 12px rgb(166 129 0 / 16%); }
.report-list .report-card.active { border-color: #d8b000; box-shadow: inset 3px 0 var(--manager-action); background: #fff9dc; }
.approve-report { border-color: #17643f; background: #17643f; color: #fff; }
.report-card-action { border-color: #aebfca; background: #e8f0f4; color: #284858; }
.report-table-toggle, .object-toggle { border-color: #cbd4d8; background: #fff; color: #26343b; }
.report-card:hover .report-card-action, .report-table-toggle:hover, .object-toggle:hover { border-color: #8aaec6; background: #f1f7fb; }
.edit-work { border-color: #9db8ca; background: #eef6fb; color: #214f6c; }

.registry-view, .catalog-view { margin-top: 0; }
.registry-card-list { display: none; }
.registry-card { display: grid; gap: 8px; padding: 14px; border: 1px solid #d6dde1; border-radius: 11px; background: var(--manager-surface); }
.registry-card-heading { display: flex; justify-content: space-between; gap: 10px; }
.registry-card-heading span, .registry-card p { color: #69757e; font-size: 0.72rem; }
.registry-card p { margin: 0; }
.registry-card-metrics { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; align-items: baseline; margin: 2px 0; }
.registry-card-metrics dt { color: #77828a; font-size: 0.62rem; }
.registry-card-metrics dd { margin: 0; overflow-wrap: anywhere; font-size: 0.78rem; font-weight: 850; }
.registry-card-link { min-height: 44px; display: grid; place-items: center; border: 1px solid #cbd4d8; border-radius: 8px; text-decoration: none; }

.catalog-section-switch { display: flex; gap: 7px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: thin; }
.catalog-section-switch button { flex: 0 0 auto; min-height: 44px; padding-inline: 14px; border: 1px solid #cbd4d8; border-radius: 999px; background: #fff; color: #4f5c63; font-size: 0.74rem; font-weight: 800; }
.catalog-section-switch button.active { border-color: var(--manager-nav); background: var(--manager-nav); color: #fff; }
.catalog-editor-panel { min-width: 0; }
.catalog-section { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 0.75fr); gap: 14px 20px; border-color: #d5dce0; border-radius: 11px; box-shadow: 0 8px 26px rgb(31 45 52 / 6%); }
.catalog-section[hidden] { display: none; }
.catalog-section-heading, .catalog-section > .search-label, .catalog-section > input, .catalog-list { grid-column: 1; }
.catalog-form, .catalog-detail { grid-column: 2; grid-row: 1 / span 4; margin: 0; padding: 0 0 0 20px; border-top: 0; border-left: 1px solid #e0e5e8; }
.catalog-detail { min-height: 160px; }
.catalog-detail-empty { margin: 0; padding: 18px; border: 1px dashed #cbd4d8; border-radius: 10px; color: #69757e; font-size: 0.74rem; }
.catalog-detail-card { padding: 17px; border: 1px solid #d9e0e4; border-radius: 10px; background: #f8fafb; }
.catalog-detail-kicker { color: #69757e; font-size: 0.63rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.catalog-detail-card h3 { margin: 5px 0 15px; font-size: 1.05rem; }
.catalog-detail-card dl { display: grid; gap: 10px; margin: 0; }
.catalog-detail-field { display: grid; gap: 3px; }
.catalog-detail-field dt { color: #69757e; font-size: 0.65rem; font-weight: 800; }
.catalog-detail-field dd { margin: 0; color: #273239; font-size: 0.78rem; font-weight: 750; }
.catalog-import { display: block; }
.catalog-import > * { grid-column: auto; }

@media (min-width: 1024px) {
  .manager-shell { display: grid; grid-template-columns: var(--manager-sidebar) minmax(0, 1fr); }
  .manager-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; width: var(--manager-sidebar); flex-direction: column; }
  .manager-main { grid-column: 2; margin: 0 auto; }
  .workspace-switch { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .manager-sidebar { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .manager-brand { padding: 12px 18px; }
  .manager-contour-note { display: none; }
  .workspace-switch { grid-template-columns: repeat(4, 1fr); padding: 8px; }
  .workspace-switch button { justify-content: center; }
  .manager-main { width: min(100% - 28px, 980px); padding: 22px 0 54px; }
  .dashboard-kpis { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .catalog-section { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr); }
}

@media (max-width: 767px) {
  .review-page { padding-bottom: calc(var(--manager-mobile-nav) + env(safe-area-inset-bottom)); }
  .manager-sidebar { min-height: 0; }
  .manager-brand, .manager-contour-note { display: none; }
  .manager-main { width: 100%; padding: 0 8px 20px; }
  .queue-header { margin-inline: -8px; padding: 17px 16px 15px; border-bottom: 3px solid var(--manager-action); background: var(--manager-nav); color: #fff; }
  .queue-header h1 { font-size: 1.2rem; }
  .queue-header p { color: #aeb9be; font-size: 0.65rem; }
  .header-actions { grid-auto-flow: column; }
  .count-badge { display: none; }
  .header-actions button { min-height: 44px; padding: 4px 8px; border: 0; background: transparent; color: #fff; font-size: 0.65rem; }
  .test-contour { font-size: 0.52rem; }
  .mobile-workspace-nav { position: fixed; inset: auto 0 0; z-index: 50; display: grid; height: calc(var(--manager-mobile-nav) + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr); padding: 6px 4px env(safe-area-inset-bottom); border-top: 1px solid #d4dbdf; background: #fff; }
  .workspace-switch button { display: grid; min-width: 0; min-height: 58px; place-items: center; gap: 0; padding: 4px 2px; color: #6e7a81; font-size: 0.58rem; text-align: center; }
  .workspace-switch button span { width: 30px; padding: 5px; border-radius: 8px; }
  .workspace-switch button.active { background: transparent; color: #182126; box-shadow: none; }
  .workspace-switch button.active span { background: #fff1ab; box-shadow: inset 0 -2px var(--manager-action); }
  .dashboard-view { gap: 10px; padding: 14px 4px; }
  .dashboard-view > .notice { font-size: 0.66rem; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-kpi { min-height: 78px; padding: 10px; }
  .dashboard-kpi strong { font-size: 1.45rem; }
  .dashboard-kpi span, .dashboard-kpi small { font-size: 0.6rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { order: -1; }
  .dashboard-shift { display: none; }
  .launch-note { padding: 14px; }
  .dashboard-section-heading { padding: 12px; }
  .dashboard-section-heading button { min-height: 44px; }
  .dashboard-report-row { min-height: 64px; padding: 10px 12px; }
  .reports-workspace { border: 0; border-radius: 0; }
  .decision-panel { position: sticky; bottom: calc(var(--manager-mobile-nav) + env(safe-area-inset-bottom)); z-index: 20; grid-template-columns: 1fr 1.2fr; padding: 8px; box-shadow: 0 -8px 24px rgb(24 33 38 / 9%); }
  .decision-panel .comment-label, .decision-panel .decision-note { grid-column: 1 / -1; }
  .registry-filters { grid-template-columns: 1fr; }
  .registry-filters > *, .registry-date-pair, .registry-filter-actions { grid-column: 1 / -1; }
  .registry-table-wrap { display: none; }
  .registry-card-list { display: grid; gap: 8px; }
  .registry-export-row { align-items: stretch; flex-direction: column; }
  .catalog-section { display: block; padding: 10px; }
  .catalog-form, .catalog-detail { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid #e0e5e8; border-left: 0; }
  .catalog-editor-panel.editor-open .catalog-form:not([hidden]) { position: fixed; inset: auto 8px calc(var(--manager-mobile-nav) + env(safe-area-inset-bottom)) 8px; z-index: 40; max-height: min(72vh, 620px); overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px; border: 1px solid #cbd4d8; border-radius: 16px 16px 0 0; background: #fff; box-shadow: 0 -12px 36px rgb(24 33 38 / 18%); }
  .catalog-row, .dashboard-report-row, .work-row { overflow-wrap: anywhere; }
  .catalog-form-actions { grid-template-columns: 1fr; }
  .report-edit-toggle { position: sticky; top: 8px; z-index: 12; }
  .editor-actions { grid-template-columns: 1fr; }
}

/* Final responsive sizing: late operations-grid rules must not restore narrow tracks. */
@media (min-width: 1024px) {
  .manager-main { width: 100%; margin: 0; }
}

@media (min-width: 768px) and (max-width: 899px) {
  .reports-workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .reports-workspace { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .decision-panel { position: static; grid-template-columns: minmax(0, 1fr); }
  .mobile-decision-actions { position: sticky; }
}

.correction-preview,
.mobile-decision-actions { grid-column: 1 / -1; }
.mobile-decision-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }

@media (max-width: 767px) {
  .mobile-decision-actions { grid-template-columns: minmax(0, 1fr); }
  .work-editor { grid-template-columns: minmax(0, 1fr); }
  .work-editor > * { grid-column: 1 !important; }
}
:root { --historical-border: #cbd3dc; }
.historical-import { display: block; min-width: 0; }
.historical-import p, .historical-import .import-preview { overflow-wrap: anywhere; }
.historical-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; padding: 16px; border: 1px solid var(--historical-border); border-radius: 8px; min-width: 0; }
.historical-fields legend { font-weight: 700; padding: 0 6px; }
.historical-fields label, .historical-recovery label { display: grid; gap: 6px; min-width: 0; }
.historical-fields input, .historical-fields select, .historical-recovery input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--historical-border); border-radius: 6px; padding: 8px; background: #fff; color: #202d39; }
.historical-fields button, .historical-import > button, .historical-recovery button { padding: 8px 12px; border: 1px solid var(--historical-border); border-radius: 6px; font-weight: 700; }
.historical-source-row { grid-column: 1 / -1; margin: 0; font-size: .85rem; }
.historical-confirm { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.historical-confirm input { flex: 0 0 22px; width: 22px; }
.historical-recovery { display: grid; gap: 8px; margin-top: 20px; border-top: 1px solid var(--historical-border); padding-top: 16px; }
.historical-import [hidden] { display: none !important; }
@media (max-width: 600px) { .historical-fields { grid-template-columns: minmax(0, 1fr); padding: 10px; } }
