:root {
  color-scheme: light;
  --nav-950: #07172b;
  --nav-900: #0a213d;
  --nav-800: #0f3056;
  --teal-700: #047857;
  --teal-600: #059669;
  --teal-100: #d1fae5;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-50: #eff6ff;
  --ink-950: #0f172a;
  --ink-800: #1e293b;
  --ink-650: #334155;
  --ink-500: #64748b;
  --line-300: #cbd5e1;
  --line-200: #e2e8f0;
  --line-100: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-selected: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --rail-width: 176px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
}


* {
  box-sizing: border-box;
}

html {
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

body {
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  min-width: 320px;
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink-950);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

/* Tabular numbers for financial precision */
.money,
.mtool-value-cell,
.mtool-matrix-value,
.mtool-template-input,
.mtool-formula-output,
.statement-cell-control input,
.statement-sheet-table td,
.font-mono-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width, 176px) minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-collapsed {
  --rail-width: 56px;
  grid-template-columns: 56px minmax(0, 1fr);
}

body.preparation-mode {
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
  background: var(--surface);
}

body.preparation-mode .app-shell {
  height: 100vh;
  width: 100vw;
  display: grid !important;
  grid-template-columns: var(--rail-width, 176px) minmax(0, 1fr) !important;
  overflow: hidden !important;
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body.preparation-mode .app-shell.sidebar-collapsed {
  --rail-width: 56px;
  grid-template-columns: 56px minmax(0, 1fr) !important;
}

body.preparation-mode .side-rail {
  display: flex !important;
}

body.preparation-mode .app-main {
  height: 100vh;
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  min-height: 0 !important;
  min-width: 0 !important;
  background: var(--surface);
}

body.preparation-mode .topbar {
  display: flex !important;
  flex: 0 0 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  border-bottom: 1px solid var(--line-200);
  background: var(--surface);
  z-index: 50;
  padding: 0 16px;
  box-sizing: border-box;
}

body.preparation-mode .stepper,
body.preparation-mode .filing-context,
.stepper[hidden],
.filing-context[hidden],
[hidden] {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

body.preparation-mode .screen {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: calc(100vh - 56px) !important;
  max-height: calc(100vh - 56px) !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--surface);
  box-sizing: border-box;
}

body.preparation-mode[data-step="3"] .screen {
  overflow: hidden !important;
  contain: paint !important;
}

body.preparation-mode[data-step="3"] .screen:has(.note-text-block-backdrop),
body.preparation-mode[data-step="3"] .screen:has(.note-mapping-backdrop),
body.note-editor-open .screen,
body.note-editor-open .mapping-main-area,
body.note-mapping-dialog-open .screen,
body.note-mapping-dialog-open .mapping-main-area {
  contain: none !important;
}

body.preparation-mode:not([data-step="3"]) .screen {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.side-rail {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(180deg, #071e36, #092a4c 70%, #061c33);
  border-right: 1px solid #11365b;
  overflow-y: auto;
  overflow-x: hidden;
  user-select: none;
  z-index: 50;
  box-sizing: border-box;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  min-height: 52px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.app-shell.sidebar-collapsed .rail-header {
  padding: 0 8px;
  justify-content: center;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #dbeafe;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  flex: 0 0 28px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: scale(1.05);
  border-color: #38bdf8;
}

.sidebar-toggle .toggle-icon {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-collapsed .sidebar-toggle .toggle-icon,
.side-rail.collapsed .sidebar-toggle .toggle-icon {
  transform: rotate(180deg);
}

.brand-mark {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-symbol {
  display: flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}

.brand-symbol svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #38bdf8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-text {
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.app-shell.sidebar-collapsed .brand-text,
.side-rail.collapsed .brand-text,
.app-shell.sidebar-collapsed .rail-text,
.side-rail.collapsed .rail-text,
.app-shell.sidebar-collapsed .rail-step span:not(.rail-icon),
.side-rail.collapsed .rail-step span:not(.rail-icon) {
  display: none !important;
}

.app-shell.sidebar-collapsed .brand-mark {
  justify-content: center;
  padding: 10px 0;
}

.app-shell.sidebar-collapsed .rail-step,
.app-shell.sidebar-collapsed .rail-link {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

.app-shell.sidebar-collapsed .rail-step .rail-icon {
  margin: 0;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  padding-top: 14px;
}

.rail-step,
.rail-link {
  position: relative;
  display: flex;
  min-height: 46px;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 550;
  box-sizing: border-box;
}

.rail-step svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-step:hover,
.rail-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.rail-step.active {
  color: #fff;
  background: #0284c7;
  font-weight: 700;
}

.rail-step.active::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #38bdf8;
  content: "";
}

.rail-step:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.rail-footer {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  background: var(--surface);
}

.release-notice {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(430px, calc(100vw - 32px));
  padding: 16px 14px 16px 18px;
  box-sizing: border-box;
  border: 1px solid #b7d6eb;
  border-left: 4px solid #1682b8;
  border-radius: 8px;
  background: #f7fcff;
  box-shadow: 0 12px 30px rgba(24, 56, 82, .16);
  color: #17324a;
}

.release-notice[hidden] { display: none; }
.release-notice-content { min-width: 0; }
.release-notice-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #32617f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.release-notice-eyebrow time { margin-left: 8px; font-weight: 600; }
.release-notice-content strong { display: block; font-size: 16px; line-height: 1.35; }
.release-notice-content p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.release-notice-dismiss {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #32617f;
  font-size: 24px;
  line-height: 1;
}
.release-notice-dismiss:hover { background: #e6f3fb; }
@media (max-width: 640px) {
  .release-notice { top: 12px; right: 16px; }
}
@media print {
  .release-notice { display: none !important; }
}

/* ==========================================================================
   Preparation Mode Topbar
   ========================================================================== */
.topbar {
  display: none;
  min-height: 52px;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  z-index: 40;
  box-sizing: border-box;
}

.topbar-product {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-product h1 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.topbar-product p {
  margin: 0;
  color: #64748b;
  font-size: 10px;
}

.topbar-filing {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  justify-content: center;
}

.topbar-workflow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 6px;
}

.topbar-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s ease-in-out;
}

.topbar-step:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
}

.topbar-step.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 700;
}

.topbar-step.done {
  color: #059669;
}

.topbar-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  font-size: 9.5px;
  font-weight: 700;
}

.topbar-step.active .topbar-step-num {
  background: #0284c7;
  color: #ffffff;
}

.topbar-step.done .topbar-step-num {
  background: #059669;
  color: #ffffff;
}

.topbar-step-sep {
  color: #94a3b8;
  font-size: 11px;
}

.topbar-company-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  max-width: 380px;
}

.topbar-company-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-company-meta {
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-framework-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-open-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #f8fbff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease-in-out;
  white-space: nowrap;
  box-shadow: none;
}

.topbar-tool svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  stroke: currentColor;
  fill: none;
}

.topbar-tool:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.topbar-tool.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.topbar-save {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
}

.topbar-save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(5,150,105,0.25);
  border-radius: 9999px;
  padding: 3px 9px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-save-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.topbar-save-status.is-busy {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.topbar-save-status.is-busy::before {
  width: 9px;
  height: 9px;
  border: 2px solid #bfdbfe;
  border-top-color: currentColor;
  background: transparent;
  animation: spin 0.8s linear infinite;
}

.privacy-lock {
  display: none;
}

.stepper {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

.step {
  display: grid;
  grid-template-columns: 30px minmax(0, auto) 1fr;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ink-650);
  font-size: 13px;
  font-weight: 560;
}

.step:last-child {
  grid-template-columns: 30px minmax(0, auto);
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #aebbc8;
  border-radius: 50%;
  color: var(--ink-650);
  background: var(--surface);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-line {
  height: 1px;
  margin-left: 7px;
  background: #9dadbd;
}

.step.active {
  color: var(--teal-700);
  font-weight: 720;
}

.step.active .step-number,
.step.done .step-number {
  border-color: var(--teal-700);
  color: #fff;
  background: var(--teal-700);
}

.step.done {
  color: var(--ink-800);
}

.filing-context {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

.filing-context.visible {
  display: flex;
}

.context-framework {
  color: var(--ink-950);
  font-weight: 700;
}

.context-dot {
  color: #9cabb9;
}

.screen {
  min-height: calc(100vh - 138px);
}

.screen.with-context {
  min-height: calc(100vh - 180px);
}

.section-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h2,
.panel-heading h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 23px;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.page-heading p {
  max-width: 690px;
  margin: 8px 0 0;
  color: var(--ink-650);
  font-size: 14px;
  line-height: 1.55;
}

.local-note {
  display: flex;
  max-width: 320px;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--teal-600);
  color: var(--ink-650);
  background: #f0f8f7;
  font-size: 12px;
  line-height: 1.45;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.upload-field {
  position: relative;
  display: flex;
  min-height: 258px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.upload-field.dragover {
  border-color: var(--teal-600);
  background: #f3fbfa;
  box-shadow: 0 0 0 3px rgba(0, 135, 129, 0.12);
}

.upload-field.is-loaded {
  border-color: #8dbfb7;
}

.upload-field h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.upload-field p {
  margin: 7px 0 0;
  color: var(--ink-650);
  font-size: 13px;
  line-height: 1.5;
}

.upload-target {
  display: grid;
  min-height: 112px;
  place-items: center;
  margin-top: 20px;
  padding: 20px;
  border: 1px dashed #91a5b8;
  border-radius: var(--radius-sm);
  color: var(--ink-650);
  background: var(--surface-muted);
  text-align: center;
}

.upload-target strong {
  display: block;
  margin-top: 8px;
  color: var(--ink-800);
  font-size: 13px;
}

.upload-target span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.upload-target svg {
  width: 31px;
  fill: none;
  stroke: var(--teal-700);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.upload-input {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  padding: 5px;
  border: 1px solid #b8c5d1;
  border-radius: var(--radius-sm);
  color: var(--ink-650);
  background: var(--surface);
  font-size: 11px;
}

.upload-input::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  padding: 4px 10px;
  border: 1px solid var(--nav-800);
  border-radius: 4px;
  color: var(--nav-900);
  background: #f6f9fc;
  font: inherit;
  font-weight: 680;
  cursor: pointer;
}

.file-result {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid #b8d8d3;
  border-radius: var(--radius-sm);
  background: #f6fbfa;
}

.file-result.is-ocr {
  border-color: #a9d2cd;
  background: #f5fbfa;
}

.file-result.is-warning {
  border-color: #e4c98e;
  background: #fffaf0;
}

.file-icon {
  display: grid;
  width: 38px;
  height: 42px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #d6e0e8;
  border-radius: 5px;
  color: var(--teal-700);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.file-copy {
  min-width: 0;
}

.file-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-950);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  display: block;
  margin-top: 4px;
  color: var(--success);
  font-size: 11px;
}

.file-copy small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
}

.ocr-evidence {
  color: var(--teal-700);
}

.ocr-warning {
  color: #95620b;
  font-weight: 680;
}

.ocr-timing {
  color: var(--ink-600);
  font-size: 10px;
}

.processing-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-700);
  font-size: 12px;
}

.processing-target {
  min-height: 132px;
}

.processing-copy {
  width: min(100%, 360px);
}

.processing-copy strong,
.processing-copy > span:not(.spinner) {
  display: block;
}

.processing-copy .spinner {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 5px;
}

.processing-copy strong {
  display: inline;
  color: var(--ink-800);
  font-size: 13px;
}

.processing-copy > span:not(.spinner) {
  margin-top: 7px;
  color: var(--ink-650);
  font-size: 11px;
}

.ocr-progress-track {
  height: 6px;
  margin: 12px 0 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe8e6;
}

.ocr-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal-700);
  transition: width 160ms ease;
}

.ocr-review-list {
  margin-top: 8px;
  color: var(--ink-700);
  font-size: 11px;
}

.ocr-review-list summary {
  color: #95620b;
  cursor: pointer;
  font-weight: 700;
}

.ocr-review-list ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.ocr-review-list li {
  display: grid;
  gap: 2px;
}

.ocr-review-list li span {
  display: inline;
  margin: 0;
  color: #95620b;
  font-size: 10px;
}

.ocr-review-list li small {
  overflow: hidden;
  color: var(--ink-650);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-copy .button {
  min-height: 31px;
  padding: 5px 11px;
  font-size: 11px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #badbd7;
  border-top-color: var(--teal-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button.is-loading svg,
.button.is-loading svg,
.topbar-tool.is-loading svg,
button.is-refreshing svg,
.button.is-refreshing svg,
.topbar-tool.is-refreshing svg {
  animation: spin 0.8s linear infinite;
}

.refresh-statements-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.source-actions,
.reference-actions,
.page-actions,
.toolbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reference-actions {
  flex-wrap: wrap;
}

.source-actions {
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-200);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--nav-800);
  border-radius: var(--radius-sm);
  color: var(--nav-900);
  background: var(--surface);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) {
  background: #eef5fa;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--teal-700);
  color: #fff;
  background: var(--teal-700);
}

.button.primary:hover:not(:disabled) {
  border-color: #00645f;
  background: #006c67;
}

.button.danger {
  border-color: #db9ca3;
  color: #9f1e2c;
}

.button.ghost {
  border-color: transparent;
  color: var(--ink-650);
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.button svg,
.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.scope-note {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  color: var(--ink-650);
  background: var(--surface-muted);
  font-size: 12px;
  line-height: 1.55;
}

.scope-note strong {
  color: var(--ink-800);
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}

.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-300);
  font-size: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--ink-650);
  font-size: 11px;
  font-weight: 650;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #b8c5d1;
  border-radius: var(--radius-sm);
  color: var(--ink-950);
  background: var(--surface);
  font-size: 13px;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(202, 37, 52, 0.1);
}

.helper {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.4;
}

.setup-aside {
  align-self: start;
  border-left: 1px solid var(--line-300);
  padding-left: 24px;
}

.setup-aside h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.extraction-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.extraction-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-200);
}

.extraction-list .check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 11px;
}

.extraction-list strong {
  display: block;
  font-size: 12px;
}

.extraction-list span {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.35;
}

/* Setup Wizard Tab Bar & Panels */
.setup-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.setup-tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.setup-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.setup-tab.active {
  background: #ffffff;
  color: #1e40af;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.setup-tab .tab-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
}

.setup-tab.active .tab-step {
  background: #2563eb;
  color: #ffffff;
}

.setup-panel {
  display: none;
}

.setup-panel.active {
  display: block;
}

.setup-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-300);
}

/* Intake Health Banner & Feature Cards */
.intake-health-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 20px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.intake-health-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intake-health-stat span:first-child {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.intake-health-stat strong {
  font-size: 14px;
  color: #0f172a;
  font-weight: 700;
}

.intake-feature-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.intake-feature-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.intake-feature-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.intake-feature-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #64748b;
}

/* Validation Filter Bar */
.validation-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
}

.validation-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.validation-filter-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.validation-filter-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.validation-filter-tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.validation-filter-tab.active .badge.error { background: #fee2e2; color: #b91c1c; }
.validation-filter-tab.active .badge.warning { background: #fef3c7; color: #b45309; }
.validation-filter-tab.active .badge.passed { background: #dcfce7; color: #15803d; }
.validation-filter-tab.active .badge.all { background: #e2e8f0; color: #334155; }

.validation-screen {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 180px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-300);
}

.mapping-toolbar h2,
.validation-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 730;
  letter-spacing: -0.018em;
}

.mapping-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.mapping-heading span {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 560;
}

.quick-review-button {
  gap: 8px;
  border-color: #79b2ae;
  color: var(--teal-700);
  background: #eef8f7;
  white-space: nowrap;
}

.quick-review-button:hover,
.quick-review-button.active {
  border-color: var(--teal-700);
  color: #fff;
  background: var(--teal-700);
}

.quick-review-button > span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.quick-review-button.active > span,
.quick-review-button:hover > span {
  color: var(--teal-700);
}

.full-coverage {
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--line-300);
  background: var(--surface-muted);
}

.coverage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.coverage-summary .eyebrow {
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coverage-summary h3 {
  margin: 3px 0 2px;
  font-size: 14px;
}

.coverage-summary p {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
}

.coverage-meter {
  display: grid;
  min-width: 150px;
  grid-template-columns: 42px 108px;
  align-items: center;
  gap: 9px;
}

.coverage-meter strong {
  color: var(--ink-800);
  font-size: 14px;
}

.coverage-meter > span {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-200);
}

.coverage-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal-600);
}

.coverage-sections {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.coverage-section {
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.coverage-section.missing {
  border-color: #efd8b1;
  background: var(--warning-bg);
}

.coverage-section.attention {
  border-color: #b9d2e8;
  background: #f3f8fd;
}

.coverage-status {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--surface);
  background: var(--success);
  font-size: 10px;
  font-weight: 800;
}

.coverage-section.missing .coverage-status {
  background: var(--warning);
}

.coverage-section.attention .coverage-status {
  background: var(--blue-600);
}

.coverage-section strong,
.coverage-section small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-section strong {
  color: var(--ink-800);
  font-size: 10px;
}

.coverage-section small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.coverage-open {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid var(--line-300);
  border-radius: 5px;
  color: var(--blue-600);
  background: var(--surface);
  font-size: 9px;
  font-weight: 680;
}

.full-section-editor {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.full-section-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-300);
  background: #eef4f8;
}

.full-section-editor h3 {
  margin: 2px 0;
  font-size: 14px;
}

.full-section-editor p {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
}

.full-section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.full-fact-list {
  max-height: 420px;
  overflow-y: auto;
}

.full-fact-item {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 34%);
  gap: 18px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-200);
}

.full-fact-item:last-child {
  border-bottom: 0;
}

.full-fact-item.missing {
  background: #fffbf3;
}

.full-fact-item.unreviewed {
  background: #f7faff;
}

.full-fact-copy {
  min-width: 0;
}

.full-fact-copy strong,
.full-fact-copy small,
.full-fact-copy span {
  display: block;
}

.full-fact-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.full-fact-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-500);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-fact-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 2px;
  color: var(--ink-800);
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.full-fact-copy span {
  color: var(--ink-500);
  font-size: 9px;
}

.full-fact-entry {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 5px;
}

.full-fact-entry textarea {
  resize: vertical;
}

.full-review-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-800);
  font-size: 10px;
}

.full-review-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal-700);
}

.full-fact-status {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-bg);
  font-size: 8px;
  font-weight: 720;
  text-transform: uppercase;
}

.full-fact-status.missing {
  color: var(--error);
  background: var(--error-bg);
}

.full-fact-status.unreviewed {
  color: var(--warning);
  background: var(--warning-bg);
}

.full-controlled-select {
  display: grid;
  gap: 4px;
}

.full-controlled-select > span {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.full-controlled-select .select {
  min-height: 36px;
  font-size: 10px;
}


.quick-review-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid #b9dcd8;
  border-bottom: 1px solid #b9dcd8;
  color: var(--ink-650);
  background: #eef8f7;
  font-size: 11px;
}

.quick-review-strip > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.quick-review-strip strong {
  color: var(--teal-700);
  font-size: 13px;
}

.quick-review-strip-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-review-strip-actions > span {
  color: var(--teal-700);
  font-weight: 720;
  white-space: nowrap;
}

.authority-review-queue {
  padding: 13px 20px 14px;
  border-bottom: 1px solid var(--line-300);
  background: #fbfcfd;
}

.authority-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.authority-review-header h4 {
  margin: 2px 0 3px;
  color: var(--ink-950);
  font-size: 13px;
}

.authority-review-header p,
.authority-reason,
.authority-scope-note,
.authority-unmapped-note {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.45;
}

.authority-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.authority-filter {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--line-300);
  border-radius: 6px;
  color: var(--ink-650);
  background: var(--surface);
  font-size: 10px;
  white-space: nowrap;
}

.authority-filter strong { margin-right: 3px; color: var(--ink-950); }
.authority-filter.active { border-color: #79b2ae; color: var(--teal-700); background: #eef8f7; }

.authority-queue-list {
  display: grid;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: 8px;
}

.authority-queue-item {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(260px, 1.45fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-300);
  background: var(--surface);
}

.authority-queue-item:last-child { border-bottom: 0; }
.authority-queue-source,
.authority-queue-target { display: grid; gap: 3px; min-width: 0; }
.authority-queue-source strong,
.authority-queue-target > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.authority-queue-source small,
.authority-queue-target small { color: var(--ink-500); font-size: 9px; }
.authority-queue-target { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.authority-queue-target small { grid-column: 2; }

.authority-status {
  display: inline-flex;
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 760;
  white-space: nowrap;
}

.authority-status.auto-mapped { color: #087b68; background: #dff5ef; }
.authority-status.needs-confirmation { color: #915600; background: #fff0cb; }
.authority-status.unmapped { color: #b23348; background: #fde7eb; }
.authority-status.confirmed-by-reviewer { color: #176c55; background: #e1f2e9; }
.authority-status.not-assessed { color: var(--ink-500); background: var(--line-200); }
.authority-empty { margin: 0; padding: 12px; color: var(--ink-500); font-size: 11px; }

.authority-inspector-section {
  padding: 11px;
  border: 1px solid #b9dcd8;
  border-radius: var(--radius-sm);
  background: #f4fbfa;
}

.authority-inspector-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.authority-mapping-summary { display: grid; gap: 3px; margin: 9px 0; padding: 8px; border-radius: 5px; background: #fff; }
.authority-mapping-summary strong { font-size: 11px; }
.authority-mapping-summary small { color: var(--ink-500); font-size: 9px; }
.authority-inspector-section .select { width: 100%; margin: 5px 0 8px; }
.authority-inspector-section .button { width: 100%; }
.authority-scope-note { margin-top: 8px; }

.mbrs-active-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-300);
  background: #eef4f8;
}

.mbrs-active-actions,
.mbrs-adjacent-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mbrs-adjacent-nav .button {
  min-height: 30px;
}

.mbrs-section-pill {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--teal-700);
  background: var(--teal-100);
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

.mbrs-statement-workspace {
  min-width: 0;
  background: var(--surface-muted);
}

.mbrs-disclosure-workspace {
  padding: 0 20px 20px;
  background: var(--surface-muted);
}

.mbrs-disclosure-workspace .full-section-editor {
  margin-top: 20px;
}

.mbrs-sheet {
  width: calc(100% - 28px);
  min-width: 0;
  margin: 14px;
  overflow: hidden;
  border: 1px solid #adb7c2;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 35, 62, .08);
}

.mbrs-sheet-registration {
  display: flex;
  gap: 5px;
  padding: 13px 16px 4px;
  color: #1d2937;
  font-size: 10px;
}

.mbrs-sheet-header {
  padding: 4px 18px 13px;
  text-align: center;
}

.mbrs-sheet-header h3,
.mbrs-sheet-header h4,
.mbrs-sheet-header p {
  margin: 2px 0;
}

.mbrs-sheet-header h3 {
  color: #17243a;
  font-size: 14px;
  letter-spacing: .01em;
}

.mbrs-sheet-header h4 {
  margin-top: 10px;
  color: #17243a;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mbrs-sheet-header p {
  color: #3d4d61;
  font-size: 10px;
}

.mbrs-sheet-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.mbrs-sheet-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.mbrs-sheet-table th,
.mbrs-sheet-table td {
  border: 1px solid #c3ccd5;
}

.mbrs-sheet-table thead th {
  padding: 7px 8px;
  color: #26384c;
  background: #eef3f7;
  text-align: center;
  font-weight: 730;
}

.mbrs-sheet-table thead th:first-child {
  width: 25%;
  text-align: left;
}

.mbrs-sheet-table thead th:nth-child(2) { width: 35%; }
.mbrs-sheet-table thead th:nth-child(3),
.mbrs-sheet-table thead th:nth-child(4) { width: 15%; }
.mbrs-sheet-table thead th:last-child { width: 10%; }

.mbrs-sheet-table thead small {
  display: block;
  margin-top: 2px;
  color: #607188;
  font-size: 8px;
}

.mbrs-sheet-table tbody td {
  height: 46px;
  padding: 6px 8px;
  color: #24364a;
  vertical-align: middle;
}

.mbrs-sheet-table tbody tr:not(.mbrs-sheet-section-row):not(.mtool-workbook-heading-row):hover,
.mbrs-sheet-table tbody tr.selected {
  background: #f0f6fc;
}

.mbrs-sheet-table tbody td:first-child strong,
.mbrs-sheet-table tbody td:first-child small {
  display: block;
}

.mbrs-sheet-table tbody td:first-child strong {
  font-size: 10px;
}

.mbrs-sheet-table tbody td:first-child small {
  margin-top: 3px;
  color: #6b7a8d;
  font-size: 8px;
}

.mbrs-sheet-section-row th {
  padding: 5px 9px;
  color: #132e50;
  background: #dbe6f0;
  text-align: left;
  font-size: 10px;
}

.mtool-workbook-heading-row th {
  padding: 5px 10px;
  border-bottom: 1px dotted #9baabc;
  color: #142e4e;
  background: #f2f5f7;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
}

.statement-total-row td {
  border-top: 1px solid var(--line-300);
  border-bottom: 3px double var(--ink-950);
  background: var(--surface-muted) !important;
  font-weight: 700;
  color: var(--ink-950);
}

.mtool-required-mark {
  margin-right: 1px;
  color: #d12035;
}

.mbrs-taxonomy-select {
  width: 100%;
  min-height: 31px;
  padding: 4px 24px 4px 7px;
  border: 1px solid #9baab8;
  border-radius: 2px;
  color: #1f334b;
  background: linear-gradient(#fff, #f1f3f5);
  font-size: 9px;
}

.mbrs-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.mbrs-sheet-review {
  text-align: center;
}

.mbrs-sheet-review .evidence-link {
  display: block;
  margin: 3px auto 0;
  font-size: 8px;
}

.mbrs-sheet-empty {
  padding: 28px;
  text-align: center;
}

.mbrs-sheet footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: #627188;
  background: #f8fafc;
  font-size: 8px;
}

.mbrs-sheet footer strong {
  color: #b83232;
}

.fact-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 28, 54, .52);
  backdrop-filter: blur(2px);
}

.fact-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(4, 29, 55, .28);
}

.fact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-300);
  background: #eef4f8;
}

.fact-modal-header strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-950);
  font-size: 13px;
}

.fact-modal-content.inspector {
  max-height: calc(100vh - 125px);
  overflow-y: auto;
  padding: 18px;
  border-left: 0;
  background: var(--surface);
}

.fact-modal-content .inspector-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-coverage > summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style-position: inside;
}

.full-coverage[open] > summary {
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  min-width: 230px;
}

.search-box input {
  min-height: 36px;
  padding-left: 34px;
}

.search-box svg {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 18px;
  fill: none;
  stroke: var(--ink-500);
  stroke-width: 1.7;
}

.mapping-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: 238px minmax(540px, 1fr) 300px;
}

.source-rail {
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line-300);
  background: var(--surface);
}

.source-rail h3,
.inspector h3,
.export-panel h3 {
  margin: 0 0 15px;
  font-size: 14px;
}

.source-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.source-list::before {
  position: absolute;
  top: 21px;
  bottom: 21px;
  left: -5px;
  width: 2px;
  background: #b7ddd8;
  content: "";
}

.source-card {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 12px 10px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.source-card > span {
  min-width: 0;
}

.source-card::before {
  position: absolute;
  top: 20px;
  left: -12px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--teal-700);
  content: "✓";
  font-size: 8px;
}

.source-card strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card span {
  display: block;
  margin-top: 4px;
  color: var(--success);
  font-size: 10px;
}

.source-card small {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.section-index {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-200);
}

.section-index h4 {
  margin: 0 0 6px;
  color: var(--ink-650);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-index button {
  display: grid;
  min-height: 34px;
  grid-template-columns: 1fr 24px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-650);
  background: transparent;
  text-align: left;
  font-size: 10px;
}

.section-index button:hover {
  color: var(--nav-900);
  background: var(--surface-muted);
}

.section-index button strong {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-100);
  font-size: 9px;
}

.facts-region {
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
  background: var(--surface);
}

.fact-section {
  position: relative;
  min-width: 0;
  border-bottom: 8px solid var(--surface-muted);
}

.fact-section:last-child {
  border-bottom: 0;
}

.fact-section-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px 8px 16px;
  border-top: 1px solid var(--line-300);
  border-bottom: 1px solid var(--line-300);
  background: #eef4f8;
}

.fact-section:first-child .fact-section-header {
  border-top: 0;
}

.fact-section-header h3 {
  margin: 0;
  color: var(--ink-950);
  font-size: 13px;
  font-weight: 730;
}

.fact-section-header span {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.fact-section .facts-table th {
  position: static;
}

.fact-table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.facts-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.facts-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 48px;
  padding: 8px 10px;
  border-right: 1px solid var(--line-200);
  border-bottom: 1px solid var(--line-300);
  color: var(--ink-650);
  background: #f8fafc;
  text-align: left;
  font-size: 10px;
  font-weight: 680;
}

.facts-table td {
  height: 58px;
  padding: 8px 10px;
  border-right: 1px solid var(--line-200);
  border-bottom: 1px solid var(--line-200);
  color: var(--ink-800);
  vertical-align: middle;
}

.facts-table tr {
  transition: background 100ms ease;
}

.facts-table tbody tr:hover,
.facts-table tbody tr.selected {
  background: var(--surface-selected);
}

.facts-table tbody tr {
  cursor: pointer;
}

.facts-table .col-review { width: 58px; text-align: center; }
.facts-table .col-source { width: 185px; }
.facts-table .col-value { width: 112px; }
.facts-table .col-concept { width: 245px; }
.facts-table .col-confidence { width: 82px; }
.facts-table .col-evidence { width: 66px; }

.money {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-cell strong {
  display: block;
  font-size: 11px;
  font-weight: 630;
}

.source-cell span {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.table-select {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #adbdca;
  border-radius: 5px;
  color: var(--ink-800);
  background: #fff;
  font-size: 10px;
}

.confidence {
  font-weight: 650;
}

.confidence.high { color: var(--success); }
.confidence.medium { color: var(--warning); }
.confidence.low { color: var(--error); }

.review-check {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--teal-700);
}

.evidence-link {
  border: 0;
  color: var(--blue-600);
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
}

.inspector {
  min-width: 0;
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid var(--line-300);
  background: #fbfcfd;
}

.inspector-section {
  margin-bottom: 20px;
}

.inspector-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
}

.evidence-source {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-800);
  font-size: 11px;
}

.evidence-source svg {
  width: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.mapping-ocr-status {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--ink-500);
  background: var(--surface-100);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.mapping-ocr-status.review-required {
  color: var(--danger-700, #a33a32);
  background: var(--danger-100, #fde9e7);
}

.page-citation {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 650;
}

.evidence-excerpt {
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  color: var(--ink-800);
  background: var(--surface);
  font-size: 11px;
  line-height: 1.55;
}

.inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inspector-grid .field.full {
  grid-column: 1 / -1;
}

.inspector .input,
.inspector .select {
  min-height: 36px;
  font-size: 11px;
}

.bottom-rail {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 22px;
  border-top: 1px solid var(--line-300);
  background: var(--surface);
}

.health-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-800);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.health-dot {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.health-dot.success { background: var(--success); }
.health-dot.warning { background: var(--warning); }
.health-dot.error { background: var(--error); }

.empty-table {
  padding: 60px 20px;
  color: var(--ink-500);
  text-align: center;
  font-size: 13px;
}

.validation-screen {
  grid-template-rows: minmax(0, 1fr) auto;
}

.validation-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.validation-main {
  min-width: 0;
  overflow: auto;
  padding: 20px 22px 28px;
}

.validation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.validation-health {
  display: grid;
  width: min(470px, 100%);
  grid-template-columns: 72px repeat(3, 1fr);
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.health-shield {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  margin: 8px 10px;
  border: 2px solid var(--teal-700);
  border-radius: 50%;
  color: var(--teal-700);
  font-size: 22px;
}

.validation-count {
  min-height: 48px;
  padding: 5px 14px;
  border-left: 1px solid var(--line-200);
}

.validation-count strong {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.validation-count span {
  color: var(--ink-650);
  font-size: 10px;
}

.validation-count.error strong { color: var(--error); }
.validation-count.warning strong { color: var(--warning); }
.validation-count.passed strong { color: var(--success); }

.validation-group {
  margin-top: 18px;
}

.validation-group h3 {
  margin: 0;
  padding: 0 0 7px;
  border-bottom: 1px solid #aebdcb;
  font-size: 14px;
}

.validation-row {
  display: grid;
  grid-template-columns: 108px 78px minmax(220px, 1fr) minmax(150px, 0.65fr) 68px;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--line-200);
  color: var(--ink-800);
  font-size: 10px;
}

.validation-row > * {
  min-width: 0;
  padding: 8px 10px;
}

.severity {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  text-transform: capitalize;
}

.severity-mark {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
}

.severity.passed { color: var(--success); }
.severity.warning { color: var(--warning); }
.severity.error { color: var(--error); }

.validation-row.warning {
  border-color: #efd6a7;
  background: #fffbf3;
}

.validation-row.error {
  border-color: #efb8be;
  background: #fff7f8;
}

.row-action {
  border: 0;
  color: var(--blue-600);
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
}

.export-panel {
  overflow-y: auto;
  padding: 20px 20px 26px;
  border-left: 1px solid var(--line-300);
  background: #fbfcfd;
}

.package-detail {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line-200);
}

.package-detail:first-of-type {
  border-top-color: var(--line-300);
}

.package-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--nav-900);
  font-size: 15px;
}

.package-detail span {
  display: block;
  color: var(--ink-500);
  font-size: 10px;
}

.package-detail strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 570;
  line-height: 1.45;
}

.acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-300);
  color: var(--ink-800);
  font-size: 11px;
  line-height: 1.4;
}

.acknowledgement input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal-700);
}

.export-panel .button {
  width: 100%;
  margin-top: 9px;
}

.mtool-callout {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #91b7df;
  border-radius: var(--radius-sm);
  color: #26466b;
  background: #f3f8fd;
  font-size: 11px;
  line-height: 1.5;
}

.validation-log {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-top: 1px solid var(--line-300);
  color: var(--ink-650);
  background: var(--surface);
  font-size: 11px;
}

.log-title {
  color: var(--ink-950);
  font-weight: 650;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  width: min(380px, calc(100vw - 40px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  border: 1px solid #88b7b0;
  border-radius: var(--radius-sm);
  color: #123b37;
  background: #f0faf8;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.45;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: #df9ca4;
  color: #7c1d28;
  background: #fff4f5;
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .coverage-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-workspace {
    grid-template-columns: 200px minmax(520px, 1fr);
  }

  .mbrs-workspace {
    display: block;
  }

  .mbrs-workspace .source-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line-300);
  }

  .mbrs-workspace .source-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mbrs-workspace .source-list::before,
  .mbrs-workspace .source-card::before {
    display: none;
  }

  .mapping-workspace .inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 180px minmax(260px, 1fr) 1fr;
    gap: 18px;
    border-top: 1px solid var(--line-300);
    border-left: 0;
  }

  .inspector > h3 {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

@media (max-width: 860px) {
  .topbar h1 { font-size: 19px; }
  .privacy-lock span { display: none; }

  .stepper {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 12px;
  }

  .step,
  .step:last-child {
    grid-template-columns: 28px 1fr;
    gap: 5px;
  }

  .step-line { display: none; }
  .step-label { font-size: 10px; }

  .filing-context {
    min-width: 0;
    max-width: 100vw;
    overflow-x: auto;
    padding-inline: 16px;
    white-space: nowrap;
  }

  .section-page {
    padding: 22px 16px;
  }

  .page-heading {
    flex-direction: column;
  }

  .local-note { max-width: none; }
  .upload-grid,
  .setup-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.wide { grid-column: auto; }

  .setup-aside {
    border-top: 1px solid var(--line-300);
    border-left: 0;
    padding-top: 22px;
    padding-left: 0;
  }

  .source-actions,
  .bottom-rail,
  .validation-log {
    align-items: stretch;
    flex-direction: column;
  }

  .mapping-toolbar {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .mbrs-navigator-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .mbrs-section-picker {
    width: 100%;
    min-width: 0;
  }

  

  .mbrs-active-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .mbrs-sheet {
    width: calc(100% - 20px);
    margin: 10px;
  }

  .coverage-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .full-section-editor > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .full-section-actions {
    justify-content: flex-start;
  }

  .toolbar-actions {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toolbar-actions .quick-review-button {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .quick-review-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .quick-review-strip > div {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .quick-review-strip-actions {
    width: 100%;
    justify-content: space-between;
  }

  .authority-review-header,
  .authority-queue-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .authority-review-header { flex-direction: column; }
  .authority-filter-row { justify-content: flex-start; }
  .authority-queue-target { grid-template-columns: auto minmax(0, 1fr); }
  .authority-queue-item .button { width: 100%; }

  .search-box {
    width: 100%;
    min-width: 0;
  }

  .mapping-workspace {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .source-rail {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line-300);
  }

  .source-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-index h4 {
    grid-column: 1 / -1;
  }

  .source-list::before,
  .source-card::before {
    display: none;
  }

  .facts-region {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 520px;
  }

  .mapping-workspace .inspector {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .health-summary {
    justify-content: space-between;
    gap: 8px;
  }

  .validation-layout {
    grid-template-columns: 1fr;
  }

  .export-panel {
    border-top: 1px solid var(--line-300);
    border-left: 0;
  }

  .validation-row {
    grid-template-columns: 96px 70px minmax(180px, 1fr) 56px;
  }

  .validation-row .validation-source {
    display: none;
  }
}

@media (max-width: 560px) {
  .step-label {
    display: none;
  }

  

.mbrs-active-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .mbrs-adjacent-nav .button {
    flex: 1;
  }

  .fact-modal-backdrop {
    padding: 10px;
  }

  .fact-modal {
    max-height: calc(100vh - 20px);
  }

  .fact-modal-content.inspector {
    max-height: calc(100vh - 98px);
  }

  .fact-modal-content .inspector-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mbrs-sheet footer {
    flex-direction: column;
  }

  .step,
  .step:last-child {
    display: flex;
    justify-content: center;
  }

  .page-heading h2 { font-size: 21px; }

  .coverage-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .coverage-meter {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .coverage-sections {
    grid-template-columns: 1fr;
  }

  .full-fact-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .upload-grid { gap: 14px; }
  .upload-field { min-height: 230px; }

  .source-actions .button,
  .bottom-rail .button {
    width: 100%;
  }

  .page-actions,
  .button-row {
    width: 100%;
    flex-direction: column-reverse;
  }

  .page-actions .button,
  .button-row .button {
    width: 100%;
  }

  .source-list { grid-template-columns: minmax(0, 1fr); }
  .health-summary { flex-wrap: wrap; }
  .validation-health { grid-template-columns: 58px repeat(3, 1fr); }
  .health-shield { width: 40px; height: 40px; margin: 8px; }
  .validation-count { padding-inline: 8px; }
  .validation-count strong { font-size: 17px; }

  .validation-row {
    grid-template-columns: 92px 64px 1fr;
    padding: 4px 0;
  }

  .validation-row .validation-source,
  .validation-row .row-action {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.form-section-intro,
.form-section-note {
  margin: -3px 0 16px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.55;
}

.form-section-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue-600);
  background: var(--surface-muted);
}

.field-checkbox {
  min-height: 84px;
  justify-content: center;
  padding: 13px 14px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.checkbox-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--teal-700);
}

.checkbox-control strong {
  color: var(--ink-800);
  font-size: 13px;
  line-height: 1.35;
}

.mtool-sheet-guidance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-300);
  border-bottom: 1px solid var(--line-300);
  background: #f7fafc;
  color: var(--ink-650);
  font-size: 11px;
}

.mtool-sheet-guidance strong {
  color: var(--ink-950);
}

.mbrs-sheet-table {
  min-width: 720px;
}

.mbrs-sheet-table th:first-child {
  width: 44%;
}

.mbrs-sheet-table th:nth-child(n + 2) {
  min-width: 180px;
}

.mtool-concept {
  display: block;
  max-width: 420px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-500);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mtool-value-cell {
  min-width: 188px;
  padding: 8px !important;
  background: #fff;
  vertical-align: top;
}

.statement-sheet-table {
  min-width: 700px;
}

.statement-sheet-table col.statement-line-column {
  width: 42%;
}

.statement-sheet-table col.statement-period-column {
  width: 29%;
}

.statement-sheet-table.has-details-column col.statement-line-column {
  width: 38%;
}

.statement-sheet-table.has-details-column col.statement-period-column {
  width: 25%;
}

.statement-sheet-table.has-details-column col.statement-detail-column {
  width: 12%;
}

.mbrs-sheet-table.statement-sheet-table thead th:first-child,
.mbrs-sheet-table.statement-sheet-table thead th:nth-child(n + 2),
.statement-sheet-table .mtool-value-cell {
  width: auto;
  min-width: 0;
}

.statement-sheet-table .mtool-value-cell {
  padding: 5px 7px !important;
  vertical-align: middle;
}

.statement-sheet-table .mtool-template-control {
  min-height: 34px;
}

.statement-cell-control {
  position: relative;
}

.statement-formula-mark {
  position: absolute;
  top: 50%;
  left: 8px;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mtool-value-cell.formula-locked .mtool-formula-output {
  padding-left: 34px;
  background: var(--surface-muted);
  font-style: italic;
  color: var(--ink-800);
}

.statement-cell-meta {
  min-height: 16px;
  margin-top: 3px;
}

.statement-cell-meta .mtool-source-badge {
  min-height: 16px;
  padding: 1px 5px;
  font-size: 8px;
}

.statement-cell-meta .mtool-review-toggle {
  gap: 3px;
  font-size: 9px;
}

.statement-cell-meta .mtool-review-toggle input {
  width: 13px;
  height: 13px;
}

.statement-detail-heading,
.statement-detail-cell {
  width: 96px;
  min-width: 82px !important;
  padding: 5px 7px !important;
  text-align: center;
  vertical-align: middle;
}

.mtool-see-details {
  appearance: none;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: #145fc0;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mtool-see-details:hover {
  color: #0a3f86;
}

.mtool-see-details:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

.statement-detail-target > td {
  background: #eaf9f7 !important;
  box-shadow: inset 0 1px 0 #65bfb5, inset 0 -1px 0 #65bfb5;
}

.statement-detail-target > td:first-child {
  box-shadow: inset 3px 0 0 var(--teal-700), inset 0 1px 0 #65bfb5, inset 0 -1px 0 #65bfb5;
}

.statement-detail-target {
  scroll-margin-top: 150px;
}

.mtool-value-cell.auto-zero {
  background: #fffaf0;
}

.mtool-value-cell.unavailable {
  color: var(--ink-500);
  text-align: center;
  vertical-align: middle;
}

.mtool-template-control {
  width: 100%;
  min-height: 38px;
  border-color: #8eaed0;
  background: #fff;
  color: var(--ink-950);
  font-size: 12px;
}

.mtool-template-control:hover {
  border-color: var(--blue-600);
}

.mtool-number-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mtool-formula-output[readonly],
.mtool-linked-detail-output[readonly],
.mtool-linked-detail-output:disabled {
  border-color: #a7b6c7;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58) 25%, transparent 25%) 0 0 / 8px 8px,
    #e9eef4;
  color: #24364b;
  font-weight: 760;
  cursor: not-allowed;
  box-shadow: inset 3px 0 0 #647b94;
}

.mtool-formula-output[readonly]:hover,
.mtool-formula-output[readonly]:focus,
.mtool-linked-detail-output[readonly]:hover,
.mtool-linked-detail-output[readonly]:focus,
.mtool-linked-detail-output:disabled:hover,
.mtool-linked-detail-output:disabled:focus {
  border-color: #8193a7;
  outline-color: #8193a7;
}

.mtool-cell-meta,
.mtool-template-meta {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.mtool-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--line-100);
  color: var(--ink-650);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
}

.mtool-source-badge.auto-zero {
  background: var(--warning-bg);
  color: var(--warning);
}

.mtool-source-badge.formula {
  background: #e4eaf1;
  color: #354b63;
}

.mtool-source-badge.manual {
  background: #e8effa;
  color: #245b97;
}

.mtool-source-badge.reference,
.mtool-source-badge.extracted,
.mtool-source-badge.setup {
  background: var(--success-bg);
  color: var(--success);
}

.mtool-source-badge.missing {
  background: var(--error-bg);
  color: var(--error);
}

.mtool-review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.mtool-review-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--teal-700);
}

.mtool-formula-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: #52677e;
  font-size: 10px;
  font-weight: 750;
}

.mtool-formula-state::before {
  content: "ƒx";
  margin-right: 4px;
  color: #354b63;
  font-weight: 850;
}

.mtool-template-groups {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface-muted);
}

.mtool-template-group {
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  background: #fff;
}

.mtool-template-group > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  color: var(--ink-950);
  font-size: 13px;
  font-weight: 780;
  list-style: none;
}

.mtool-template-group > summary::-webkit-details-marker {
  display: none;
}

.mtool-template-group > summary::before {
  content: "›";
  color: var(--blue-600);
  font-size: 19px;
  transform: rotate(0deg);
  transition: transform 150ms ease;
}

.mtool-template-group[open] > summary::before {
  transform: rotate(90deg);
}

.mtool-template-group > summary span {
  flex: 1;
}

.mtool-template-group > summary strong {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--line-100);
  color: var(--ink-650);
  font-size: 10px;
}

.mtool-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line-300);
  background: var(--line-200);
}

.mtool-text-block-grid {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line-300);
  background: var(--line-200);
  margin-bottom: 24px;
}

.mtool-template-field {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  background: #fff;
}

.mtool-template-field.missing {
  background: #fff9fa;
}

.mtool-template-field.optional {
  background: #fbfdff;
}

.scope-filing-body {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--surface-muted);
}

.scope-filing-fields {
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
}

.scope-business-block {
  overflow: hidden;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  background: #fff;
}

.scope-business-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-300);
  background: #eef4f8;
}

.scope-business-block h4,
.scope-business-block p {
  margin: 0;
}

.scope-business-block h4 {
  color: var(--ink-900);
  font-size: 13px;
}

.scope-business-block p {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.scope-business-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #165c73;
  background: #dff1f4;
  font-size: 9px;
  font-weight: 800;
}

.scope-business-scroll {
  overflow-x: auto;
}

.scope-business-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
}

.scope-business-table col.scope-business-index {
  width: 16%;
}

.scope-business-table col.scope-business-msic {
  width: 24%;
}

.scope-business-table col.scope-business-description {
  width: 60%;
}

.scope-business-table th,
.scope-business-table td {
  padding: 10px 12px;
  border-right: 1px solid var(--line-200);
  border-bottom: 1px solid var(--line-200);
  text-align: left;
  vertical-align: top;
}

.scope-business-table tr > :last-child {
  border-right: 0;
}

.scope-business-table tbody tr:last-child > * {
  border-bottom: 0;
}

.scope-business-table thead th {
  color: #173653;
  background: #f5f8fb;
  font-size: 10px;
}

.scope-business-table tbody th {
  color: var(--ink-800);
  background: #fbfcfd;
  font-size: 11px;
}

.scope-business-table tbody th span {
  display: block;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 600;
}

.scope-business-control {
  min-width: 0;
}

.scope-business-control.missing .mtool-template-control {
  border-color: #d48c99;
  background: #fff9fa;
}

.scope-business-control.optional .mtool-template-control {
  background: #fbfdff;
}

.scope-business-control .mtool-template-control {
  width: 100%;
}

.scope-business-unavailable {
  display: inline-block;
  padding: 8px 0;
  color: var(--danger);
  font-size: 9px;
}

.mtool-source-badge.optional {
  background: #eef4fa;
  color: var(--ink-650);
}

.mtool-template-label {
  display: grid;
  gap: 4px;
}

.mtool-template-label strong {
  color: var(--ink-800);
  font-size: 12px;
  line-height: 1.4;
}

.mtool-template-label small {
  overflow: hidden;
  color: var(--ink-500);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mtool-text-block {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .mtool-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mtool-template-groups {
    padding: 10px;
  }

  .scope-filing-body {
    padding: 10px;
  }
}

.mtool-statement-stack {
  display: grid;
  gap: 18px;
}

.mtool-matrix-sheet,
.mtool-note-sheet {
  overflow: hidden;
}

.mtool-matrix-block {
  border-top: 1px solid #c3ccd5;
  background: #fff;
}

.mtool-matrix-block + .mtool-matrix-block {
  margin-top: 18px;
  border-top: 2px solid #173f73;
}

.mtool-matrix-period {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  color: #fff;
  background: #173f73;
}

.mtool-matrix-period strong {
  font-size: 12px;
}

.mtool-matrix-period span {
  color: #e7eef8;
  font-size: 9px;
}

.mtool-matrix-table {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
}

.mbrs-sheet-table.mtool-matrix-table thead th:nth-child(n + 2) {
  width: 124px;
  min-width: 124px;
  max-width: 124px;
  padding: 8px 7px;
  line-height: 1.25;
  white-space: normal;
}

.mtool-matrix-table thead th.mtool-total-column {
  background: #e2ebf4;
  box-shadow: inset 2px 0 0 #8098b1;
}

.mtool-matrix-table thead th.mtool-total-column small {
  display: block;
  margin-top: 2px;
  color: #59718b;
  font-size: 9px;
  font-weight: 800;
}

.mtool-matrix-label-column {
  width: 250px;
}

.mtool-matrix-value-column {
  width: 124px;
}

.mtool-matrix-table thead th:first-child,
.mtool-matrix-table tbody td:first-child,
.mtool-matrix-table .mbrs-sheet-section-row th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.mtool-matrix-table thead th:first-child {
  z-index: 4;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}

.mtool-matrix-table tbody td:first-child {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  background: #fff;
}

.mtool-matrix-table tbody tr:hover td:first-child {
  background: #f0f6fc;
}

.mtool-matrix-table .mbrs-sheet-section-row th {
  z-index: 3;
  text-align: left;
}

.mtool-matrix-subsection-row th {
  padding: 6px 9px;
  color: #30465f;
  background: #edf2f6;
  text-align: left;
  font-size: 9px;
}

.mtool-matrix-value {
  width: 124px;
  min-width: 124px;
  max-width: 124px;
  padding: 5px !important;
  background: #fff;
  vertical-align: middle;
}

.mtool-matrix-value.auto-zero {
  background: #fffaf0;
}

.mtool-matrix-value.unavailable {
  color: #8390a1;
  background: #f6f8fa;
  text-align: center;
}

.mtool-matrix-value .mtool-template-control {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 10px;
}

.mtool-matrix-map-action {
  width: 100%;
  justify-content: center;
  margin-top: 3px;
}

.socie-matrix {
  min-width: 0;
}

.note-matrix {
  min-width: 0;
}

.note-matrix .mtool-matrix-label-column {
  width: 280px;
}

.note-matrix thead th:first-child,
.note-matrix tbody td:first-child {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
}

.mtool-note-sheet.full-section-editor > .mbrs-sheet-header {
  display: block;
  padding: 4px 18px 13px;
  border-bottom: 0;
  background: #fff;
  text-align: center;
}

.mtool-note-blocks {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f3f6f9;
}

.mtool-note-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #c3ccd5;
  background: #fff;
}

.mtool-note-block.missing {
  background: #fff9fa;
}

.mtool-note-block > header {
  display: grid;
  gap: 4px;
}

.mtool-note-block > header strong {
  color: #173f73;
  font-size: 12px;
}

.mtool-note-block > header small {
  overflow: hidden;
  color: var(--ink-500);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mtool-note-block .mtool-text-block {
  min-height: 190px;
}

.note-text-block-register {
  margin: 14px;
  overflow: hidden;
  border: 1px solid #c3ccd5;
  border-radius: 6px;
  background: #fff;
}

.note-register-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #d8dfe6;
  background: #f4f7fa;
}

.note-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
}

.note-search-icon {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: #64748b;
}

.note-search-icon svg {
  width: 14px;
  height: 14px;
}

.note-search-input {
  width: 100%;
  height: 32px;
  padding: 5px 12px 5px 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.note-search-input:focus {
  border-color: #0056b3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.15);
}

.note-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-pill {
  padding: 4px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.note-pill.active {
  border-color: #173f73;
  background: #173f73;
  color: #fff;
}

.note-text-block-register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #c3ccd5;
  background: #edf2f6;
}

.note-text-block-register-header > div {
  display: grid;
  gap: 4px;
}

.note-text-block-register-header > div small {
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.45;
}

.note-text-block-register-header strong {
  color: #142f54;
  font-size: 13px;
}

.note-text-block-register-header > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #08776f;
  background: #dff3ef;
  font-size: 10px;
  font-weight: 800;
}

.note-text-block-register-rows {
  display: grid;
}

.note-text-block-register-group + .note-text-block-register-group,
.note-text-block-template-register {
  border-top: 1px solid #d8dfe6;
}

.note-text-block-register-group-header,
.note-text-block-template-register summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  color: #173f73;
  background: #edf2f7;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid #d8dfe6;
}

.note-group-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d8e2ec;
  color: #244b7a;
  font-size: 10px;
  font-weight: 700;
}

.note-text-block-register-group-header span:not(.note-group-badge),
.note-text-block-template-register summary span:not(.note-group-badge) {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.note-text-block-template-register summary {
  cursor: pointer;
  list-style-position: inside;
}

.note-text-block-template-register summary::marker {
  color: #08776f;
}

.mtool-note-source-headings {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mtool-note-source-headings.multiple {
  margin-top: 2px;
  gap: 3px;
}

.mtool-note-source-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #5a738e;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
}

.mtool-note-source-heading .heading-bullet {
  color: #08776f;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.mtool-note-source-order {
  color: #08776f;
  font-size: 10px;
  font-weight: 700;
}

.note-text-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 16px;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.note-text-block-row:hover {
  background: #f4f8fb;
}

.note-text-block-row:last-child {
  border-bottom: 0;
}

.note-text-block-row.missing {
  background: #fffcfc;
}

.note-text-block-row.missing:hover {
  background: #fef4f4;
}

.note-text-block-row.not-applicable {
  background: #f8fafc;
  opacity: 0.75;
}

.note-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.note-status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.note-status-indicator.mapped {
  background: #dff3ef;
  color: #08776f;
}

.note-status-indicator.unmapped {
  background: #f1f5f9;
  color: #94a3b8;
}

.note-text-block-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.note-text-block-copy header strong.note-title {
  color: #173f73;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.note-text-block-copy header strong {
  color: #173f73;
  font-size: 12px;
}

.note-text-block-copy header small {
  overflow: hidden;
  color: var(--ink-500);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-text-block-copy > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 3px 0;
  color: #455d77;
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-text-block-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #5e7187;
  font-size: 9px;
  font-weight: 700;
}

.note-text-block-meta > span:not(.mtool-source-badge) {
  padding-left: 7px;
  border-left: 1px solid #cad3dc;
}

.note-text-block-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.scalar-note-fields {
  border-top: 1px solid #c3ccd5;
}

.note-text-block-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 23, 43, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
  overflow: hidden;
}

.note-text-block-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(1200px, 100%);
  height: min(880px, 100%);
  max-height: 100%;
  margin: auto;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.45);
}

.note-text-block-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.note-text-block-dialog-header > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.note-text-block-dialog-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
}

.note-text-block-dialog-header p {
  overflow: hidden;
  margin: 0;
  color: #62758a;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-text-block-close {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  background: #fff;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-text-block-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.note-rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 18px;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  background: #ffffff;
  font-size: 11px;
}

.note-rich-editor-toolbar-group {
  display: flex;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.note-rich-editor-toolbar-group button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid #e2e8f0;
  color: #1e293b;
  background: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.note-rich-editor-toolbar-group button:last-child {
  border-right: 0;
}

.note-rich-editor-toolbar-group button:hover,
.note-rich-editor-toolbar-group button:focus-visible {
  color: #1d4ed8;
  background: #eff6ff;
  outline: none;
}

.note-table-grid-controls button[aria-pressed="true"] {
  color: #fff;
  background: #2a72d4;
}

.note-table-grid-controls button:disabled {
  color: #8796a5;
  background: #f1f4f6;
  cursor: not-allowed;
}

.note-table-grid-controls button:last-child {
  min-width: 88px;
}

.note-table-insert-control {
  position: relative;
}

.note-table-insert-control > button,
.note-table-insert-popover button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bdc9d5;
  border-radius: 5px;
  color: #183d70;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.note-table-insert-control > button:hover,
.note-table-insert-control > button:focus-visible,
.note-table-insert-popover button:hover,
.note-table-insert-popover button:focus-visible {
  color: #fff;
  background: #1c5681;
  outline: none;
}

.note-table-insert-popover {
  position: absolute;
  z-index: 6;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 9px;
  min-width: 210px;
  padding: 12px;
  border: 1px solid #9eafc0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(5, 25, 49, .24);
}

.note-table-insert-popover[hidden] {
  display: none;
}

.note-table-insert-popover label {
  display: grid;
  gap: 4px;
  color: #526981;
  font-size: 9px;
  font-weight: 700;
}

.note-table-insert-popover select {
  min-width: 86px;
  height: 32px;
  border: 1px solid #bdc9d5;
  border-radius: 4px;
  color: #173252;
  background: #fff;
}

.note-table-insert-popover button {
  grid-column: 1 / -1;
  color: #fff;
  background: #087f76;
}

.note-rich-editor-format-state {
  margin-left: auto;
  white-space: nowrap;
}

.note-rich-editor-format-state strong {
  color: #08776f;
}

.note-rich-editor-workspace {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 11px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 24px;
  overflow: auto;
  background: #6d7075;
}

.note-rich-editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, 100%);
  padding: 10px 14px;
  border-radius: 6px;
  color: #526981;
  background: #f4f7f9;
  box-shadow: 0 1px 3px rgba(5, 25, 49, .18);
}

.note-rich-editor-heading > div {
  display: grid;
  gap: 3px;
}

.note-rich-editor-heading label {
  color: #183d70;
  font-size: 11px;
  font-weight: 800;
}

.note-rich-editor-heading p {
  margin: 0;
  color: #5b6f85;
  font-size: 10px;
  line-height: 1.45;
}

.note-rich-editor-heading > span {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
}

.note-rich-editor {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: min(1180px, 100%);
  max-width: 100%;
  min-width: 0;
  height: max-content;
  min-height: 510px;
  padding: 36px 48px;
  border: 2px solid transparent;
  color: #000000;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 9pt;
  line-height: 1.5;
  outline: none;
  overflow: visible;
}

.note-rich-editor.page-preview-mode {
  width: 541.28pt !important;
  max-width: 541.28pt !important;
  min-width: 541.28pt !important;
  margin: 16px auto !important;
  padding: 28.35pt 0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  transition: transform 0.15s ease-out;
}

.note-rich-editor.page-preview-mode.fit-width {
  transform-origin: top center;
}

.note-rich-editor > * {
  box-sizing: border-box;
  max-width: 100%;
}

.note-rich-editor:focus {
  border-color: #2a72d4;
  box-shadow: 0 0 0 3px rgba(42, 114, 212, .22), 0 2px 8px rgba(0, 0, 0, .28);
}

.note-rich-editor:empty::before {
  color: #7c8b9b;
  content: attr(data-placeholder);
}

.note-rich-editor p {
  margin: 0 0 7pt 0;
  overflow-wrap: break-word;
  text-align: justify;
  text-justify: inter-word;
}

.note-rich-editor p.mtool-note-heading {
  text-align: left;
  font-weight: bold;
  margin: 10pt 0 4pt 0;
}

.note-rich-editor table {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  margin: 6pt 0;
  border-collapse: collapse;
  table-layout: fixed;
  border: none;
}

.button.ai-map {
  background: #1f6f78;
  border-color: #1f6f78;
  color: #fff;
}

.button.ai-map:hover:not(:disabled) { background: #185b63; border-color: #185b63; }

.ai-mapping-job-status {
  align-items: center;
  background: #f2f8f8;
  border: 1px solid #b8d9dc;
  border-left: 4px solid #1f6f78;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
}

.ai-mapping-job-status > div { display: grid; gap: .2rem; }
.ai-mapping-job-status span { color: #52677a; font-size: .78rem; }
.ai-mapping-job-status.failed { background: #fff6f5; border-color: #e7b8b3; border-left-color: #b42318; }
.ai-mapping-error { color: #b42318 !important; }

.mapping-reconciliation-panel {
  grid-area: reconciliation;
  min-width: 0;
  margin: 0 1rem 1rem;
  border: 1px solid #c7d5e2;
  border-left: 4px solid #b42318;
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 47, 70, .05);
}

.mapping-reconciliation-panel.is-reconciled {
  border-left-color: #1f6f78;
  background: #f7fbfb;
}

.mapping-reconciliation-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  background: #f2f7fa;
}

.mapping-reconciliation-header h3 { margin: .2rem 0; color: #102d4f; font-size: 1rem; }
.mapping-reconciliation-header p { margin: 0; color: #52677a; font-size: .78rem; }
.mapping-reconciliation-metrics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem .8rem; align-content: center; color: #52677a; font-size: .72rem; }
.mapping-reconciliation-metrics strong { color: #102d4f; font-size: .9rem; }
.mapping-reconciliation-list { display: grid; border-top: 1px solid #e1e8ee; }
.mapping-reconciliation-item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(5.5rem, .55fr) minmax(0, 1.35fr) auto;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  padding: .65rem .8rem;
  border-bottom: 1px solid #e1e8ee;
  font-size: .73rem;
}
.mapping-reconciliation-item > * { min-width: 0; }
.reconciliation-item-source, .reconciliation-item-target, .reconciliation-item-amount { display: grid; gap: .18rem; }
.reconciliation-item-source strong, .reconciliation-item-target span, .mapping-reconciliation-item p { overflow-wrap: anywhere; }
.mapping-reconciliation-item small { color: #718399; font-size: .68rem; }
.reconciliation-item-amount { text-align: right; white-space: nowrap; }
.mapping-reconciliation-item p { margin: 0; color: #334e68; line-height: 1.35; }
.reconciliation-status { display: inline-block !important; width: max-content; padding: .2rem .35rem; border-radius: 3px; background: #fbe9e7; color: #a1261c; font-size: .66rem; font-weight: 700; }
.reconciliation-status.correct { background: #e6f5ee; color: #176b58; }
.reconciliation-status.unmapped, .reconciliation-status.low-confidence { background: #fff4d6; color: #8a5a00; }
.reconciliation-status.conflict, .reconciliation-status.duplicate { background: #f2eafe; color: #6640a1; }
.reconciliation-open-button { white-space: nowrap; }
.mapping-reconciliation-more, .mapping-reconciliation-empty { margin: 0; padding: .7rem 1rem; color: #52677a; font-size: .75rem; }

.ai-mapping-job-status {
  grid-area: status;
  min-width: 0;
  margin: 0 1rem;
}

@media (max-width: 1100px) {
  .mapping-reconciliation-header { flex-direction: column; }
  .mapping-reconciliation-metrics { justify-content: flex-start; }
  .mapping-reconciliation-item { grid-template-columns: minmax(0, 1fr) auto; }
  .reconciliation-item-target, .mapping-reconciliation-item p { grid-column: 1 / -1; }
  .reconciliation-item-amount { grid-column: 2; grid-row: 1; }
  .reconciliation-open-button { justify-self: start; }
}

.note-rich-editor[data-table-resize-ready="true"] table {
  transition: box-shadow 120ms ease;
}

.note-rich-editor[data-table-resize-ready="true"] table:hover {
  box-shadow: 0 0 0 1px rgba(42, 114, 212, .22);
}

.note-rich-editor.is-resizing-table,
.note-rich-editor.is-resizing-table * {
  cursor: col-resize !important;
  user-select: none !important;
}

.note-rich-editor.show-table-gridlines th,
.note-rich-editor.show-table-gridlines td {
  outline: 1px solid rgba(91, 111, 133, .32);
  outline-offset: -1px;
}

.note-rich-editor td,
.note-rich-editor th {
  min-width: 0;
  padding: 2.5pt 4pt;
  vertical-align: top;
  font-size: 9pt;
  line-height: 1.35;
  border: none;
}

.note-rich-editor td:not(:first-child),
.note-rich-editor th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.note-rich-editor td:focus,
.note-rich-editor th:focus {
  background: #e9f2ff;
  outline: 2px solid #2a72d4;
  outline-offset: -2px;
}

.note-rich-editor tr.mtool-total-row > td:not(:first-child),
.note-rich-editor tr.mtool-total-row > th:not(:first-child) {
  font-weight: 400;
}

.note-rich-editor tr.mtool-section-row > td,
.note-rich-editor tr.mtool-section-row > th {
  padding-top: 5pt;
  padding-bottom: 1pt;
  font-weight: 700;
}

.note-rich-editor tr.mtool-source-header-row > td,
.note-rich-editor tr.mtool-source-unit-row > td {
  vertical-align: bottom;
  font-weight: 700;
  line-height: 1.15;
}

.note-rich-editor ul,
.note-rich-editor ol {
  padding-left: 26px;
}

.note-text-block-editor-count {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: min(900px, 100%);
  padding: 7px 10px;
  border-radius: 4px;
  color: #687b8e;
  background: #f4f7f9;
  font-size: 9px;
}

.note-text-block-export-note {
  display: grid;
  gap: 4px;
  width: min(900px, 100%);
  padding: 12px;
  border-left: 3px solid #07837a;
  color: #4f647b;
  background: #e9f5f2;
  font-size: 10px;
  line-height: 1.45;
}

.note-text-block-export-note strong {
  color: #08776f;
}

.note-text-block-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 12px 20px;
  flex-shrink: 0;
}

.mtool-note-table-preview-title,
.mtool-note-edit-label {
  color: #52677f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.mtool-note-table-preview-title {
  margin-bottom: 7px;
}

.mtool-note-table-preview table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 11px;
}

.mtool-note-table-preview th,
.mtool-note-table-preview td {
  padding: 6px 8px;
  border-bottom: 1px solid #d5dce4;
  text-align: right;
}

.mtool-note-table-preview th:first-child,
.mtool-note-table-preview td:first-child {
  text-align: left;
}

.mtool-note-table-preview th {
  color: #173f73;
  background: #edf2f6;
  font-weight: 700;
}

.mtool-note-edit-label {
  margin-top: 2px;
}

.note-matrix-block {
  margin: 0 14px 14px;
  border: 1px solid #c3ccd5;
}

@media (max-width: 860px) {
  .note-text-block-row {
    grid-template-columns: 1fr;
  }

  .note-text-block-actions {
    grid-auto-flow: column;
    justify-content: space-between;
    justify-items: start;
  }

  .note-text-block-backdrop {
    padding: 10px;
  }

  .note-text-block-dialog {
    max-height: calc(100vh - 20px);
  }

  .note-rich-editor-toolbar {
    align-items: flex-start;
  }

  .note-rich-editor-format-state {
    width: 100%;
    margin-left: 0;
  }

  .note-rich-editor-workspace {
    padding: 10px;
  }

  .note-rich-editor-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .note-rich-editor {
    min-height: 430px;
    padding: 25px 20px;
  }

  .note-text-block-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .note-text-block-dialog-actions > div:last-child {
    justify-content: flex-end;
  }

  .mtool-matrix-period {
    align-items: flex-start;
    flex-direction: column;
  }

  .mtool-matrix-table thead th:first-child,
  .mtool-matrix-table tbody td:first-child {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
  }

  .mtool-matrix-label-column,
  .note-matrix .mtool-matrix-label-column {
    width: 210px;
  }

  .mtool-note-blocks {
    padding: 10px;
  }

  .note-matrix-block {
    margin: 0 10px 10px;
  }
}

.full-section-editor,
.mbrs-sheet {
  box-shadow: none;
}

.upload-field {
  border-color: var(--workspace-line-strong);
  border-radius: 5px;
}

.local-note,
.scope-note,
.mtool-callout {
  border-radius: 3px;
  box-shadow: none;
}

.form-section {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--workspace-line);
  border-radius: 0;
}

.form-section + .form-section {
  margin-top: 18px;
}

.form-section h3,
.setup-aside h3,
.validation-group h3,
.export-panel h3 {
  font-size: 14px;
}

.field label,
.mtool-template-label strong {
  color: #34475a;
  font-size: 11px;
  font-weight: 700;
}

.field .input,
.field .select,
.mtool-template-control {
  min-height: 36px;
  font-size: 11px;
}

.field small,
.mtool-template-label small,
.mtool-template-meta {
  font-size: 9px;
}

.mbrs-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.mapping-screen {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 100%;
  grid-template-areas: "navigator main";
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden;
  background: #ffffff;
  transition: grid-template-columns 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.mapping-screen.mbrs-nav-collapsed {
  grid-template-columns: 44px minmax(0, 1fr);
}

.mapping-screen.compare-open {
  grid-template-columns: 256px minmax(380px, 1fr) minmax(360px, 38vw);
  grid-template-areas: "navigator main compare";
}

.mapping-screen.compare-open.mbrs-nav-collapsed {
  grid-template-columns: 44px minmax(380px, 1fr) minmax(360px, 38vw);
}

.mapping-screen.compare-open.compare-mode-split {
  grid-template-columns: 256px minmax(320px, 1fr) minmax(620px, 52vw);
}

.mapping-screen.compare-open.compare-mode-split.mbrs-nav-collapsed {
  grid-template-columns: 44px minmax(320px, 1fr) minmax(620px, 56vw);
}

.mapping-screen.compare-open.compare-mode-pdf {
  grid-template-columns: 256px minmax(380px, 1fr) minmax(360px, 38vw);
}

.mapping-screen.compare-open.compare-mode-pdf.mbrs-nav-collapsed {
  grid-template-columns: 44px minmax(380px, 1fr) minmax(360px, 42vw);
}

.mapping-screen.compare-open.compare-mode-mapping {
  grid-template-columns: 256px minmax(380px, 1fr) minmax(360px, 38vw);
}

.mapping-screen.compare-open.compare-mode-mapping.mbrs-nav-collapsed {
  grid-template-columns: 44px minmax(380px, 1fr) minmax(360px, 42vw);
}

.mbrs-content-index {
  grid-area: navigator;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 8px 24px;
  display: flex;
  flex-direction: column;
  position: static;
  box-sizing: border-box;
}

.mbrs-content-index.collapsed {
  padding: 8px 0;
  overflow: hidden;
}

.mbrs-content-index.collapsed .mbrs-heading-top > div,
.mbrs-content-index.collapsed .mbrs-section-picker,
.mbrs-content-index.collapsed .mbrs-group-tabs,
.mbrs-content-index.collapsed .mbrs-section-options {
  display: none !important;
}

.mbrs-content-index.collapsed .mbrs-heading-top {
  justify-content: center;
  padding: 0;
  margin: 0;
}

.mbrs-content-index.collapsed .mbrs-navigator-heading {
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}

.mbrs-navigator-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px 10px;
  margin: 0;
  box-sizing: border-box;
}

.mbrs-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mbrs-heading-top .eyebrow {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.mbrs-heading-top h3 {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.section-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  flex: 0 0 24px;
}

.section-nav-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.section-nav-toggle .toggle-icon {
  transition: transform 0.2s ease-in-out;
}

.mbrs-content-index.collapsed .section-nav-toggle .toggle-icon {
  transform: rotate(180deg);
}

.mbrs-section-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  width: 100%;
}

.mbrs-section-picker > span {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
}

.mbrs-section-picker .select {
  width: 100%;
  min-height: 28px;
  height: 28px;
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
}

.mbrs-group-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  margin: 6px 0 8px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.mbrs-group-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: none;
  box-sizing: border-box;
}

.mbrs-group-tabs button:hover {
  background: rgba(226, 232, 240, 0.6);
  color: #0f172a;
}

.mbrs-group-tabs button.active {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
}

.mbrs-group-tabs button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9.5px;
  font-weight: 700;
}

.mbrs-group-tabs button.active strong {
  background: #0284c7;
  color: #ffffff;
}

.mbrs-section-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0;
  margin: 0;
  overflow-y: auto;
  box-sizing: border-box;
}

.mbrs-section-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  box-sizing: border-box;
}

.mbrs-section-options button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.mbrs-section-options button.active {
  background: #f0f9ff;
  border-color: #bae6fd;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08);
}

.mbrs-section-options button.active .section-label-title {
  color: #0369a1;
  font-weight: 700;
}

.mbrs-section-options button.active .section-label-sub {
  color: #0284c7;
}

.section-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.section-label-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.section-label-sub {
  font-size: 9.5px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.15;
  white-space: normal;
}

.mbrs-section-options button .section-label-text,
.mbrs-section-options button span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
}

.mbrs-review-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.mbrs-review-status.ready {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.mbrs-review-status.review {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mapping-main-area {
  grid-area: main;
  display: flex;
  flex-direction: column;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  min-width: 0;
  overflow: hidden !important;
  contain: paint !important;
  background: #ffffff;
  box-sizing: border-box;
}

.mapping-toolbar {
  flex: 0 0 46px;
  min-height: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  z-index: 10;
  box-sizing: border-box;
}

.mapping-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mapping-section-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.mapping-heading h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbrs-adjacent-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mbrs-statement-workspace,
.mbrs-disclosure-workspace {
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px 18px;
  background: #ffffff;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.mapping-screen.compare-open .mbrs-compare-panel {
  grid-area: compare;
  height: 100%;
  overflow-y: hidden;
  border-left: 1px solid #e2e8f0;
}

.full-section-editor {
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  background: #fff;
}

.full-section-editor > header {
  min-height: 62px;
  padding: 10px 12px;
  background: #f7f8f9;
}

.full-section-editor > header h3 {
  font-size: 14px;
}

.full-section-editor > header p {
  font-size: 9px;
}

.mtool-template-groups {
  gap: 0;
  padding: 0;
  background: #fff;
}

.mtool-template-group {
  border: 0;
  border-radius: 0;
}

.mtool-template-group + .mtool-template-group {
  border-top: 1px solid var(--workspace-line);
}

.mtool-template-group > summary {
  min-height: 40px;
  padding: 9px 12px;
  background: #fff;
}

.mtool-field-grid,
.mtool-text-block-grid {
  gap: 1px;
  background: var(--workspace-line);
}

.mtool-template-field {
  min-height: 128px;
  padding: 12px;
  background: #fff;
}

.mtool-source-badge,
.mbrs-section-pill,
.mbrs-review-status {
  border-radius: 3px;
}

.mtool-review-toggle {
  font-size: 9px;
}

.note-text-block-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #fff;
}

.note-text-block-copy strong {
  color: #173f73;
  font-size: 13px;
  font-weight: 600;
}

.note-text-block-actions .button {
  min-width: 100px;
  justify-content: center;
}

.mbrs-sheet {
  width: calc(100% - 24px);
  margin: 12px;
  border-radius: 3px;
  background: #fff;
}

.mbrs-sheet > header {
  padding: 12px 14px;
}

.mbrs-sheet-table {
  min-width: 0;
  table-layout: fixed;
}

.mbrs-sheet-table.statement-sheet-table {
  width: 100%;
  min-width: 0;
}

.mbrs-sheet-table.statement-sheet-table thead th:nth-child(n + 2),
.statement-sheet-table .mtool-value-cell,
.statement-detail-heading,
.statement-detail-cell {
  min-width: 0 !important;
}

.statement-sheet-table col.statement-line-column {
  width: 44%;
}

.statement-sheet-table col.statement-period-column {
  width: 28%;
}

.statement-sheet-table.has-details-column col.statement-line-column {
  width: 42%;
}

.statement-sheet-table.has-details-column col.statement-period-column {
  width: 25%;
}

.statement-sheet-table.has-details-column col.statement-detail-column {
  width: 68px;
}

.statement-sheet-table .mtool-template-control {
  min-width: 0;
  width: 100%;
}

.statement-detail-cell {
  padding-inline: 4px !important;
  width: 68px;
  min-width: 60px !important;
}

.mtool-see-details {
  display: inline-block;
  max-width: 100%;
  padding-inline: 2px;
  font-size: 9px;
  white-space: nowrap;
}

.mbrs-sheet-table thead th {
  color: #4d5a67;
  background: #eef0f2;
  font-size: 9px;
}

.mbrs-sheet-table th,
.mbrs-sheet-table td {
  height: 38px;
  padding: 5px 8px;
  border-color: var(--workspace-line);
}

.mbrs-sheet-table tbody td:first-child,
.mbrs-sheet-table tbody th:first-child {
  width: 44%;
}

.mbrs-sheet-table tbody td:first-child strong {
  font-size: 10px;
}

.mbrs-sheet-section-row th,
.mtool-workbook-heading-row th {
  height: 28px;
  color: #2f465a;
  background: #eceeef;
  font-size: 10px;
}

.statement-total-row > td,
.statement-total-row > th {
  background: #dcecf9;
}

.mtool-number-input {
  text-align: right;
}

.mtool-formula-output {
  color: #3e4b57;
  background-color: #eff1f3;
  background-image: none;
}

.full-coverage {
  padding: 9px 16px;
  font-size: 9px;
}

.bottom-rail {
  min-height: 48px;
  height: 48px;
  padding: 8px 18px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 48px;
  box-sizing: border-box;
}

.bottom-rail .page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

/* Statement Table Mapping Target Pills & Highlight */
.statement-line-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.source-map-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  transition: all 0.15s ease;
}

.source-map-target-pill:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #312e81;
}

.source-map-target-pill.active {
  background: #4338ca;
  border-color: #312e81;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(67, 56, 202, 0.25);
}

.statement-recalc-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  transition: all 0.15s ease;
}

.statement-recalc-pill:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
  box-shadow: 0 1px 2px rgba(194, 65, 12, 0.15);
}

.statement-sheet-table tbody tr.mbrs-target-selected > td,
.statement-sheet-table tbody tr.mbrs-target-selected > th {
  background: #eef2ff !important;
}

.statement-sheet-table tbody tr.mbrs-target-selected td:first-child {
  box-shadow: inset 3.5px 0 0 #4f46e5 !important;
}

/* Modern Source Mapping Editor */
.source-mapping-editor {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #dce2e8);
  background: #f8fafc;
  max-height: 540px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex-shrink: 0;
}

.source-mapping-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.source-mapping-summary-tag {
  font-weight: 500;
  color: #64748b;
  font-size: 11px;
}

.source-mapping-editor form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  min-width: 0;
}

/* 1. Active Destination Card */
.active-destination-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.destination-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.destination-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
}

.destination-section {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.destination-main-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.destination-field-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.destination-lead-path {
  font-size: 10.5px;
  color: #64748b;
}

.destination-current-values {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.current-value-label {
  font-size: 11px;
  color: #475569;
}

.current-value-pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.current-value-pill.has-value {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.current-value-pill.is-blank {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

/* Recalculation Assistant Banners */
.destination-recalc-banner {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.destination-recalc-banner .recalc-banner-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #92400e;
}

.destination-recalc-banner .recalc-banner-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #78350f;
}

.destination-recalc-banner .recalc-banner-btn {
  align-self: flex-start;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: #d97706;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.destination-recalc-banner .recalc-banner-btn:hover {
  background: #b45309;
}

/* Currently Mapped Sources on Destination Card */
.destination-mapped-sources {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mapped-sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.mapped-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mapped-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  color: #1e293b;
}

.chip-label {
  font-weight: 500;
}

.chip-remove-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-weight: 700;
  cursor: pointer;
  padding: 0 3px;
  font-size: 12px;
  line-height: 1;
  border-radius: 3px;
  transition: all 0.1s ease;
}

.chip-remove-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.clear-all-mappings-btn {
  color: #dc2626 !important;
  font-weight: 600;
  padding: 1px 6px;
  font-size: 10px;
  border: 1px solid #fecaca !important;
  background: #fff5f5 !important;
  border-radius: 4px;
  cursor: pointer;
}

.clear-all-mappings-btn:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
}

.destination-picker-details {
  margin-top: 4px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 4px;
}

.destination-picker-summary {
  font-size: 10.5px;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
}

.destination-picker-dropdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

/* 2. Source Figures Grid with Multi-select */
.source-figures-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-figures-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  gap: 8px;
}

.source-figures-section-title .title-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.source-figures-section-title small {
  color: #64748b;
  font-weight: 500;
}

.source-selection-controls {
  display: flex;
  gap: 4px;
}

.source-figures-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px;
  background: #ffffff;
}

.source-figure-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.12s ease;
}

.source-figure-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.source-figure-card.is-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.card-checkbox-indicator {
  padding-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.source-card-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #2563eb;
  margin: 0;
  pointer-events: none;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-status-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.unmap-pill-btn {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.1s ease;
}

.unmap-pill-btn:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

.card-amounts-scope-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475569;
}

.card-scope-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 4px;
  border-radius: 3px;
}

.card-scope-tag.group-tag {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.card-scope-tag.company-tag {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Selected Items Summary */
.selected-items-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 5px;
}

.selected-items-summary .summary-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #0369a1;
}

.selected-items-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.selected-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: #ffffff;
  border: 1px solid #7dd3fc;
  border-radius: 4px;
  font-size: 10.5px;
  color: #0c4a6e;
}

.selected-item-chip .chip-del {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
  font-size: 11px;
}

.selected-item-chip .chip-del:hover {
  color: #ef4444;
}

.card-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.source-status-badge.unmapped {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.source-status-badge.mapped {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.card-amounts-line {
  display: flex;
  gap: 12px;
  font-size: 10.5px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.card-amounts-line strong {
  color: #0f172a;
}

.card-context-note {
  font-size: 9.5px;
  color: #64748b;
}

.source-figures-empty {
  padding: 12px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

.source-figures-empty p {
  margin: 0;
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
}

.source-figures-empty small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #64748b;
}

/* Row Evidence */
.source-evidence-callout {
  padding: 6px 10px;
  background: #eef2f6;
  border-radius: 5px;
  font-size: 11px;
}

.evidence-title {
  font-weight: 600;
  color: #334155;
  display: block;
  margin-bottom: 2px;
}

.evidence-text {
  color: #475569;
  line-height: 1.35;
  margin: 0;
}

.source-column-review-box {
  padding: 8px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
}

.source-column-review-box p {
  margin: 0 0 6px;
  font-size: 11px;
  color: #92400e;
}

/* 3. Mapping Mode Switcher & Calculation Preview */
.mapping-mode-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-selection-header {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mode-selection-header strong {
  font-size: 11.5px;
  color: #0f172a;
}

.mode-selection-header span {
  font-size: 10.5px;
  color: #475569;
}

.mode-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.12s ease;
}

.mode-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.mode-card.active {
  border-color: #4338ca;
  background: #eef2ff;
  box-shadow: 0 0 0 1.5px #4338ca;
}

.mode-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.mode-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: auto;
}

.mode-tag.component {
  background: #e0e7ff;
  color: #3730a3;
}

.mode-tag.direct {
  background: #f1f5f9;
  color: #475569;
}

.mode-calculation-preview {
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.calc-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.calc-op {
  color: #64748b;
  font-weight: 700;
}

.calc-equals {
  color: #64748b;
  font-weight: 700;
}

.calc-result {
  color: #15803d;
  font-weight: 700;
}

.mode-hint {
  font-size: 10px;
  color: #64748b;
  line-height: 1.25;
}

.mode-direct-preview {
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.direct-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

/* 3b. Rule Scope Selection */
.source-mapping-scope-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.scope-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.scope-section-header .scope-label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.scope-section-header .scope-hint {
  font-size: 10.5px;
  color: #64748b;
}

.scope-options-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}

.scope-option {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.scope-option:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.scope-option.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.scope-option input[type="radio"] {
  margin-top: 2px;
  accent-color: #2563eb;
}

.scope-option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scope-option-info strong {
  font-size: 11px;
  color: #1e293b;
  line-height: 1.2;
}

.scope-option-info small {
  font-size: 10px;
  color: #64748b;
  line-height: 1.2;
}

/* 4. Actions & Submit Button */
.source-mapping-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.mapping-submit-btn {
  width: 100%;
  font-weight: 600;
  padding: 7px 12px;
  font-size: 12px;
}

.knowledge-treatment-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.3;
}

.knowledge-treatment-pill.component {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.knowledge-treatment-pill.direct {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.source-mapping-periods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.source-mapping-error { color: #b42318; }
.mapping-rule-issues { padding: 10px 16px; font-size: 12px; background: #fffbeb; color: #854d0e; max-height: 160px; overflow: auto; flex-shrink: 0; }
.mapping-rule-issues summary { cursor: pointer; font-weight: 600; }
.source-mapping-reuse { color: #475569; }
.knowledge-rule-choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; margin-top: 6px; }
.mbrs-compare-panel {
  grid-area: compare;
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--workspace-line);
  background: #fff;
}

.compare-panel-header {
  display: flex;
  min-height: 44px;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--workspace-line);
  background: #ffffff;
  flex-shrink: 0;
  box-sizing: border-box;
}

.compare-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.compare-header-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.01em;
  padding: 2px 4px;
}

.card-title-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.source-card-page-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.source-card-page-tag:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.source-mapping-section-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-bottom: 4px;
}

.mapping-section-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.source-mapping-section-picker-row select {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 8px;
  cursor: pointer;
}

.compare-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
}

.compare-view-segmented-control {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.compare-mode-tab {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  gap: 4px;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.compare-mode-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.85);
}

.compare-mode-tab.active {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.compare-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.compare-status-badge {
  font-size: 9.5px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
}

.compare-close {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid #d4dbe1;
  border-radius: 4px;
  color: #51606e;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-panel-workspace {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* 1. PDF Mode (100% PDF) */
.mbrs-compare-panel.view-mode-pdf .source-mapping-editor {
  display: none !important;
}

.mbrs-compare-panel.view-mode-pdf .compare-document-stage {
  flex: 1 1 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pdf-floating-map-pill {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
  border-radius: 20px;
  font-size: 11.5px;
  color: #1e293b;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pdf-floating-map-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.18);
  border-color: #93c5fd;
}

.pdf-floating-map-pill .pill-indicator {
  font-size: 13px;
}

.pdf-floating-map-pill strong {
  color: #1d4ed8;
}

.pdf-floating-map-pill .pill-action-btn {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pdf-floating-map-pill .pill-action-btn:hover {
  background: #1e40af;
}

/* 2. Mapping Inspector Mode (100% Mapping Editor) */
.mbrs-compare-panel.view-mode-mapping .compare-document-stage {
  display: none !important;
}

.mbrs-compare-panel.view-mode-mapping .source-mapping-editor {
  display: block;
  flex: 1 1 100%;
  width: 100%;
  height: 100%;
  max-height: none !important;
  border-bottom: none;
  overflow-y: auto;
}

/* 3. Split View Mode */
.mbrs-compare-panel.view-mode-split .compare-panel-workspace {
  display: flex;
  flex-direction: row;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mbrs-compare-panel.view-mode-split .source-mapping-editor {
  flex: 0 0 350px;
  width: 350px;
  min-width: 300px;
  max-width: 420px;
  height: 100%;
  max-height: none !important;
  border-bottom: none;
  border-right: 1px solid var(--border, #dce2e8);
  overflow-y: auto;
}

.mbrs-compare-panel.view-mode-split .compare-document-stage {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 1360px) {
  .mbrs-compare-panel.view-mode-split .compare-panel-workspace {
    flex-direction: column;
  }
  .mbrs-compare-panel.view-mode-split .source-mapping-editor {
    flex: 1 1 48%;
    width: 100%;
    max-height: 50% !important;
    border-right: none;
    border-bottom: 1px solid var(--border, #dce2e8);
  }
  .mbrs-compare-panel.view-mode-split .compare-document-stage {
    flex: 1 1 52%;
    min-height: 50%;
  }
}

.compare-panel-header strong {
  color: #2d4053;
  font-size: 12px;
}

.compare-panel-header span {
  overflow: hidden;
  color: var(--workspace-muted);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compare-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #d4dbe1;
  border-radius: 4px;
  color: #51606e;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.compare-panel-controls {
  display: flex;
  min-height: 52px;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--workspace-line);
  background: #f7f8f9;
}

.compare-panel-controls label {
  display: grid;
  gap: 3px;
}

.compare-panel-controls label > span,
.compare-panel-controls > span {
  color: var(--workspace-muted);
  font-size: 9px;
}

.compare-hydration-status {
  color: #2563eb !important;
  font-weight: 600;
  white-space: nowrap;
}

.compare-panel-controls .select {
  min-width: 118px;
  min-height: 30px;
  font-size: 10px;
}

.compare-document-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #6f747a;
}

.compare-document-page {
  min-height: 760px;
  padding: 32px 30px 44px;
  color: #15191d;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.compare-document-stage.source-preview-active {
  overflow: hidden;
  padding: 0;
  background: #525659;
}

.compare-document-page.original-pdf-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: #525659;
  box-shadow: none;
}

.compare-source-pdf {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #525659;
}

.persistent-source-pdf-viewer {
  position: fixed;
  z-index: 6;
  overflow: auto;
  box-sizing: border-box;
  padding: 16px;
  background: #525659;
  text-align: center;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.persistent-source-pdf-viewer[hidden],
body.management-mode .persistent-source-pdf-viewer,
body:not(.preparation-mode) .persistent-source-pdf-viewer,
body[data-step="1"] .persistent-source-pdf-viewer,
body[data-step="2"] .persistent-source-pdf-viewer,
body[data-step="4"] .persistent-source-pdf-viewer {
  display: none !important;
}

.source-pdf-page-frame {
  position: relative;
  margin: 0 auto 18px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

.source-pdf-page-frame:last-child { margin-bottom: 0; }

.source-pdf-page-frame canvas {
  display: block;
}

.source-pdf-page-label {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 1;
  padding: 2px 5px;
  border-radius: 3px;
  color: #64748b;
  background: rgba(255, 255, 255, .86);
  font: 10px/1.2 "Segoe UI", sans-serif;
}

.compare-document-page-number {
  margin-bottom: 20px;
  color: #8a9299;
  font: 9px/1.3 "Segoe UI", sans-serif;
  text-align: right;
}

.compare-document-lines {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  line-height: 1.45;
}

.compare-document-lines p {
  margin: 0 0 6px;
}

.compare-evidence-list {
  display: grid;
  gap: 12px;
}

.compare-evidence-list > div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e6e8;
}

.compare-evidence-list strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
}

.compare-evidence-list span,
.compare-empty span {
  color: #59636c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  line-height: 1.45;
}

.compare-empty {
  display: grid;
  gap: 6px;
  padding: 40px 10px;
  text-align: center;
}

.note-text-block-dialog {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: min(1200px, 100%) !important;
  height: min(880px, 100%) !important;
  max-height: 100% !important;
  margin: auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.45) !important;
  position: relative !important;
}

.note-text-block-dialog.source-capture-open {
  max-width: min(1560px, 100%) !important;
}

.note-text-block-dialog-header {
  flex: 0 0 auto !important;
  min-height: 56px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 12px 20px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  box-sizing: border-box !important;
}

.note-rich-editor-toolbar {
  flex: 0 0 auto !important;
  min-height: 44px;
  max-height: min(28vh, 180px) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

.note-rich-editor-toolbar-group {
  flex: 0 0 auto;
}

.note-rich-editor-toolbar-group button,
.note-toolbar-more-toggle {
  min-height: 32px;
  font-size: 10px;
}

.note-rich-editor-heading {
  display: none;
}

.note-rich-editor-workspace {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 18px !important;
  background: #f1f5f9 !important;
  box-sizing: border-box !important;
}

.note-editor-title-card {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 960px !important;
  background: #ffffff !important;
  border-radius: 6px 6px 0 0 !important;
  border: 1px solid #cbd5e1 !important;
  border-bottom: 2px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  padding: 24px 44px 18px 44px !important;
  margin: 0 auto !important;
  user-select: none !important;
}

.note-editor-title-badge {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #64748b !important;
}

.note-editor-title-pill {
  display: inline-block !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.note-editor-title-heading {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.3 !important;
}

.note-rich-editor {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 960px !important;
  min-width: 0 !important;
  min-height: 480px !important;
  padding: 24px 44px 36px 44px !important;
  background: #ffffff !important;
  border-radius: 0 0 6px 6px !important;
  border: 1px solid #cbd5e1 !important;
  border-top: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
  margin: 0 auto !important;
}

.note-text-block-dialog-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 10px 18px !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  z-index: 10 !important;
}


.note-source-capture-toggle {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #2f6fb4;
  border-radius: 4px;
  color: #fff;
  background: #2f6fb4;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.note-source-capture-toggle:hover,
.note-source-capture-toggle[aria-expanded="true"] {
  border-color: #174f8e;
  background: #174f8e;
}

.note-source-capture-toggle:disabled {
  color: #8c99a5;
  border-color: #d6dce2;
  background: #eef1f4;
  cursor: not-allowed;
}

.note-source-capture-message {
  flex: 0 0 auto;
  max-width: 250px;
  color: #536980;
  font-size: 10px;
  line-height: 1.25;
}

.note-source-capture-message.error {
  color: #a43b3b;
}

.note-text-block-dialog.source-capture-open {
  max-width: min(1560px, calc(100vw - 32px)) !important;
}

.note-editor-capture-layout {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-content: center !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.note-editor-capture-layout.capture-open {
  max-width: 100% !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
  align-items: start;
}


.note-editor-column {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 11px;
}

.note-editor-column .note-rich-editor-heading,
.note-editor-column .note-rich-editor,
.note-editor-column .note-source-editor-panel {
  width: 100%;
}

.note-source-capture-panel {
  position: sticky;
  top: 0;
  display: flex;
  min-width: 0;
  height: min(620px, calc(92vh - 190px));
  min-height: 470px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #aeb9c5;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.note-source-capture-panel[hidden] {
  display: none !important;
}

.note-source-capture-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid #d7dee5;
  background: #f8fafc;
}

.note-source-capture-panel > header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.note-source-capture-panel > header strong {
  color: #233d5c;
  font-size: 12px;
}

.note-source-capture-panel > header span {
  overflow: hidden;
  color: #6b7b8b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-source-capture-panel > header button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c6d0d9;
  border-radius: 4px;
  color: #315174;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.note-source-capture-controls {
  display: grid;
  grid-template-columns: auto minmax(100px, 150px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #d7dee5;
  background: #fff;
}

.note-source-capture-controls label {
  color: #344e69;
  font-size: 10px;
  font-weight: 750;
}

.note-source-capture-controls select {
  min-width: 0;
  height: 32px;
  padding: 0 28px 0 8px;
  border: 1px solid #b9c5d0;
  border-radius: 4px;
  color: #263f5b;
  background: #fff;
  font: inherit;
  font-size: 10px;
}

.note-source-capture-controls p {
  margin: 0;
  color: #6c7c8b;
  font-size: 9px;
  line-height: 1.35;
}

.note-source-capture-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: #555b62;
}

.note-source-capture-pages {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.note-source-capture-page-wrapper {
  display: grid;
  min-width: 0;
  gap: 6px;
  scroll-margin-top: 8px;
}

.note-source-capture-page-label {
  position: sticky;
  z-index: 2;
  top: 0;
  justify-self: start;
  padding: 3px 7px;
  border-radius: 3px;
  color: #f4f7fa;
  background: rgba(32, 43, 54, .9);
  font-size: 9px;
  font-weight: 750;
  pointer-events: none;
}

.note-source-capture-page {
  position: relative;
  width: 100%;
  min-height: 320px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .32);
}

.note-source-capture-page[data-render-state="pending"]::before,
.note-source-capture-page[data-render-state="loading"]::before,
.note-source-capture-page[data-render-state="error"]::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #667789;
  background: #f7f9fb;
  content: "Loading page…";
  font-size: 10px;
}

.note-source-capture-page[data-render-state="error"]::before {
  color: #a53b44;
  content: "Page could not be rendered";
}

.note-source-capture-page canvas {
  display: block;
  max-width: none;
  background: #fff;
}

.note-source-capture-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.note-source-capture-overlay.is-loading {
  cursor: progress;
  background: rgba(255, 255, 255, .38);
}

.note-source-capture-selection {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #1674dc;
  background: rgba(22, 116, 220, .14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset;
  pointer-events: none;
}

.note-source-capture-result {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #d7dee5;
  background: #fff;
}

.note-source-capture-result > span {
  min-height: 14px;
  color: #4f6275;
  font-size: 9px;
  line-height: 1.35;
}

.note-source-capture-result > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.note-source-capture-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 260px;
  padding: 30px;
  color: #697a8b;
  text-align: center;
}

.note-source-capture-empty strong {
  color: #344e69;
  font-size: 12px;
}

.note-source-capture-empty span {
  max-width: 330px;
  font-size: 10px;
  line-height: 1.5;
}

.validation-screen {
  padding: 22px 24px 0;
}

.validation-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.validation-health {
  border-color: var(--workspace-line);
  border-radius: 5px;
  box-shadow: none;
}

.validation-row {
  grid-template-columns: 100px 58px minmax(190px, 1fr) minmax(105px, 160px) 54px;
  min-height: 42px;
  gap: 8px;
  padding: 6px 8px;
  font-size: 9px;
}

.validation-row.error {
  background: #fff4f5;
}

.validation-row.warning {
  background: #fffaf0;
}

.export-panel {
  border-radius: 4px;
}

@media (max-width: 1280px) {
  .mapping-screen.compare-open {
    grid-template-columns: 220px minmax(400px, 1fr) minmax(330px, 40vw);
  }

  .mbrs-content-index {
    width: auto;
  }

  .topbar {
    grid-template-columns: 170px minmax(0, 1fr) auto;
  }
}

@media (max-width: 1000px) and (min-width: 861px) {
  .topbar-product p,
  .filing-period {
    display: none;
  }

  .filing-company {
    max-width: 190px;
  }

  .topbar-tool,
  .topbar-save {
    gap: 4px;
    padding-inline: 7px;
    font-size: 9px;
  }
}

@media (max-width: 1120px) {
  .validation-layout {
    grid-template-columns: 1fr;
  }

  .export-panel {
    position: static;
  }

  .mapping-screen.compare-open {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas: "navigator main";
  }

  .mapping-screen.compare-open .mbrs-compare-panel {
    z-index: 18;
    top: 52px !important;
    right: 0;
    bottom: 0;
    width: min(440px, calc(100vw - 64px));
    height: calc(100vh - 52px);
    box-shadow: -10px 0 28px rgba(25, 43, 63, .18);
    position: fixed;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 64px;
  }

  .topbar {
    grid-template-columns: minmax(130px, 1fr) auto;
  }

  .topbar-filing {
    display: none;
  }

  .section-page,
  .validation-screen {
    padding: 18px 16px 28px;
  }

  .mapping-screen {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .mapping-heading span,
  .quick-review-button {
    display: none;
  }

  .validation-row {
    grid-template-columns: 92px 54px minmax(150px, 1fr) 48px;
  }

  .validation-source {
    display: none;
  }
}

@media (max-width: 640px) {
  .screen {
    min-height: calc(100vh - 118px);
  }

  .topbar {
    position: sticky;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 7px 10px;
  }

  .topbar-product p {
    display: none;
  }

  .topbar-save span,
  .topbar-tool span {
    display: none;
  }

  .topbar-save,
  .topbar-tool {
    width: 34px;
    min-width: 34px;
    justify-content: center;
    padding: 5px;
  }

  .mapping-screen,
  .mapping-screen.compare-open {
    display: block;
    min-height: auto;
  }

  .mapping-toolbar {
    min-height: 44px;
  }

  .mbrs-content-index {
    max-height: 252px;
  }

  

  

  .mbrs-active-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .mbrs-statement-workspace,
  .mbrs-disclosure-workspace {
    overflow-x: auto;
  }

  .mbrs-sheet {
    min-width: 680px;
  }

  .mtool-field-grid {
    grid-template-columns: 1fr;
  }

  .mtool-template-field {
    min-height: 0;
  }

  .note-text-block-row {
    grid-template-columns: 1fr;
  }

  .note-text-block-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mapping-screen.compare-open .mbrs-compare-panel {
    top: 58px !important;
    width: 100vw;
  }

  .compare-document-stage {
    padding: 10px;
  }

  .compare-document-page {
    min-height: 680px;
    padding: 24px 18px 36px;
  }

  .note-rich-editor-toolbar {
    max-height: none;
  }

  .note-rich-editor {
    min-height: 470px;
    padding: 28px 20px;
  }

  .validation-row {
    grid-template-columns: 86px 48px minmax(0, 1fr);
  }

  .validation-row .row-action {
    grid-column: 3;
    justify-self: start;
  }
}

@media (max-width: 1120px) {
  .note-editor-capture-layout.capture-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .note-source-capture-panel {
    position: static;
    width: 100%;
    height: min(540px, 62vh);
  }
}

@media (max-width: 640px) {
  .note-source-capture-controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .note-source-capture-controls p {
    grid-column: 1 / -1;
  }

  .note-source-capture-result > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .note-source-capture-result [data-note-capture-clear] {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Full Filing PDF Review & Print Styles (FS-MPERS Style)
   ========================================================================== */
.pdf-review-screen {
  height: 100%;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f1f5f9;
  padding-bottom: 60px;
  box-sizing: border-box;
}

.pdf-review-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pdf-review-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pdf-review-toolbar-left h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.pdf-review-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-review-container {
  max-width: 900px;
  margin: 24px auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 48px 56px;
}

.pdf-review-document {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  line-height: 1.5;
}

.pdf-page-section {
  margin-bottom: 32px;
  padding: 24px 28px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.pdf-section-title-bar {
  margin-bottom: 18px;
  background: #1a4c96;
  color: #ffffff;
  padding: 6pt 10pt;
  border-radius: 2px;
}

.pdf-section-title-bar h2 {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 10pt;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: normal;
  text-transform: uppercase;
}

.pdf-note-block {
  margin-bottom: 14px;
  border: 0.56pt solid #e5e8ea;
  border-radius: 2px;
  background: #ffffff;
  overflow: hidden;
}

.pdf-disclosure-band {
  background: #e8f0fe;
  color: #333333;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 9pt;
  font-weight: 700;
  padding: 5pt 10pt;
  border-bottom: 0.56pt solid #e5e8ea;
  text-align: left;
}

.pdf-note-block .pdf-narrative-block {
  padding: 6pt 8pt;
  margin: 0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 9pt;
  line-height: 13.5pt;
  color: #000000;
}

.pdf-narrative-block > :first-child {
  margin-top: 0 !important;
}

.pdf-narrative-block > :last-child {
  margin-bottom: 0 !important;
}

.pdf-statement-header {
  text-align: center;
  margin-bottom: 20px;
}

.pdf-statement-header h2 {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 2px 0;
}

.pdf-statement-header .pdf-incorporation {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 6px 0;
}

.pdf-statement-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px 0;
}

.pdf-statement-header .pdf-statement-period {
  font-size: 12px;
  color: #475569;
  margin: 0;
}

.pdf-subheading {
  font-size: 13.5px;
  font-weight: 700;
  margin: 20px 0 8px 0;
  color: #1e293b;
}

.pdf-key-value-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px 0;
  font-size: 12px;
}

.pdf-key-value-table th {
  width: 58%;
  text-align: left;
  padding: 5px 8px;
  font-weight: 500;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.pdf-key-value-table td {
  width: 42%;
  text-align: left;
  padding: 5px 8px;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.pdf-grid-table,
.pdf-financial-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12px;
}

.pdf-grid-table th {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  font-weight: 600;
  text-align: left;
}

.pdf-grid-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  vertical-align: top;
}

.pdf-financial-table thead th {
  border-top: 1.5px solid #0f172a;
  border-bottom: 1.5px solid #0f172a;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: bottom;
}

.pdf-financial-table thead th small {
  font-weight: normal;
  color: #64748b;
}

.pdf-financial-table tbody td {
  padding: 5px 6px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: top;
}

.pdf-item-cell {
  word-break: break-word;
  overflow-wrap: break-word;
  padding-right: 14px;
}

.pdf-statement-heading-cell {
  font-weight: 700;
  color: #0f172a;
  padding-top: 10px !important;
  padding-bottom: 4px !important;
  padding-right: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pdf-num-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-left: 6px;
}

.pdf-table-heading-row td {
  border-bottom: none !important;
  background: transparent !important;
}

.pdf-table-total-row td {
  font-weight: 700;
  border-top: 1px solid #0f172a !important;
  border-bottom: 3px double #0f172a !important;
}

.pdf-narrative-block {
  font-size: 12.5px;
  line-height: 1.6;
  color: #0f172a;
  margin: 12px 0;
  text-align: left;
}

.pdf-narrative-block p {
  margin: 0 0 8px 0;
  text-align: justify;
  text-justify: inter-word;
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.pdf-narrative-block .mtool-note-heading {
  font-weight: 700;
  margin: 12px 0 6px 0;
  text-align: left;
}

.pdf-narrative-block table {
  box-sizing: border-box;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0;
  font-size: 11.5px;
  border: none;
}

.pdf-narrative-block th,
.pdf-narrative-block td {
  padding: 3px 6px;
  border: none;
}

.pdf-narrative-block table.mtool-layout-table td,
.pdf-narrative-block table.mtool-layout-table th {
  border: none !important;
}

.pdf-narrative-block table:not([data-afs-table]) tr.mtool-total-row td:not(:first-child),
.pdf-narrative-block table:not([data-afs-table]) tr.mtool-summary-row td:not(:first-child) {
  border-bottom: 3.5pt double #000000;
}

.pdf-narrative-block table:not([data-afs-table]) tr.mtool-total-row td:first-child,
.pdf-narrative-block table:not([data-afs-table]) tr.mtool-summary-row td:first-child {
  border-top: none !important;
  border-bottom: none !important;
}

.pdf-narrative-block table:not([data-afs-table]) tr.mtool-total-row td,
.pdf-narrative-block table:not([data-afs-table]) tr.mtool-summary-row td {
  font-weight: 700;
}

.pdf-note-block {
  margin-bottom: 24px;
}

.pdf-note-block-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 14px 0 6px 0;
  text-align: left;
}

.pdf-footnotes {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #cbd5e1;
}

.pdf-footnotes-heading,
.pdf-footnotes h4 {
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.pdf-footnote-item,
.pdf-footnotes p {
  font-size: 11.5px;
  line-height: 1.6;
  color: #1d4ed8;
  margin: 0 0 6px 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Statement Footnotes (Breakdowns of Mapped Items)
   ========================================================================== */
.statement-footnotes-section {
  margin-top: 24px;
  padding: 16px 20px;
  border-top: 2px solid #e2e8f0;
  background: #ffffff;
  border-radius: 0 0 8px 8px;
}

.statement-footnotes-heading {
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  color: #0f172a;
  margin: 0 0 10px 0;
  text-transform: none;
  letter-spacing: normal;
}

.statement-footnotes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.statement-footnote-item {
  font-size: 12px;
  line-height: 1.6;
  color: #1d4ed8;
  font-family: inherit;
  word-break: break-word;
  overflow-wrap: break-word;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.statement-footnote-item.highlight-footnote {
  background-color: #dbeafe;
}

.statement-footnote-equation {
  color: #1d4ed8;
}

.statement-footnote-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.statement-footnote-badge:hover {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

/* ==========================================================================
   Text Block Card Styling
   ========================================================================== */
.note-text-block-export-note strong {
  color: #08776f;
}

.note-text-block-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid #cbd4dd;
  background: #fff;
}

.note-text-block-dialog-actions > div {
  display: flex;
  gap: 8px;
}

.note-mapping-editor-status {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-top: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}

.note-mapping-editor-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.note-list-start-popover {
  position: absolute;
  z-index: 50;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 8px 12px;
}

.note-source-editor-panel {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
}

.note-source-capture-pages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

.mtool-note-table-preview {
  overflow-x: auto;
  padding: 10px;
  border: 1px solid #c3ccd5;
  background: #fbfcfe;
}

.mtool-textblock-field-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.mtool-textblock-snippet {
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0%;
  min-width: 0;
}

.mtool-textblock-field-card .button {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: max-content;
}

@media (max-width: 640px) {
  .mtool-textblock-field-card {
    flex-wrap: wrap;
    gap: 8px;
  }
  .mtool-textblock-snippet {
    flex: 1 0 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .mtool-textblock-field-card .button {
    margin-left: auto;
  }
}

/* Print stylesheet moved to the end of this file for absolute cascade priority */
/* Model controls wrap within the dialog while the document keeps its own scroll area. */
.note-text-block-dialog-header, .note-text-block-dialog-actions, .afs-validation-panel { flex-shrink:0; }
.note-rich-editor-toolbar { flex:0 0 auto; flex-wrap:wrap; max-height:250px; max-height:min(36vh,250px); overflow:auto; align-items:center; }
.note-rich-editor-more { display:flex; flex:1 0 100%; min-width:0; flex-wrap:wrap; gap:8px 10px; padding-top:6px; }
.note-rich-editor-more[hidden] { display:none; }
.note-rich-editor-toolbar-group { max-width:100%; }
.note-rich-editor-more .note-rich-editor-toolbar-group { flex-wrap:wrap; }
.note-toolbar-more-toggle { margin-left:auto; border:1px solid #b8c5d2; border-radius:5px; background:white; color:#183d70; padding:0 12px; }
.afs-dimensions { display:flex; flex-wrap:wrap; gap:8px; border:0; background:transparent; }
.afs-dimension { display:flex; align-items:center; gap:4px; border:1px solid #b8c5d2; border-radius:6px; background:white; padding-left:6px; }
.afs-dimensions label { display:flex; align-items:center; gap:4px; font-size:11px; white-space:nowrap; }
.afs-dimensions input { width:58px; min-height:28px; padding:3px; }
.afs-validation-panel { padding:8px 20px; border-top:1px solid #dce2e7; font-size:12px; max-height:145px; overflow:auto; }
.afs-validation-panel summary { cursor:pointer; }
.afs-validation-panel p { margin:6px 0; }
.afs-validation-panel button { border:0; background:transparent; text-align:left; color:#735d19; cursor:pointer; font:inherit; }
@media(max-width:600px) {
 .note-text-block-dialog-header { padding:12px; }
 .note-text-block-dialog-header h3 { font-size:17px; }
 .note-text-block-dialog-actions { gap:8px; padding:8px 12px; }
 .note-text-block-dialog-actions .button { min-height:36px; padding:8px 12px; }
 .note-source-capture-message { max-width:100%; }
}

/* ========================================================================== 
   2026 workspace refresh — compact, calm and task-first
   ========================================================================== */
:root {
  --nav-950: #031c3c;
  --nav-900: #062653;
  --blue-600: #0b63f6;
  --ink-950: #0b1f3a;
  --ink-800: #263a54;
  --ink-650: #52647a;
  --line-300: #c9d4e1;
  --line-200: #dce4ed;
  --line-100: #edf2f7;
  --surface-muted: #f7f9fc;
  --radius-sm: 6px;
  --radius-md: 8px;
  --rail-width: 216px;
  --shadow: 0 8px 24px rgba(8, 34, 67, 0.07);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.button.primary {
  border-color: #0b63f6;
  background: #0b63f6;
  color: #fff;
  box-shadow: none;
}

.button.primary:hover:not(:disabled) {
  border-color: #0753d5;
  background: #0753d5;
}

.side-rail {
  background: #031c3c;
  border-right-color: #0b2c57;
}

.rail-header {
  height: 64px;
  min-height: 64px;
  padding: 0 14px 0 20px;
}

.brand-mark {
  border-bottom: 0;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.brand-symbol { display: none; }

.rail-nav {
  gap: 6px;
  padding: 28px 12px 12px;
}

.rail-step,
.rail-link {
  min-height: 44px;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 560;
}

.rail-step.active {
  background: rgba(62, 118, 207, 0.28);
  color: #fff;
}

.rail-step.active::before { display: none; }

.sidebar-toggle {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-toggle:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  transform: none;
}

body.preparation-mode .topbar {
  position: relative;
  display: flex !important;
  flex: 0 0 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  padding: 0 18px;
  border-bottom: 1px solid #11365b;
  background: #071e36;
  color: #fff;
  z-index: 60;
  box-sizing: border-box;
}

body.preparation-mode .screen {
  height: calc(100vh - 56px) !important;
  max-height: calc(100vh - 56px) !important;
  margin-top: 0 !important;
}

.topbar-product {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-product-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-product-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.topbar-product-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-filing {
  min-width: 0;
  justify-content: flex-start;
}

.topbar-workflow {
  display: none !important;
}

.topbar-company-tag {
  max-width: 340px;
  gap: 10px;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 11px;
}

.topbar-company-meta { color: #b8c8dc; }

.topbar-framework-badge {
  border-color: rgba(136, 184, 255, 0.38);
  background: rgba(49, 117, 219, 0.2);
  color: #dbeafe;
}

.topbar-actions { gap: 8px; }

.topbar-tool,
.topbar-save {
  height: 34px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.34);
  background: transparent;
  color: #f4f7fb;
  font-size: 11px;
  font-weight: 650;
}

.topbar-tool:hover:not(:disabled),
.topbar-tool.active {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-primary-action {
  height: 36px;
  min-height: 36px;
  padding-inline: 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-open-status {
  border-color: rgba(125, 171, 239, 0.34);
  background: rgba(36, 92, 174, 0.22);
  color: #dbeafe;
}

.topbar-more-menu { position: relative; }
.topbar-more-menu summary {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.topbar-more-menu summary::-webkit-details-marker { display: none; }
.topbar-more-menu summary svg { fill: currentColor; }
.topbar-more-menu > div {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 90;
  display: grid;
  width: 190px;
  padding: 6px;
  border: 1px solid #d4deea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(4, 28, 60, 0.18);
}
.topbar-menu-item {
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #263a54;
  text-align: left;
  font-size: 11px;
  font-weight: 620;
}
.topbar-menu-item:hover { background: #f0f5fb; }

.mapping-screen,
.mapping-main-area,
.mbrs-content-index,
.mapping-screen.compare-open .mbrs-compare-panel {
  height: 100%;
}

.mapping-screen {
  grid-template-columns: 256px minmax(0, 1fr);
  background: #fff;
  transition: none;
}

.mapping-screen.compare-open {
  grid-template-columns: 256px minmax(380px, 1fr) minmax(360px, 38vw);
}

.mbrs-content-index {
  padding: 18px 10px 24px;
  border-right-color: #dce4ed;
  background: #f8fafc;
}

.mbrs-navigator-heading {
  padding: 0 6px 12px;
}

.mbrs-heading-top { margin-bottom: 8px; }
.mbrs-heading-top h3 {
  color: #263a54;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.mbrs-group-tabs {
  margin: 0 0 10px;
  padding: 6px 0 10px;
  border-top: 0;
  border-bottom-color: #dce4ed;
}

.mbrs-group-tabs button,
.mbrs-section-options button { transition: none; }

.mbrs-group-tabs button.active,
.mbrs-section-options button.active {
  background: #e8f1ff;
  color: #0758d8;
}

.mbrs-section-options { gap: 3px; }
.mbrs-section-options button {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 11px;
}

.mapping-toolbar {
  flex-basis: 52px;
  min-height: 52px;
  height: 52px;
  padding: 0 18px;
  border-bottom-color: #dce4ed;
}

.mapping-heading h2 {
  color: #0b1f3a;
  font-size: 15px;
}

.mapping-section-badge { display: none; }

.mbrs-statement-workspace,
.mbrs-disclosure-workspace {
  flex: 1 1 0% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  overscroll-behavior: contain !important;
  padding: 0;
  background: #fff;
}

.mbrs-disclosure-workspace {
  padding: 0 0 80px 0 !important;
}


.mbrs-sheet {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.mbrs-sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 42px;
  background: #f7f9fc;
  color: #52647a;
  font-size: 9.5px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 #e1e7ef;
}

.mbrs-sheet-table th,
.mbrs-sheet-table td {
  height: 42px;
  padding: 6px 12px;
  border-color: #e1e7ef;
}

.mbrs-sheet-table tbody tr:hover > td,
.mbrs-sheet-table tbody tr:hover > th { background: #f5f9ff; }

.statement-total-row > td,
.statement-total-row > th { background: #eaf2ff; }

.mtool-template-control:focus,
.mtool-number-input:focus {
  border-color: #0b63f6;
  box-shadow: 0 0 0 2px rgba(11, 99, 246, 0.14);
}

@media (max-width: 1120px) {
  .topbar-product { min-width: auto; }
  .topbar-product p,
  .topbar-company-meta,
  .workspace-open-status { display: none; }
  .topbar-company-tag { max-width: 220px; padding-left: 12px; }
  .topbar-tool span { display: none; }
  .topbar-save span { display: inline; }
}

@media (max-width: 760px) {
  body.preparation-mode .topbar { padding: 0 10px; }
  .topbar-product h1 { font-size: 17px; }
  .topbar-company-tag { display: none; }
  .topbar-workflow { padding: 0 6px; grid-template-columns: repeat(4, 1fr); }
  .topbar-step { min-width: 0; gap: 5px; padding: 0 4px; font-size: 10px; }
  .topbar-step-num { width: 22px; height: 22px; }
  .topbar-step::before,
  .topbar-step::after { width: calc(50% - 25px); }
  .topbar-actions { gap: 5px; }
  .topbar-tool,
  .topbar-save,
  .topbar-more-menu summary { width: 32px; padding: 0; justify-content: center; }
  .topbar-save span,
  .topbar-primary-action span { display: none; }
  .topbar-primary-action { width: 36px; padding: 0; }
  .topbar-primary-action::after { content: "→"; font-size: 17px; }
  .mapping-screen { grid-template-columns: 48px minmax(0, 1fr); }
  .mapping-screen.compare-open { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
  .mapping-screen.compare-open .mbrs-content-index { display: none; }
  .mbrs-content-index { padding-inline: 4px; }
  .mbrs-content-index:not(.collapsed) { width: 220px; position: absolute; z-index: 40; box-shadow: 8px 0 24px rgba(4, 28, 60, 0.16); }
}

/* Desktop statement workbench refinements */
.mapping-screen.mbrs-nav-collapsed {
  grid-template-columns: 52px minmax(0, 1fr);
}

.mapping-screen.compare-open.mbrs-nav-collapsed {
  grid-template-columns: 52px minmax(380px, 1fr) minmax(320px, 34vw);
}

.mbrs-content-index.collapsed {
  width: 52px;
  padding: 14px 0;
}

.mbrs-content-index.collapsed .mbrs-heading-top h3,
.mbrs-content-index.collapsed .mbrs-section-picker,
.mbrs-content-index.collapsed .mbrs-group-tabs,
.mbrs-content-index.collapsed .mbrs-section-options {
  display: none !important;
}

.mbrs-content-index.collapsed .mbrs-heading-top,
.mbrs-content-index.collapsed .mbrs-navigator-heading {
  width: 100%;
  justify-content: center;
  padding: 0;
}

.section-nav-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: #cfd9e5;
  border-radius: 6px;
  background: #fff;
}

.mbrs-content-index.collapsed .section-nav-toggle {
  width: 34px;
  height: 34px;
}

.mapping-toolbar {
  flex-basis: 56px;
  min-height: 56px;
  height: 56px;
  padding-inline: 20px;
}

.mapping-heading h2 {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.toolbar-actions,
.mbrs-adjacent-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbrs-adjacent-nav .button {
  min-height: 34px;
  gap: 5px;
  padding-inline: 9px;
  border-color: #d5dee9;
  background: #fff;
  color: #40536b;
}

.mbrs-adjacent-nav .button:hover:not(:disabled) {
  border-color: #aebed0;
  background: #f6f9fc;
}

.search-box {
  width: 300px;
  min-width: 240px;
}

.mbrs-sheet-registration {
  display: none;
}

/* Modern Compact Statement Header */
.statement-modern-header {
  min-height: 52px;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.statement-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.statement-header-entity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.statement-company-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.statement-reg-badge {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.statement-header-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.statement-title-text {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.statement-period-badge {
  font-size: 10px;
  color: #475569;
  font-weight: 500;
}

.statement-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.statement-header-meta .meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 10px;
  color: #334155;
}

.statement-header-meta .meta-label {
  color: #64748b;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Institutional Accounting Data Grid */
.statement-sheet-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.statement-sheet-table th,
.statement-sheet-table td {
  height: 33px !important;
  padding: 3px 8px !important;
  border-bottom: 1px solid #e2e8f0;
}

.statement-sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 32px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 #cbd5e1;
}

.statement-sheet-table th:first-child,
.statement-sheet-table td:first-child {
  width: 38%;
}

.statement-sheet-table th:nth-child(2),
.statement-sheet-table td:nth-child(2),
.statement-sheet-table th:nth-child(3),
.statement-sheet-table td:nth-child(3) {
  width: 27%;
}

.statement-sheet-table th:last-child,
.statement-sheet-table td:last-child {
  width: 8%;
}

.statement-sheet-table tbody tr:hover > td,
.statement-sheet-table tbody tr:hover > th {
  background: #f8fafc;
}

.statement-sheet-table tbody tr.statement-row-active > td,
.statement-sheet-table tbody tr.statement-row-active > th {
  background: #f0fdf4 !important;
}

.statement-sheet-table tbody tr.statement-row-active td:first-child {
  box-shadow: inset 3px 0 0 #059669;
}

.statement-line-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.statement-item-name {
  font-weight: 500;
  color: #1e293b;
}

.source-page-link-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.12s ease;
}

.source-page-link-pill:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* Modern Grid Cells (replaces chunky input boxes) */
.statement-sheet-table .mtool-template-control {
  min-height: 28px !important;
  height: 28px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 4px;
  padding: 2px 6px !important;
  font-size: 12px !important;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.statement-sheet-table .mtool-template-control:hover:not([readonly]):not(:disabled) {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

.statement-sheet-table .mtool-template-control:focus {
  border-color: #2563eb !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
  outline: none !important;
}

.statement-sheet-table .mtool-template-control::placeholder {
  color: #94a3b8;
  opacity: 0.8;
  text-align: right;
}

.mtool-pending-source-preview {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
  color: #9a5900;
  font-size: 10px;
  line-height: 1.3;
}

.mtool-pending-source-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mtool-pending-source-preview small {
  flex: none;
  font-size: 9px;
  font-weight: 700;
}

.statement-cell-control .mtool-pending-source-preview {
  justify-content: flex-end;
  font-size: 9px;
}

.mtool-source-badge.pending-source,
.note-status-indicator.pending-source {
  background: #fff1d6;
  color: #8a4e00;
}

.note-text-block-row.pending-source {
  background: #fffaf0;
}

.note-pending-source-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0;
  color: #815010;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-pending-source-summary strong {
  margin-right: 5px;
}

.note-pending-source-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  margin: 12px auto;
  border: 1px solid #e6c17d;
  border-radius: 6px;
  background: #fffaf0;
}

.note-pending-source-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0d9ad;
  color: #815010;
  font-size: 11px;
}

.note-pending-source-content {
  max-height: 380px;
  overflow: auto;
  padding: 16px;
  color: #26384a;
  background: #fff;
  font-size: 12px;
}

.note-pending-source-content table {
  max-width: 100%;
  border-collapse: collapse;
}

.note-rich-editor-toolbar.pending-locked {
  display: none !important;
}

.statement-sheet-table .mtool-template-control.is-negative,
.statement-sheet-table .mtool-template-control[data-negative="true"] {
  color: #b91c1c !important;
}

.statement-sheet-table .mtool-formula-output[readonly],
.statement-sheet-table .mtool-linked-detail-output[readonly] {
  background: #f8fafc !important;
  border-color: transparent !important;
  color: #334155 !important;
  font-weight: 600;
  cursor: default;
  box-shadow: none !important;
}

.statement-sheet-table .statement-formula-mark {
  left: 4px;
  font-size: 8.5px;
  padding: 0 3px;
  height: 14px;
  border-radius: 2px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  pointer-events: none;
}

.statement-sheet-table .statement-cell-control {
  display: flex;
  align-items: center;
  position: relative;
}

/* Formal Accounting Single Overline & Double Underline on Total Rows */
.statement-sheet-table tr.statement-total-row td {
  border-top: 1px solid #475569 !important;
  border-bottom: 3px double #0f172a !important;
  background: #f8fafc !important;
  font-weight: 700 !important;
}

.statement-sheet-table tr.statement-total-row .statement-item-name {
  font-weight: 700 !important;
}

.statement-sheet-table tr.statement-total-row .mtool-template-control {
  font-weight: 700 !important;
}

.mbrs-sheet-table a {
  color: #0758d8;
  font-weight: 650;
  text-decoration: none;
}

.mbrs-sheet-table a:hover {
  text-decoration: underline;
}

/* Consolidated Modern 48px Footer */
.mapping-modern-footer {
  flex: 0 0 48px !important;
  min-height: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
  padding: 0 16px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  position: relative !important;
  box-sizing: border-box !important;
  z-index: 20 !important;
}

.footer-coverage-group {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.footer-progress-bar-wrap {
  width: 72px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.footer-progress-bar-fill {
  height: 100%;
  background: #059669;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.footer-coverage-count {
  font-size: 11.5px;
  color: #334155;
  white-space: nowrap;
}

.footer-coverage-count small {
  color: #64748b;
  font-weight: 500;
}

.footer-breakdown-btn {
  font-size: 11px;
  padding: 2px 6px;
  cursor: pointer;
  color: #2563eb;
  list-style: none;
}

.footer-breakdown-btn::-webkit-details-marker {
  display: none;
}

.full-coverage-popover {
  position: relative;
}

.coverage-popover-content {
  position: absolute;
  bottom: 34px;
  left: 0;
  width: min(440px, 80vw);
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 14px;
  z-index: 50;
  box-sizing: border-box;
}

.coverage-popover-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.coverage-popover-header strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
}

.coverage-popover-header p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: #64748b;
}

/* Hide raw topbar debug string on all screens */
.workspace-open-status {
  display: none !important;
}

/* Modern sleek scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

@media (max-width: 1050px) {
  .mapping-screen { grid-template-columns: 210px minmax(0, 1fr); }
  .mapping-screen.mbrs-nav-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
  .mbrs-adjacent-nav .button span { display: none; }
  .mbrs-adjacent-nav .button { width: 34px; padding: 0; justify-content: center; }
  .search-box { width: 270px; min-width: 210px; }
}

@media (max-width: 700px) {
  body.preparation-mode[data-step="3"] .screen:has(.compare-open) { contain: none !important; }
  .mapping-screen.compare-open .mbrs-compare-panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 1300 !important;
  }
  .source-mapping-editor { max-height: 55dvh; }
  .source-mapping-editor .field > span { font-size: 12px; }
}

/* ==========================================================================
   Full PDF Review Mode & Print Stylesheet
   ========================================================================== */
body.pdf-review-mode,
body.pdf-review-mode .app-shell,
body.pdf-review-mode .app-main,
body.pdf-review-mode .screen {
  contain: none !important;
}

body.pdf-review-mode .screen {
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  contain: none !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 9.5mm;
  }

  /* 1. Neutralize all root, viewport, scroll, containment, and clipping constraints */
  html,
  body,
  body[class],
  body[data-step],
  #app-shell,
  .app-shell,
  body .app-shell,
  body[class] .app-shell,
  .app-main,
  body .app-main,
  body[class] .app-main,
  #screen,
  .screen,
  body .screen,
  body[class] .screen,
  body[data-step] .screen,
  .pdf-review-screen,
  .pdf-review-container,
  .pdf-review-document {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    contain: none !important;
    display: block !important;
    position: static !important;
    float: none !important;
    transform: none !important;
    filter: none !important;
    clip: auto !important;
    clip-path: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
  }

  /* 2. Hide all application chrome, navigation, toolbars, and notifications */
  #topbar,
  .topbar,
  body .topbar,
  body[class] .topbar,
  #side-rail,
  .side-rail,
  body .side-rail,
  #stepper,
  .stepper,
  body .stepper,
  #filing-context,
  .filing-context,
  body .filing-context,
  .pdf-review-toolbar,
  .no-print,
  #toast-region,
  .toast-region,
  .bottom-rail,
  .mbrs-content-index,
  .mapping-toolbar,
  .sidebar-toggle,
  .rail-header,
  .rail-nav,
  .rail-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* 3. Section and page break behavior */
  .pdf-page-section {
    page-break-inside: auto !important;
    break-inside: auto !important;
    margin-bottom: 24px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .pdf-page-section:not(:first-child) {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* Headings must stay with following content */
  h1, h2, h3, h4, h5, h6,
  .pdf-section-title-bar,
  .pdf-statement-header,
  .pdf-subheading,
  .pdf-note-block-title {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  /* Tables and rows */
  table,
  .pdf-grid-table,
  .pdf-financial-table,
  .pdf-key-value-table {
    page-break-inside: auto !important;
    break-inside: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  tr,
  .pdf-table-heading-row {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  tr.mtool-total-row,
  .pdf-table-total-row {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-before: avoid !important;
    break-before: avoid !important;
  }

  tr.mtool-value-row:has(+ tr.mtool-total-row) {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .pdf-note-block {
    margin-bottom: 10pt !important;
  }

  .pdf-note-block .pdf-narrative-block {
    padding: 6pt 8pt !important;
  }

  .pdf-socie-block {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-top: 16px !important;
  }

  .pdf-footnotes {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-top: 16px !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ==========================================================================
   AFS Note Section Mapping Modal & Modules
   ========================================================================== */

.note-mapping-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}

.coverage-popover-content .coverage-sections {
  grid-template-columns: minmax(0, 1fr);
}

.coverage-popover-content .coverage-section strong,
.coverage-popover-content .coverage-section small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.coverage-popover-header [data-close-coverage] {
  float: right;
}

.validation-field-target {
  outline: 3px solid #d97706;
  outline-offset: -3px;
  background: #fff7ed !important;
  scroll-margin-block: 80px;
}

.coverage-popover-header {
  position: sticky;
  top: -14px;
  background: white;
  z-index: 1;
}

.note-mapping-dialog {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}

.note-mapping-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.note-mapping-title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-mapping-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.note-mapping-heading-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.note-mapping-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}

.note-mapping-concept-hint {
  font-size: 12px;
  color: #64748b;
  font-family: var(--font-mono, monospace);
  word-break: break-all;
}

.note-mapping-close-btn {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  background: #ffffff;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.note-mapping-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.note-mapping-dialog-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.note-mapping-current-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.note-mapping-current-status.is-mapped {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.note-mapping-current-status.is-unmapped {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.current-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator-dot.mapped {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-indicator-dot.unmapped {
  background: #94a3b8;
}

.note-mapping-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-mapping-selector-group label strong {
  display: block;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 2px;
}

.field-subtext {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.note-mapping-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.note-mapping-select:focus {
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.note-mapping-preview-container {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.preview-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #0f172a;
}

.preview-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
}

.preview-card-meta {
  display: flex;
  gap: 6px;
}

.preview-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.preview-badge.pages {
  background: #e0e7ff;
  color: #3730a3;
}

.preview-badge.tables {
  background: #fef3c7;
  color: #92400e;
}

.note-mapping-conflict-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
  color: #92400e;
  font-size: 12px;
}

.preview-card-content {
  padding: 12px 14px;
}

.preview-snippet-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.preview-snippet-text {
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
  white-space: pre-wrap;
}

.note-mapping-rule-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.note-mapping-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.note-mapping-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  cursor: pointer;
}

.checkbox-copy strong {
  display: block;
  font-size: 13px;
  color: #1e3a8a;
}

.checkbox-copy p,
.checkbox-copy small {
  margin: 2px 0 0;
  font-size: 11px;
  color: #3b82f6;
  line-height: 1.35;
}

.note-mapping-scope-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #dbeafe;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #1e40af;
  white-space: nowrap;
}

.note-mapping-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.note-mapping-dialog-footer .footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-map-section-btn {
  font-size: 12px;
  padding: 4px 10px;
  white-space: nowrap;
}

.note-toolbar-map-btn {
  font-size: 11px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.compare-source-note-mapping-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
}

.compare-source-note-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-mapping-error-banner {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 12px;
}

/* Composite Multi-Item Notes Status & Chips */
.note-mapping-current-status.is-composite {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.composite-status-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.composite-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #166534;
}

.composite-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.composite-item-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 12px;
  color: #1e293b;
}

.composite-item-chip .chip-bullet {
  color: #22c55e;
  font-weight: bold;
}

.composite-item-chip .chip-title {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composite-item-chip .chip-page {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.composite-item-chip .remove-item-btn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.composite-item-chip .remove-item-btn:hover {
  background: #fecaca;
  color: #991b1b;
}

.composite-status-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #bbf7d0;
  padding-top: 8px;
}

/* Drag-and-drop & Reordering enhancements for composite notes */
.composite-item-chip.is-draggable {
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.composite-item-chip.is-draggable:hover {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.composite-item-chip.is-dragging {
  opacity: 0.4;
  background: #dcfce7;
  border: 1px dashed #16a34a;
  cursor: grabbing !important;
}

.composite-item-chip.drag-over {
  border-top: 2px solid #2563eb;
  background: #eff6ff;
  transform: translateY(-2px);
}

.composite-item-chip .chip-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  letter-spacing: -2px;
  cursor: grab;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.composite-item-chip:hover .chip-drag-handle {
  color: #475569;
  background: #e2e8f0;
}

.composite-item-chip .chip-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
}

.chip-reorder-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.reorder-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 9px;
  line-height: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.reorder-arrow-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.reorder-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.composite-drag-hint {
  display: block;
  font-size: 11px;
  color: #15803d;
  margin-top: 2px;
  font-weight: 400;
}

/* Composite strip in Text Block Editor */
.note-editor-composite-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
}

.note-editor-composite-strip .composite-strip-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #166534;
}

.note-editor-composite-strip .composite-strip-hint {
  font-size: 11px;
  color: #15803d;
  font-weight: 400;
  margin-left: auto;
}

.composite-strip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composite-strip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid #86efac;
  border-radius: 4px;
  font-size: 11px;
  color: #1e293b;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}

.composite-strip-chip:hover {
  background: #f0fdf4;
  border-color: #4ade80;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.composite-strip-chip.is-dragging {
  opacity: 0.4;
  border-style: dashed;
  cursor: grabbing !important;
}

.composite-strip-chip.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.composite-strip-chip .chip-drag-handle {
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: -2px;
  cursor: grab;
}

.composite-strip-chip .chip-num {
  font-weight: 700;
  color: #16a34a;
}

.composite-strip-chip .chip-text {
  font-weight: 500;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composite-strip-chip .chip-mini-arrows {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
}

.mini-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  font-size: 8px;
  line-height: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 3px;
  cursor: pointer;
  color: #475569;
}

.mini-arrow-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.mini-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.destination-dimension-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px 0;
  padding: 5px 8px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.dimension-switcher-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dimension-switcher-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dimension-switch-btn {
  font-size: 11px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.dimension-switch-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.dimension-switch-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  font-weight: 600;
}

.dimension-switch-btn small {
  opacity: 0.85;
}


/* Balancing Residual Calculator Modal */
.misc-residual-modal {
  width: min(860px, 96vw);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.misc-residual-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.misc-residual-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.misc-residual-callout-icon {
  font-size: 20px;
  line-height: 1;
}

.misc-residual-callout-text p {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #166534;
}

.misc-residual-callout-text code {
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #14532d;
  font-family: monospace;
}

.misc-residual-callout-text small {
  display: block;
  color: #15803d;
  font-size: 12px;
}

.misc-residual-conso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .misc-residual-conso-grid {
    grid-template-columns: 1fr;
  }
}

.misc-residual-single-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.misc-residual-scope-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.scope-block-header {
  margin-bottom: 12px;
}

.scope-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.scope-badge.group {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.scope-badge.company {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.scope-columns-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.residual-column-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.residual-input-group label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 600;
}

.currency-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.currency-input-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.currency-prefix {
  padding: 6px 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid #cbd5e1;
}

.residual-num-input {
  flex: 1;
  border: none;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  width: 100%;
  outline: none;
  font-family: inherit;
  color: #0f172a;
}

.residual-deduction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  padding: 2px 0;
}

.deduction-val {
  font-weight: 600;
  color: #dc2626;
}

.residual-result-card {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
}

.residual-result-card.zero {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.result-label {
  font-size: 11px;
  color: #15803d;
  font-weight: 600;
}

.result-val {
  font-size: 16px;
  font-weight: 700;
  color: #166534;
  text-align: right;
  margin-top: 2px;
}

.result-val.zero {
  color: #94a3b8;
}

.misc-residual-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line-300);
  background: #f8fafc;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
