:root {
  --palette-light-greenish-blue: #55efc4;
  --palette-faded-poster: #81ecec;
  --palette-green-darner-tail: #74b9ff;
  --palette-shy-moment: #a29bfe;
  --palette-city-lights: #dfe6e9;
  --palette-mint-leaf: #00b894;
  --palette-robin-egg-blue: #00cec9;
  --palette-electron-blue: #0984e3;
  --palette-exodus-fruit: #6c5ce7;
  --palette-soothing-breeze: #b2bec3;
  --palette-sour-lemon: #ffeaa7;
  --palette-first-date: #fab1a0;
  --palette-pink-glamour: #ff7675;
  --palette-pico-8-pink: #fd79a8;
  --palette-american-river: #636e72;
  --palette-bright-yarrow: #fdcb6e;
  --palette-orangeville: #e17055;
  --palette-chi-gong: #d63031;
  --palette-prunus-avium: #e84393;
  --palette-dracula-orchid: #2d3436;
  --bg: #f6f8fa;
  --bg-page: var(--bg);
  --bg-surface: #ffffff;
  --bg-section: #edf8ff;
  --bg-total: #f3f7fa;
  --surface: #ffffff;
  --text: var(--palette-dracula-orchid);
  --text-main: var(--text);
  --muted: #667585;
  --text-muted: var(--muted);
  --line: #d9e3ea;
  --border-subtle: var(--line);
  --primary: var(--palette-electron-blue);
  --blue-action: var(--primary);
  --ok: #078466;
  --green-ready: var(--palette-mint-leaf);
  --warn: #946200;
  --yellow-review: var(--palette-bright-yarrow);
  --red-error: var(--palette-chi-gong);
  --radius-panel: 8px;
  --radius-control: 6px;
  --checkbox-size: 16px;
  --sidebar-width: 276px;
  --shadow: 0 8px 24px rgba(45, 52, 54, 0.06);
  --shadow-soft: var(--shadow);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 12px min(4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-brand {
  display: grid;
  gap: 1px;
  min-width: 230px;
}

.topbar nav,
.topbar-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.topbar a,
.nav-menu button {
  border-radius: 6px;
  color: #344256;
  line-height: 1;
  padding: 9px 10px;
}

.topbar a:hover,
.nav-menu button:hover,
.nav-menu:focus-within > button {
  background: #edf8ff;
  color: var(--primary);
}

.nav-menu {
  position: relative;
}

.nav-menu button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nav-submenu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  min-width: 150px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 5;
}

.nav-menu:focus-within .nav-submenu,
.nav-menu:hover .nav-submenu {
  display: grid;
  gap: 8px;
}

.app-layout {
  min-height: 100vh;
  padding-left: var(--sidebar-width);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  bottom: 0;
  box-shadow: 8px 0 24px rgba(45, 52, 54, 0.03);
  display: flex;
  flex-direction: column;
  left: 0;
  overflow-y: auto;
  position: fixed;
  top: 0;
  width: var(--sidebar-width);
  z-index: 70;
}

.sidebar-brand {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 11px;
  min-height: 72px;
  padding: 18px 18px 16px;
}

.sidebar-brand-mark {
  align-items: center;
  border: 1px solid #c7d4e2;
  border-radius: 7px;
  color: #2f4c68;
  display: inline-flex;
  flex: 0 0 auto;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.sidebar-brand-mark svg,
.sidebar-icon svg,
.sidebar-mobile-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-brand-mark svg {
  height: 18px;
  width: 18px;
}

.sidebar-brand strong {
  color: #172234;
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.sidebar-brand small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 14px 10px;
}

.sidebar-nav-main {
  display: grid;
  gap: 3px;
}

.sidebar-link,
.sidebar-section-toggle {
  align-items: center;
  border-radius: 6px;
  color: #344256;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
}

.sidebar-link:hover,
.sidebar-section-toggle:hover,
.sidebar-sublink:hover {
  background: #edf4fd;
  color: var(--primary);
}

.sidebar-link.is-active,
.sidebar-sublink.is-active {
  background: #e8f1ff;
  color: #075ec9;
}

.sidebar-link.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-icon {
  align-items: center;
  color: #526477;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  width: 20px;
}

.sidebar-link.is-active .sidebar-icon,
.sidebar-section.is-active .sidebar-section-title .sidebar-icon,
.sidebar-details.is-active .sidebar-section-toggle .sidebar-icon {
  color: var(--primary);
}

.sidebar-icon svg {
  height: 17px;
  width: 17px;
}

.sidebar-section {
  border-top: 1px solid #e7edf3;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
}

.sidebar-section-title {
  align-items: center;
  color: #172234;
  display: flex;
  font-size: 14px;
  font-weight: 900;
  gap: 10px;
  min-height: 34px;
  padding: 5px 10px;
}

.sidebar-subnav {
  display: grid;
  gap: 2px;
  padding-left: 30px;
}

.sidebar-sublink {
  border-radius: 5px;
  color: #3f4d5f;
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 10px;
}

.sidebar-sublink.is-active {
  font-weight: 850;
}

.sidebar-nav-bottom {
  border-top: 1px solid #e7edf3;
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
}

.sidebar-details summary {
  cursor: pointer;
  list-style: none;
}

.sidebar-details summary::-webkit-details-marker {
  display: none;
}

.sidebar-details .sidebar-section-toggle::after {
  color: #6a7b8e;
  content: "v";
  font-size: 12px;
  margin-left: auto;
}

.sidebar-details[open] .sidebar-section-toggle::after {
  transform: rotate(180deg);
}

.sidebar-subnav-settings {
  margin-top: 2px;
}

.sidebar-page-help .sidebar-section-toggle,
.sidebar-page-help-link {
  color: #344256;
}

.sidebar-page-help[open] .sidebar-section-toggle {
  background: #edf8ff;
  color: var(--primary);
}

.sidebar-page-help[open] .sidebar-icon {
  color: var(--primary);
}

.sidebar-page-help-panel {
  background: #f8fafc;
  border: 1px solid #dbe6f1;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  margin: 4px 0 6px 30px;
  max-height: min(380px, calc(100vh - 240px));
  overflow: auto;
  padding: 10px;
}

.sidebar-page-help-panel .aml-page-help-heading,
.sidebar-page-help-panel .aml-page-help-entry-heading {
  align-items: flex-start;
  display: grid;
  gap: 4px;
}

.sidebar-page-help-panel .aml-page-help-heading h3,
.sidebar-page-help-panel .aml-page-help-entry h4 {
  font-size: 13px;
  line-height: 1.25;
  margin: 0;
}

.sidebar-page-help-panel .aml-page-help-heading a {
  font-size: 12px;
  font-weight: 750;
}

.sidebar-page-help-panel .aml-page-help-entry {
  border-top: 1px solid #e6edf5;
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.sidebar-page-help-panel .aml-page-help-entry:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.sidebar-page-help-panel .aml-markdown-body {
  font-size: 12px;
  gap: 6px;
  line-height: 1.4;
}

.sidebar-signout {
  color: #344256;
}

.sidebar-mobile-toggle,
.sidebar-backdrop {
  display: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  letter-spacing: 0;
  line-height: 1.15;
}

h2 {
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.18;
}

h3 {
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.25;
}

.topbar p,
.hero p,
.empty {
  color: var(--muted);
}

.shell {
  margin: 18px auto 40px;
  width: min(1180px, calc(100vw - 32px));
}

.app-layout > .shell {
  width: min(1180px, calc(100vw - var(--sidebar-width) - 32px));
}

.bas-workspace-page .shell {
  margin-top: 12px;
  width: min(1760px, calc(100vw - 16px));
}

.bas-workspace-page .app-layout > .shell {
  width: min(1760px, calc(100vw - var(--sidebar-width) - 16px));
}

.year-end-mapping-page .shell {
  margin-top: 12px;
  width: min(2200px, calc(100vw - 16px));
}

.year-end-mapping-page .app-layout > .shell {
  width: min(2200px, calc(100vw - var(--sidebar-width) - 16px));
}

.requests-wide-page .shell {
  margin-top: 12px;
  max-width: none;
  width: calc(100vw - 16px);
}

.requests-wide-page .app-layout > .shell {
  max-width: none;
  width: calc(100vw - var(--sidebar-width) - 16px);
}

.aml-command-header {
  align-items: flex-start;
  gap: 12px;
}

.aml-document-header {
  background:
    linear-gradient(90deg, rgba(9, 132, 227, 0.08), rgba(0, 184, 148, 0.05) 48%, rgba(253, 203, 110, 0.08)),
    #fff;
  border: 1px solid #d6e2ec;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(45, 52, 54, 0.05);
  margin-bottom: 12px;
  padding: 14px 16px;
}

.aml-document-header h2 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 21px;
  gap: 8px;
  letter-spacing: 0;
  margin: 0;
}

.aml-document-header p {
  color: #546372;
  font-size: 13px;
  margin-top: 3px;
}

.aml-document-header .eyebrow {
  color: #516171;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.aml-header-link {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #cfdbe6;
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 10px;
}

.aml-header-link:hover {
  border-color: #93b9da;
  color: var(--primary);
}

.aml-command-actions {
  align-items: flex-end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.aml-dashboard-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
}

.aml-action-sheet,
.aml-reference-strip {
  background: #fff;
  border: 1px solid #d9e3ea;
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -2px 0 12px;
  overflow: hidden;
}

.aml-reference-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aml-action-sheet a,
.aml-reference-strip a {
  color: var(--text);
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 12px 14px;
  text-decoration: none;
}

.aml-action-sheet a + a,
.aml-reference-strip a + a {
  border-left: 1px solid #e0e8ef;
}

.aml-action-sheet a:hover,
.aml-reference-strip a:hover {
  background: #f5fbff;
}

.aml-action-sheet strong,
.aml-reference-strip strong {
  font-size: 13px;
}

.aml-action-sheet span,
.aml-reference-strip span {
  color: #607080;
  font-size: 12px;
  font-weight: 650;
}

.aml-register-shortcuts {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.aml-register-shortcuts a {
  background: #fff;
  border: 1px solid #d1dee9;
  border-radius: 5px;
  color: #34516a;
  font-size: 12px;
  font-weight: 750;
  padding: 6px 9px;
  text-decoration: none;
}

.aml-register-shortcuts a:hover,
.aml-register-shortcuts a.is-active {
  background: #eaf5ff;
  border-color: #76a8d1;
  color: #124d78;
}

.aml-register-focus-cdd [data-register-panel],
.aml-register-focus-reviews [data-register-panel],
.aml-register-focus-escalations [data-register-panel],
.aml-register-focus-training [data-register-panel] {
  display: none;
}

.aml-register-focus-cdd [data-register-panel="cdd"],
.aml-register-focus-reviews [data-register-panel="reviews"],
.aml-register-focus-escalations [data-register-panel="escalations"],
.aml-register-focus-training [data-register-panel="training"] {
  display: block;
}

.ai-table-scroll { overflow-x: auto; max-width: 100%; }
.ai-intake-table { min-width: 980px; table-layout: fixed; }
.ai-intake-table th:first-child { width: 72px; }
.ai-intake-table th:last-child { width: 96px; }
.ai-intake-table input:not([type="checkbox"]), .ai-intake-table select,
.ai-suggestion-table input:not([type="checkbox"]), .ai-suggestion-table textarea {
  width: 100%; min-width: 0; box-sizing: border-box; margin: 3px 0;
}
.ai-suggestion-table { min-width: 860px; table-layout: fixed; }
.ai-suggestion-table th:first-child { width: 72px; }
.ai-suggestion-table th:nth-child(2) { width: 22%; }
.ai-workspace td { vertical-align: top; overflow-wrap: anywhere; }
.ai-reply-types { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-run-history { margin-top: 12px; }
.ai-workspace .section-actions { align-items: end; }
.ai-workspace .button { white-space: normal; word-break: normal; overflow-wrap: normal; }
.year-end-table-scroll { max-width: 100%; overflow-x: auto; }
.setup-inline-form { display: block; }
.setup-inline-form select { width: 100%; }
.client-type-code { display: inline-block; min-width: 18px; text-align: center; }
.setup-add-control { margin-top: 4px; font-size: 0.76rem; }
.setup-add-control > summary { color: #0667c9; cursor: pointer; font-weight: 650; }
.setup-add-control form { margin-top: 5px; min-width: 260px; }
.setup-add-control input[type="file"] { max-width: 220px; font-size: 0.72rem; }
.contact-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.contact-create-grid label { display: grid; gap: 2px; font-size: 0.7rem; }
.contact-create-grid label span { color: #667085; font-weight: 400; }
.contact-create-grid input,
.contact-create-grid textarea { min-width: 0; width: 100%; }
.contact-create-grid .contact-notes { grid-column: 1 / -1; }
.ai-setting-row { align-items: start; display: grid; gap: 5px; }
.ai-setting-line { align-items: flex-start; display: flex; gap: 6px; min-height: 22px; }
.ai-setting-line > label { align-items: center; display: inline-flex; gap: 5px; min-height: 22px; }
.ai-setting-line input { margin: 0; }
.ai-setting-help { color: #475467; font-size: 0.76rem; max-width: 820px; }
.ai-setting-help > summary {
  align-items: center;
  background: #f3f8fc;
  border: 1px solid #9eb8cd;
  border-radius: 50%;
  color: #175b8d;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  list-style: none;
  width: 18px;
}
.ai-setting-help > summary::-webkit-details-marker { display: none; }
.ai-setting-help p { background: #f7fafc; border-left: 2px solid #9eb8cd; margin: 4px 0 2px; padding: 5px 7px; }
@media (max-width: 760px) {
  .year-end-table-scroll > table { min-width: 720px; }
  .odyssey-mapping-panel { min-width: 0; max-width: 100%; overflow-x: auto; }
}

@media print {
  .sidebar,
  .site-sidebar,
  .primary-navigation,
  .aml-action-sheet,
  .aml-register-shortcuts,
  .page-help {
    display: none !important;
  }

  .shell,
  main {
    max-width: none !important;
    width: 100% !important;
  }
}

.aml-workstream-strip {
  background: #fff;
  border: 1px solid #d9e3ea;
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 12px;
  overflow: hidden;
}

.aml-workstream-strip > a,
.aml-workstream-strip > div {
  color: var(--text);
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 11px 14px;
  text-decoration: none;
}

.aml-workstream-strip > a + a,
.aml-workstream-strip > a + div,
.aml-workstream-strip > div + a,
.aml-workstream-strip > div + div {
  border-left: 1px solid #e0e8ef;
}

.aml-workstream-strip > a:hover {
  background: #f5fbff;
}

.aml-workstream-strip span,
.aml-workstream-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.aml-workstream-strip strong {
  font-size: 22px;
  line-height: 1;
}

.aml-document-header + .aml-page-help + .aml-dashboard-kpis,
.aml-document-header + .aml-page-help-fallback + .aml-dashboard-kpis,
.aml-document-header + .aml-dashboard-kpis {
  margin-top: 0;
}

.aml-kpi-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 3px;
  min-height: 86px;
  padding: 10px;
  text-decoration: none;
}

.aml-kpi-tile:hover {
  border-color: #93b9da;
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.12);
}

.aml-kpi-tile span,
.aml-kpi-tile small {
  color: var(--muted);
  font-size: 12px;
}

.aml-kpi-tile span {
  font-weight: 800;
}

.aml-kpi-tile strong {
  font-size: 26px;
  line-height: 1;
}

.aml-dashboard-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.aml-dashboard-column {
  display: grid;
  gap: 10px;
}

.aml-dashboard-panel {
  padding: 0;
}

.aml-dashboard-panel-heading {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #dfe8f0;
  border-radius: 8px 8px 0 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
  padding: 9px 12px;
}

.aml-dashboard-panel-heading h3 {
  font-size: 14px;
  margin: 0;
}

.aml-dashboard-panel-heading a,
.aml-dashboard-panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.aml-dashboard-panel-heading a:hover {
  color: var(--accent);
}

.aml-collapsed-panel {
  padding: 0;
}

.aml-collapsed-panel summary {
  cursor: pointer;
  list-style: none;
}

.aml-collapsed-panel summary::-webkit-details-marker {
  display: none;
}

.aml-collapsed-panel summary > span:first-child {
  display: grid;
  gap: 2px;
}

.aml-collapsed-panel summary strong {
  color: var(--text);
  font-size: 14px;
}

.aml-collapsed-panel summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.aml-collapsed-panel-body {
  border-top: 1px solid #dfe8f0;
}

.aml-tight-table {
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

.aml-tight-table table {
  font-size: 12px;
}

.aml-tight-table th,
.aml-tight-table td {
  padding: 8px 10px;
}

.aml-dashboard-panel > .empty,
.aml-dashboard-panel > .aml-risk-list,
.aml-dashboard-panel > .aml-dashboard-split,
.aml-dashboard-panel > .table-wrap:not(.aml-tight-table) {
  margin: 0;
  padding: 10px 12px 12px;
}

.aml-document-header ~ .panel,
.aml-document-header ~ .aml-form-workspace .panel,
.aml-document-header ~ .aml-case-main .panel {
  border-color: #dbe5ee;
  box-shadow: 0 6px 18px rgba(45, 52, 54, 0.045);
}

.aml-document-header ~ .panel > h3:first-child,
.aml-document-header ~ .aml-case-main .panel > h3:first-child,
.aml-document-header ~ .panel > .panel-heading:first-child,
.aml-document-header ~ .aml-case-main .panel > .panel-heading:first-child {
  background: #f8fafc;
  border-bottom: 1px solid #dfe8f0;
  border-radius: 8px 8px 0 0;
  margin: -16px -16px 14px;
  padding: 10px 14px;
}

.aml-document-header ~ .panel > h3:first-child,
.aml-document-header ~ .aml-case-main .panel > h3:first-child {
  font-size: 14px;
}

.aml-document-header ~ .panel .stack-form,
.aml-document-header ~ .aml-form-workspace .stack-form {
  gap: 13px;
}

.aml-document-header ~ .panel label,
.aml-document-header ~ .aml-form-workspace label {
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.aml-document-header ~ .panel input,
.aml-document-header ~ .panel select,
.aml-document-header ~ .panel textarea,
.aml-document-header ~ .aml-form-workspace input,
.aml-document-header ~ .aml-form-workspace select,
.aml-document-header ~ .aml-form-workspace textarea {
  background: #fff;
  border-color: #cfdbe6;
}

.aml-document-header ~ .panel input:focus,
.aml-document-header ~ .panel select:focus,
.aml-document-header ~ .panel textarea:focus,
.aml-document-header ~ .aml-form-workspace input:focus,
.aml-document-header ~ .aml-form-workspace select:focus,
.aml-document-header ~ .aml-form-workspace textarea:focus {
  border-color: #74b9ff;
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.16);
  outline: 0;
}

.aml-dashboard-split {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.aml-dashboard-split div {
  background: #f8fafc;
  border: 1px solid #dfe8ef;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.aml-dashboard-split span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.aml-dashboard-split strong {
  font-size: 22px;
}

.aml-risk-list {
  display: grid;
  gap: 9px;
}

.aml-risk-row {
  display: grid;
  gap: 5px;
}

.aml-risk-row > div:first-child {
  align-items: center;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}

.aml-risk-row span {
  color: var(--muted);
  font-weight: 800;
}

.aml-risk-track {
  background: #edf2f7;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.aml-risk-fill {
  background: #94a3b8;
  display: block;
  height: 100%;
  width: var(--risk-share);
}

.aml-risk-fill-low {
  background: #00b894;
}

.aml-risk-fill-medium {
  background: #d97706;
}

.aml-risk-fill-high {
  background: #dc2626;
}

.aml-risk-fill-not_rated {
  background: #94a3b8;
}

.aml-personnel-grid {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.aml-personnel-card {
  padding: 0;
}

.aml-personnel-card-heading {
  align-items: flex-start;
  background: #f8fafc;
  border-bottom: 1px solid #dfe8f0;
  border-radius: 8px 8px 0 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.aml-personnel-card-heading h3 {
  font-size: 14px;
  margin: 0;
}

.aml-personnel-card-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 2px 0 0;
}

.aml-role-fold {
  border-top: 1px solid #e3ebf2;
  padding: 0;
}

.aml-role-fold summary {
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  padding: 9px 12px;
}

.aml-role-fold summary::-webkit-details-marker {
  display: none;
}

.aml-role-fold summary::after {
  content: "+";
  float: right;
}

.aml-role-fold[open] summary::after {
  content: "-";
}

.aml-role-fold dl,
.aml-role-fold p,
.aml-role-fold ul {
  color: #4b5c6c;
  font-size: 12px;
  margin: 0;
}

.aml-role-fold dl {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.aml-role-fold dt {
  color: #1f2d3d;
  font-weight: 900;
}

.aml-role-fold dd {
  margin: 0;
}

.aml-personnel-layout {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.hero,
.panel,
.auth-card,
.metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
}

.hero,
.panel,
.auth-card {
  padding: 16px;
}

.auth-card-narrow {
  display: grid;
  gap: 10px;
  margin-left: auto;
  margin-right: auto;
  max-width: 620px;
}

.bas-workspace-page .hero,
.bas-workspace-page .panel {
  padding: 12px;
}

.bas-workspace-page .hero,
.bas-workspace-page .organisation-focus,
.bas-workspace-page .setup-disclosure {
  margin-bottom: 10px;
}

.hero {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metrics {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metrics article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong {
  font-size: 28px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-disclosure {
  margin-bottom: 18px;
}

.setup-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
}

.setup-summary::-webkit-details-marker {
  display: none;
}

.setup-summary span {
  font-size: 18px;
  font-weight: 800;
}

.setup-summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.setup-summary::after {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  content: "Open";
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.setup-disclosure[open] .setup-summary {
  margin-bottom: 18px;
}

.setup-disclosure[open] .setup-summary::after {
  content: "Hide";
}

.actions-panel {
  margin-bottom: 18px;
}

.organisation-focus {
  margin-bottom: 18px;
}

.focus-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.bas-focus-form {
  flex: 1 1 980px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) auto auto auto;
  margin-top: 0;
}

.bas-focus-toolbar {
  align-items: end;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.bas-sync-form {
  margin-top: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-action-layout {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
}

.sync-action-groups {
  display: grid;
  gap: 10px;
}

.sync-action-group {
  border-left: 4px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
}

.sync-action-group .table-actions {
  margin-top: 6px;
}

.sync-action-title {
  color: var(--text);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.action-group-green {
  background: rgba(85, 239, 196, 0.08);
  border-left-color: var(--palette-mint-leaf);
}

.action-group-blue {
  background: rgba(116, 185, 255, 0.09);
  border-left-color: var(--palette-electron-blue);
}

.action-group-orange {
  background: rgba(253, 203, 110, 0.11);
  border-left-color: var(--palette-orangeville);
}

.action-group-neutral {
  background: rgba(223, 230, 233, 0.32);
  border-left-color: var(--palette-soothing-breeze);
}

.sync-action-help {
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px;
}

.sync-action-help strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.sync-action-help p {
  margin: 0 0 7px;
}

.sync-action-help p:last-child {
  margin-bottom: 0;
}

.sync-action-help span {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 980px) {
  .sync-action-layout {
    grid-template-columns: 1fr;
  }
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.primary-action {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  font-weight: 700;
  padding: 12px 14px;
}

.message.success {
  background: rgba(85, 239, 196, 0.16);
  border-color: rgba(0, 184, 148, 0.28);
  color: var(--ok);
}

.message.error {
  background: rgba(255, 118, 117, 0.13);
  border-color: rgba(214, 48, 49, 0.28);
  color: var(--red-error);
}

.message.warning {
  background: rgba(253, 203, 110, 0.2);
  border-color: rgba(148, 98, 0, 0.24);
  color: var(--warn);
}

.message.info {
  background: rgba(116, 185, 255, 0.16);
  border-color: rgba(9, 132, 227, 0.24);
  color: var(--primary);
}

table {
  border-collapse: collapse;
  margin-top: 12px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
}

th {
  color: #334155;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.status.ok {
  background: rgba(85, 239, 196, 0.18);
  color: var(--ok);
}

.status.warn {
  background: rgba(253, 203, 110, 0.22);
  color: var(--warn);
}

.status.caution {
  background: rgba(116, 185, 255, 0.18);
  color: var(--primary);
}

.ftc-autosave-summary {
  margin-top: 4px;
}

.ftc-autosave-summary[data-state="saved"],
.ftc-tag-status[data-state="saved"] {
  color: var(--ok);
}

.ftc-autosave-summary[data-state="error"],
.ftc-tag-status[data-state="error"] {
  color: var(--red-error);
}

.ftc-autosave-summary[data-state="saving"],
.ftc-tag-status[data-state="saving"] {
  color: var(--primary);
}

.ftc-tag-status {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
  min-height: 14px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.button {
  align-items: center;
  background: #fff;
  border: 1px solid #b8c4d2;
  border-radius: var(--radius-control);
  color: #253344;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  gap: 6px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
}

.button:hover,
.small-button:hover,
.icon-button:hover,
.mini-icon-button:hover,
.mini-button:hover {
  border-color: #93b9da;
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.18);
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button.compact {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 10px;
}

.button.danger {
  background: rgba(255, 118, 117, 0.12);
  border-color: rgba(214, 48, 49, 0.28);
  color: var(--red-error);
}

.button.action-green,
.small-button.action-green {
  background: rgba(85, 239, 196, 0.14);
  border-color: rgba(0, 184, 148, 0.24);
  color: #10644f;
}

.button.action-blue,
.small-button.action-blue {
  background: rgba(116, 185, 255, 0.16);
  border-color: rgba(9, 132, 227, 0.24);
  color: #075da4;
}

.button.action-orange,
.small-button.action-orange {
  background: rgba(253, 203, 110, 0.18);
  border-color: rgba(225, 112, 85, 0.24);
  color: #8b4509;
}

.button.action-red,
.small-button.action-red {
  background: rgba(255, 118, 117, 0.13);
  border-color: rgba(214, 48, 49, 0.24);
  color: #a31f20;
}

.small-button {
  align-items: center;
  background: #fff;
  border: 1px solid #b8c4d2;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  min-height: 32px;
  padding: 5px 9px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input {
  border: 1px solid #cbd5df;
  border-radius: var(--radius-control);
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

select,
input[type="file"],
textarea {
  border: 1px solid #cbd5df;
  border-radius: var(--radius-control);
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.22);
  outline: 0;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
  outline: 2px solid rgba(9, 132, 227, 0.28);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.28);
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
  display: inline-block;
  flex: 0 0 auto;
  height: var(--checkbox-size);
  min-height: var(--checkbox-size);
  padding: 0;
  vertical-align: middle;
  width: var(--checkbox-size);
}

.message-draft {
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.row-checkbox {
  min-height: var(--checkbox-size);
  width: var(--checkbox-size);
}

label {
  color: #334155;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aml-detail-form {
  gap: 16px;
}

.aml-form-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.aml-form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.aml-form-section h4 {
  font-size: 14px;
  margin: 0;
}

.aml-detail-grid {
  align-items: start;
}

.aml-workspace {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}

.aml-flow-panel,
.aml-section-panel,
.aml-next-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.aml-flow-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.aml-flow-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.aml-flow-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.aml-flow-map {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.aml-flow-step {
  background: #f8fafc;
  border: 1px solid #d9e3ea;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 10px;
}

.aml-flow-step.complete {
  background: rgba(85, 239, 196, 0.12);
  border-color: rgba(0, 184, 148, 0.36);
}

.aml-flow-step.current {
  background: #edf8ff;
  border-color: rgba(9, 132, 227, 0.45);
  box-shadow: inset 0 0 0 1px rgba(9, 132, 227, 0.12);
}

.aml-flow-step.blocked {
  background: rgba(253, 203, 110, 0.14);
  border-color: rgba(253, 203, 110, 0.7);
}

.aml-flow-step.locked {
  background: #f1f5f9;
  border-style: dashed;
  color: #64748b;
}

.aml-flow-step.upcoming {
  color: #64748b;
}

.aml-flow-step.restricted .aml-flow-label::after {
  color: var(--muted);
  content: "Restricted";
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
  text-transform: uppercase;
}

.aml-flow-index {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.aml-flow-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

a.aml-flow-label {
  color: var(--primary);
}

.aml-flow-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.aml-workspace-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
}

.aml-section-panel,
.aml-next-panel {
  padding: 14px;
}

.aml-section-panel h3,
.aml-next-panel h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.aml-section-nav {
  display: grid;
  gap: 6px;
}

.aml-section-nav a {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: var(--text);
  display: flex;
  font-size: 13px;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 10px;
}

.aml-section-nav a:hover {
  border-color: #93b9da;
  box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.14);
}

.aml-section-nav a.restricted {
  border-style: dashed;
  color: #64748b;
}

.aml-section-nav small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.aml-next-list {
  color: #334155;
  display: grid;
  gap: 7px;
  font-size: 13px;
  margin: 0;
  padding-left: 18px;
}

.aml-mini-alert {
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.aml-mini-alert.warning {
  background: rgba(253, 203, 110, 0.16);
  border: 1px solid rgba(253, 203, 110, 0.55);
}

.aml-mini-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #065f46;
}

.aml-save-cluster {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.aml-autosave-error {
  background: rgba(214, 48, 49, 0.08);
  color: var(--red-error);
}

.aml-case-header h2 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aml-workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  margin: 0 0 14px;
  padding: 16px;
}

.aml-workspace-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.aml-workspace-heading h3 {
  font-size: 16px;
  margin: 0;
}

.aml-workspace-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.aml-workspace .aml-flow-map {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.aml-workspace .aml-flow-step {
  align-items: start;
  display: flex;
  gap: 9px;
  min-height: 76px;
}

.aml-flow-copy {
  display: grid;
  gap: 4px;
}

.aml-workspace-guidance {
  background: #f8fbff;
  border: 1px solid #dbe8f5;
  border-radius: 6px;
  color: #334155;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 12px;
}

.aml-workspace-guidance strong {
  color: var(--text);
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.aml-workspace-guidance ul {
  display: grid;
  font-size: 13px;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.aml-warning-banner,
.aml-role-banner {
  align-items: center;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.aml-warning-banner {
  background: #fff8ed;
  border: 1px solid rgba(253, 170, 66, 0.55);
  color: #2f2f2f;
}

.aml-role-banner {
  background: #eef6ff;
  border: 1px solid #b9d7fb;
  color: #1f3654;
}

.aml-role-banner a {
  font-size: 13px;
  font-weight: 850;
  margin-left: auto;
}

.aml-form-workspace {
  padding-bottom: 72px;
}

.aml-issue-layout,
.aml-case-layout {
  align-items: start;
  display: grid;
  gap: 16px;
}

.aml-issue-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.aml-case-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.aml-case-main {
  display: grid;
  gap: 14px;
}

.aml-case-summary-strip {
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.aml-case-summary-strip div {
  border-right: 1px solid #d8e2ec;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 16px;
}

.aml-case-summary-strip div:last-child {
  border-right: 0;
}

.aml-case-summary-strip span,
.aml-case-rail small,
.aml-section-save {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.aml-case-summary-strip strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}

.aml-case-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 16px;
}

.aml-case-rail h3 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0;
  padding: 14px 16px;
  text-transform: uppercase;
}

.aml-case-rail-nav {
  display: grid;
}

.aml-case-rail-nav a {
  align-items: center;
  border-top: 1px solid #eef2f6;
  color: #1f2d3d;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 16px;
}

.aml-case-rail-nav a:hover,
.aml-case-rail-nav a.is-active {
  background: #edf5ff;
  color: var(--primary);
}

.aml-case-rail-nav span {
  font-size: 14px;
  font-weight: 850;
}

.aml-case-section {
  scroll-margin-top: 18px;
}

.aml-intake-panel h4,
.aml-program-layout h4 {
  font-size: 13px;
  margin: 0 0 10px;
}

.aml-intake-split {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aml-intake-split section,
.aml-association-intake {
  background: #f8fafc;
  border: 1px solid #e3ebf2;
  border-radius: 8px;
  padding: 12px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.aml-page-help,
.aml-page-help-fallback {
  bottom: 24px;
  position: fixed;
  right: 24px;
  z-index: 80;
}

.aml-page-help summary {
  list-style: none;
}

.aml-page-help summary::-webkit-details-marker {
  display: none;
}

.aml-page-help[open] summary {
  background: #edf8ff;
  border-color: #93b9da;
}

.aml-page-help-drawer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  display: grid;
  gap: 12px;
  max-height: min(620px, calc(100vh - 140px));
  overflow: auto;
  padding: 14px;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: min(440px, calc(100vw - 32px));
  z-index: 60;
}

.aml-page-help-heading,
.aml-page-help-entry-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.aml-page-help-heading h3,
.aml-page-help-entry h4 {
  font-size: 14px;
  margin: 0;
}

.aml-page-help-entry {
  border-top: 1px solid #edf2f7;
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.aml-page-help-entry:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.aml-markdown-body {
  color: #334155;
  display: grid;
  font-size: 13px;
  gap: 8px;
  line-height: 1.5;
}

.aml-markdown-body h2,
.aml-markdown-body h3,
.aml-markdown-body h4,
.aml-markdown-body p,
.aml-markdown-body ul {
  margin: 0;
}

.aml-markdown-body ul {
  padding-left: 18px;
}

.aml-program-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

form.aml-program-layout {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.aml-program-main {
  display: grid;
  gap: 14px;
}

.aml-program-aside {
  position: sticky;
  top: 16px;
}

.monospace-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.aml-program-version-preview td {
  background: #fbfdff;
  padding: 0 12px 12px;
}

.aml-accordion-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.aml-accordion-item {
  border-bottom: 1px solid #e4ebf2;
}

.aml-accordion-item:last-child {
  border-bottom: 0;
}

.aml-detail-form .aml-form-section.aml-accordion-item {
  border: 1px solid #e4ebf2;
  border-radius: 8px;
  padding-top: 0;
}

.aml-detail-form .aml-form-section.aml-accordion-item + .aml-form-section.aml-accordion-item {
  margin-top: 10px;
}

.aml-accordion-header {
  align-items: center;
  background: #fff;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 16px;
  justify-content: space-between;
  min-height: 74px;
  padding: 16px 18px;
  text-align: left;
  width: 100%;
}

.aml-accordion-header:hover {
  background: #f8fbff;
}

.aml-accordion-title {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.aml-accordion-title strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.aml-accordion-title small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 3px;
}

.aml-accordion-chevron {
  color: #203044;
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.aml-accordion-item.is-open .aml-accordion-chevron {
  transform: rotate(90deg);
}

.aml-section-meta {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.aml-accordion-body {
  display: none;
  gap: 12px;
  padding: 0 18px 18px 52px;
}

.aml-accordion-item.is-open .aml-accordion-body {
  display: grid;
}

.aml-section-intro {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-width: 960px;
}

.aml-pdd-table-wrap {
  margin-top: 0;
}

.aml-service-task-table select,
.aml-service-task-table input {
  min-width: 0;
  width: 100%;
}

.aml-service-task-table th:first-child,
.aml-service-task-table td:first-child {
  width: 40%;
}

.aml-service-task-table th:nth-child(2),
.aml-service-task-table td:nth-child(2),
.aml-service-task-table th:nth-child(3),
.aml-service-task-table td:nth-child(3) {
  width: 18%;
}

.aml-identity-document-flow {
  display: grid;
  gap: 12px;
}

.aml-document-card {
  background: #fbfdff;
  border: 1px solid #d8e3ee;
  border-radius: 8px;
  padding: 14px;
}

.aml-document-card-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.aml-document-card-heading h5 {
  font-size: 14px;
  margin: 0;
}

.aml-pdd-table {
  table-layout: fixed;
}

.aml-pdd-table th {
  background: #0f4f6d;
  color: #fff;
  font-size: 11px;
  text-transform: none;
}

.aml-pdd-table th:nth-child(1) {
  width: 28%;
}

.aml-pdd-table th:nth-child(2) {
  width: 36%;
}

.aml-pdd-table th:nth-child(3) {
  width: 16%;
}

.aml-pdd-table th:nth-child(4) {
  width: 20%;
}

.aml-pdd-table td {
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
  vertical-align: top;
}

.aml-pdd-table tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

.aml-pdd-table select,
.aml-pdd-table textarea {
  width: 100%;
}

.aml-pdd-table textarea {
  min-height: 66px;
}

.aml-ecdd-party-table {
  min-width: 1540px;
}

.aml-ecdd-party-table th {
  font-size: 10px;
  line-height: 1.25;
}

.aml-ecdd-party-table th:nth-child(1) {
  width: 8%;
}

.aml-ecdd-party-table th:nth-child(2) {
  width: 10%;
}

.aml-ecdd-party-table th:nth-child(3) {
  width: 14%;
}

.aml-ecdd-party-table th:nth-child(4) {
  width: 10%;
}

.aml-ecdd-party-table th:nth-child(5),
.aml-ecdd-party-table th:nth-child(6),
.aml-ecdd-party-table th:nth-child(7) {
  width: 15%;
}

.aml-ecdd-party-table th:nth-child(8),
.aml-ecdd-party-table th:nth-child(9) {
  width: 11%;
}

.aml-ecdd-collection-table th:nth-child(2),
.aml-ecdd-collection-table th:nth-child(3) {
  width: 12%;
}

.aml-ecdd-collection-table th:nth-child(4),
.aml-ecdd-review-table th:nth-child(2) {
  width: 8%;
}

.aml-ecdd-collection-table th:nth-child(5),
.aml-ecdd-review-table th:nth-child(3) {
  width: auto;
}

.aml-pdd-table .aml-date-requested-cell input {
  min-width: 116px;
}

.aml-pdd-table .aml-completed-cell {
  text-align: center;
  vertical-align: middle;
}

.aml-compact-checkbox {
  height: 18px;
  width: 18px !important;
}

.aml-inline-process {
  display: inline-block;
  margin-top: 4px;
  position: relative;
}

.aml-inline-process summary {
  color: var(--accent);
  cursor: pointer;
  display: inline;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.aml-inline-process summary::-webkit-details-marker {
  display: none;
}

.aml-inline-process > div {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #334155;
  left: 0;
  min-width: 280px;
  padding: 10px 12px;
  position: absolute;
  top: 22px;
  width: min(360px, 70vw);
  z-index: 30;
}

.aml-inline-process p {
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.aml-linked-report-panel table td {
  vertical-align: top;
}

.aml-report-party-blocks {
  display: grid;
  gap: 10px;
}

.aml-report-party-block {
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  padding: 10px 12px;
}

.aml-report-party-block h4 {
  font-size: 13px;
  margin: 0 0 6px;
}

.aml-report-party-block dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.aml-report-party-block dl > div {
  display: grid;
  gap: 4px;
  grid-template-columns: 150px minmax(0, 1fr);
}

.aml-report-party-block dt {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.aml-report-party-block dd {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.aml-report-compact-rows {
  display: grid;
  gap: 8px;
}

.aml-report-compact-row {
  border: 1px solid #dfe8f1;
  border-radius: 6px;
  padding: 8px 10px;
}

.aml-report-compact-row h4 {
  font-size: 12px;
  margin: 0 0 4px;
}

.aml-report-compact-row dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.aml-report-compact-row dl > div {
  display: grid;
  gap: 4px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.aml-report-compact-row dt {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.aml-report-compact-row dd {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.aml-risk-severity {
  margin: 0 8px 4px 0;
  text-transform: uppercase;
}

.aml-risk-severity.high,
.status-pill.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.status-pill.warning {
  background: rgba(253, 203, 110, 0.24);
  color: #946200;
}

.aml-risk-severity.medium {
  background: rgba(253, 203, 110, 0.24);
  color: #946200;
}

.aml-country-risk-table .field-hint {
  display: block;
  margin-top: 4px;
}

.aml-country-risk-table tr.country-blocked {
  background: rgba(239, 68, 68, 0.04);
}

.aml-country-blocker-row td {
  border-top: 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  padding-top: 0;
}

.aml-country-risk-pill.low {
  background: rgba(85, 239, 196, 0.2);
  color: #10644f;
}

.aml-country-risk-pill.medium {
  background: rgba(253, 203, 110, 0.24);
  color: #946200;
}

.aml-country-risk-pill.high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.aml-country-risk-pill.unknown {
  background: #eef2f4;
  color: var(--muted);
}

.compact-detail-list {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.compact-detail-list > div {
  border-top: 1px solid #e1e9ef;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
}

.compact-detail-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-detail-list dd {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.aml-relationship-map {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
  padding: 8px;
  border: 1px solid var(--border, #d7e0e8);
  background: #f8fbfc;
}

.aml-relationship-edge {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.35fr) minmax(150px, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.aml-relationship-edge span {
  color: var(--muted, #52616f);
  text-align: center;
}

.aml-relationship-edge span::before,
.aml-relationship-edge span::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin: 0 5px 3px;
  background: #7b8d9b;
}

.aml-relationship-form {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #d7e0e8);
}

.aml-review-date-panel {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #cddde5;
  background: #f7fbfa;
}

.aml-review-date-panel h4 {
  margin: 0 0 2px;
  font-size: 0.9rem;
}

.aml-relationship-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 780px) {
  .aml-relationship-edge,
  .aml-relationship-grid {
    grid-template-columns: 1fr;
  }

  .aml-relationship-edge span {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .compact-detail-list {
    grid-template-columns: 1fr;
  }
}

.aml-beneficial-owner-block {
  display: grid;
  gap: 10px;
}

.aml-beneficial-owner-summary {
  background: #f8fbfd;
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px 12px;
}

.aml-beneficial-owner-summary strong,
.aml-beneficial-owner-summary span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.aml-beneficial-owner-summary strong {
  color: #334155;
  text-transform: uppercase;
}

.aml-beneficial-owner-table {
  min-width: 1180px;
  table-layout: fixed;
}

.aml-beneficial-owner-table th {
  background: #0f4f6d;
  color: #fff;
  font-size: 10px;
  line-height: 1.25;
  text-transform: none;
}

.aml-beneficial-owner-table th:nth-child(1),
.aml-beneficial-owner-table th:nth-child(4),
.aml-beneficial-owner-table th:nth-child(7),
.aml-beneficial-owner-table th:nth-child(8) {
  width: 15%;
}

.aml-beneficial-owner-table th:nth-child(2),
.aml-beneficial-owner-table th:nth-child(5),
.aml-beneficial-owner-table th:nth-child(6) {
  width: 12%;
}

.aml-beneficial-owner-table th:nth-child(3) {
  width: 8%;
}

.aml-beneficial-owner-table td {
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
  vertical-align: top;
}

.aml-beneficial-owner-table tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

.aml-beneficial-owner-table input,
.aml-beneficial-owner-table select,
.aml-beneficial-owner-table textarea {
  font-size: 12px;
  min-width: 0;
  width: 100%;
}

.aml-beneficial-owner-table textarea {
  min-height: 58px;
}

.aml-beneficial-owner-table .status-pill {
  margin-top: 5px;
}

.warning-text {
  color: #b45309;
  font-weight: 800;
}

.settings-table tr.is-muted {
  opacity: 0.64;
}

.aml-risk-radio-list {
  display: grid;
  gap: 5px;
}

.aml-risk-radio-list > div {
  display: flex;
}

.aml-risk-radio-list label {
  align-items: center;
  border: 1px solid #d7e2ec;
  border-radius: 6px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  width: 100%;
}

.aml-risk-radio-list input {
  margin: 0;
}

.aml-risk-radio-list label:has(input[value="yes"]:checked) {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(185, 28, 28, 0.35);
  color: #b91c1c;
}

.aml-risk-radio-list label:has(input[value="no"]:checked) {
  background: rgba(85, 239, 196, 0.12);
  border-color: rgba(16, 100, 79, 0.3);
  color: #10644f;
}

.aml-radio-good-yes label:has(input[value="yes"]:checked) {
  background: rgba(85, 239, 196, 0.12);
  border-color: rgba(16, 100, 79, 0.3);
  color: #10644f;
}

.aml-radio-good-yes label:has(input[value="no"]:checked) {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(185, 28, 28, 0.35);
  color: #b91c1c;
}

.aml-radio-good-no label:has(input[value="yes"]:checked) {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(185, 28, 28, 0.35);
  color: #b91c1c;
}

.aml-radio-good-no label:has(input[value="no"]:checked) {
  background: rgba(85, 239, 196, 0.12);
  border-color: rgba(16, 100, 79, 0.3);
  color: #10644f;
}

.aml-risk-radio-list label:has(input[value="not_applicable"]:checked) {
  background: #eef2f4;
  border-color: #cbd5e1;
  color: var(--muted);
}

.aml-form-subsections {
  display: grid;
  gap: 12px;
}

.aml-form-subsection {
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  padding: 12px;
}

.aml-form-subsection-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.aml-form-subsection-heading h4 {
  font-size: 15px;
  margin: 0;
}

.aml-subsection-actions {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 8px;
}

.aml-report-action-panel {
  align-items: center;
  background: #fff8e6;
  border: 1px solid rgba(253, 203, 110, 0.65);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px 14px;
}

.aml-report-action-panel[hidden] {
  display: none;
}

.aml-report-action-panel div {
  display: grid;
  gap: 3px;
}

.aml-report-action-panel span {
  color: #675120;
  font-size: 13px;
}

.aml-check-row {
  align-items: center;
  display: flex;
  font-weight: 800;
  gap: 10px;
}

.aml-check-row input {
  flex: 0 0 auto;
}

.aml-guidance-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 20px;
  position: sticky;
  top: 16px;
}

.aml-guidance-card h3 {
  font-size: 18px;
  margin: 0;
}

.aml-guidance-card > p,
.aml-guidance-item p,
.aml-help-note p {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.aml-guidance-item {
  border-top: 1px solid #e4ebf2;
  display: grid;
  gap: 6px;
  padding-top: 14px;
}

.aml-guidance-item strong,
.aml-help-note strong {
  color: var(--text);
  font-size: 14px;
}

.aml-help-note {
  background: #edf6ff;
  border: 1px solid #d5e8fa;
  border-radius: 6px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.aml-sticky-actions {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  bottom: 0;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
  display: flex;
  gap: 10px;
  left: calc(var(--sidebar-width) + 16px);
  padding: 8px 12px;
  position: sticky;
  right: 16px;
  z-index: 30;
}

.aml-sticky-status {
  align-items: center;
  color: #2f855a;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  white-space: nowrap;
}

.aml-sticky-buttons {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.aml-sticky-actions .button {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 10px;
}

.aml-sticky-actions .empty {
  font-size: 12px;
}

.form-field {
  color: #334155;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  font-weight: 400;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.field-label {
  color: #334155;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.aml-abr-check {
  align-items: flex-start;
  display: inline-flex;
  margin-top: 6px;
  position: relative;
}

.aml-abr-status-button {
  align-items: center;
  background: #eef2f4;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  min-height: 26px;
  padding: 4px 9px;
}

.aml-abr-status-button.success {
  background: rgba(85, 239, 196, 0.2);
  border-color: rgba(7, 132, 102, 0.35);
  color: #10644f;
}

.aml-abr-status-button.warning {
  background: rgba(253, 203, 110, 0.22);
  border-color: rgba(148, 98, 0, 0.35);
  color: var(--warn);
}

.aml-abr-status-button.loading {
  background: #eaf4ff;
  border-color: #9cc7f4;
  color: var(--primary);
}

.aml-abr-popover {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  left: 0;
  min-width: min(420px, 86vw);
  padding: 12px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 60;
}

.aml-abr-popover-heading {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.aml-abr-details {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.aml-abr-details div {
  display: grid;
  gap: 8px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.aml-abr-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.aml-abr-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.form-field .errorlist {
  color: var(--red-error);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding-left: 16px;
}

.aml-evidence-input-row {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.aml-evidence-input-row textarea {
  min-height: 72px;
}

.aml-evidence-input-row .button {
  min-height: 40px;
  white-space: nowrap;
}

.aml-error-summary {
  background: rgba(255, 118, 117, 0.1);
  border: 1px solid rgba(214, 48, 49, 0.28);
  border-radius: var(--radius-panel);
  color: var(--red-error);
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.aml-error-summary h4,
.aml-error-summary p {
  margin: 0;
}

.aml-error-summary ul {
  margin: 0;
  padding-left: 18px;
}

.bas-settings-sheet {
  display: grid;
  gap: 18px;
  max-width: 820px;
}

.settings-two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-single {
  max-width: calc(50% - 8px);
}

.settings-table-wrap {
  display: grid;
  gap: 8px;
}

.settings-table-wrap h4 {
  color: var(--text);
  font-size: 14px;
  margin: 4px 0 0;
}

.settings-table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

.settings-table th,
.settings-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}

.settings-table thead th {
  background: #eef3f8;
  color: #344256;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-table tbody th {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
  width: 92px;
}

.settings-table td:nth-child(2) {
  text-align: center;
  width: 72px;
}

.settings-table td:nth-child(2) input {
  min-height: 18px;
  width: 18px;
}

.settings-table .settings-method-cell {
  text-align: center;
  width: 72px;
}

.settings-table .settings-method-cell .checkbox-inline {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  margin: 0;
}

.settings-table .settings-method-cell input[type="checkbox"] {
  height: var(--checkbox-size);
  min-height: var(--checkbox-size);
  width: var(--checkbox-size);
}

.aml-task-type-table td:nth-child(2),
.aml-task-type-table td:nth-child(3) {
  text-align: center;
}

.settings-table select {
  min-height: 34px;
  padding: 5px 8px;
}

.settings-table .errorlist {
  margin: 4px 0 0;
}

.muted-cell {
  color: var(--muted);
}

.filter-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.4fr repeat(3, minmax(150px, 1fr)) auto;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkbox-label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
}

.checkbox-label input {
  min-height: var(--checkbox-size);
  width: var(--checkbox-size);
}

.muted-text {
  color: var(--muted);
}

.hero-actions,
.section-heading {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row.compact-actions {
  justify-content: flex-end;
}

.button-row.compact-actions form {
  margin: 0;
}

.aml-collapsible-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.aml-collapsible-panel > summary span {
  font-weight: 800;
}

.aml-collapsible-panel > summary small {
  color: var(--muted);
  font-weight: 600;
}

.aml-collapsible-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.clients-table {
  font-size: 13px;
  margin-top: 12px;
}

.clients-table-wrap {
  overflow-x: auto;
}

.clients-wide-page main.shell { max-width: none; width: calc(100% - 24px); min-width: 0; }
.clients-table .client-source-cell { min-width: 190px; position: sticky; right: 0; background: #fff; z-index: 1; box-shadow: -2px 0 3px #dce4ec; }
.clients-table td:nth-child(2) { min-width: 165px; }
.source-entry { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.source-logo { width: 52px; height: 28px; flex: 0 0 52px; vertical-align: middle; }

.clients-search-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(260px, 360px) auto auto;
}

.usage-range-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.usage-range-form select {
  border: 1px solid #cbd5df;
  border-radius: var(--radius-control);
  font: inherit;
  min-height: 38px;
  padding: 7px 34px 7px 10px;
}

.mcp-request-review-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(90px, 0.5fr) minmax(180px, 1.4fr) auto;
}

.mcp-request-review-form textarea {
  min-height: 40px;
}

.usage-grid {
  margin-bottom: 18px;
}

.clients-table small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

.clients-table .client-group-row td {
  background: #eaf4fb;
  color: #0369a1;
  font-size: 13px;
  font-weight: 900;
}

.matching-rule-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.matching-rule-search,
.matching-rule-run {
  align-items: end;
  gap: 8px;
}

.matching-rule-table {
  font-size: 13px;
  min-width: 1040px;
}

.matching-rule-table th,
.matching-rule-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.matching-rule-table th {
  background: #eef2f5;
  color: #4b5563;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.matching-rule-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.matching-rule-table tbody tr:hover td {
  background: #edf3f8;
}

.matching-rule-table td:first-child {
  width: 52%;
}

.matching-rule-table td:last-child,
.matching-rule-table th:last-child {
  text-align: right;
  width: 88px;
}

.matching-rule-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.drag-handle {
  color: #94a3b8;
  display: inline-block;
  font-weight: 900;
  margin-right: 8px;
  transform: rotate(90deg);
}

.muted-row {
  opacity: 0.62;
}

.workbench-coa-table {
  min-width: 980px;
}

.workbench-coa-table th,
.workbench-coa-table td {
  vertical-align: middle;
}

.coa-statement-row td {
  background: #dfe9ef;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.coa-classification-row td {
  background: #eef6fb;
  color: #0369a1;
  font-weight: 900;
}

.coa-header-row td {
  background: #fbfdff;
  font-weight: 800;
}

.coa-header-row.subheader td {
  background: #ffffff;
}

.coa-account-row td {
  background: #ffffff;
}

.coa-tree-label {
  display: inline-block;
  min-width: 0;
}

.coa-tree-label.depth-0 {
  padding-left: 4px;
}

.coa-tree-label.depth-1 {
  padding-left: 24px;
}

.coa-tree-label.depth-2 {
  padding-left: 48px;
}

.rule-summary,
.small-muted {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.button-row.tight {
  flex-wrap: nowrap;
}

.matching-rule-dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: 760px;
  padding: 0;
  width: min(760px, calc(100vw - 28px));
}

.matching-rule-dialog::backdrop {
  background: rgba(24, 33, 43, 0.38);
}

.matching-rule-editor {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.modal-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: -18px -18px 0;
  padding: 14px 18px;
}

.rule-form-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.checkbox-row {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.matching-rule-editor input[type="text"],
.matching-rule-editor input[type="number"],
.matching-rule-editor select,
.matching-rule-toolbar input,
.matching-rule-toolbar select {
  border: 1px solid #b8c4d2;
  border-radius: 6px;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.matching-rule-editor label,
.matching-rule-toolbar label {
  color: var(--text);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 4px;
}

.table-wrap {
  overflow-x: auto;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.tax-planning-stages p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.tax-planning-page .shell {
  width: min(1640px, calc(100vw - 24px));
}

.tax-planning-workflow {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.tax-planning-workflow article,
.tax-plan-roadmap-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.tax-planning-workflow article.active {
  border-color: rgba(23, 92, 211, 0.35);
  box-shadow: inset 4px 0 0 var(--primary);
}

.tax-planning-workflow span {
  align-items: center;
  background: #eaf2ff;
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.tax-planning-workflow strong,
.tax-plan-roadmap-grid strong {
  font-size: 15px;
}

.tax-plan-setup-panel {
  margin-bottom: 18px;
}

.tax-plan-setup-grid {
  grid-template-columns: minmax(130px, 170px) minmax(260px, 1fr) minmax(220px, 1fr);
}

.tax-plan-workpaper-panel {
  margin-bottom: 18px;
}

.tax-plan-wrap {
  max-height: 72vh;
  overflow: auto;
}

.tax-plan-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  line-height: 1.22;
  margin-top: 0;
  min-width: 1280px;
  table-layout: fixed;
}

.tax-plan-table th,
.tax-plan-table td {
  padding: 6px 7px;
  vertical-align: top;
}

.tax-plan-table th {
  background: #eef4f8;
  position: sticky;
  top: 0;
  z-index: 4;
}

.tax-plan-table .sticky-col {
  background: #fff;
  left: 0;
  position: sticky;
  z-index: 3;
}

.tax-plan-table th.sticky-col {
  background: #eef4f8;
  z-index: 5;
}

.tax-plan-row-col {
  width: 420px;
}

.tax-plan-entity-col {
  width: 190px;
}

.tax-plan-total-col {
  width: 145px;
}

.tax-plan-table th.entity-heading {
  vertical-align: bottom;
}

.entity-heading strong,
.entity-heading small {
  display: block;
}

.entity-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  text-transform: none;
}

.entity-tools,
.row-tools {
  display: inline-flex;
  gap: 4px;
  margin-top: 5px;
}

.entity-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.xero-icon-button {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: lowercase;
  width: 34px;
}

.xero-icon-button.none {
  background: #f1f5f9;
  color: #64748b;
}

.xero-icon-button.connected {
  background: #13b5d0;
  border-color: #13b5d0;
  color: #fff;
}

.xero-icon-button.error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.row-tools {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-top: 0;
}

.entity-tax-rate-mode,
.entity-custom-rate,
.entity-group-input {
  margin-top: 5px;
  width: 100%;
}

.entity-group-heading {
  background: #f7fafc;
}

.tax-plan-section-row td {
  background: #eaf6ff;
  border-top: 2px solid #c6dff4;
  color: #0369a1;
  font-weight: 900;
}

.tax-plan-section-row span {
  margin-right: 10px;
}

.tax-plan-row.row-total td {
  background: #f4f7fa;
  font-weight: 900;
}

.tax-plan-title-row td {
  background: #fffaf0;
}

.tax-plan-row-label {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.tax-plan-title-input {
  flex: 0 1 260px;
  font-weight: 800;
  min-width: 140px;
  width: auto;
}

.tax-plan-custom-row .tax-plan-title-input {
  font-weight: 400;
}

.tax-plan-input {
  border-radius: 4px;
  font-size: 12px;
  min-height: 26px;
  padding: 3px 5px;
}

.tax-plan-money {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tax-plan-textarea {
  min-height: 92px;
  resize: vertical;
  width: 100%;
}

.tax-plan-output,
.tax-plan-total-cell {
  font-variant-numeric: tabular-nums;
}

.tax-plan-roadmap {
  margin-bottom: 18px;
}

.tax-plan-roadmap-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.tax-plan-history-table {
  margin-top: 12px;
}

.tax-plan-download-icon {
  background: rgba(116, 185, 255, 0.16);
  border-color: rgba(9, 132, 227, 0.24);
  color: #075da4;
}

.tax-plan-action-button {
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
}

.tax-plan-action-button svg {
  fill: none;
  flex: 0 0 auto;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}

.tax-plan-action-button.action-green {
  background: rgba(85, 239, 196, 0.14);
  border-color: rgba(0, 184, 148, 0.24);
  color: #10644f;
}

.tax-plan-action-button.action-orange {
  background: rgba(253, 203, 110, 0.18);
  border-color: rgba(225, 112, 85, 0.24);
  color: #8b4509;
}

.tax-plan-action-button.action-blue {
  background: rgba(116, 185, 255, 0.16);
  border-color: rgba(9, 132, 227, 0.24);
  color: #075da4;
}

.tax-plan-action-button.action-red {
  background: rgba(255, 118, 117, 0.13);
  border-color: rgba(214, 48, 49, 0.24);
  color: #a31f20;
}

.tax-plan-workpaper-link.ready {
  background: rgba(85, 239, 196, 0.2);
  border-color: rgba(0, 184, 148, 0.3);
  color: #10644f;
}

.tax-plan-workpaper-link.syncing {
  background: #eef2f4;
  border-color: #cbd5e1;
  color: #64748b;
}

.tax-plan-workpaper-link.reports_needed {
  background: rgba(253, 203, 110, 0.2);
  border-color: rgba(253, 203, 110, 0.56);
  color: #704900;
}

.tax-plan-workpaper-link.error {
  background: rgba(255, 118, 117, 0.16);
  border-color: rgba(214, 48, 49, 0.24);
  color: #a31f20;
}

.xero-report-table {
  min-width: 1100px;
}

.xero-report-table th:first-child,
.xero-report-table td:first-child {
  min-width: 260px;
}

.tax-plan-deleted-entities {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tax-plan-deleted-entity-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
}

.tax-plan-deleted-entity-row small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.38);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 80;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  width: min(900px, 96vw);
}

.tax-plan-manual-rows {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.tax-plan-manual-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 0.8fr) minmax(140px, 0.8fr) auto auto auto;
}

.tax-plan-add-entity-grid {
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) minmax(180px, 0.8fr);
  margin: 14px 0;
}

.mini-button {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.mini-button.danger {
  color: #b91c1c;
}

.mini-icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  padding: 0;
  width: 24px;
}

.mini-icon-button svg {
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 14px;
}

.mini-icon-button.danger {
  color: #b91c1c;
}

.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.icon-button svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}

.icon-button.danger {
  color: #b91c1c;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.status-pill.ok {
  background: rgba(85, 239, 196, 0.2);
  color: #10644f;
}

.status-pill.warn {
  background: rgba(253, 203, 110, 0.22);
  color: var(--warn);
}

.status-pill.muted {
  background: #eef2f4;
  color: var(--muted);
}

.summary-strip {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
}

.summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-strip strong {
  color: var(--text);
  margin-left: 6px;
}

.source-summary-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin: 10px 0 12px;
}

.source-summary-grid div {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.source-summary-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-summary-grid strong {
  display: block;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.worksheet-panel .panel-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  margin: -4px -4px 10px;
  padding: 4px 4px 12px;
}

.worksheet-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  margin-top: 8px;
  overflow-x: auto;
}

.bas-worksheet-table,
.compact-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  line-height: 1.18;
  width: 100%;
}

.bas-worksheet-table {
  min-width: 1680px;
  table-layout: fixed;
}

.bas-worksheet-table .description-table-col {
  width: 255px;
}

.bas-worksheet-table .money-table-col {
  width: 9%;
}

.bas-worksheet-table .rec-table-col {
  width: 78px;
}

.soft-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.bas-worksheet-table .confirmed-table-col {
  width: 82px;
}

.bas-worksheet-table .note-table-col {
  width: 150px;
}

.bas-worksheet-table th,
.bas-worksheet-table td,
.compact-table th,
.compact-table td {
  padding: 6px 7px;
  vertical-align: top;
}

.bas-worksheet-table th {
  font-size: 11px;
}

.bas-worksheet-table th {
  background: #eef5f8;
  position: sticky;
  top: 0;
  z-index: 4;
}

.bas-worksheet-table .worksheet-group-row th {
  background: #dfecef;
  border-bottom: 1px solid #f8fbfd;
  height: 24px;
  text-align: center;
  vertical-align: middle;
}

.bas-worksheet-table .worksheet-column-row th {
  top: 25px;
}

.bas-worksheet-table .source-group {
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bas-worksheet-table .sticky-col {
  background: #fff;
  min-width: unset;
  position: sticky;
  z-index: 3;
}

.bas-worksheet-table th.sticky-col {
  background: #eef4f8;
  z-index: 5;
}

.bas-worksheet-table .worksheet-group-row th.sticky-col {
  background: #dfe9ef;
}

.bas-worksheet-table .description-col {
  left: 0;
  width: 255px;
}

.worksheet-row.row-total td,
.worksheet-row.row-total-style td {
  background: var(--bg-total);
  font-weight: 800;
}

.worksheet-row.bas-amendment-row td {
  background: rgba(253, 203, 110, 0.18);
  border-bottom: 2px solid rgba(225, 112, 85, 0.28);
  border-top: 2px solid rgba(225, 112, 85, 0.48);
  font-weight: 900;
}

.worksheet-row.final-check-result td {
  font-size: 1.5em;
  font-weight: 900;
}

.worksheet-row.final-check-ok td {
  background: rgba(85, 239, 196, 0.22);
  color: #14532d;
}

.worksheet-row.final-check-warn td {
  background: rgba(253, 203, 110, 0.3);
  color: #713f12;
}

.worksheet-row.final-check-error td {
  background: rgba(255, 118, 117, 0.22);
  color: #7f1d1d;
}

.worksheet-row.row-section td {
  background: var(--bg-section);
  border-top: 2px solid rgba(116, 185, 255, 0.32);
  color: #0369a1;
  font-size: 12px;
  font-weight: 900;
}

.worksheet-row.row-section .section-title-cell {
  color: #0284c7;
  text-align: left;
}

.worksheet-row.row-note td {
  background: #fffaf0;
}

.money-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.money-header,
.worksheet-money-col {
  min-width: 116px;
  width: 9%;
}

.group-start {
  border-left: 2px solid #dce7ef;
}

.bas-xero-cell {
  font-weight: 800;
}

.calculated-cell {
  background: #f8fbfd;
  color: #334155;
}

.cell-source-link {
  color: inherit;
  display: inline-block;
  border-radius: 4px;
  padding: 1px 2px;
  text-decoration: underline;
  text-decoration-color: rgba(9, 132, 227, 0.32);
  text-underline-offset: 2px;
}

.cell-source-link:hover {
  background: rgba(116, 185, 255, 0.18);
  color: #1d4ed8;
}

.worksheet-row.is-selected td {
  background-image: linear-gradient(rgba(129, 236, 236, 0.14), rgba(129, 236, 236, 0.14));
}

.worksheet-row .selected-cell {
  box-shadow: inset 0 0 0 2px rgba(9, 132, 227, 0.42);
}

.raw-json {
  background: #f8fafc;
  border: 1px solid #dbe4ec;
  border-radius: 4px;
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
}

.worksheet-input {
  border-radius: 4px;
  font-size: 11px;
  min-height: 24px;
  padding: 3px 5px;
}

.money-input {
  min-width: 104px;
  text-align: right;
  width: 100%;
}

.description-input {
  width: 100%;
}

.note-input {
  min-height: 24px;
  min-width: 132px;
  width: 100%;
}

.checkbox-cell {
  text-align: center;
}

.checkbox-cell input[type="checkbox"] {
  min-height: var(--checkbox-size);
  width: var(--checkbox-size);
}

.toggle-switch {
  align-items: center;
  color: #0f766e;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 4px;
  white-space: nowrap;
}

.toggle-switch input[type="checkbox"] {
  min-height: var(--checkbox-size);
  width: var(--checkbox-size);
}

.toggle-switch input[type="checkbox"]:not(:checked) + span {
  color: #b45309;
}

.toggle-switch input[type="checkbox"]:not(:checked) + span::before {
  content: "Off";
}

.toggle-switch input[type="checkbox"]:not(:checked) + span {
  font-size: 0;
}

.toggle-switch input[type="checkbox"]:not(:checked) + span::before {
  font-size: 11px;
}

.rec-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  white-space: nowrap;
}

.rec-status.ok {
  background: #e8f7ef;
  color: #047857;
}

.rec-status.warn {
  background: #fff4e8;
  color: #b45309;
}

.heat-map-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heat-map-table {
  min-width: 840px;
}

.heat-map-table th,
.heat-map-table td {
  white-space: nowrap;
}

.sticky-col {
  background: var(--surface);
  left: 0;
  min-width: 260px;
  position: sticky;
  z-index: 2;
}

.heat-total {
  font-weight: 800;
}

.heat-cell {
  font-weight: 800;
  min-width: 56px;
  text-align: center;
}

.heat-0 {
  background: #fff;
  color: var(--muted);
}

.heat-1 {
  background: #fff7ed;
  color: #9a3412;
}

.heat-2 {
  background: #ffedd5;
  color: #9a3412;
}

.heat-3 {
  background: #fed7aa;
  color: #7c2d12;
}

.heat-4 {
  background: #fb923c;
  color: #111827;
}

.heat-5 {
  background: #b91c1c;
  color: #fff;
}

.calculator-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calculator-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
}

.calculator-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.calculator-card h3 {
  font-size: 20px;
}

.calculator-card p,
.calculator-card small {
  color: var(--muted);
}

.calculator-setup-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) minmax(280px, 1.2fr);
}

.calculator-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr);
}

.calculator-workpaper-form {
  margin-bottom: 18px;
}

.calculator-title-field {
  margin-top: 14px;
}

.calculator-field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.calculator-actions {
  margin-top: 14px;
}

.calculator-results-panel {
  position: sticky;
  top: 14px;
}

.calculator-result-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.calculator-result-grid div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.calculator-result-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calculator-result-grid strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.calculator-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.calculator-property-table {
  min-width: 940px;
}

.calculator-property-table input,
.calculator-property-table select {
  font-size: 12px;
  min-height: 32px;
}

.calculator-schedule-table {
  margin-top: 10px;
}

.errorlist {
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 820px) {
  .app-layout {
    padding-left: 0;
  }

  .app-layout > .shell,
  .bas-workspace-page .app-layout > .shell,
  .year-end-mapping-page .app-layout > .shell,
  .requests-wide-page .app-layout > .shell {
    margin-top: 64px;
    width: min(1180px, calc(100vw - 24px));
  }

  .sidebar {
    box-shadow: 14px 0 32px rgba(15, 23, 42, 0.18);
    max-width: calc(100vw - 48px);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .sidebar-open {
    overflow: hidden;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.36);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 60;
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-mobile-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: var(--shadow);
    color: #243244;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    gap: 8px;
    left: 12px;
    min-height: 40px;
    padding: 8px 12px;
    position: fixed;
    top: 12px;
    z-index: 80;
  }

  .sidebar-mobile-toggle svg {
    height: 18px;
    width: 18px;
  }

  .topbar,
  .topbar nav,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .metrics,
  .focus-form,
  .form-grid,
    .settings-two-col,
    .checkbox-grid,
    .filter-bar,
    .tax-planning-workflow,
    .tax-plan-roadmap-grid,
    .tax-plan-setup-grid,
    .calculator-grid,
    .calculator-layout,
    .calculator-field-grid,
    .calculator-setup-grid,
    .aml-issue-layout,
    .aml-case-layout,
    .aml-case-summary-strip,
    .aml-dashboard-grid,
    .aml-dashboard-kpis,
    .aml-dashboard-split,
    .aml-workstream-strip,
    .aml-personnel-grid,
    .aml-personnel-layout,
    .aml-workspace-grid,
    .aml-flow-map {
    grid-template-columns: 1fr;
  }

  .aml-workspace-heading,
  .aml-command-header,
  .aml-command-actions,
  .aml-dashboard-panel-heading,
  .aml-accordion-header,
  .aml-section-meta,
  .aml-role-banner,
  .aml-sticky-actions,
  .aml-sticky-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .aml-case-summary-strip div {
    border-right: 0;
    border-top: 1px solid #d8e2ec;
  }

  .aml-case-summary-strip div:first-child {
    border-top: 0;
  }

  .aml-case-rail,
  .aml-guidance-card {
    position: static;
  }

  .aml-accordion-header {
    gap: 10px;
  }

  .aml-section-meta {
    display: grid;
    gap: 6px;
    justify-items: start;
  }

  .aml-accordion-body {
    padding: 0 14px 16px;
  }

  .aml-sticky-actions {
    left: 0;
    right: 0;
  }

  .aml-sticky-buttons {
    width: 100%;
  }

  .aml-sticky-buttons .button {
    justify-content: center;
    width: 100%;
  }

  .calculator-results-panel {
    position: static;
  }

  .bas-settings-sheet,
  .settings-single {
    max-width: none;
  }

  .setup-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-summary small {
    text-align: left;
  }

  .setup-summary::after {
    width: fit-content;
  }
}

.aml-inline-action-bar {
  align-items: center;
  background: #f7fbff;
  border: 1px solid #d8e7f3;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 10px;
  padding: 10px 12px;
}

.aml-inline-action-bar strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.request-status-chart {
  display: grid;
  gap: 8px;
}

.request-status-row {
  align-items: center;
  display: grid;
  font-size: 0.84rem;
  gap: 10px;
  grid-template-columns: minmax(84px, 120px) 1fr 44px;
}

.request-status-row strong {
  font-size: 0.9rem;
  text-align: right;
}

.request-status-track {
  background: #e5e7eb;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.request-status-fill {
  background: #64748b;
  border-radius: inherit;
  height: 100%;
  min-width: 2px;
}

.request-status-fill.ok {
  background: #0f766e;
}

.request-status-fill.warning {
  background: #b45309;
}

.request-status-fill.info {
  background: #2563eb;
}

.request-status-fill.neutral {
  background: #475569;
}

.query-template-picker {
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  padding: 12px;
}

.query-template-picker h4 {
  font-size: 0.92rem;
  margin: 0 0 10px;
}

.query-template-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.query-template-group {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 0;
  padding: 10px;
}

.query-template-group legend {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 4px;
}

.query-template-option {
  align-items: flex-start;
  display: grid;
  font-size: 0.78rem;
  gap: 7px;
  grid-template-columns: 14px 1fr;
  line-height: 1.35;
  margin: 7px 0;
}

.query-template-option input {
  margin-top: 2px;
}

.year-end-workspace {
  display: grid;
  gap: 12px;
  grid-auto-columns: minmax(340px, 420px);
  grid-auto-flow: column;
  overflow-x: auto;
  padding-bottom: 10px;
}

.workflow-column {
  min-width: 0;
}

.workflow-column .panel {
  height: 100%;
  margin: 0;
}

.compact-table {
  font-size: 0.78rem;
}

.compact-table td,
.compact-table th {
  padding: 7px 8px;
  vertical-align: top;
}

.compact-table small {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 2px;
}

.compact-table select {
  font-size: 0.74rem;
  max-width: 170px;
}

.inset-form {
  background: #f7fbfe;
  border: 1px solid var(--line);
  margin: 12px 0;
  padding: 10px;
}

.inset-form p {
  margin: 0 0 7px;
}

.is-muted {
  color: var(--muted);
  opacity: 0.65;
}

.compact-list {
  font-size: 0.78rem;
  margin: 7px 0 0;
  padding-left: 18px;
}

.form-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 6px 0 10px;
}

.workflow-progress {
  display: inline-grid;
  gap: 3px;
  grid-template-columns: repeat(6, 14px);
}

.workflow-progress i {
  background: #cfd9e2;
  display: block;
  height: 6px;
}

.workflow-progress i.is-complete {
  background: var(--primary);
}

.year-end-hero {
  margin-bottom: 10px;
}

.draft-page-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; border-bottom: 1px solid var(--border, #d7e1ec); }
.draft-page-nav a { padding: 7px 12px; font-size: 12px; font-weight: 650; border-bottom: 3px solid transparent; text-decoration: none; }
.draft-page-nav a.is-active { color: #0066cc; background: #eaf3ff; border-bottom-color: #0066cc; }
.year-end-stage-bar {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  margin: 0 0 12px;
  overflow-x: auto;
}

.return-issue-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(95px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.return-issue-cards article {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  background: var(--surface-muted, #f7f8fa);
}

.return-issue-cards span,
.return-issue-cards strong {
  display: block;
}

.return-issue-cards span { font-size: 11px; }
.return-issue-cards strong { font-size: 20px; line-height: 1.15; }

.returns-entity-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 4px 12px;
  margin: 8px 0;
  font-size: 11px;
}

.returns-entity-bars > div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 90px 34px;
  gap: 6px;
  align-items: center;
}

.returns-entity-bars i {
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #dce1e7;
}

.returns-entity-bars b { display: block; height: 100%; background: #247a54; }
.returns-blockers { border-left: 3px solid #bb7a10; padding: 5px 9px; margin: 8px 0; }
.returns-queue details { min-width: 270px; }
.returns-queue fieldset { max-height: 150px; overflow: auto; padding: 5px 8px; }
.returns-queue fieldset label { display: block; font-size: 11px; }
.return-satisfied { background: #d9f2e5; color: #185a3c; }
.return-not_applicable { background: #e9edf2; color: #3e4b59; }
.return-partial { background: #fff0cf; color: #7a4a00; }
.return-missing { background: #ffe0e0; color: #8b2525; }

@media (max-width: 1000px) {
  .return-issue-cards { grid-template-columns: repeat(3, 1fr); }
  .returns-entity-bars { grid-template-columns: 1fr; }
}

.odyssey-mapping-panel {
  font-size: 0.75rem;
}

.mapping-kpis {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  margin: 6px 0;
}

.mapping-kpis > span,
.mapping-kpis > a {
  background: #f5f7fa;
  border: 1px solid #dce3ea;
  color: inherit;
  display: grid;
  gap: 2px;
  padding: 5px 7px;
  text-decoration: none;
}

.mapping-kpis a:hover,
.mapping-kpis a:focus-visible {
  background: #eef3f8;
  border-color: #98abc0;
}

.mapping-kpis a.is-active {
  background: #eaf2fb;
  border-color: #3078b8;
  box-shadow: inset 0 0 0 1px #3078b8;
}

.mapping-kpis strong {
  font-size: 0.92rem;
}

.mapping-kpis i {
  background: #9aa8b7;
  display: block;
  height: 3px;
}

.mapping-kpis .is-confirmed i { background: #2d8a57; }
.mapping-kpis .is-suggested i { background: #3783c4; }
.mapping-kpis .is-manual i { background: #6750a4; }
.mapping-kpis .is-unmapped i,
.mapping-kpis .is-impacted i { background: #c1583f; }

.mapping-gate {
  border-left: 4px solid #b6422c;
  background: #fff3f0;
  margin: 6px 0;
  padding: 6px 8px;
}

.mapping-gate.is-ready {
  background: #edf8f1;
  border-color: #2d8a57;
}

.mapping-filter-bar,
.mapping-bulk-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0;
}

.mapping-filter-bar label {
  color: var(--muted);
  display: grid;
  font-size: 0.65rem;
  gap: 2px;
}

.mapping-filter-bar select { max-width: 180px; }
.mapping-bulk-actions label {
  color: var(--muted);
  display: grid;
  font-size: 0.65rem;
  gap: 2px;
}
.mapping-bulk-actions label select { max-width: 310px; }
.mapping-bulk-actions > input { min-width: 220px; }
.mapping-bulk-divider {
  align-self: stretch;
  border-left: 1px solid #cfd9e2;
  margin: 0 3px;
}
.mapping-bulk-note {
  color: var(--muted);
  font-size: 0.68rem;
  margin: 0 0 6px;
}
.mapping-table-wrap { max-height: 68vh; }
.mapping-review-table { min-width: 1420px; }
.mapping-review-table th { position: sticky; top: 0; z-index: 2; }
.mapping-review-table td { padding: 4px 5px; vertical-align: top; }
.mapping-review-table td:nth-child(2) { min-width: 205px; }
.mapping-review-table td:nth-child(7) { min-width: 225px; }
.mapping-review-table td:nth-child(8) { min-width: 190px; }
.mapping-review-table small { display: block; font-size: 0.64rem; line-height: 1.25; }
.mapping-review-table .mapping-primary-label {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
  margin-bottom: 1px;
}
.mapping-review-table .mapping-account-cell > small,
.mapping-review-table .mapping-coa-cell > small { color: var(--muted); }
.mapping-review-table .number { font-variant-numeric: tabular-nums; text-align: right; }
.mapping-select-all {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.mapping-select-all span { font-size: 0.64rem; }
.mapping-result-count { color: var(--muted); font-size: 0.72rem; margin: 6px 0; }

.mapping-pill-confirmed,
.mapping-pill-manual { background: #e4f4ea; color: #17633c; }
.mapping-pill-suggested { background: #e5f0fb; color: #155f9d; }
.mapping-pill-unmapped,
.mapping-pill-conflicted,
.mapping-pill-impacted { background: #fde9e5; color: #91331f; }

.mapping-drawer summary { cursor: pointer; white-space: nowrap; }
.mapping-drawer[open] {
  background: #fff;
  border: 1px solid #ccd7e1;
  box-shadow: 0 10px 26px rgba(25, 45, 65, 0.16);
  padding: 7px;
  position: absolute;
  right: 20px;
  width: min(820px, 80vw);
  z-index: 8;
}

.mapping-drawer-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mapping-drawer-grid form { display: grid; gap: 4px; margin-bottom: 5px; }

.mapping-search-field { flex: 1 1 260px; }
.mapping-search-field input { min-width: 240px; width: 100%; }

.mapping-workspace-toolbar {
  align-items: center;
  background: #f7f9fb;
  border: 1px solid #d7e0e8;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 7px;
  padding: 5px 7px;
}

.mapping-allocation-progress {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(110px, 210px);
  min-width: 330px;
}

.mapping-allocation-progress div { display: flex; gap: 5px; white-space: nowrap; }
.mapping-allocation-progress span { color: var(--muted); }
.mapping-allocation-progress > i { background: #d8e0e7; display: block; height: 5px; }
.mapping-allocation-progress > i b { background: #2d8a57; display: block; height: 100%; }

.mapping-view-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  justify-content: flex-end;
}

.mapping-view-controls label { align-items: center; cursor: pointer; display: inline-flex; gap: 4px; white-space: nowrap; }

.mapping-allocation-tray {
  align-items: end;
  background: #edf4fb;
  border: 1px solid #b7ccdf;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  padding: 6px 7px;
}

.mapping-allocation-tray label:not(.mapping-select-all) {
  color: var(--muted);
  display: grid;
  font-size: 0.65rem;
  gap: 2px;
}

.mapping-allocation-tray select { max-width: 370px; min-width: 245px; }
.mapping-allocation-tray > input[type="text"],
.mapping-allocation-tray > input:not([type]) { flex: 1 1 260px; min-width: 220px; width: auto; }
.mapping-allocation-status { color: #155f9d; font-size: 0.68rem; font-weight: 700; max-width: 360px; }

.mapping-follow-up {
  align-items: center;
  background: #fff8d8;
  border: 1px solid #e1bd3b;
  box-shadow: inset 4px 0 0 #e0ad14;
  display: grid;
  font-size: 0.7rem;
  gap: 8px;
  grid-template-columns: minmax(290px, 1.4fr) minmax(320px, 1fr) auto;
  margin-top: 5px;
  padding: 6px 8px;
}

.mapping-follow-up-main { display: grid; gap: 1px; }
.mapping-follow-up-main > strong { color: #6f5200; font-size: 0.76rem; }
.mapping-follow-up-main small { color: #6e6650; }
.mapping-follow-up-counts { display: grid; gap: 2px; margin: 0; }
.mapping-follow-up-counts div { display: grid; grid-template-columns: 78px 1fr; }
.mapping-follow-up-counts dt { color: #796628; font-weight: 700; }
.mapping-follow-up-counts dd { margin: 0; }
.mapping-follow-up form { align-items: center; display: flex; gap: 8px; white-space: nowrap; }
.mapping-follow-up form a { color: #6e5c1b; font-weight: 700; }
.button.mapping-follow-up-apply { background: #e5b526; border-color: #b78d0b; color: #352700; }
.button.mapping-follow-up-apply:hover { background: #d8a612; }

.mapping-allocation-workspace {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(690px, 1.8fr) minmax(410px, 0.9fr);
  margin-top: 7px;
  min-height: 620px;
}

.mapping-tree-pane,
.mapping-queue-pane {
  background: #fff;
  border: 1px solid #d4dde5;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mapping-pane-heading {
  align-items: center;
  background: #f2f5f7;
  border-bottom: 1px solid #d4dde5;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px 8px;
}

.mapping-pane-heading h4 { font-size: 0.8rem; margin: 0; }
.mapping-pane-heading span { color: var(--muted); display: block; font-size: 0.64rem; margin-top: 1px; }
.mapping-pane-heading > strong { background: #fff; border: 1px solid #c8d2dc; min-width: 34px; padding: 3px 6px; text-align: center; }

.mapping-queue-tools {
  align-items: end;
  background: #f8fafb;
  border-bottom: 1px solid #dce3e9;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(170px, 1fr) 112px auto;
  padding: 5px 7px;
}

.mapping-queue-tools label {
  color: var(--muted);
  display: grid;
  font-size: 0.61rem;
  gap: 2px;
}

.mapping-queue-tools input,
.mapping-queue-tools select { min-width: 0; width: 100%; }
.mapping-queue-tools > span { color: var(--muted); font-size: 0.61rem; grid-column: 1 / -1; }
.mapping-queue-no-results { color: var(--muted); font-size: 0.68rem; margin: 0; padding: 14px 10px; text-align: center; }
.mapping-source-card[hidden],
.mapping-queue-group[hidden],
.mapping-queue-no-results[hidden] { display: none; }

.mapping-pane-columns {
  background: #fafbfc;
  border-bottom: 1px solid #e0e6eb;
  color: #708090;
  display: grid;
  font-size: 0.6rem;
  font-weight: 800;
  grid-template-columns: 1fr 55px 105px;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  text-transform: uppercase;
}

.mapping-pane-columns span:nth-child(n + 2) { text-align: right; }
.mapping-tree-scroll,
.mapping-queue-scroll { max-height: 72vh; min-height: 540px; overflow: auto; }

.mapping-classification,
.mapping-header,
.mapping-target,
.mapping-queue-group { border-bottom: 1px solid #edf0f3; }

.mapping-classification > summary,
.mapping-header > summary,
.mapping-target > summary,
.mapping-queue-group > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) 45px 105px;
  list-style-position: inside;
  min-height: 28px;
  padding: 4px 8px;
}

.mapping-classification > summary { background: #eef2f5; font-size: 0.73rem; }
.mapping-header > summary { background: #f7f8fa; padding-left: 20px; }
.mapping-header-child > summary { background: #fafbfc; padding-left: 32px; }
.mapping-target > summary { padding-left: 42px; }
.mapping-tree-count,
.mapping-tree-value { color: #627384; font-size: 0.64rem; font-variant-numeric: tabular-nums; text-align: right; }
.mapping-tree-value { white-space: nowrap; }

.mapping-target > summary.mapping-drop-target {
  grid-template-columns: minmax(0, 1fr) 45px 105px;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.mapping-target-title { min-width: 0; }
.mapping-target-title strong { display: block; font-size: 0.73rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-target-title small { color: var(--muted); display: block; font-size: 0.61rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-target-title .mono,
.mapping-source-meta .mono { font-size: inherit; }
.mapping-drop-target.is-drop-ready { background: #dceefa; box-shadow: inset 0 0 0 2px #2f78b7; }

.mapping-target-accounts,
.mapping-queue-accounts { background: #fff; }
.mapping-target-accounts { padding-left: 48px; }

.mapping-source-card {
  align-items: center;
  border-top: 1px solid #edf0f3;
  display: grid;
  gap: 6px;
  grid-template-columns: 18px minmax(170px, 1fr) 155px auto auto;
  min-height: 39px;
  padding: 4px 7px;
}

.mapping-source-card[draggable="true"] { cursor: grab; }
.mapping-source-card[draggable="true"]:active { cursor: grabbing; }
.mapping-source-card:hover { background: #f7fbff; }
.mapping-source-card.is-selected { background: #eaf4fc; box-shadow: inset 3px 0 0 #3078b8; }
.mapping-source-card.is-dragging { opacity: 0.45; }
.mapping-selection-slot { align-items: center; display: flex; justify-content: center; min-width: 18px; }
.mapping-selection-slot .mapping-select-check { margin: 0; }
.mapping-source-main { min-width: 0; }
.mapping-source-main > strong { display: block; font-size: 0.74rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-source-meta,
.mapping-entity-name { color: var(--muted); display: block; font-size: 0.6rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-entity-name { display: none; color: #3f607c; }
.show-entities .mapping-entity-name { display: block; }

.mapping-source-values {
  display: grid;
  font-size: 0.59rem;
  font-variant-numeric: tabular-nums;
  gap: 1px;
  grid-template-columns: 1fr;
  text-align: right;
}
.mapping-source-values span { color: var(--muted); display: flex; gap: 4px; justify-content: space-between; }
.mapping-source-values b { color: var(--text); }
.mapping-source-card .status-pill { font-size: 0.57rem; padding: 2px 4px; white-space: nowrap; }
.mapping-inspect-button { background: transparent; border: 0; color: #1767a3; cursor: pointer; font: inherit; font-size: 0.61rem; padding: 2px; }
.mapping-inspect-button:hover { text-decoration: underline; }

.mapping-queue-group > summary { background: #f5f7f9; grid-template-columns: minmax(0, 1fr) 40px 95px; }
.mapping-queue-accounts .mapping-source-card { grid-template-columns: 18px minmax(150px, 1fr) 140px auto auto; }
.mapping-empty-note { color: var(--muted); font-size: 0.63rem; margin: 0; padding: 6px 12px; }
.hide-empty-destinations .mapping-empty-destination { display: none; }

.mapping-audit-details { border: 1px solid #d4dde5; margin-top: 7px; }
.mapping-audit-details > summary { align-items: center; background: #f4f6f8; cursor: pointer; display: flex; gap: 8px; padding: 6px 8px; }
.mapping-audit-details > summary span { color: var(--muted); font-size: 0.66rem; }
.mapping-audit-details .mapping-table-wrap { border: 0; }
.mapping-inspect-dialog .matching-rule-editor { gap: 8px; padding: 12px; }
.mapping-inspect-dialog .modal-heading { margin: -12px -12px 0; padding: 9px 12px; }
.mapping-inspect-dialog .modal-heading span { color: var(--muted); font-size: 0.68rem; }
.mapping-inspect-dialog .rule-form-box { gap: 7px; padding: 9px; }
.mapping-inspect-dialog .rule-form-box h4 { margin: 0; }

@media (max-width: 1220px) {
  .mapping-follow-up { grid-template-columns: 1fr; }
  .mapping-follow-up form { white-space: normal; }
  .mapping-allocation-workspace { grid-template-columns: 1fr; }
  .mapping-tree-scroll,
  .mapping-queue-scroll { max-height: 58vh; min-height: 360px; }
  .mapping-workspace-toolbar { align-items: stretch; flex-direction: column; }
  .mapping-view-controls { justify-content: flex-start; }
}

.rule-library-tabs {
  border-bottom: 1px solid #cfd9e2;
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.rule-library-tabs a {
  background: #f3f6f9;
  border: 1px solid #d8e1e8;
  border-bottom: 0;
  color: #4a5c6d;
  font-size: 0.74rem;
  padding: 6px 10px;
}

.rule-library-tabs a.is-active {
  background: #fff;
  color: #075ec9;
  font-weight: 700;
}

.rule-library-table { min-width: 1200px; }
.rule-library-table td { padding: 4px 5px; vertical-align: top; }
.rule-library-table td:first-child { min-width: 245px; }
.rule-library-table td:nth-child(4) { min-width: 220px; }
.rule-library-table small { display: block; font-size: 0.64rem; }
.mapping-pill-active { background: #e4f4ea; color: #17633c; }
.mapping-pill-pending { background: #fff2cc; color: #765600; }
.mapping-pill-retired { background: #e9edf1; color: #536273; }
.compact-rule-proposal details > summary { cursor: pointer; font-size: 0.76rem; }
.compact-rule-proposal .matching-rule-editor {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}
.compact-rule-proposal .matching-rule-editor p { margin: 0; }

.query-rule-toolbar { align-items: flex-end; display: flex; gap: 8px; justify-content: space-between; }
.query-rule-filters { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 5px; }
.query-rule-filters label,
.query-preview-picker label { color: var(--muted); font-size: 0.64rem; margin: 0; }
.query-rule-filters input,
.query-rule-filters select,
.query-preview-picker select { display: block; font-size: 0.7rem; min-height: 28px; padding: 3px 5px; }
.query-rule-table { font-size: 0.7rem; min-width: 1500px; }
.query-rule-table td { padding: 4px 5px; vertical-align: top; }
.query-rule-table td:nth-child(1) { min-width: 185px; }
.query-rule-table td:nth-child(6) { min-width: 320px; }
.query-rule-table small { display: block; font-size: 0.63rem; line-height: 1.28; }
.query-rule-table details summary { color: #245c8f; cursor: pointer; font-size: 0.64rem; }
.query-preview-table { font-size: 0.68rem; min-width: 980px; }
.compact-query-rule-proposal details > summary { cursor: pointer; font-size: 0.76rem; }
.query-rule-editor { display: grid; gap: 5px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
.query-rule-editor p { margin: 0; }
.query-rule-editor textarea { min-height: 58px; }
.query-rule-editor .errorlist { color: #a43626; font-size: 0.65rem; margin: 0; padding-left: 14px; }

.year-end-query-workspace { padding: 10px; }
.query-generate-form { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.query-generate-form textarea { min-height: 34px; width: 260px; }
.manual-query-add { position: relative; }
.manual-query-add > summary { list-style: none; }
.manual-query-add > form { background: #fff; border: 1px solid #cfd9e2; box-shadow: 0 8px 24px rgb(31 48 66 / 14%); max-width: 720px; padding: 10px; position: absolute; right: 0; top: 34px; width: 65vw; z-index: 20; }
.query-review-kpis { display: grid; gap: 6px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 8px 0; }
.query-review-kpis > span { background: #f5f8fb; border: 1px solid #dbe4ec; font-size: 0.65rem; padding: 6px 8px; position: relative; }
.query-review-kpis strong { display: block; font-size: 1rem; }
.query-review-kpis i { background: #6d8092; bottom: 0; height: 3px; left: 0; position: absolute; right: 0; }
.query-review-kpis .is-high i,
.query-review-kpis .is-unresolved i { background: #c1583f; }
.query-review-kpis .is-edited i { background: #6750a4; }
.query-review-kpis .is-excluded i { background: #8a96a2; }
.query-review-filters { align-items: flex-end; background: #f6f8fa; border: 1px solid #dce4eb; display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; }
.query-review-filters label,
.query-bulk-toolbar label { color: var(--muted); font-size: 0.62rem; margin: 0; }
.query-review-filters select,
.query-bulk-toolbar select { display: block; font-size: 0.69rem; min-height: 27px; padding: 2px 4px; }
.query-heatmap { border: 1px solid #dbe4ec; margin: 7px 0; }
.query-heatmap > summary { align-items: center; background: #f5f8fb; cursor: pointer; display: flex; font-size: 0.7rem; gap: 8px; padding: 5px 7px; }
.query-heatmap > summary span { color: var(--muted); font-size: 0.62rem; }
.query-heatmap table { font-size: 0.62rem; margin: 5px; width: auto; }
.query-heatmap th,
.query-heatmap td { max-width: 105px; padding: 3px 4px; text-align: center; }
.query-heatmap td[class^="heat-"] { background: #f3f6f8; }
.query-heatmap .heat-1 { background: #dceeff; }
.query-heatmap .heat-2 { background: #b9dcfb; }
.query-heatmap .heat-3 { background: #8fc5f3; }
.query-heatmap .heat-4,
.query-heatmap .heat-5 { background: #66ade8; color: #092d4d; font-weight: 700; }
.query-bulk-toolbar { align-items: flex-end; display: flex; gap: 5px; justify-content: flex-end; margin: 6px 0; }
.draft-query-entity,
.draft-query-type { border: 1px solid #d7e0e8; margin: 5px 0; }
.draft-query-entity > summary,
.draft-query-type > summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; padding: 5px 7px; }
.draft-query-entity > summary { background: #eaf1f7; font-size: 0.74rem; }
.draft-query-type { margin: 5px; }
.draft-query-type > summary { background: #f4f7fa; font-size: 0.69rem; }
.draft-query-entity summary span { color: var(--muted); font-size: 0.61rem; }
.draft-query-account { border-top: 1px solid #e0e7ed; margin: 0 5px 6px; }
.draft-query-account-heading { align-items: center; background: #fafbfd; display: flex; justify-content: space-between; padding: 5px 6px; }
.draft-query-account-heading strong { font-size: 0.7rem; }
.draft-query-account-heading small { color: var(--muted); display: block; font-size: 0.6rem; }
.draft-query-balances { display: flex; font-size: 0.61rem; gap: 9px; }
.draft-account-table { font-size: 0.67rem; min-width: 1260px; }
.draft-account-table th,
.draft-account-table td { padding: 3px 4px; vertical-align: top; }
.draft-account-table th.select-col { width: 24px; }
.draft-account-table td:nth-child(2) { min-width: 300px; }
.draft-account-table td:nth-child(3) { min-width: 240px; }
.draft-account-table td:nth-child(4) { min-width: 145px; }
.draft-account-table small { display: block; font-size: 0.61rem; line-height: 1.3; }
.draft-account-table .query-why { color: #5f6f7d; margin-top: 3px; }
.draft-account-table details > summary { color: #245c8f; cursor: pointer; font-size: 0.62rem; }
.risk-high { background: #fde8e3; color: #8c2f20; }
.risk-normal { background: #fff2cc; color: #765600; }
.risk-low { background: #e4f4ea; color: #17633c; }

@media (max-width: 1050px) {
  .query-rule-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-review-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.year-end-stage {
  background: #f4f7fa;
  border: 1px solid #dbe4ec;
  color: #526477;
  display: grid;
  gap: 4px;
  min-width: 145px;
  padding: 9px 10px;
}

.year-end-stage strong {
  color: #263647;
  font-size: 0.76rem;
}

.year-end-stage span {
  font-size: 0.68rem;
  min-height: 16px;
}

.year-end-stage i {
  background: #d4dee7;
  display: block;
  height: 4px;
  overflow: hidden;
}

.year-end-stage i b {
  background: #3d8b66;
  display: block;
  height: 100%;
}

.year-end-stage.is-active {
  background: #e8f1ff;
  border-color: #3b82d0;
}

.year-end-stage.is-active strong {
  color: #075ec9;
}

.year-end-stage.is-complete {
  background: #edf8f1;
}

.setup-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 10px;
}

.setup-summary span {
  color: var(--muted);
  font-size: 0.76rem;
}

.setup-summary strong {
  color: #263647;
  display: block;
  font-size: 0.85rem;
}

.section-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.compact-upload-form {
  background: #f7fbfe;
  border: 1px solid #dce7ef;
  margin-bottom: 12px;
  padding: 10px;
}

.year-end-work-in-entity {
  border: 1px solid #dbe4ec;
  margin: 0 0 8px;
}

.year-end-work-in-entity > summary {
  align-items: center;
  background: #f6f9fc;
  cursor: pointer;
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  padding: 8px 10px;
}

.year-end-work-in-entity > summary span {
  color: var(--muted);
  font-size: 0.7rem;
}

.year-end-work-in-entity > .form-hint,
.year-end-work-in-entity > .compact-table {
  margin: 8px;
}

.work-in-row-upload,
.work-in-file {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.work-in-row-upload input[type="file"] {
  max-width: 220px;
}

.compact-table tr.work-in-row-needs-review > td {
  background: #edf6ff;
}

.compact-table tr.work-in-row-ready > td {
  background: #eaf7ee;
}

.compact-table tr.work-in-row-not-required > td {
  background: #f1f3f5;
  color: #6b7785;
}

.work-in-autosave-status {
  color: var(--muted);
  font-size: 0.72rem;
  min-height: 1rem;
  padding: 0 8px 4px;
  text-align: right;
}

.work-in-autosave-status[data-state="saved"] {
  color: #26734d;
}

.work-in-autosave-status[data-state="error"] {
  color: #9b2c2c;
}

.work-in-file {
  border-top: 1px solid #e3e9ef;
  font-size: 0.7rem;
  margin-top: 6px;
  padding-top: 5px;
}

.work-in-file small {
  color: var(--muted);
}

.two-up-workspace {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.draft-table td:nth-child(2) {
  min-width: 260px;
}

.portal-preview {
  background: #f6f8fb;
  border: 1px solid #d8e0e8;
  padding: 12px;
}

.portal-preview-header {
  align-items: center;
  border-bottom: 1px solid #d8e0e8;
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  padding-bottom: 8px;
}

.portal-preview-header span,
.portal-question small,
.portal-why {
  color: var(--muted);
  font-size: 0.72rem;
}

.portal-question {
  border-bottom: 1px solid #e0e7ee;
  padding: 10px 0;
}

.portal-question:last-child {
  border-bottom: 0;
}

.portal-question p {
  font-size: 0.8rem;
  margin: 5px 0;
}

.portal-question textarea {
  background: #fff;
  box-sizing: border-box;
  margin-top: 6px;
  width: 100%;
}

.preview-controls {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.preview-controls button {
  background: #fff;
  border: 1px solid #bac8d4;
  border-radius: 3px;
  color: #344256;
  font-size: 0.74rem;
  padding: 4px 12px;
}

.preview-upload {
  background: #fff;
  border: 1px dashed #9aaebe;
  color: #526477;
  font-size: 0.74rem;
  margin-top: 6px;
  padding: 8px;
}

.status-warning {
  color: #a65c00;
  font-weight: 700;
}

.entity-delivery-picker {
  display: grid;
  gap: 5px;
}

@media (max-width: 920px) {
  .two-up-workspace {
    grid-template-columns: 1fr;
  }
}

.inline-edit {
  margin-top: 6px;
}

.inline-edit summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
}

.inline-edit form {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  min-width: 240px;
}

.inline-edit input,
.inline-edit select,
.inline-edit textarea {
  font-size: 0.74rem;
  min-height: 28px;
}

@media print {
  body {
    background: #fff;
    font-size: 11px;
  }

  .topbar,
  .sidebar,
  .sidebar-mobile-toggle,
  .sidebar-backdrop,
  .no-print,
  .actions-panel {
    display: none !important;
  }

  .app-layout {
    padding-left: 0;
  }

  .shell {
    margin: 0;
    width: 100%;
  }

  .hero,
  .panel,
  .metrics article {
    box-shadow: none;
  }

  .panel,
  .hero {
    break-inside: avoid;
    margin-bottom: 12px;
  }
}
.draft-scope { border-bottom: 1px solid #d8dee4; padding-bottom: 12px; margin-bottom: 12px; }
.draft-scope-entity { border-top: 1px solid #d8dee4; padding: 8px 0; }
.draft-scope-entity summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.draft-scope-entity label { font-size: 12px; }
.draft-scope-entity textarea { width: 100%; min-width: 0; }
.draft-scope-entity table { min-width: 1000px; table-layout: fixed; }
.draft-scope-entity td { overflow-wrap: anywhere; vertical-align: top; }
.draft-scope-entity input:not([type=checkbox]), .draft-scope-entity select { width: 100%; min-width: 0; }
