:root {
  --bm-ink: #141414;
  --bm-ink-strong: #0b1220;
  --bm-muted: #6b7280;
  --bm-faint: #8e8e93;
  --bm-line: #d8dde4;
  --bm-line-strong: #b9bec6;
  --bm-page: #eef0f3;
  --bm-surface: #ffffff;
  --bm-raised: #f7f8fa;
  --bm-control: #ffffff;
  --bm-control-muted: #f6f7f9;
  --bm-nav: #101820;
  --bm-nav-soft: #182331;
  --bm-gold: #d4a437;
  --bm-gold-dark: #a88737;
  --bm-gold-soft: rgba(212, 164, 55, 0.14);
  --bm-warning: #b45309;
  --bm-warning-soft: #fff7ed;
  --bm-silver: #c7c7c9;
  --bm-silver-2: #8e8e93;
  --bm-silver-soft: #f7f7f8;
  --bm-green: #1ea64b;
  --bm-green-dark: #178a3c;
  --bm-green-soft: #e6f6ec;
  --bm-danger: #c61f1f;
  --bm-danger-soft: #fdeaea;
  --bm-teal: #0c756f;
  --bm-teal-soft: #e1f4f1;
  --bm-blue: #315f8f;
  --bm-blue-soft: #e7eef7;
  --bm-red: var(--bm-danger);
  --bm-red-soft: var(--bm-danger-soft);
  --bm-truth: #111827;
  --bm-shadow: 0 10px 28px rgba(17, 17, 17, 0.06);
  --bm-shadow-strong: 0 18px 42px rgba(17, 17, 17, 0.12);
  --bm-sidebar-image: url("/images/sidebar-1.jpg");
  --bm-field-height: 35px;
  --bm-field-radius: 6px;
  --bm-field-padding-x: 10px;
  --bm-font-sans: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bm-type-caption: 0.75rem;
  --bm-type-label: 0.8125rem;
  --bm-type-body: 0.875rem;
  --bm-type-control: 0.875rem;
  --bm-type-section: 1rem;
  --bm-type-title: clamp(1.75rem, 2vw, 2.125rem);
  --bm-leading-tight: 1.2;
  --bm-leading-body: 1.45;
  --bm-weight-body: 400;
  --bm-weight-copy-strong: 560;
  --bm-weight-control: 620;
  --bm-weight-heading: 740;
  --bm-weight-display: 780;
  --bm-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  --bm-ink: #e8edf3;
  --bm-ink-strong: #ffffff;
  --bm-muted: #a8b2bf;
  --bm-faint: #7d8998;
  --bm-line: #2d3745;
  --bm-line-strong: #3a4656;
  --bm-page: #0f141b;
  --bm-surface: #171d25;
  --bm-raised: #111820;
  --bm-control: #111820;
  --bm-control-muted: #151d27;
  --bm-nav: #080e14;
  --bm-nav-soft: #121b26;
  --bm-gold-soft: rgba(212, 164, 55, 0.2);
  --bm-warning: #fb923c;
  --bm-warning-soft: rgba(194, 65, 12, 0.18);
  --bm-green-soft: rgba(30, 166, 75, 0.18);
  --bm-danger-soft: rgba(198, 31, 31, 0.18);
  --bm-teal-soft: rgba(12, 117, 111, 0.18);
  --bm-blue-soft: rgba(49, 95, 143, 0.2);
  --bm-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --bm-shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.38);
  --bm-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a8b2bf' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bm-page);
  color: var(--bm-ink);
  font-family: var(--bm-font-sans);
  font-weight: var(--bm-weight-body);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
}

.app-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  isolation: isolate;
  padding: 24px 16px 18px;
  background:
    linear-gradient(180deg, rgba(7, 13, 20, 0.9), rgba(13, 20, 29, 0.86)),
    var(--bm-sidebar-image) center bottom / cover no-repeat,
    var(--bm-nav);
  color: #eef6fd;
}

.app-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bm-sidebar-image) center bottom / cover no-repeat;
  filter: saturate(0.95) contrast(1.02);
}

.app-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 14, 20, 0.94) 0%, rgba(12, 20, 29, 0.82) 54%, rgba(8, 14, 20, 0.94) 100%),
    radial-gradient(circle at 18% 18%, rgba(212, 164, 55, 0.15), transparent 28%);
}

.app-rail > * {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: grid;
  justify-items: start;
  align-items: center;
  gap: 6px;
  min-height: 92px;
  color: #ffffff;
  text-decoration: none;
}

.brand-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  display: block;
  background: transparent;
  mix-blend-mode: screen;
}

.brand-lockup small {
  display: block;
  color: var(--bm-silver);
  font-size: 0.78rem;
  line-height: 1.1;
  padding-left: 4px;
}

.brand-lockup small,
.entity-switcher small {
  color: var(--bm-silver);
}

.entity-switcher {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.entity-switcher summary {
  min-height: 84px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 13px;
  color: #ffffff;
  list-style: none;
  cursor: pointer;
}

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

.entity-switcher summary::marker {
  content: "";
}

.entity-switcher[open] summary {
  border-color: rgba(212, 164, 55, 0.42);
}

.entity-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.company-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(212, 164, 55, 0.18);
  color: #ffffff;
  font-weight: 900;
}

.entity-chevron {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  opacity: 0.9;
  transition: transform 160ms ease, background 160ms ease;
}

.entity-switcher[open] .entity-chevron {
  transform: rotate(180deg);
  background: rgba(212, 164, 55, 0.18);
}

.entity-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(13, 20, 29, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.entity-menu form {
  margin: 0;
}

.entity-menu-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.entity-menu-item:hover,
.entity-menu-item:focus-visible {
  border-color: rgba(212, 164, 55, 0.32);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.entity-menu-item.is-active {
  border-color: rgba(212, 164, 55, 0.42);
  background: rgba(212, 164, 55, 0.14);
}

.entity-menu-item span {
  color: var(--bm-silver);
  font-size: 0.78rem;
}

.entity-switcher strong {
  color: #ffffff;
  line-height: 1.2;
}

.entity-text > span,
.rail-status span,
.section-kicker,
.command-path {
  font-size: 0.72rem;
  font-weight: 680;
  letter-spacing: 0;
  text-transform: uppercase;
}

.entity-text > span,
.rail-status span {
  color: var(--bm-silver);
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rail-section {
  margin: 9px 0 2px;
  color: var(--bm-silver);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.rail-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 760;
}

.rail-nav a:hover,
.rail-nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.rail-nav a.active {
  background: linear-gradient(90deg, rgba(212, 164, 55, 0.34), rgba(255, 255, 255, 0.08));
  box-shadow: inset 3px 0 0 var(--bm-gold);
}

.rail-nav a:hover .nav-glyph,
.rail-nav a.active .nav-glyph {
  background: var(--bm-gold);
  color: #111111;
}

.nav-glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(212, 164, 55, 0.16);
  color: #ffffff;
  font-size: 0.69rem;
  font-weight: 900;
}

.rail-status {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(13, 116, 109, 0.16);
  border: 1px solid rgba(223, 244, 241, 0.17);
}

.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* The Simple Journal form is emitted by a Razor tag helper and therefore does
   not receive the view's CSS-isolation attribute. Keep its wide entry grid
   constrained to the workspace; the grid itself owns narrow-screen scrolling. */
#simple-journal-form {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Keep fluid Simple Journal lookups readable without sacrificing the complete
   placeholder at narrower desktop column widths. */
#simple-journal-form .quick-select-host .lookup-trigger {
  padding-right: 24px;
  padding-left: 9px;
  font-size: clamp(0.72rem, 0.7vw, 0.8125rem);
}

#simple-journal-form .quick-select-host .lookup-caret {
  right: 8px;
}

/* Tag-helper output does not receive Razor CSS-isolation attributes. */
.history-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  color: var(--bm-muted);
  background: var(--bm-surface);
  font-size: var(--bm-type-caption);
  font-weight: var(--bm-weight-body);
  line-height: 1.2;
  text-decoration: none;
}

.history-view-all:hover {
  border-color: var(--bm-line-strong);
  color: var(--bm-ink);
  text-decoration: none;
}

.command-bar {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(320px, 560px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--bm-line);
  backdrop-filter: blur(14px);
}

.command-bar strong,
.command-path {
  display: block;
}

.command-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.command-title strong {
  color: var(--bm-ink-strong);
  font-size: 1.16rem;
  line-height: 1.15;
}

.command-path {
  color: var(--bm-muted);
}

.command-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.system-health-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(30, 166, 75, 0.28);
  border-radius: 999px;
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
  font-size: 0.78rem;
  font-weight: 860;
}

.system-health-chip span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bm-green-dark);
  box-shadow: 0 0 0 4px rgba(30, 166, 75, 0.12);
}

.command-actions a {
  color: var(--bm-ink);
  font-weight: 720;
  text-decoration: none;
}

.menu-button,
.command-icon {
  min-width: 38px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  display: inline-grid;
  place-items: center;
}

.ui-icon {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-search {
  position: relative;
  display: grid;
  min-width: 0;
}

.global-search::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 13px;
  height: 13px;
  z-index: 1;
  border: 2px solid var(--bm-muted);
  border-radius: 999px;
  transform: translateY(-56%);
  opacity: 0.78;
}

.global-search::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 50%;
  width: 7px;
  height: 2px;
  z-index: 1;
  border-radius: 999px;
  background: var(--bm-muted);
  transform: translateY(4px) rotate(45deg);
  opacity: 0.78;
}

.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.global-search input {
  height: 45px;
  padding: 0 62px 0 44px;
  border-color: var(--bm-line-strong);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.03);
}

.global-search input:focus {
  border-color: rgba(212, 164, 55, 0.66);
  outline: 2px solid rgba(212, 164, 55, 0.12);
}

.global-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-raised);
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.theme-toggle {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  background: var(--bm-raised);
}

.theme-toggle span {
  min-width: 48px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 830;
}

.theme-toggle[aria-pressed="false"] .theme-toggle-light,
.theme-toggle[aria-pressed="true"] .theme-toggle-dark {
  background: var(--bm-surface);
  color: var(--bm-ink-strong);
  box-shadow: 0 3px 10px rgba(17, 17, 17, 0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 168px;
}

.user-chip > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-gold);
  color: #ffffff;
  font-weight: 860;
}

.user-chip div {
  min-width: 0;
}

.user-chip strong,
.user-chip small {
  display: block;
  line-height: 1.15;
}

.user-chip strong {
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
}

.user-chip small {
  color: var(--bm-muted);
  font-size: 0.75rem;
}

.app-workspace {
  min-width: 0;
  padding: 18px 24px 24px;
}

.app-shell:has(.xtract-result-shell) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app-main:has(.xtract-result-shell) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: 52px minmax(0, 1fr);
}

.app-main:has(.xtract-result-shell) .command-bar {
  min-height: 52px;
  padding-inline: 16px;
}

.app-main:has(.xtract-result-shell) .global-search input {
  height: 36px;
}

.app-main:has(.xtract-result-shell) .menu-button,
.app-main:has(.xtract-result-shell) .command-icon,
.app-main:has(.xtract-result-shell) .user-chip > span {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.app-main:has(.xtract-result-shell) .theme-toggle {
  min-height: 34px;
}

.app-main:has(.xtract-result-shell) .theme-toggle span {
  min-height: 26px;
}

.app-main:has(.xtract-result-shell) .user-chip strong {
  font-size: 0.8rem;
}

.app-main:has(.xtract-result-shell) .user-chip small {
  font-size: 0.68rem;
}

.app-main:has(.xtract-result-shell) .app-workspace {
  height: calc(100vh - 52px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 12px 68px;
  scroll-padding-bottom: 88px;
}

.gj-shell {
  display: grid;
  gap: 10px;
}

.gj-topline {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.gj-title h1 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.95rem;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: var(--bm-weight-display);
}

.journal-mode-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 9px;
  padding: 4px;
  border: 1px solid #d8dde2;
  border-radius: 9px;
  background: #fff;
}

.journal-mode-switch form {
  margin: 0;
}

.journal-mode-switch a,
.journal-mode-switch button {
  padding: 7px 11px;
  border: 0;
  border-radius: 6px;
  color: #596570;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 760;
}

.journal-mode-switch a.active,
.journal-mode-switch button.active {
  color: #17130a;
  background: linear-gradient(135deg, #edcf60, #c59a32);
}

.section-kicker {
  color: var(--bm-teal);
}

.journal-tabs {
  display: flex;
  min-height: 34px;
  align-items: end;
  gap: 26px;
  border-bottom: 1px solid var(--bm-line);
}

.journal-tabs a,
.journal-tabs button {
  position: relative;
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bm-muted);
  text-decoration: none;
  font-weight: 740;
}

.journal-tabs a.active,
.journal-tabs button.active {
  color: var(--bm-gold-dark);
}

.journal-tabs a.active::after,
.journal-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--bm-gold);
}

.journal-tab-count {
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  background: var(--bm-surface);
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.journal-tabs button.active .journal-tab-count {
  border-color: rgba(212, 164, 55, 0.42);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.journal-tab-panel {
  display: grid;
  gap: 10px;
}

.journal-tab-panel[hidden] {
  display: none;
}

.journal-list-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.journal-list-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.journal-list-header h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 850;
}

.journal-list-header p {
  margin: 4px 0 0;
  color: var(--bm-muted);
  font-size: 0.86rem;
}

.journal-list-empty {
  min-height: 120px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 20px;
  border: 1px dashed var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
  text-align: center;
}

.journal-list-empty strong {
  color: var(--bm-ink-strong);
}

.journal-list-empty span {
  max-width: 520px;
  color: var(--bm-muted);
  font-size: 0.86rem;
}

.journal-list-table-wrap {
  border-color: var(--bm-line-strong);
}

.journal-list-table {
  min-width: 920px;
}

.journal-list-table th {
  background: var(--bm-raised);
}

.journal-list-table td {
  color: var(--bm-ink);
  font-size: 0.88rem;
}

.journal-list-table td strong {
  color: var(--bm-ink-strong);
}

.journal-list-description {
  display: block;
  color: var(--bm-ink-strong);
  font-weight: 760;
}

.journal-list-date {
  color: var(--bm-ink-strong);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.journal-list-table small {
  display: block;
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.76rem;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.view-menu {
  position: relative;
}

.view-menu summary {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-weight: 820;
  list-style: none;
  cursor: pointer;
}

.period-pill {
  min-height: 35px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-weight: 830;
}

.purchases-shell {
  gap: 14px;
}

.cashbook-shell {
  gap: 14px;
}

.cashbook-topline {
  align-items: start;
  margin-bottom: 6px;
}

.cb-account-filter {
  width: fit-content;
  max-width: 100%;
  display: inline-grid;
  grid-template-columns: 26px minmax(0, auto);
  align-items: end;
  gap: 8px;
  margin-top: 7px;
  cursor: pointer;
}

.cb-account-filter-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  align-self: end;
  margin-bottom: 1px;
  border: 1px solid rgba(15, 139, 127, 0.18);
  border-radius: 999px;
  background: rgba(15, 139, 127, 0.08);
  color: var(--bm-teal);
}

.cb-account-filter-icon .ui-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.cb-account-filter-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.cb-account-filter-label {
  color: var(--bm-teal);
  font-size: 0.68rem;
  font-weight: 820;
  white-space: nowrap;
}

.cb-account-select-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
}

.cb-account-select-wrap::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  right: 3px;
  top: 50%;
  border-right: 1.7px solid rgba(15, 139, 127, 0.72);
  border-bottom: 1.7px solid rgba(15, 139, 127, 0.72);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.cb-account-filter select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  max-width: min(100%, 480px);
  min-height: 22px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--bm-ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 590;
  line-height: 1.18;
  padding: 0 18px 1px 0;
  text-overflow: ellipsis;
}

.cb-account-filter select:hover {
  border-bottom-color: rgba(15, 139, 127, 0.24);
  color: var(--bm-ink-strong);
}

.cb-account-filter:hover .cb-account-select-wrap::after,
.cb-account-filter:focus-within .cb-account-select-wrap::after {
  border-color: var(--bm-teal);
  transform: translateY(-50%) rotate(45deg);
}

.cb-account-filter select:focus-visible {
  outline: 2px solid rgba(15, 139, 127, 0.24);
  outline-offset: 3px;
  border-radius: 6px;
}

.cashbook-shell .purchase-header-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-size: 0.78rem;
  font-weight: 820;
  text-decoration: none;
}

.cb-intake-band {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.cb-import-card {
  min-height: 86px;
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.035);
}

.cb-import-card {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
}

.cb-import-copy {
  display: grid;
  gap: 4px;
  align-self: center;
}

.cb-import-history-head span {
  color: var(--bm-muted);
  font-size: 0.69rem;
  font-weight: 840;
}

.cb-import-copy strong,
.cb-import-history-head strong {
  color: var(--bm-ink-strong);
  font-size: 1.02rem;
  font-weight: 880;
}

.cb-file-drop {
  min-height: 42px;
  min-width: min(360px, 100%);
  display: grid;
  place-items: center;
  padding: 8px 16px;
  border: 1px dashed rgba(15, 139, 127, 0.32);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--bm-teal);
  cursor: pointer;
  text-align: center;
  justify-self: end;
}

.cb-file-drop:hover,
.cb-file-drop:focus-within {
  border-color: rgba(15, 139, 127, 0.5);
  background: rgba(15, 139, 127, 0.075);
}

.cb-file-drop input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cb-file-drop span {
  max-width: 100%;
  overflow: hidden;
  color: var(--bm-teal);
  font-size: 0.8rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-import-card .bm-primary-button {
  min-width: 132px;
  min-height: 42px;
}

.cb-reading-queue {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 23, 31, 0.42);
  backdrop-filter: blur(3px);
}

.cb-reading-queue[hidden] {
  display: none;
}

.cb-reading-card {
  position: relative;
  overflow: hidden;
  width: min(520px, calc(100vw - 32px));
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid rgba(12, 117, 111, 0.24);
  border-left: 2px solid var(--bm-teal);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.86), rgba(255, 255, 255, 0.94));
  box-shadow: 0 24px 64px rgba(10, 23, 31, 0.22);
}

.cb-reading-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(12, 117, 111, 0), rgba(12, 117, 111, 0.78), rgba(212, 164, 55, 0.78), rgba(12, 117, 111, 0));
  transform: translateX(-100%);
  animation: purchase-reading-sweep 1.65s ease-in-out infinite;
}

.cb-reading-card strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-reading-card span,
.cb-reading-card small {
  overflow: hidden;
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-history-panel {
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.16);
}

.cb-history-panel[hidden] {
  display: none;
}

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

.cb-history-panel-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cb-history-panel-head span {
  color: var(--bm-teal);
  font-size: 0.68rem;
  font-weight: 760;
  text-transform: uppercase;
}

.cb-history-panel-head small {
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 560;
}

.cb-icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: #fff;
  color: var(--bm-ink);
  cursor: pointer;
}

.cb-icon-button:hover,
.cb-icon-button:focus-visible {
  border-color: rgba(15, 139, 127, 0.35);
  color: var(--bm-teal);
}

.cb-import-focus {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.4fr) auto;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 139, 127, 0.22);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(15, 139, 127, 0.08), rgba(255, 255, 255, 0.82));
}

.cb-import-focus-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cb-import-focus span,
.cb-import-focus small {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.cb-import-focus strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-import-focus-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  gap: 8px;
}

.cb-import-focus-metrics div {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.cb-import-focus-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cb-import-focus-actions form {
  margin: 0;
}

.cb-import-item .is-confirmed,
.cb-import-focus .is-confirmed {
  color: #0f766e;
}

.cb-import-item .is-review,
.cb-import-focus .is-review {
  color: #9a7a25;
}

.cb-import-item .is-posted,
.cb-import-focus .is-posted {
  color: var(--bm-ink-strong);
}

.cb-import-item .is-imported,
.cb-import-focus .is-imported {
  color: var(--bm-muted);
}

.cb-import-history {
  display: grid;
  gap: 8px;
  align-content: start;
}

.cb-import-history-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.cb-import-history-head::-webkit-details-marker {
  display: none;
}

.cb-import-list {
  display: grid;
  gap: 3px;
  padding-bottom: 6px;
}

.cb-import-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
}

.cb-import-item:first-child {
  border-top: 0;
}

.cb-import-item.is-active {
  border-color: rgba(15, 139, 127, 0.16);
  background: rgba(15, 139, 127, 0.045);
}

.cb-import-item div {
  min-width: 0;
}

.cb-import-item-status {
  text-align: right;
}

.cb-import-item strong,
.cb-import-item span,
.cb-import-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-import-item strong {
  color: var(--bm-ink-strong);
  font-size: 0.74rem;
  font-weight: 680;
}

.cb-import-item span {
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 540;
}

.cb-import-item small {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.64rem;
  font-weight: 460;
}

.cb-import-item a {
  display: inline-flex;
  justify-content: flex-end;
  margin-top: 3px;
  color: var(--bm-teal);
  font-size: 0.66rem;
  font-weight: 560;
  text-decoration: none;
}

.cb-import-item-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.cb-import-item-actions form {
  margin: 0;
}

.cb-import-item-actions a,
.cb-import-item-actions button {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bm-teal);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.cb-import-item-actions button:disabled {
  color: var(--bm-muted);
  cursor: default;
  opacity: 0.58;
}

.cb-reconciliation-panel {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 61;
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.16);
}

.cb-reconciliation-panel[hidden] {
  display: none;
}

.cb-reconciliation-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.cb-reconciliation-panel-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cb-reconciliation-panel-head span,
.cb-reconciliation-blockers > span {
  color: var(--bm-teal);
  font-size: 0.68rem;
  font-weight: 760;
  text-transform: uppercase;
}

.cb-reconciliation-panel-head strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-reconciliation-panel-head small {
  overflow: hidden;
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-reconciliation-panel > em {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 620;
  line-height: 1.2;
  background: rgba(248, 250, 252, 0.76);
}

.cb-reconciliation-panel > em.is-balanced {
  border-color: rgba(15, 118, 110, 0.2);
  color: var(--bm-teal);
  background: rgba(240, 253, 250, 0.68);
}

.cb-reconciliation-panel > em.is-difference {
  border-color: rgba(217, 166, 33, 0.28);
  color: var(--bm-gold-dark);
  background: rgba(255, 251, 235, 0.72);
}

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

.cb-reconciliation-grid div {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.72);
}

.cb-reconciliation-grid span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 610;
}

.cb-reconciliation-grid strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-reconciliation-grid strong.is-balanced {
  color: var(--bm-teal);
}

.cb-reconciliation-grid strong.is-difference {
  color: var(--bm-gold-dark);
}

.cb-reconciliation-blockers {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.cb-reconciliation-blockers ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cb-reconciliation-blockers li {
  color: var(--bm-muted);
  font-size: 0.75rem;
  font-weight: 540;
  line-height: 1.35;
}

.cb-reconciliation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.cb-reconciliation-actions form {
  margin: 0;
}

.cb-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 12px;
}

.cb-tools-drawer {
  order: 3;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.cb-tools-drawer > summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  color: var(--bm-ink);
  cursor: pointer;
  list-style: none;
}

.cb-tools-drawer > summary::-webkit-details-marker {
  display: none;
}

.cb-tools-drawer > summary span {
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 840;
}

.cb-tools-drawer > summary strong {
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  font-weight: 860;
}

.cb-tools-drawer .cb-control-grid {
  padding: 0 12px 12px;
}

.cb-panel,
.cb-workspace-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.cb-manual-entry {
  align-content: start;
}

.cb-manual-entry > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.cb-manual-entry > summary::-webkit-details-marker {
  display: none;
}

.cb-manual-entry > summary span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 840;
}

.cb-manual-entry > summary strong {
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  font-weight: 860;
}

.cb-panel-heading,
.cb-workspace-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.cb-workspace-heading {
  align-items: center;
  justify-content: space-between;
}

.cb-date-window {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.035);
}

.cb-date-window label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.68rem;
}

.cb-date-window input {
  width: 116px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--bm-ink-strong);
  font: inherit;
  outline: none;
}

.cb-date-window button:not(.cb-date-window-action) {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-left: 1px solid var(--bm-line);
  background: transparent;
  color: var(--bm-teal);
  cursor: pointer;
}

.cb-date-window-action {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid var(--bm-line);
  background: transparent;
  color: var(--bm-teal);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 680;
  cursor: pointer;
}

.cb-date-window-action:hover,
.cb-date-window-action:focus-visible {
  color: var(--bm-teal-strong);
  outline: none;
}

.cb-date-window .ui-icon {
  width: 17px;
  height: 17px;
}

.cb-panel-heading h2,
.cb-workspace-heading h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.02rem;
  line-height: 1.15;
  font-weight: 860;
}

.cb-panel-heading p,
.cb-workspace-heading p {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--bm-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.cb-count-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(15, 139, 127, 0.16);
  border-radius: 999px;
  background: rgba(15, 139, 127, 0.08);
  color: var(--bm-teal);
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.cb-count-pill.muted {
  border-color: rgba(148, 163, 184, 0.22);
  background: var(--bm-raised);
  color: var(--bm-muted);
}

.cb-account-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.cb-account-tile {
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.72));
}

details.cb-account-tile > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

details.cb-account-tile > summary::-webkit-details-marker {
  display: none;
}

details.cb-account-tile > summary small {
  grid-column: 1 / -1;
}

.cb-account-tile.is-archived {
  opacity: 0.62;
}

.cb-account-tile strong {
  display: block;
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 860;
}

.cb-account-tile span,
.cb-account-tile small {
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.cb-account-balance {
  display: grid;
  gap: 2px;
  text-align: right;
}

.cb-account-edit-form,
.cb-statement-balance-form {
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
}

.cb-account-status-form {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.cb-compact-form,
.cb-import-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.cb-import-form {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.cb-compact-form label,
.cb-import-form label,
.cb-allocation-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cb-compact-form label span,
.cb-import-form label span,
.cb-allocation-form label span {
  color: var(--bm-muted);
  font-size: 0.69rem;
  font-weight: 820;
}

.cb-compact-form .cb-checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
}

.cb-compact-form .cb-checkbox-field input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--bm-teal);
}

.cb-compact-form .cb-checkbox-field span {
  font-size: 0.72rem;
}

.cb-compact-form input,
.cb-compact-form select,
.cb-import-form input,
.cb-import-form select,
.cb-allocation-form select {
  width: 100%;
  min-height: 35px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font-size: 0.8rem;
  font-weight: 720;
}

.cb-compact-form input,
.cb-import-form input {
  padding: 0 10px;
}

.cb-compact-form select,
.cb-import-form select,
.cb-allocation-form select {
  padding: 0 9px;
}

.cb-wide-field {
  grid-column: span 2;
}

.cb-secondary-action,
.bm-primary-button {
  min-height: 36px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 860;
}

.cb-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--bm-line);
  background: var(--bm-surface);
  color: var(--bm-ink);
}

.cb-link-button {
  border: 0;
  background: transparent;
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-decoration: underline;
  cursor: pointer;
}

.cb-secondary-action:hover,
.cb-secondary-action:focus-visible {
  border-color: rgba(15, 139, 127, 0.34);
  background: rgba(15, 139, 127, 0.06);
}

.cb-summary-strip {
  order: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cb-workspace-panel {
  order: 2;
}

.cb-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cb-workspace-actions form {
  margin: 0;
}

.cb-selection-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.cb-selection-actions[hidden] {
  display: none;
}

.cb-selected-count {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 760;
  white-space: nowrap;
}

.cb-selection-action-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-teal);
  font-size: 0.76rem;
  font-weight: 820;
  cursor: pointer;
}

.cb-selection-action-button:hover,
.cb-selection-action-button:focus-visible {
  border-color: rgba(15, 139, 127, 0.34);
  background: rgba(15, 139, 127, 0.06);
  outline: none;
}

.cb-selection-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.cb-selection-icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-muted);
  cursor: pointer;
}

.cb-selection-icon-button:hover,
.cb-selection-icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--bm-danger) 24%, var(--bm-line));
  background: color-mix(in srgb, var(--bm-danger-soft) 72%, var(--bm-surface));
  color: var(--bm-danger);
  outline: none;
}

.cb-selection-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.cb-workspace-actions .bm-primary-button,
.cb-workspace-actions .cb-secondary-action {
  min-width: 136px;
}

.cb-workspace-actions .bm-primary-button.has-selection {
  border-color: var(--bm-teal);
  background: var(--bm-teal);
  color: #ffffff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--bm-teal) 14%, transparent);
}

.cb-workspace-actions .bm-primary-button.has-selection:hover,
.cb-workspace-actions .bm-primary-button.has-selection:focus-visible {
  background: color-mix(in srgb, var(--bm-teal) 92%, #000000);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--bm-teal) 18%, transparent);
}

.cb-summary-strip button {
  min-height: 58px;
  display: grid;
  gap: 2px;
  align-content: center;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.cb-summary-strip button:hover,
.cb-summary-strip button:focus-visible {
  border-color: rgba(212, 164, 55, 0.42);
  background: color-mix(in srgb, var(--bm-gold-soft) 70%, var(--bm-surface));
  outline: none;
}

.cb-summary-strip button.is-active {
  border-color: rgba(212, 164, 55, 0.58);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bm-gold-soft) 80%, var(--bm-surface)),
    var(--bm-surface)
  );
  box-shadow: inset 0 0 0 1px rgba(212, 164, 55, 0.08);
}

.cb-summary-strip span {
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 820;
}

.cb-summary-strip strong {
  color: var(--bm-ink-strong);
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cb-empty-inline,
.cb-empty-workspace {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.cb-empty-workspace {
  min-height: 132px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.cb-empty-inline strong,
.cb-empty-workspace strong {
  color: var(--bm-ink-strong);
  font-weight: 860;
}

.cb-empty-inline span,
.cb-empty-workspace span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.cb-import-confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(2px);
}

.cb-import-confirm[hidden] {
  display: none;
}

.cb-import-confirm-card {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.cb-import-confirm-card.is-candidate-review {
  width: min(1280px, calc(100vw - 72px));
}

.cb-import-confirm-copy {
  display: grid;
  gap: 3px;
}

.cb-import-confirm-copy span {
  color: var(--bm-teal);
  font-size: 0.72rem;
  font-weight: 840;
}

.cb-import-confirm-copy strong {
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 880;
}

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

.cb-import-confirm-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: var(--bm-raised);
}

.cb-import-confirm-grid span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 820;
}

.cb-import-confirm-grid strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-import-confirm-grid strong.is-missing {
  color: var(--bm-gold-dark);
}

.cb-pdf-review-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(16, 125, 117, 0.18);
  border-radius: 8px;
  background: rgba(231, 246, 242, 0.58);
}

.cb-pdf-review-summary[hidden] {
  display: none;
}

.cb-pdf-review-summary strong {
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 780;
}

.cb-pdf-review-summary span {
  color: var(--bm-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.cb-pdf-review-summary a {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  text-decoration: none;
}

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

.cb-pdf-review-stats[hidden] {
  display: none;
}

.cb-pdf-stat-card {
  appearance: none;
  display: grid;
  gap: 2px;
  min-height: 48px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.cb-pdf-stat-card:hover,
.cb-pdf-stat-card.is-active {
  border-color: rgba(20, 125, 116, 0.34);
  background: rgba(240, 253, 250, 0.78);
}

.cb-pdf-stat-card:focus-visible {
  outline: 2px solid rgba(20, 125, 116, 0.32);
  outline-offset: 2px;
}

.cb-pdf-review-stats span {
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 720;
}

.cb-pdf-review-stats strong {
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 780;
}

.cb-pdf-ai-witness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 125, 116, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
}

.cb-pdf-ai-witness[hidden] {
  display: none;
}

.cb-pdf-ai-witness div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cb-pdf-ai-witness strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 780;
}

.cb-pdf-ai-witness span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.cb-pdf-normalizer-comparison {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.76);
}

.cb-pdf-normalizer-comparison[hidden] {
  display: none;
}

.cb-pdf-normalizer-comparison summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.cb-pdf-normalizer-comparison summary::-webkit-details-marker {
  display: none;
}

.cb-pdf-normalizer-comparison summary strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 780;
}

.cb-pdf-comparison-chips,
.cb-pdf-comparison-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cb-pdf-comparison-chips span,
.cb-pdf-comparison-pages span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
}

.cb-pdf-comparison-chips span.is-good {
  border-color: rgba(20, 125, 116, 0.26);
  background: rgba(231, 246, 242, 0.68);
  color: var(--bm-teal-strong);
}

.cb-pdf-comparison-chips span.is-review {
  border-color: rgba(191, 150, 46, 0.28);
  background: rgba(255, 248, 226, 0.78);
  color: var(--bm-gold-dark);
}

.cb-pdf-comparison-examples {
  display: grid;
  gap: 6px;
}

.cb-pdf-comparison-examples div {
  display: grid;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.cb-pdf-comparison-examples strong {
  color: var(--bm-ink-strong);
  font-size: 0.72rem;
  font-weight: 780;
}

.cb-pdf-comparison-examples span,
.cb-pdf-comparison-examples small {
  color: var(--bm-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.cb-import-parser-details {
  display: grid;
  gap: 8px;
}

.cb-import-parser-details summary {
  cursor: pointer;
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.cb-pdf-review-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.cb-import-preview-table {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
}

.cb-import-preview-head,
.cb-import-preview-row {
  display: grid;
  grid-template-columns: 0.74fr minmax(0, 1.45fr) 0.64fr 0.64fr 0.7fr;
  gap: 8px;
  align-items: center;
}

.cb-import-preview-head {
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 760;
}

.cb-import-preview-row {
  min-height: 36px;
  padding: 7px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--bm-ink);
  font-size: 0.72rem;
  font-weight: 520;
}

.cb-import-preview-row:first-child {
  border-top: 0;
}

.cb-import-preview-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-import-preview-table.is-candidate-review {
  max-height: min(48vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
}

.cb-import-preview-table.is-candidate-review .cb-import-preview-head {
  grid-template-columns: 38px minmax(108px, 0.72fr) minmax(190px, 1.85fr) minmax(94px, 0.72fr) minmax(94px, 0.72fr) minmax(104px, 0.78fr) minmax(132px, 0.98fr) minmax(132px, 0.76fr) 68px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.98);
}

.cb-pdf-candidate-row {
  display: grid;
  grid-template-columns: 38px minmax(108px, 0.72fr) minmax(190px, 1.85fr) minmax(94px, 0.72fr) minmax(94px, 0.72fr) minmax(104px, 0.78fr) minmax(132px, 0.98fr) minmax(132px, 0.76fr) 68px;
  gap: 8px;
  align-items: start;
  padding: 9px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  font-size: 0.72rem;
}

.cb-pdf-candidate-row:first-child {
  border-top: 0;
}

.cb-pdf-candidate-row.is-ignored {
  opacity: 0.54;
}

.cb-pdf-candidate-row.is-imported {
  opacity: 0.72;
}

.cb-pdf-candidate-row.is-pending-review {
  background: color-mix(in srgb, var(--bm-warning-soft) 42%, transparent);
}

.cb-pdf-candidate-row.is-pending-review input {
  border-color: color-mix(in srgb, var(--bm-warning) 34%, var(--bm-line));
}

.cb-pdf-candidate-row input {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background: #fff;
  color: var(--bm-ink);
  font: inherit;
  font-weight: 520;
}

.cb-pdf-candidate-row:not(.is-pending-review) input {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.cb-pdf-candidate-row:not(.is-pending-review) input:hover,
.cb-pdf-candidate-row:not(.is-pending-review) input:focus {
  border-color: rgba(148, 163, 184, 0.28);
  background: #fff;
}

.cb-pdf-candidate-row input[data-candidate-date],
.cb-pdf-candidate-row input[data-candidate-balance] {
  font-variant-numeric: tabular-nums;
}

.cb-pdf-candidate-row input[type="number"] {
  text-align: right;
}

.cb-pdf-select-all,
.cb-pdf-row-select {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cb-pdf-select-all input[type="checkbox"],
.cb-pdf-row-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--bm-teal);
}

.cb-pdf-candidate-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--bm-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.cb-pdf-candidate-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-pdf-status-detail {
  grid-column: 2 / -1;
  margin: 0 0 2px;
  padding: 3px 8px;
  border-left: 2px solid currentColor;
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cb-pdf-status-detail[hidden] {
  display: none;
}

.cb-pdf-status-detail.is-proof,
.cb-pdf-status-detail.is-safe {
  color: var(--bm-teal);
}

.cb-pdf-status-detail.is-warning,
.cb-pdf-status-detail.is-issue,
.cb-pdf-status-detail.is-review,
.cb-pdf-status-detail.is-pending {
  color: var(--bm-warning);
}

.cb-pdf-candidate-meta:empty {
  display: none;
}

.cb-pdf-candidate-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.cb-pdf-check-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

button.cb-pdf-check-badge {
  width: 100%;
  gap: 6px;
  border-style: solid;
  cursor: pointer;
  font-family: inherit;
}

button.cb-pdf-check-badge::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 120ms ease, margin 120ms ease;
}

button.cb-pdf-check-badge[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

button.cb-pdf-check-badge:focus-visible {
  outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
  outline-offset: 2px;
}

.cb-pdf-check-badge.is-safe,
.cb-pdf-check-badge.is-accepted {
  border-color: rgba(12, 117, 111, 0.18);
  background: rgba(231, 246, 242, 0.78);
  color: var(--bm-teal);
}

.cb-pdf-check-badge.is-review,
.cb-pdf-check-badge.is-issue,
.cb-pdf-check-badge.is-pending {
  border-color: color-mix(in srgb, var(--bm-warning) 38%, var(--bm-line));
  background: var(--bm-warning-soft);
  color: var(--bm-warning);
}

.cb-pdf-check-badge.is-imported,
.cb-pdf-check-badge.is-ignored {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(241, 245, 249, 0.78);
  color: var(--bm-muted);
}

.cb-pdf-source-button {
  min-height: 34px;
  padding: 0 7px;
  font-size: 0.7rem;
}

.cb-pdf-source-actions {
  display: grid;
  grid-template-columns: minmax(62px, 1fr) minmax(54px, 0.82fr);
  gap: 6px;
}

.cb-pdf-proof-button {
  min-height: 34px;
  padding: 0 7px;
  font-size: 0.7rem;
}

.cb-pdf-candidate-actions button {
  min-height: 32px;
  padding: 0 7px;
}

.cb-pdf-ignore-button {
  opacity: 0.48;
}

.cb-pdf-candidate-row:hover .cb-pdf-ignore-button,
.cb-pdf-candidate-row:focus-within .cb-pdf-ignore-button,
.cb-pdf-candidate-row.is-pending-review .cb-pdf-ignore-button {
  opacity: 1;
}

.cb-pdf-source-snippet {
  flex-basis: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  white-space: normal !important;
}

.cb-pdf-proof-drawer {
  grid-column: 1 / -1;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(12, 117, 111, 0.16);
  background: linear-gradient(90deg, rgba(231, 246, 242, 0.7), rgba(255, 255, 255, 0.88));
  color: var(--bm-ink);
}

.cb-pdf-proof-drawer[hidden] {
  display: none;
}

.cb-pdf-proof-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.cb-pdf-proof-summary span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--bm-teal);
  font-size: 0.66rem;
  font-weight: 740;
}

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

.cb-pdf-proof-section {
  min-width: 0;
  padding: 0;
}

.cb-pdf-proof-section h4 {
  margin: 0 0 6px;
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cb-pdf-proof-section p,
.cb-pdf-proof-section small,
.cb-pdf-proof-section span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.cb-pdf-proof-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 9px;
  margin: 0;
}

.cb-pdf-proof-fields div {
  min-width: 0;
}

.cb-pdf-proof-fields dt {
  color: var(--bm-muted);
  font-size: 0.62rem;
  font-weight: 740;
}

.cb-pdf-proof-fields dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 0.7rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-pdf-proof-list {
  display: grid;
  gap: 6px;
}

.cb-pdf-proof-list article {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.cb-pdf-proof-list article strong,
.cb-pdf-proof-list article span,
.cb-pdf-proof-list article p,
.cb-pdf-proof-list article small {
  display: block;
  min-width: 0;
}

.cb-pdf-proof-list article strong {
  color: var(--bm-teal);
  font-size: 0.68rem;
  font-weight: 790;
}

.cb-pdf-proof-list article p {
  margin: 3px 0;
  color: var(--bm-ink);
  font-weight: 620;
}

.cb-pdf-proof-witness-row {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.cb-pdf-proof-witness-row:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.cb-pdf-proof-witness-row > span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  padding: 0.16rem 0.48rem;
}

.cb-pdf-proof-witness-row.is-match > span {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.cb-pdf-proof-witness-row.is-conflict > span {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

@media (max-width: 1100px) {
  .cb-pdf-proof-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cb-import-confirm-warning {
  padding: 10px 12px;
  border: 1px solid rgba(212, 164, 55, 0.28);
  border-radius: 8px;
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
  font-size: 0.78rem;
  font-weight: 740;
  line-height: 1.35;
}

.cb-import-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cb-reconcile-toolbar {
  display: grid;
  gap: 12px;
  margin: 12px 0 14px;
  padding-top: 2px;
}

.cb-reconcile-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.cb-reconcile-tabs > span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 2px solid transparent;
  color: var(--bm-muted);
  font-weight: 840;
}

.cb-reconcile-tabs > span.is-active {
  border-bottom-color: var(--bm-gold);
  color: var(--bm-ink-strong);
}

.cb-reconcile-tabs strong {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(212, 164, 55, 0.12);
  color: var(--bm-gold-dark);
  font-size: 0.72rem;
}

.cb-reconcile-search {
  position: relative;
  max-width: 760px;
  margin: 0;
}

.cb-reconcile-search::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 16px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(100, 116, 139, 0.66);
  border-radius: 999px;
}

.cb-reconcile-search::after {
  content: "";
  position: absolute;
  top: 29px;
  left: 29px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.66);
  transform: rotate(45deg);
}

.cb-reconcile-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cb-reconcile-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink-strong);
  font-weight: 760;
}

.cb-register-head {
  display: grid;
  grid-template-columns: 32px 96px minmax(260px, 1.35fr) minmax(210px, 1fr) 116px 116px 142px;
  gap: 12px;
  align-items: center;
  padding: 0 12px 9px;
  color: var(--bm-muted);
  font-size: 0.64rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0;
}

.cb-register-head span:nth-child(5),
.cb-register-head span:nth-child(6) {
  text-align: right;
}

.cb-register-head span:nth-child(7) {
  text-align: center;
}

.cb-movement-list {
  display: grid;
  gap: 8px;
}

.cb-movement-row {
  overflow: hidden;
  border: 1px solid var(--bm-line);
  border-left: 2px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: var(--bm-surface);
}

.cb-movement-row.is-ready {
  border-left-color: var(--bm-teal);
}

.cb-movement-row.is-matched {
  border-left-color: rgba(15, 139, 127, 0.72);
}

.cb-movement-row.is-review,
.cb-movement-row.is-reading {
  border-left-color: var(--bm-gold);
}

.cb-movement-row.is-risk {
  border-left-color: #dc2626;
}

.cb-movement-row.is-posted {
  border-left-color: rgba(22, 163, 74, 0.68);
}

.cb-movement-row.is-resolved {
  border-left-color: rgba(100, 116, 139, 0.42);
}

.cb-movement-main {
  display: grid;
  grid-template-columns: 32px 96px minmax(260px, 1.35fr) minmax(210px, 1fr) 116px 116px 142px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.cb-select-row {
  display: grid;
  place-items: center;
  margin: 0;
}

.cb-select-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--bm-gold);
}

.cb-movement-main time {
  color: var(--bm-ink);
  font-size: 0.76rem;
  font-weight: 580;
}

.cb-movement-main strong {
  display: block;
  color: var(--bm-ink);
  font-size: 0.77rem;
  line-height: 1.28;
  font-weight: 560;
}

.cb-movement-main span {
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.cb-money {
  display: grid;
  justify-items: end;
  text-align: right;
  min-height: 24px;
  font-variant-numeric: tabular-nums;
}

.cb-money strong {
  display: block;
  color: var(--bm-ink);
  font-size: 0.77rem;
  font-weight: 580;
  font-variant-numeric: tabular-nums;
}

.cb-money span {
  display: block;
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 560;
  text-align: right;
}

.cb-money.in strong {
  color: var(--bm-ink);
}

.cb-money.out strong {
  color: var(--bm-ink);
}

.cb-statement-line span {
  display: block;
  margin-top: 3px;
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-category-match strong,
.cb-category-button {
  color: var(--bm-teal);
  font-size: 0.78rem;
  font-weight: 620;
  text-decoration: none;
}

.cb-category-button {
  min-height: 30px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.cb-category-button:hover,
.cb-category-button:focus-visible,
.cb-category-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--bm-teal) 24%, transparent);
  background: color-mix(in srgb, var(--bm-teal-soft) 78%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bm-teal) 8%, transparent);
  outline: none;
}

.cb-category-match span {
  display: block;
  margin-top: 3px;
}

.cb-movement-row.is-review .cb-category-match strong,
.cb-movement-row.is-reading .cb-category-match strong,
.cb-movement-row.is-review .cb-category-button,
.cb-movement-row.is-reading .cb-category-button {
  color: var(--bm-gold-dark);
}

.cb-movement-row.is-review .cb-category-button:hover,
.cb-movement-row.is-reading .cb-category-button:hover,
.cb-movement-row.is-review .cb-category-button:focus-visible,
.cb-movement-row.is-reading .cb-category-button:focus-visible,
.cb-movement-row.is-review .cb-category-button[aria-expanded="true"],
.cb-movement-row.is-reading .cb-category-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--bm-gold) 34%, transparent);
  background: color-mix(in srgb, var(--bm-gold-soft) 88%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bm-gold) 10%, transparent);
}

.cb-movement-row.is-risk .cb-category-match strong,
.cb-movement-row.is-risk .cb-category-button {
  color: var(--bm-danger);
}

.cb-movement-row.is-risk .cb-category-button:hover,
.cb-movement-row.is-risk .cb-category-button:focus-visible,
.cb-movement-row.is-risk .cb-category-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--bm-danger) 28%, transparent);
  background: color-mix(in srgb, var(--bm-danger-soft) 88%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bm-danger) 8%, transparent);
}

.cb-direction span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 680;
}

.cb-direction.in span {
  color: var(--bm-muted);
}

.cb-direction.out span {
  color: var(--bm-muted);
}

.cb-payee {
  display: grid;
  gap: 2px;
}

.cb-payee span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.cb-payee strong {
  color: var(--bm-ink);
  font-size: 0.77rem;
  font-weight: 520;
  line-height: 1.25;
}

.cb-status-pill {
  justify-self: end;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
  white-space: nowrap;
}

.cb-status-pill.is-ready,
.cb-status-pill.is-matched,
.cb-status-pill.is-posted {
  background: rgba(15, 139, 127, 0.08);
  color: var(--bm-teal);
}

.cb-status-pill.is-resolved {
  background: rgba(100, 116, 139, 0.08);
  color: var(--bm-muted);
}

.cb-status-pill.is-review,
.cb-status-pill.is-reading {
  background: color-mix(in srgb, var(--bm-gold-soft) 74%, var(--bm-surface));
  color: var(--bm-gold-dark);
}

.cb-status-pill.is-risk {
  background: color-mix(in srgb, var(--bm-danger-soft) 82%, var(--bm-surface));
  color: var(--bm-danger);
}

.cb-movement-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 12px 9px 152px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: color-mix(in srgb, var(--bm-raised) 72%, transparent);
}

.cb-movement-detail.has-decision {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.cb-movement-detail.has-bill-match {
  gap: 8px 16px;
}

.cb-movement-row.is-ready .cb-movement-detail,
.cb-movement-row.is-matched .cb-movement-detail {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bm-green-soft) 76%, transparent),
    color-mix(in srgb, var(--bm-raised) 62%, transparent)
  );
}

.cb-movement-row.is-review .cb-movement-detail,
.cb-movement-row.is-reading .cb-movement-detail {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bm-gold-soft) 82%, transparent),
    color-mix(in srgb, var(--bm-raised) 62%, transparent)
  );
}

.cb-movement-row.is-risk .cb-movement-detail {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bm-danger-soft) 84%, transparent),
    color-mix(in srgb, var(--bm-raised) 62%, transparent)
  );
}

.cb-signal-block {
  min-width: 0;
}

.cb-signal-block strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 0.76rem;
  font-weight: 520;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.cb-signal-block strong span {
  color: var(--bm-teal);
  font-weight: 650;
}

.cb-signal-block small {
  max-width: 520px;
  color: var(--bm-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.cb-recon-summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 0.85fr) minmax(130px, 0.85fr);
  gap: 10px;
  align-items: start;
}

.cb-recon-summary div {
  min-width: 0;
}

.cb-recon-summary span {
  display: block;
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 820;
}

.cb-recon-summary strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-recon-evidence {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cb-recon-evidence strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 0.76rem;
  font-weight: 540;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-recon-evidence strong span {
  color: var(--bm-teal);
  font-weight: 680;
}

.cb-recon-evidence small {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1.3;
}

.cb-match-proof-wrap {
  grid-column: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.cb-match-proof {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--bm-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.cb-proof-prefix {
  color: var(--bm-teal);
  font-weight: 560;
  cursor: help;
}

.cb-proof-dot {
  display: none;
}

.cb-proof-label,
.cb-proof-fact {
  appearance: none;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--bm-teal) 18%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bm-teal-soft) 78%, transparent);
  color: var(--bm-teal);
  font: inherit;
  font-weight: 520;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

button.cb-proof-fact {
  cursor: pointer;
}

.cb-proof-fact:hover,
.cb-proof-fact:focus-visible {
  border-color: color-mix(in srgb, var(--bm-teal) 38%, transparent);
  background: color-mix(in srgb, var(--bm-teal-soft) 92%, transparent);
  box-shadow: 0 6px 14px rgba(15, 139, 127, 0.1);
  outline: none;
}

.cb-proof-fact.is-confirmed,
.cb-proof-fact.is-link {
  border-color: color-mix(in srgb, var(--bm-teal) 22%, transparent);
  background: color-mix(in srgb, var(--bm-teal-soft) 82%, transparent);
  color: var(--bm-teal);
}

.cb-proof-fact.is-link:hover,
.cb-proof-fact.is-link:focus-visible {
  border-color: color-mix(in srgb, var(--bm-teal) 42%, transparent);
  background: color-mix(in srgb, var(--bm-teal-soft) 100%, transparent);
}

.cb-proof-fact.is-review {
  border-color: color-mix(in srgb, var(--bm-gold-dark) 28%, transparent);
  background: color-mix(in srgb, var(--bm-gold-soft) 84%, transparent);
  color: var(--bm-gold-dark);
}

.cb-proof-fact.is-review:hover,
.cb-proof-fact.is-review:focus-visible {
  border-color: color-mix(in srgb, var(--bm-gold-dark) 44%, transparent);
  background: color-mix(in srgb, var(--bm-gold-soft) 96%, transparent);
  box-shadow: 0 6px 14px rgba(183, 133, 31, 0.11);
}

.cb-proof-fact.is-tax {
  border-color: color-mix(in srgb, var(--bm-teal) 16%, transparent);
  background: color-mix(in srgb, var(--bm-green-soft) 56%, transparent);
  color: var(--bm-teal);
}

.cb-movement-detail.has-bill-match .cb-recon-evidence {
  grid-column: 1;
}

.cb-movement-detail.has-bill-match .cb-recon-evidence strong {
  overflow: visible;
  font-size: 0.78rem;
  font-weight: 560;
  text-overflow: clip;
  white-space: normal;
}

.cb-movement-detail.has-bill-match .cb-recon-evidence small {
  margin-top: 1px;
  color: var(--bm-ink);
  font-size: 0.78rem;
  font-weight: 540;
}

.cb-movement-row.is-review .cb-recon-evidence strong span,
.cb-movement-row.is-reading .cb-recon-evidence strong span {
  color: var(--bm-gold-dark);
}

.cb-signal-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.cb-signal-chips span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid rgba(15, 139, 127, 0.12);
  border-radius: 6px;
  background: rgba(15, 139, 127, 0.055);
  color: var(--bm-teal);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.cb-movement-row.is-review .cb-signal-chips span,
.cb-movement-row.is-reading .cb-signal-chips span {
  border-color: color-mix(in srgb, var(--bm-gold) 28%, transparent);
  background: color-mix(in srgb, var(--bm-gold-soft) 86%, transparent);
  color: var(--bm-gold-dark);
}

.cb-movement-row.is-risk .cb-signal-chips span {
  border-color: color-mix(in srgb, var(--bm-danger) 22%, transparent);
  background: color-mix(in srgb, var(--bm-danger-soft) 86%, transparent);
  color: var(--bm-danger);
}

html[data-theme="dark"] .cb-proof-label,
html[data-theme="dark"] .cb-proof-fact {
    border-color: color-mix(in srgb, var(--bm-teal) 34%, transparent);
    background: color-mix(in srgb, var(--bm-teal-soft) 44%, var(--bm-surface));
    color: var(--bm-teal);
    text-decoration: none;
}

html[data-theme="dark"] .cb-proof-fact.is-review {
    border-color: color-mix(in srgb, var(--bm-gold) 38%, transparent);
    background: color-mix(in srgb, var(--bm-gold-soft) 52%, var(--bm-surface));
    color: var(--bm-gold);
}

html[data-theme="dark"] .cb-proof-fact.is-tax {
    border-color: color-mix(in srgb, var(--bm-teal) 30%, transparent);
    background: color-mix(in srgb, var(--bm-green-soft) 40%, var(--bm-surface));
    color: var(--bm-teal);
}

html[data-theme="dark"] .cb-proof-dot {
    display: none;
}

.cb-match-actions,
.cb-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cb-review-prompt {
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.cb-review-panel {
  padding: 8px 16px 12px 210px;
  border-top: 1px solid color-mix(in srgb, var(--bm-line) 70%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bm-gold-soft) 20%, transparent), transparent 42%),
    color-mix(in srgb, var(--bm-surface) 86%, transparent);
}

.cb-review-panel[hidden] {
  display: none;
}

.cb-row-actions-primary {
  min-width: 142px;
}

.cb-row-actions-primary form,
.cb-row-actions-primary button {
  min-width: 66px;
}

.cb-row-actions-primary .bm-primary-button,
.cb-row-actions-primary .cb-secondary-action {
  min-height: 32px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 620;
}

.cb-row-actions-primary .bm-primary-button {
  border: 1px solid var(--bm-teal);
  background: var(--bm-teal);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--bm-teal) 14%, transparent);
}

.cb-row-actions-primary .bm-primary-button:hover,
.cb-row-actions-primary .bm-primary-button:focus-visible {
  background: color-mix(in srgb, var(--bm-teal) 92%, #000000);
  color: #ffffff;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--bm-teal) 18%, transparent);
}

.cb-row-actions-primary .cb-review-toggle {
  border-color: color-mix(in srgb, var(--bm-gold) 44%, var(--bm-line));
  background: color-mix(in srgb, var(--bm-gold-soft) 76%, var(--bm-surface));
  color: var(--bm-gold-dark);
}

.cb-row-actions-primary .cb-review-toggle:hover,
.cb-row-actions-primary .cb-review-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--bm-gold) 58%, var(--bm-line));
  background: color-mix(in srgb, var(--bm-gold-soft) 90%, var(--bm-surface));
  color: var(--bm-gold-dark);
}

.cb-allocation-form {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(170px, 0.78fr) 132px;
  gap: 10px;
  align-items: end;
  max-width: 690px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--bm-line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bm-surface) 90%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--bm-ink) 5%, transparent);
}

.cb-match-review {
  display: grid;
  gap: 12px;
  width: min(820px, 100%);
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--bm-gold) 34%, var(--bm-line));
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bm-gold-soft) 55%, var(--bm-surface)), var(--bm-surface));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--bm-ink) 5%, transparent);
}

.cb-evidence-review {
  display: grid;
  gap: 10px;
  width: min(820px, 100%);
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--bm-teal) 20%, var(--bm-line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--bm-surface) 94%, transparent);
}

.cb-evidence-review-copy {
  display: grid;
  gap: 2px;
}

.cb-evidence-review-copy span,
.cb-evidence-list > span {
  color: var(--bm-teal);
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1;
}

.cb-evidence-review-copy strong {
  color: var(--bm-ink);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.2;
}

.cb-evidence-review-copy small {
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 560;
  line-height: 1.35;
}

.cb-evidence-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cb-evidence-review-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--bm-line) 76%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bm-page-bg) 48%, var(--bm-surface));
}

.cb-evidence-review-grid span {
  color: var(--bm-muted);
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1;
}

.cb-evidence-review-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-evidence-list {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.cb-evidence-list div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cb-evidence-list small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--bm-teal) 24%, var(--bm-line));
  border-radius: 999px;
  color: var(--bm-teal);
  background: color-mix(in srgb, var(--bm-teal-soft) 52%, var(--bm-surface));
  font-size: 0.7rem;
  font-weight: 520;
}

.cb-evidence-list.is-missing small {
  border-color: color-mix(in srgb, var(--bm-gold) 35%, var(--bm-line));
  color: var(--bm-gold-dark);
  background: color-mix(in srgb, var(--bm-gold-soft) 58%, var(--bm-surface));
}

.cb-match-review-copy {
  display: grid;
  gap: 2px;
}

.cb-match-review-copy strong {
  color: var(--bm-ink);
  font-size: 0.9rem;
  font-weight: 760;
}

.cb-match-review-copy span {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 620;
}

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

.cb-match-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--bm-line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bm-surface) 92%, transparent);
}

.cb-match-card span {
  color: var(--bm-muted);
  font-size: 0.65rem;
  font-weight: 720;
  line-height: 1;
  text-transform: uppercase;
}

.cb-match-card strong {
  color: var(--bm-ink);
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1.25;
}

.cb-match-card small {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 620;
  line-height: 1.3;
}

.cb-match-allocation-lines {
  display: grid;
  gap: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid color-mix(in srgb, var(--bm-line) 74%, transparent);
}

.cb-match-allocation-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--bm-line) 58%, transparent);
}

.cb-match-allocation-line:last-child {
  border-bottom: 0;
}

.cb-match-allocation-line span {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 0.78rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-match-allocation-line strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.cb-match-allocation-line small {
  grid-column: 1 / -1;
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.cb-match-note {
  color: var(--bm-muted);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
}

.cb-match-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cb-match-review-actions .bm-primary-button,
.cb-match-review-actions .cb-secondary-action {
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.74rem;
}

.cb-allocation-form label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cb-allocation-form label span {
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 680;
  line-height: 1;
}

.cb-allocation-form select,
.cb-allocation-form .quick-select-host,
.cb-allocation-form .lookup {
  width: 100%;
}

.cb-allocation-form .lookup-trigger {
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 650;
  box-shadow: none;
}

.cb-allocation-form .cb-secondary-action {
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 650;
}

.cb-review-panel-note {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--bm-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.cb-posted-note {
  color: var(--bm-teal);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.cb-decision-note {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--bm-muted);
  font-size: 0.68rem;
  line-height: 1.25;
  text-align: right;
}

.cb-decision-note strong {
  color: var(--bm-teal);
  font-size: 0.76rem;
  font-weight: 650;
}

.cb-movement-row.is-review .cb-decision-note strong,
.cb-movement-row.is-reading .cb-decision-note strong {
  color: var(--bm-gold-dark);
}

.cb-movement-row.is-risk .cb-decision-note strong {
  color: var(--bm-danger);
}

.cb-movement-detail.has-bill-match .cb-decision-note {
  grid-column: 2;
  align-self: center;
  justify-self: end;
}

@media (max-width: 1180px) {
  .cb-control-grid,
  .cb-movement-detail {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }

  .cb-import-card {
    grid-template-columns: 1fr;
  }

  .cb-import-card {
    padding-left: 14px;
  }

  .cb-file-drop,
  .cb-import-card .bm-primary-button {
    width: 100%;
    justify-self: stretch;
  }

  .cb-review-panel {
    padding-left: 14px;
  }

  .cb-movement-detail.has-decision,
  .cb-movement-detail.has-bill-match {
    grid-template-columns: 1fr;
  }

  .cb-movement-detail.has-bill-match .cb-match-proof-wrap,
  .cb-movement-detail.has-bill-match .cb-recon-evidence,
  .cb-movement-detail.has-bill-match .cb-decision-note {
    grid-column: auto;
    grid-row: auto;
  }

  .cb-movement-detail.has-bill-match .cb-decision-note {
    justify-self: start;
    text-align: left;
  }

  .cb-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cb-register-head {
    display: none;
  }
}

@media (max-width: 760px) {
  .cashbook-topline,
  .cb-panel-heading,
  .cb-workspace-heading,
  .cb-movement-main {
    grid-template-columns: 1fr;
  }

  .cb-account-filter {
    width: fit-content;
    max-width: 100%;
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .cb-account-filter select {
    max-width: 100%;
  }

  .cb-panel-heading,
  .cb-workspace-heading {
    display: grid;
  }

  .cb-workspace-actions {
    justify-content: stretch;
  }

  .cb-date-window,
  .cb-workspace-actions form,
  .cb-workspace-actions button {
    width: 100%;
  }

  .cb-selection-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .cb-selection-actions form {
    width: auto;
  }

  .cb-selection-actions .cb-selection-action-button {
    width: auto;
  }

  .cb-date-window {
    flex-wrap: wrap;
    justify-content: stretch;
    height: auto;
    padding: 6px 8px;
  }

  .cb-date-window label {
    flex: 1 1 140px;
  }

  .cb-date-window input {
    width: 100%;
  }

  .cb-reconcile-tabs {
    overflow-x: auto;
  }

  .cb-compact-form,
  .cb-import-form,
  .cb-import-card,
  .cb-allocation-form,
  .cb-summary-strip {
    grid-template-columns: 1fr;
  }

  .cb-wide-field {
    grid-column: auto;
  }

  .cb-money,
  .cb-status-pill {
    justify-self: start;
    text-align: left;
  }
}

.purchase-review-shell {
  max-width: none;
}

.purchase-review-topline .phase-support-text {
  max-width: 760px;
}

.purchase-upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.035);
}

.purchase-upload-panel.is-dragging {
  border-color: rgba(212, 164, 55, 0.52);
  background: rgba(255, 251, 235, 0.78);
}

.purchase-upload-panel.is-processing {
  border-color: rgba(12, 117, 111, 0.34);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.84), rgba(255, 255, 255, 0.94));
}

.purchase-upload-busy .purchase-review-tab,
.purchase-upload-busy .purchase-review-card,
.purchase-upload-busy .purchase-header-action {
  pointer-events: none;
}

.purchase-upload-busy .purchase-review-card {
  opacity: 0.54;
}

.purchase-upload-panel h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
  font-weight: 740;
  line-height: 1.18;
}

.purchase-upload-panel p {
  max-width: 780px;
  margin: 3px 0 0;
  color: var(--bm-muted);
  font-size: 0.78rem;
  line-height: 1.34;
}

.purchase-upload-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.purchase-upload-form {
  min-width: min(260px, 100%);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.purchase-sample-form {
  display: flex;
  justify-content: end;
}

.purchase-sample-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--bm-ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 720;
  cursor: pointer;
}

.purchase-sample-button:hover,
.purchase-sample-button:focus-visible {
  border-color: rgba(212, 164, 55, 0.42);
  background: rgba(255, 251, 235, 0.74);
  color: var(--bm-ink-strong);
}

.purchase-file-picker {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 760;
  cursor: pointer;
}

.purchase-file-picker input {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.purchase-file-picker:hover,
.purchase-file-picker:focus-within {
  border-color: rgba(12, 117, 111, 0.34);
  background: rgba(12, 117, 111, 0.06);
  color: var(--bm-teal);
}

.purchase-file-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--bm-muted);
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-review-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, auto));
  justify-content: start;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.purchase-review-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--bm-muted);
  font-weight: 720;
}

.purchase-review-tab:hover {
  border-color: rgba(12, 117, 111, 0.16);
  background: var(--bm-raised);
  color: var(--bm-ink-strong);
}

.purchase-review-tab.active {
  border-color: rgba(212, 164, 55, 0.32);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.purchase-review-tab.subdued {
  color: var(--bm-ink);
}

.purchase-review-tab strong {
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-raised);
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 720;
}

.purchase-review-signal {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-inline: 12px;
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.purchase-review-signal strong {
  color: var(--bm-ink-strong);
}

.purchase-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
  gap: 14px;
}

.purchase-review-layout-queue {
  grid-template-columns: minmax(0, 1fr);
}

.purchase-review-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.purchase-quick-review {
  border-left: 3px solid rgba(12, 117, 111, 0.55);
}

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

.purchase-metric {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.purchase-metric span {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.purchase-metric strong {
  color: var(--bm-ink-strong);
  font-size: 1.42rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.purchase-capture-panel {
  padding: 14px 16px 16px;
}

.purchase-capture-form {
  display: grid;
  gap: 12px;
}

.purchase-capture-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.purchase-capture-grid label {
  min-width: 0;
}

.purchase-capture-grid input,
.purchase-capture-grid select {
  min-height: 35px;
  font-size: 0.9rem;
}

.purchase-capture-wide {
  grid-column: span 2;
}

.purchase-capture-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-review-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.purchase-list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 2px;
}

.purchase-list-header h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 850;
}

.purchase-list-header p {
  margin: 2px 0 0;
  color: var(--bm-muted);
  font-size: 0.84rem;
}

.purchase-queue-header {
  align-items: center;
}

.purchase-queue-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-review-empty {
  min-height: 150px;
}

.purchase-reading-queue {
  display: grid;
  gap: 8px;
}

.purchase-reading-queue[hidden] {
  display: none;
}

.purchase-reading-card {
  position: relative;
  overflow: hidden;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(212, 164, 55, 0.28);
  border-left: 2px solid var(--bm-gold);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.78), rgba(255, 255, 255, 0.94));
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.035);
}

.purchase-reading-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(12, 117, 111, 0), rgba(12, 117, 111, 0.78), rgba(212, 164, 55, 0.78), rgba(12, 117, 111, 0));
  transform: translateX(-100%);
  animation: purchase-reading-sweep 1.65s ease-in-out infinite;
}

.purchase-reading-card-notice {
  border-color: rgba(12, 117, 111, 0.24);
  border-left-color: var(--bm-teal);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.86), rgba(255, 255, 255, 0.94));
}

.purchase-reading-card-alert {
  border-color: rgba(220, 38, 38, 0.18);
  border-left-color: rgba(220, 38, 38, 0.76);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.78), rgba(255, 255, 255, 0.95));
}

.purchase-reading-card-alert::after {
  animation: none;
  background: rgba(220, 38, 38, 0.36);
  transform: none;
}

.purchase-reading-card-done {
  border-color: rgba(12, 117, 111, 0.28);
  border-left-color: var(--bm-teal);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.96));
}

.purchase-reading-card-done::after {
  animation: none;
  background: rgba(12, 117, 111, 0.42);
  transform: none;
}

.purchase-reading-card strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-reading-card span {
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 620;
}

.purchase-batch-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.purchase-batch-panel strong {
  display: block;
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
  font-weight: 780;
}

.purchase-batch-panel span {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 620;
}

.purchase-batch-list {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  overflow: hidden;
}

.purchase-batch-chip {
  min-width: 0;
  max-width: 190px;
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid rgba(220, 227, 235, 0.92);
  border-radius: 8px;
  background: #ffffff;
}

.purchase-batch-chip strong,
.purchase-batch-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-batch-chip small {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.purchase-reading-mark {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--bm-gold);
  box-shadow: 0 0 0 0 rgba(212, 164, 55, 0.2);
  animation: bm-reading-pulse 1.2s ease-in-out infinite;
}

@keyframes bm-reading-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 164, 55, 0.22);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(212, 164, 55, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(212, 164, 55, 0);
  }
}

@keyframes purchase-reading-sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.purchase-reading-status {
  justify-self: end;
  color: var(--bm-gold-dark) !important;
  font-weight: 760 !important;
}

.purchase-review-card {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(240px, 1fr) minmax(260px, 0.9fr) minmax(150px, auto);
  gap: 14px;
  align-items: stretch;
  padding: 14px 16px;
  border: 1px solid var(--bm-line);
  border-left: 2px solid var(--bm-teal);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.045);
}

.purchase-review-card[hidden] {
  display: none;
}

.purchase-bill-card {
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.92fr) minmax(190px, 0.76fr) minmax(120px, 132px);
  gap: 12px;
}

.purchase-review-card.risk-yellow {
  border-left-color: var(--bm-gold);
}

.purchase-review-card.risk-red {
  border-left-color: var(--bm-red);
}

.purchase-review-card.is-batch-candidate {
  border-left-color: var(--bm-gold);
}

.purchase-review-card.is-newly-routed {
  border-left-color: var(--bm-gold);
  box-shadow:
    0 0 0 1px rgba(201, 150, 33, 0.28),
    0 10px 24px rgba(17, 17, 17, 0.045);
}

.purchase-bundle-card {
  border: 1px solid rgba(201, 150, 33, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(201, 150, 33, 0.055), rgba(255, 255, 255, 0.94)),
    var(--bm-surface);
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.055);
}

.purchase-bundle-card[hidden] {
  display: none;
}

.purchase-bundle-summary {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto auto minmax(190px, 1fr) auto auto minmax(125px, 0.28fr) minmax(130px, 0.26fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

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

.purchase-bundle-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--bm-ink);
  border-bottom: 2px solid var(--bm-ink);
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.purchase-bundle-card[open] .purchase-bundle-chevron {
  transform: rotate(45deg);
}

.purchase-bundle-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(201, 150, 33, 0.28);
  border-radius: 8px;
  background: rgba(201, 150, 33, 0.08);
  color: var(--bm-gold-dark);
}

.purchase-bundle-icon .ui-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.purchase-bundle-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.purchase-bundle-copy strong {
  overflow: hidden;
  color: var(--bm-ink);
  font-size: 1.01rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-bundle-copy small,
.purchase-bundle-total small,
.purchase-bundle-state small {
  color: var(--bm-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.purchase-bundle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 117, 111, 0.08);
  color: var(--bm-teal);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.purchase-bundle-pill.warn {
  background: rgba(201, 150, 33, 0.13);
  color: var(--bm-gold-dark);
}

.purchase-bundle-total {
  display: grid;
  gap: 2px;
}

.purchase-bundle-total strong {
  color: var(--bm-ink);
  font-weight: 760;
  white-space: nowrap;
}

.purchase-bundle-state {
  display: grid;
  gap: 4px;
}

.purchase-bundle-state small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.purchase-bundle-state b {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--bm-teal);
}

.purchase-bundle-state .warn b {
  background: var(--bm-gold);
}

.purchase-bundle-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(201, 150, 33, 0.52);
  border-radius: 7px;
  background: var(--bm-gold);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: 0 10px 18px rgba(201, 150, 33, 0.16);
}

.purchase-bundle-action:hover,
.purchase-bundle-action:focus-visible {
  border-color: #8f6818;
  background: linear-gradient(180deg, #c99b2f, #a87514);
  color: #ffffff;
  text-decoration: none;
}

.purchase-bundle-items {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.purchase-bundle-items .purchase-review-card {
  box-shadow: none;
}

.purchase-evidence-tile {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px 13px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(212, 164, 55, 0.11), rgba(12, 117, 111, 0.035)),
    var(--bm-raised);
}

.purchase-bill-evidence {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.purchase-bill-evidence dl {
  grid-column: 1 / -1;
}

.purchase-evidence-surface {
  position: relative;
  min-width: 0;
  min-height: 285px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bm-surface);
  background: color-mix(in srgb, var(--bm-surface) 92%, var(--bm-raised));
  box-shadow: none;
  isolation: isolate;
}

.purchase-evidence-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.68) 78%),
    linear-gradient(110deg, rgba(212, 164, 55, 0.045), rgba(12, 117, 111, 0.025));
  pointer-events: none;
}

.purchase-evidence-paper {
  position: relative;
  z-index: 1;
  min-height: 208px;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--bm-surface);
  background: color-mix(in srgb, var(--bm-surface) 92%, var(--bm-raised));
  box-shadow: none;
  cursor: zoom-in;
}

.purchase-evidence-paper img {
  width: 100%;
  height: 100%;
  min-height: 208px;
  display: block;
  object-fit: cover;
  object-position: top center;
  background: var(--bm-surface);
  background: color-mix(in srgb, var(--bm-surface) 92%, var(--bm-raised));
  pointer-events: none;
}

.purchase-evidence-open-target {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.purchase-evidence-open-target:focus-visible {
  outline: 3px solid rgba(212, 164, 55, 0.5);
  outline-offset: -4px;
}

.purchase-evidence-highlight {
  position: absolute;
  z-index: 3;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 20px);
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 16px rgba(17, 24, 39, 0.075);
  color: var(--bm-ink-strong);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.purchase-evidence-reading-lens {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 188px;
  height: 138px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 28px;
  background-color: rgba(255, 255, 255, 0.66);
  background-blend-mode: normal, screen;
  background-repeat: no-repeat;
  backdrop-filter: blur(2px) saturate(112%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  mask-image: radial-gradient(ellipse at center, #000 58%, rgba(0, 0, 0, 0.72) 72%, transparent 100%);
  transform: translate(-50%, -50%) scale(0.985);
  transition: opacity 160ms ease, transform 180ms ease;
  will-change: left, top, background-position;
}

.purchase-evidence-paper.is-lens-active .purchase-evidence-reading-lens {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.purchase-evidence-highlight.supplier {
  top: 10px;
  left: 10px;
}

.purchase-evidence-highlight.total {
  right: 10px;
  bottom: 10px;
  min-height: 42px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  padding: 5px 10px 6px;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--bm-ink-strong);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.13);
}

.purchase-evidence-highlight.total span {
  color: var(--bm-muted);
  font-size: 0.58rem;
  font-weight: 780;
  line-height: 1;
}

.purchase-evidence-highlight.total strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  font-weight: 920;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.purchase-evidence-highlight.tax {
  left: 10px;
  bottom: 10px;
  min-height: 20px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 12px rgba(17, 24, 39, 0.055);
  color: var(--bm-teal);
  font-size: 0.63rem;
}

.purchase-evidence-highlight.page {
  right: 10px;
  top: 10px;
  color: var(--bm-muted);
}

.purchase-evidence-caption,
.purchase-evidence-fact-strip {
  position: relative;
  z-index: 5;
}

.purchase-evidence-caption {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 2px 3px;
}

.purchase-evidence-caption strong,
.purchase-evidence-caption small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-evidence-caption strong {
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 850;
}

.purchase-evidence-caption small {
  margin-top: 1px;
  color: var(--bm-muted);
  font-size: 0.74rem;
}

.purchase-evidence-fact-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 10px;
  padding: 7px 2px 11px;
}

.purchase-evidence-fact-strip span {
  min-width: 0;
  display: grid;
  gap: 1px;
  color: var(--bm-muted);
  font-size: 0.68rem;
}

.purchase-evidence-fact-strip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-evidence-fact-strip .invoice-ref strong {
  color: color-mix(in srgb, var(--bm-ink-strong) 86%, var(--bm-muted));
}

.purchase-evidence-fact-strip .invoice-total {
  align-items: end;
  text-align: right;
}

.purchase-evidence-fact-strip .invoice-total strong {
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
  font-weight: 920;
}

.purchase-evidence-placeholder {
  height: 100%;
  min-height: 208px;
  display: grid;
  place-items: center;
  color: var(--bm-gold-dark);
  font-size: 2rem;
  font-weight: 900;
}

.purchase-evidence-inspector-open {
  overflow: hidden;
}

.purchase-evidence-inspector {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(620px, 980px);
}

.purchase-evidence-inspector[hidden] {
  display: none;
}

.purchase-evidence-inspector-backdrop {
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(8, 14, 22, 0.22);
  backdrop-filter: blur(3px);
}

.purchase-evidence-inspector-panel {
  min-width: 0;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-left: 1px solid var(--bm-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.96)),
    var(--bm-surface);
  box-shadow: -26px 0 60px rgba(8, 14, 22, 0.18);
}

.purchase-evidence-inspector-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.purchase-evidence-inspector-panel header strong,
.purchase-evidence-inspector-panel header small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-evidence-inspector-panel header strong {
  color: var(--bm-ink-strong);
  font-size: 1.1rem;
  line-height: 1.15;
}

.purchase-evidence-inspector-panel header small {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.purchase-evidence-inspector-frame {
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 54px rgba(17, 24, 39, 0.12);
}

.purchase-evidence-inspector-frame img {
  width: min(100%, 1800px);
  min-width: min(860px, 100%);
  height: auto;
  margin: 0 auto;
  display: block;
  background: #ffffff;
}

.purchase-evidence-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(212, 164, 55, 0.32);
  border-radius: 999px;
  background: #fff8e7;
  color: var(--bm-gold-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.purchase-evidence-tile strong,
.purchase-card-body h3,
.purchase-intelligence strong {
  color: var(--bm-ink-strong);
}

.purchase-evidence-tile small {
  color: var(--bm-muted);
  font-size: 0.76rem;
}

.purchase-evidence-tile dl {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
}

.purchase-evidence-tile dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.purchase-evidence-tile dt,
.purchase-evidence-tile dd {
  margin: 0;
  font-size: 0.76rem;
}

.purchase-evidence-tile dt {
  color: var(--bm-muted);
}

.purchase-evidence-tile dd {
  color: var(--bm-ink);
  font-weight: 650;
}

.purchase-card-body {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.purchase-card-body header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.purchase-card-body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 760;
}

.purchase-card-body header > div > span {
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}

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

.purchase-fact-grid span {
  display: grid;
  gap: 2px;
  color: var(--bm-muted);
  font-size: 0.74rem;
}

.purchase-fact-grid strong {
  color: var(--bm-ink);
  font-size: 0.86rem;
  font-weight: 650;
}

.purchase-fact-grid .purchase-total-fact {
  grid-column: 2;
  margin-top: 2px;
  padding-top: 9px;
  border-top: 1px solid rgba(12, 117, 111, 0.14);
}

.purchase-fact-grid .purchase-total-fact strong {
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.purchase-decision-panel {
  display: grid;
  gap: 7px;
  padding: 9px 0 0;
  border-top: 1px solid rgba(12, 117, 111, 0.16);
  background: transparent;
}

.purchase-decision-panel > strong {
  color: var(--bm-ink-strong);
  font-size: 0.76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.purchase-decision-panel .purchase-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.purchase-insight-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--bm-muted);
  font-size: 0.72rem;
}

.purchase-insight-field b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--bm-ink);
  font-size: 0.8rem;
  font-weight: 640;
}

.purchase-allocation-trigger {
  display: block;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  align-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  appearance: none;
  cursor: pointer;
}

.purchase-allocation-trigger b {
  box-sizing: border-box;
  width: 100%;
  min-width: 100%;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 9px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font-size: 0.8rem;
  font-weight: 640;
  line-height: 1;
  white-space: nowrap;
}

.purchase-allocation-trigger:hover b,
.purchase-allocation-trigger:focus-visible b {
  color: var(--bm-ink-strong);
}

.purchase-allocation-trigger:hover b,
.purchase-allocation-trigger:focus-visible b {
  border-color: var(--bm-teal);
  outline: 2px solid rgba(12, 117, 111, 0.12);
}

.purchase-allocation-trigger.is-multiple-category b {
  border-color: rgba(198, 31, 31, 0.34);
  background: rgba(253, 234, 234, 0.78);
  color: var(--bm-red);
}

.purchase-allocation-trigger.is-multiple-category:hover b,
.purchase-allocation-trigger.is-multiple-category:focus-visible b {
  border-color: rgba(198, 31, 31, 0.42);
  outline-color: rgba(198, 31, 31, 0.14);
  color: var(--bm-red);
}

.purchase-insight-field select,
.purchase-insight-field input[type="search"] {
  width: 100%;
  height: 31px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 640;
  padding: 0 9px;
  appearance: none;
  background-image: none;
  text-overflow: ellipsis;
}

.purchase-insight-field select:focus,
.purchase-insight-field input[type="search"]:focus {
  outline: 2px solid rgba(12, 117, 111, 0.18);
  border-color: var(--bm-teal);
}

.purchase-insight-field select:disabled,
.purchase-insight-field input[type="search"]:disabled {
  color: var(--bm-muted);
  background-color: transparent;
}

.purchase-allocation-panel[hidden] {
  display: none !important;
}

.purchase-allocation-panel {
  display: grid;
  gap: 0;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(198, 31, 31, 0.16);
  border-left: 3px solid rgba(198, 31, 31, 0.46);
  border-radius: 8px;
  background: rgba(253, 234, 234, 0.22);
}

.purchase-breakdown-list {
  display: grid;
}

.purchase-breakdown-item {
  display: grid;
  gap: 7px;
  padding: 13px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.purchase-breakdown-item:first-child {
  border-top: 0;
}

.purchase-breakdown-item header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.purchase-breakdown-item header > div {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.purchase-breakdown-item header > div > strong {
  min-width: 0;
  color: var(--bm-ink-strong);
  font-size: 0.76rem;
  font-weight: 720;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.purchase-breakdown-item header > strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.purchase-breakdown-review {
  display: grid;
  gap: 3px;
}

.purchase-breakdown-edit {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
}

.purchase-breakdown-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--bm-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 640;
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.purchase-breakdown-note:hover {
  color: rgb(198, 31, 31);
  border-color: rgba(198, 31, 31, 0.22);
  background: rgba(253, 234, 234, 0.72);
  box-shadow: 0 1px 0 rgba(198, 31, 31, 0.08);
}

.purchase-breakdown-select {
  appearance: none;
  -webkit-appearance: none;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--bm-muted);
  background-color: transparent;
  background-image: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 640;
  line-height: 1.3;
  text-overflow: ellipsis;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.purchase-breakdown-select:hover {
  color: rgb(198, 31, 31);
  border-color: rgba(198, 31, 31, 0.22);
  background-color: rgba(253, 234, 234, 0.72);
  box-shadow: 0 1px 0 rgba(198, 31, 31, 0.08);
}

.purchase-breakdown-select:focus {
  color: var(--bm-ink);
  outline: 2px solid rgba(198, 31, 31, 0.16);
  border-color: rgba(198, 31, 31, 0.34);
  background-color: #fff;
}

.purchase-breakdown-edit.is-saving .purchase-breakdown-select {
  opacity: 0.72;
}

.purchase-match-field {
  grid-column: 1 / -1;
}

.purchase-match-field label {
  display: grid;
  gap: 5px;
}

.purchase-match-field label span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
}

.purchase-match-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  padding: 0 10px;
}

.purchase-match-field select:focus {
  outline: 2px solid rgba(12, 117, 111, 0.18);
  border-color: var(--bm-teal);
}

.purchase-supplier-match-workspace {
  grid-column: 1 / -1;
  min-width: 0;
}

.purchase-supplier-match-workspace summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(12, 117, 111, 0.2);
  border-radius: 7px;
  background: rgba(12, 117, 111, 0.055);
  color: var(--bm-teal);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 720;
  list-style: none;
}

.purchase-supplier-match-workspace summary::-webkit-details-marker {
  display: none;
}

.purchase-supplier-match-workspace summary:hover,
.purchase-supplier-match-workspace summary:focus-visible,
.purchase-supplier-match-workspace[open] summary {
  border-color: rgba(12, 117, 111, 0.34);
  background: rgba(12, 117, 111, 0.09);
  color: var(--bm-teal-dark);
  outline: none;
}

.purchase-supplier-match-panel {
  display: grid;
  gap: 9px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(12, 117, 111, 0.14);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
}

.purchase-supplier-match-panel label {
  display: grid;
  gap: 5px;
}

.purchase-supplier-match-panel label span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
}

.purchase-supplier-match-panel input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  padding: 0 10px;
}

.purchase-supplier-match-panel input:focus {
  outline: 2px solid rgba(12, 117, 111, 0.18);
  border-color: var(--bm-teal);
}

.purchase-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
}

.purchase-status-pill.ready,
.purchase-status-pill.posted {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.purchase-status-pill.review {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.purchase-status-pill.held {
  background: var(--bm-red-soft);
  color: var(--bm-red);
}

.purchase-status-pill.new {
  background: var(--bm-soft);
  color: var(--bm-muted);
}

.purchase-intelligence {
  display: grid;
  align-content: start;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid rgba(12, 117, 111, 0.12);
}

.purchase-intelligence strong {
  font-size: 0.95rem;
  font-weight: 720;
}

.purchase-intelligence header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.purchase-intelligence header span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
}

.purchase-intelligence header span.risk-green {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.purchase-intelligence header span.risk-yellow {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.purchase-intelligence header span.risk-red {
  background: var(--bm-red-soft);
  color: var(--bm-red);
}

.purchase-intelligence ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.purchase-intelligence li {
  position: relative;
  padding-left: 18px;
  color: var(--bm-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.purchase-intelligence li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bm-muted);
}

.purchase-intelligence li.good::before {
  background: var(--bm-teal);
}

.purchase-intelligence li.warn::before {
  background: var(--bm-gold);
}

.purchase-card-actions {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.purchase-card-actions form {
  display: grid;
  margin: 0;
}

.purchase-card-actions .row-drill-button {
  width: 100%;
  justify-content: center;
}

.purchase-bill-actions {
  min-width: 0;
}

.purchase-hidden-form {
  display: none;
}

.purchase-bill-actions .row-drill-button {
  min-height: 32px;
  padding-inline: 9px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.12;
  white-space: normal;
}

.purchase-bill-actions .row-drill-button.purchase-approve-button {
  border-color: var(--bm-gold-dark);
  background: linear-gradient(180deg, var(--bm-gold), #b88418);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(168, 135, 55, 0.16);
}

.purchase-bill-actions .purchase-approve-button:hover,
.purchase-bill-actions .purchase-approve-button:focus-visible {
  border-color: #8f6818;
  background: linear-gradient(180deg, #c99b2f, #a87514);
  color: #ffffff;
}

.purchase-inline-action {
  min-width: 0;
}

.purchase-inline-action summary {
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.12;
  list-style: none;
  text-align: center;
}

.purchase-inline-action summary::-webkit-details-marker {
  display: none;
}

.purchase-inline-action summary:hover,
.purchase-inline-action summary:focus-visible {
  border-color: rgba(12, 117, 111, 0.32);
  background: rgba(12, 117, 111, 0.06);
  color: var(--bm-teal);
  outline: none;
}

.purchase-inline-action[open] summary {
  border-color: rgba(12, 117, 111, 0.24);
  background: rgba(12, 117, 111, 0.08);
  color: var(--bm-teal);
}

.purchase-inline-action-panel {
  display: grid;
  gap: 8px;
  margin-top: 7px;
  padding: 9px;
  border: 1px solid rgba(12, 117, 111, 0.14);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
}

.purchase-inline-action-panel label {
  display: grid;
  gap: 5px;
}

.purchase-inline-action-panel label span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
}

.purchase-inline-action-panel input,
.purchase-inline-action-panel select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(12, 117, 111, 0.18);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 560;
  padding: 0 9px;
}

.purchase-inline-action-panel input:focus,
.purchase-inline-action-panel select:focus {
  outline: 2px solid rgba(12, 117, 111, 0.18);
  border-color: var(--bm-teal);
}

.purchase-side-panel-action {
  position: relative;
  z-index: 20;
}

.purchase-side-panel-action[open] {
  z-index: 240;
}

.purchase-side-panel-action .purchase-side-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(360px, calc(100vw - 40px));
  margin: 0;
  padding: 14px;
  border-color: rgba(212, 164, 55, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.88), rgba(255, 255, 255, 0.98)),
    var(--bm-surface);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.16);
}

.purchase-side-panel-heading {
  display: grid;
  gap: 3px;
  padding-bottom: 4px;
}

.purchase-side-panel-heading strong {
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 780;
}

.purchase-side-panel-heading span {
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 540;
  line-height: 1.35;
}

.purchase-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 6px;
  color: var(--bm-teal);
  font-size: 0.74rem;
  font-weight: 720;
  text-decoration: none;
}

.purchase-inline-link:hover,
.purchase-inline-link:focus-visible {
  background: rgba(12, 117, 111, 0.06);
  color: var(--bm-teal-dark);
  outline: none;
}

.purchase-supplier-match-add,
.purchase-supplier-match-list button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: left;
}

.purchase-supplier-match-add {
  border-color: rgba(212, 164, 55, 0.4);
  background: rgba(255, 248, 231, 0.72);
  color: var(--bm-gold-dark);
  text-align: center;
}

.purchase-supplier-match-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 2px;
}

.purchase-supplier-match-workspace .purchase-supplier-match-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-height: 220px;
}

.purchase-supplier-match-list button {
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 7px 9px;
}

.purchase-supplier-match-workspace .purchase-supplier-match-list button {
  min-height: 44px;
}

.purchase-supplier-match-list button:hover,
.purchase-supplier-match-list button:focus-visible,
.purchase-supplier-match-add:hover,
.purchase-supplier-match-add:focus-visible {
  border-color: rgba(12, 117, 111, 0.28);
  background: rgba(12, 117, 111, 0.06);
}

.purchase-supplier-match-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-supplier-match-list small,
.purchase-supplier-match-empty {
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 560;
}

.purchase-supplier-match-empty {
  margin: 0;
}

.purchase-duplicate-review {
  width: 100%;
  min-width: 0;
}

.purchase-duplicate-review summary {
  min-height: 39px;
  display: grid;
  place-items: center;
  padding: 0 13px;
  border: 1px solid rgba(212, 164, 55, 0.58);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff8e7, #fff2d6);
  color: var(--bm-gold-dark);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 720;
  list-style: none;
}

.purchase-duplicate-review summary::-webkit-details-marker {
  display: none;
}

.purchase-duplicate-review summary:hover,
.purchase-duplicate-review summary:focus-visible {
  border-color: rgba(191, 139, 21, 0.72);
  background: linear-gradient(180deg, #fff3cf, #ffe8b4);
  color: #805b12;
  outline: none;
}

.purchase-duplicate-review[open] summary {
  border-color: rgba(191, 139, 21, 0.72);
  background: linear-gradient(180deg, #fff3cf, #ffe8b4);
  color: #805b12;
}

.purchase-duplicate-review-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid rgba(212, 164, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.8);
}

.purchase-duplicate-review-panel p {
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.purchase-duplicate-current,
.purchase-duplicate-match {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-duplicate-current span,
.purchase-duplicate-match span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 720;
  text-transform: uppercase;
}

.purchase-duplicate-current strong,
.purchase-duplicate-match strong {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-duplicate-current small,
.purchase-duplicate-match small {
  color: var(--bm-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.purchase-duplicate-actions {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.purchase-duplicate-actions form {
  min-width: 0;
  margin: 0;
}

.purchase-duplicate-actions button {
  box-sizing: border-box;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-control);
  color: var(--bm-ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 680;
  line-height: 1.18;
  overflow-wrap: anywhere;
  white-space: normal;
}

.purchase-duplicate-actions button:hover,
.purchase-duplicate-actions button:focus-visible {
  border-color: rgba(12, 117, 111, 0.3);
  background: rgba(12, 117, 111, 0.06);
  color: var(--bm-teal);
  outline: none;
}

.purchase-duplicate-actions form:first-child button {
  border-color: rgba(212, 164, 55, 0.44);
  background: #fff8e7;
  color: var(--bm-gold-dark);
}

.purchase-duplicate-actions form:first-child button:hover,
.purchase-duplicate-actions form:first-child button:focus-visible {
  border-color: rgba(191, 139, 21, 0.72);
  background: #fff0c7;
  color: #805b12;
}

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

.purchase-review-shell .purchase-review-topline .gj-title h1 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.purchase-review-shell .purchase-review-topline .phase-support-text {
  max-width: 620px;
  color: var(--bm-muted);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.45;
}

.purchase-supplier-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.purchase-supplier-section {
  display: grid;
  gap: 10px;
}

.purchase-supplier-section header,
.purchase-supplier-aside {
  display: grid;
  gap: 5px;
}

.purchase-supplier-section header strong,
.purchase-supplier-aside strong {
  color: var(--bm-ink-strong);
  font-size: 0.98rem;
  font-weight: 680;
}

.purchase-supplier-section header span {
  color: var(--bm-muted);
  font-size: 0.84rem;
  font-weight: 460;
  line-height: 1.42;
}

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

.purchase-supplier-grid .wide-field {
  grid-column: 1 / -1;
}

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

.purchase-supplier-actions .row-drill-button {
  min-height: 36px;
  padding-inline: 14px;
}

.purchase-supplier-actions .purchase-approve-button {
  border-color: var(--bm-gold-dark);
  background: linear-gradient(180deg, var(--bm-gold), #b88418);
  color: #ffffff;
}

.purchase-supplier-aside {
  padding: 15px;
}

.purchase-supplier-aside .section-kicker {
  font-size: 0.72rem;
  font-weight: 720;
}

.purchase-supplier-aside ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.purchase-supplier-aside li {
  position: relative;
  padding-left: 17px;
  color: var(--bm-muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.42;
}

.purchase-supplier-aside li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bm-teal);
}

.purchase-journal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.purchase-journal-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 0.38fr) minmax(280px, 0.8fr) minmax(130px, auto);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
}

.purchase-journal-main {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-content: start;
}

.purchase-journal-main h3 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 880;
}

.purchase-journal-main p {
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.84rem;
}

.purchase-journal-meta,
.purchase-journal-amounts,
.purchase-journal-lines {
  display: grid;
  gap: 7px;
}

.purchase-journal-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.purchase-journal-meta span,
.purchase-journal-amounts span,
.purchase-journal-lines span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--bm-muted);
  font-size: 0.72rem;
}

.purchase-journal-meta strong,
.purchase-journal-amounts strong,
.purchase-journal-lines b {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-journal-lines small {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-journal-console {
  gap: 10px;
}

.app-shell:has(.purchase-journal-console) {
  grid-template-columns: 252px minmax(0, 1fr);
}

.app-shell:has(.purchase-journal-console) .app-rail {
  gap: 12px;
  padding: 18px 12px 14px;
}

.app-shell:has(.purchase-journal-console) .brand-lockup {
  min-height: 74px;
}

.app-shell:has(.purchase-journal-console) .brand-logo {
  width: 214px;
}

.app-shell:has(.purchase-journal-console) .entity-switcher summary {
  min-height: 68px;
  grid-template-columns: 32px minmax(0, 1fr) 22px;
  padding: 10px;
}

.app-shell:has(.purchase-journal-console) .company-icon,
.app-shell:has(.purchase-journal-console) .nav-glyph {
  width: 30px;
  height: 30px;
}

.app-shell:has(.purchase-journal-console) .rail-nav {
  gap: 3px;
}

.app-shell:has(.purchase-journal-console) .rail-nav a {
  min-height: 34px;
  gap: 9px;
  padding-inline: 9px;
  font-size: 0.86rem;
}

.app-shell:has(.purchase-journal-console) .rail-section {
  margin-top: 7px;
}

.app-main:has(.purchase-journal-console) .command-bar {
  min-height: 58px;
  padding-inline: 16px;
}

.app-main:has(.purchase-journal-console) .app-workspace {
  padding: 10px 16px 16px;
}

.pj-hero {
  align-items: end;
}

.purchase-journal-console .gj-title h1 {
  font-size: clamp(1.88rem, 2.05vw, 2.28rem);
  line-height: 1.02;
}

.purchase-journal-console .phase-support-text {
  max-width: 780px;
  margin-top: 3px;
  font-size: 0.9rem;
  line-height: 1.38;
}

.pj-top-actions {
  align-items: center;
}

.pj-commandbar {
  display: grid;
  grid-template-columns: minmax(250px, auto) minmax(420px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.pj-readiness-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.045);
}

.pj-readiness-copy {
  min-width: 0;
}

.pj-readiness-copy h2,
.pj-register-head h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  line-height: 1.18;
  font-weight: 760;
}

.pj-readiness-copy p,
.pj-register-head p {
  margin: 5px 0 0;
  color: var(--bm-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pj-readiness-checks {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pj-readiness-check {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-control);
  color: var(--bm-ink-strong);
  text-align: center;
}

.pj-readiness-check span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 620;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pj-readiness-check.is-clear {
  border-color: rgba(30, 166, 75, 0.2);
  background: rgba(30, 166, 75, 0.07);
  color: var(--bm-green-dark);
}

.pj-readiness-check.is-warning {
  border-color: rgba(212, 164, 55, 0.3);
  background: rgba(212, 164, 55, 0.1);
  color: var(--bm-gold-dark);
}

.pj-readiness-check.is-posted {
  border-color: rgba(49, 95, 143, 0.16);
  background: rgba(49, 95, 143, 0.06);
  color: var(--bm-blue);
}

.pj-date-window,
.pj-filter-pill,
.pj-action-select,
.pj-primary-action {
  min-height: 34px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink-strong);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.035);
}

.pj-date-window {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.pj-date-form label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.68rem;
}

.pj-date-form input {
  width: 116px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--bm-ink-strong);
  font: inherit;
  outline: none;
}

.pj-date-form button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-left: 1px solid var(--bm-line);
  background: transparent;
  color: var(--bm-blue);
}

.pj-date-window .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--bm-blue);
}

.pj-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.pj-filter-pill {
  padding: 0 11px;
  font-size: 0.78rem;
  font-weight: 820;
}

.pj-filter-pill.active {
  border-color: rgba(212, 164, 55, 0.42);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.pj-bulk-form {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.pj-action-select {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(158px, auto);
  gap: 7px;
  align-items: center;
  padding: 0 8px 0 10px;
}

.pj-action-select span {
  color: var(--bm-muted);
  font-size: 0.73rem;
  font-weight: 800;
}

.pj-action-select select {
  width: 168px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.pj-primary-action {
  min-width: 132px;
  padding: 0 14px;
  border-color: var(--bm-gold-dark);
  background: linear-gradient(180deg, var(--bm-gold), #b88418);
  color: #ffffff;
  font-weight: 900;
}

.pj-primary-action:disabled {
  border-color: rgba(212, 164, 55, 0.38);
  background: linear-gradient(180deg, rgba(212, 164, 55, 0.55), rgba(184, 132, 24, 0.5));
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(184, 132, 24, 0.1);
  cursor: not-allowed;
}

.pj-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.045);
}

.pj-metric {
  position: relative;
  min-height: 64px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 10px 14px;
  border-right: 1px solid rgba(148, 163, 184, 0.24);
}

.pj-metric:last-child {
  border-right: 0;
}

.pj-metric span {
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.pj-metric strong {
  min-width: 0;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pj-metric-mark,
.pj-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 950;
}

.pj-metric-mark {
  position: absolute;
  right: 12px;
  bottom: 14px;
}

.pj-metric-mark.success,
.pj-summary-icon.success {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.pj-metric-mark.warning,
.pj-summary-icon.warning {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.pj-metric-mark.danger,
.pj-summary-icon.danger {
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

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

.pj-main,
.pj-side-rail {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.pj-table-surface,
.pj-side-card {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.055);
}

.pj-table-surface {
  overflow: hidden;
}

.pj-register-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
}

.pj-table-surface > .pj-filter-pills {
  padding: 0 18px 14px;
}

.pj-table-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.pj-search {
  min-width: min(430px, 100%);
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-control);
  color: var(--bm-muted);
}

.pj-search .ui-icon {
  width: 17px;
  height: 17px;
}

.pj-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--bm-ink);
  font-size: 0.78rem;
  outline: none;
}

.pj-selected-count,
.pj-table-footer {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pj-table-scroll {
  overflow-x: auto;
}

.pj-table {
  width: calc(100% - 10px);
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.pj-table th,
.pj-table td {
  padding: 10px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  text-align: left;
  vertical-align: middle;
}

.pj-table th {
  background: rgba(248, 250, 252, 0.72);
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.12;
  white-space: normal;
}

.pj-column-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.pj-column-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(148, 163, 184, 0.44);
  border-radius: 50%;
  color: var(--bm-muted);
  font-size: 0.58rem;
  font-weight: 760;
  line-height: 1;
  text-transform: none;
  cursor: help;
}

.pj-column-info::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 30;
  width: min(280px, 72vw);
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.13);
  color: var(--bm-ink);
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 450;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.pj-column-info:hover::after,
.pj-column-info:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pj-table td {
  color: var(--bm-ink);
  font-size: 0.73rem;
  font-weight: 720;
  line-height: 1.35;
}

.pj-table th:nth-child(1),
.pj-table td:nth-child(1) {
  width: 3%;
}

.pj-table th:nth-child(2),
.pj-table td:nth-child(2) {
  width: 6%;
}

.pj-table th:nth-child(3),
.pj-table td:nth-child(3) {
  width: 11%;
}

.pj-table th:nth-child(4),
.pj-table td:nth-child(4) {
  width: 14%;
}

.pj-table th:nth-child(5),
.pj-table td:nth-child(5) {
  width: 8%;
}

.pj-table th:nth-child(6),
.pj-table td:nth-child(6) {
  width: 6%;
}

.pj-table th:nth-child(7),
.pj-table td:nth-child(7),
.pj-table th:nth-child(8),
.pj-table td:nth-child(8) {
  width: 10%;
}

.pj-table th:nth-child(9),
.pj-table td:nth-child(9) {
  width: 8%;
}

.pj-table th:nth-child(10),
.pj-table td:nth-child(10) {
  width: 11%;
}

.pj-table th:nth-child(11),
.pj-table td:nth-child(11) {
  width: 13%;
}

.pj-table th:nth-child(7),
.pj-table th:nth-child(8) {
  line-height: 1.08;
}

.pj-table th:nth-child(11),
.pj-table td:nth-child(11) {
  text-align: center;
}

.pj-row {
  transition: background 140ms ease, box-shadow 140ms ease;
}

.pj-row[data-pj-editable="true"] {
  cursor: pointer;
}

.pj-row:hover {
  background: rgba(49, 95, 143, 0.045);
  box-shadow: inset 3px 0 0 rgba(212, 164, 55, 0.48);
}

.pj-row:has(.pj-row-check:checked) {
  background: rgba(212, 164, 55, 0.105);
  box-shadow: inset 3px 0 0 var(--bm-gold);
}

.pj-row[data-pj-status="review"] {
  background: rgba(212, 164, 55, 0.065);
}

.pj-row[data-pj-status="unbalanced"] {
  background: rgba(198, 31, 31, 0.055);
}

.pj-select-cell,
.pj-evidence-cell,
.pj-row-action-cell {
  width: 1%;
  white-space: nowrap;
}

.pj-evidence-cell,
.pj-row-action-cell {
  padding-inline: 4px !important;
}

.pj-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--bm-gold);
}

.pj-supplier,
.pj-description,
.pj-ref {
  display: block;
  min-width: 0;
}

.pj-supplier {
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--bm-ink-strong);
  font-weight: 880;
}

.pj-ref {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.71rem;
  font-weight: 780;
}

.pj-description {
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.pj-table td:nth-child(7),
.pj-table td:nth-child(8) {
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.pj-status,
.pj-insight {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 890;
  white-space: nowrap;
}

button.pj-insight {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: box-shadow 140ms ease, transform 140ms ease;
}

button.pj-insight:hover,
button.pj-insight:focus-visible {
  box-shadow: 0 0 0 2px rgba(49, 95, 143, 0.16);
  transform: translateY(-1px);
}

.pj-status.ready,
.pj-status.posted,
.pj-insight.typical {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.pj-status.warning,
.pj-insight.warning,
.pj-insight.higher {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.pj-status.danger,
.pj-insight.danger {
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

.pj-evidence-action,
.pj-icon-action {
  display: inline-grid;
  place-items: center;
  height: 26px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink-strong);
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.pj-evidence-action,
.pj-icon-action {
  width: 24px;
}

.pj-evidence-action {
  color: var(--bm-muted);
}

.pj-evidence-action:hover {
  border-color: rgba(49, 95, 143, 0.34);
  background: rgba(49, 95, 143, 0.07);
  color: var(--bm-blue);
  transform: translateY(-1px);
}

.pj-icon-action:hover:not(:disabled) {
  border-color: rgba(212, 164, 55, 0.55);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
  transform: translateY(-1px);
}

.pj-evidence-action .ui-icon,
.pj-icon-action .ui-icon {
  width: 14px;
  height: 14px;
}

.pj-evidence-action.is-disabled,
.pj-icon-action:disabled,
.pj-icon-action.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.pj-row-actions {
  display: inline-grid;
  grid-template-columns: 26px 26px 26px 30px;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.pj-row-actions .pj-inline-form {
  display: inline-grid;
}

.pj-why-action {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid rgba(49, 95, 143, 0.18);
  border-radius: 7px;
  background: rgba(49, 95, 143, 0.06);
  color: var(--bm-blue);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.pj-why-action .ui-icon {
  width: 14px;
  height: 14px;
}

.pj-why-action:hover {
  border-color: rgba(49, 95, 143, 0.34);
  background: rgba(49, 95, 143, 0.1);
  transform: translateY(-1px);
}

.pj-why-row td {
  padding: 0 12px 12px !important;
  background: rgba(49, 95, 143, 0.035);
}

.pj-why-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--bm-ink);
  text-align: left;
}

.pj-why-judgement {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pj-why-judgement > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pj-why-judgement strong {
  min-width: 0;
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  font-weight: 760;
}

.pj-why-judgement p {
  margin: 0;
  min-width: 0;
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.35;
}

.pj-why-support {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pj-why-support span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--bm-muted);
  font-size: 0.69rem;
  font-weight: 650;
  line-height: 1.25;
}

.pj-why-footer {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
}

.pj-why-source-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(49, 95, 143, 0.18);
  border-radius: 7px;
  background: rgba(49, 95, 143, 0.06);
  color: var(--bm-blue);
  font-size: 0.7rem;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.pj-why-source-link:hover {
  border-color: rgba(49, 95, 143, 0.34);
  background: rgba(49, 95, 143, 0.1);
}

.pj-further-analysis {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.pj-further-analysis summary {
  width: fit-content;
  cursor: pointer;
  color: var(--bm-blue);
  font-size: 0.72rem;
  font-weight: 700;
}

.pj-further-analysis[open] summary {
  margin-bottom: 5px;
}

.pj-further-analysis p {
  padding-left: 12px;
  border-left: 2px solid rgba(49, 95, 143, 0.16);
}

@media (max-width: 1180px) {
  .pj-why-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pj-why-footer {
    justify-content: flex-start;
    min-width: 0;
  }
}

.pj-signal-kind {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 720;
}

.pj-signal-kind.typical {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.pj-signal-kind.warning,
.pj-signal-kind.higher {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.pj-signal-kind.danger {
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

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

.pj-icon-action {
  padding: 0;
}

.pj-icon-action.primary {
  width: 30px;
  height: 30px;
  border-color: rgba(184, 132, 24, 0.42);
  background: linear-gradient(180deg, #f3d889, #d4a437);
  color: #4a3511;
  box-shadow: 0 8px 18px rgba(184, 132, 24, 0.18);
}

.pj-icon-action.primary:disabled,
.pj-icon-action.primary.is-review-blocked {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.045);
  color: rgba(17, 24, 39, 0.38);
}

.pj-icon-action.primary:hover:not(:disabled) {
  border-color: rgba(184, 132, 24, 0.62);
  background: linear-gradient(180deg, #f7df9b, #c69222);
  color: #3d2b0c;
  box-shadow: 0 10px 22px rgba(184, 132, 24, 0.24);
}

.pj-icon-action.secondary {
  border-color: rgba(49, 95, 143, 0.12);
  background: transparent;
  color: var(--bm-muted);
}

.pj-icon-action.reverse {
  border-color: rgba(212, 164, 55, 0.24);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.pj-icon-action.draft-delete {
  border-color: rgba(198, 31, 31, 0.12);
  background: transparent;
  color: rgba(198, 31, 31, 0.62);
}

.pj-icon-action.draft-delete:disabled {
  opacity: 0.34;
}

.pj-final-state {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 26px;
  border-radius: 7px;
  color: var(--bm-muted);
  opacity: 0.5;
}

.pj-final-state .ui-icon {
  width: 14px;
  height: 14px;
}

.pj-edit-row td {
  padding: 0 !important;
  background: linear-gradient(180deg, rgba(49, 95, 143, 0.05), rgba(255, 255, 255, 0.92));
}

.pj-edit-form {
  display: grid;
  gap: 10px;
  padding: 12px 14px 13px;
  border-top: 1px solid rgba(49, 95, 143, 0.1);
  box-shadow: inset 3px 0 0 rgba(212, 164, 55, 0.36);
}

.pj-inline-duplicate-review {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(212, 164, 55, 0.22);
  background: rgba(255, 248, 231, 0.72);
  box-shadow: inset 3px 0 0 rgba(212, 164, 55, 0.42);
}

.pj-inline-duplicate-review > div:first-child {
  display: grid;
  gap: 2px;
}

.pj-inline-duplicate-review > div:first-child strong {
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
  font-weight: 860;
}

.pj-inline-duplicate-review > div:first-child span {
  color: var(--bm-muted);
  font-size: 0.76rem;
}

.pj-edit-form header,
.pj-edit-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pj-edit-form header strong {
  display: block;
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.pj-edit-form header span,
.pj-edit-form footer span {
  color: var(--bm-muted);
  font-size: 0.74rem;
}

.pj-edit-close {
  min-height: 30px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink);
  padding: 0 10px;
  font-size: 0.74rem;
}

.pj-edit-strip,
.pj-edit-grid {
  display: grid;
  gap: 8px;
}

.pj-edit-strip {
  grid-template-columns:
    minmax(180px, 1.35fr)
    minmax(92px, 0.55fr)
    minmax(92px, 0.55fr)
    repeat(3, minmax(150px, 1fr));
  align-items: end;
}

.pj-edit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pj-edit-strip label,
.pj-edit-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

.pj-edit-strip label > span,
.pj-edit-grid label > span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.pj-edit-strip input,
.pj-edit-strip select,
.pj-edit-grid input,
.pj-edit-grid select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-control);
  color: var(--bm-ink);
  padding: 0 10px;
  font-size: 0.78rem;
}

.pj-edit-grid .wide-field {
  grid-column: span 2;
}

.pj-edit-details {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 8px;
}

.pj-edit-details summary {
  cursor: pointer;
  color: var(--bm-blue);
  font-size: 0.72rem;
  font-weight: 700;
}

.pj-edit-details[open] summary {
  margin-bottom: 8px;
}

.pj-save-action {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(212, 164, 55, 0.42);
  border-radius: 7px;
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
  font-size: 0.75rem;
  font-weight: 760;
}

.pj-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
}

.pj-table-footer button {
  border: 0;
  background: transparent;
  color: var(--bm-blue);
  font-weight: 850;
}

.pj-side-card h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 0.85rem;
  font-weight: 900;
}

.pj-side-card {
  display: grid;
  gap: 11px;
  padding: 13px;
}

.pj-side-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pj-side-card h2 .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--bm-gold-dark);
}

.pj-summary-lines {
  display: grid;
  gap: 8px;
}

.pj-summary-lines span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--bm-muted);
  font-size: 0.75rem;
  font-weight: 780;
}

.pj-side-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.24);
}

.pj-side-link,
.pj-smart-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--bm-ink-strong);
  text-align: left;
  text-decoration: none;
}

.pj-side-link {
  font-size: 0.75rem;
  font-weight: 880;
}

.pj-side-link .ui-icon {
  width: 16px;
  height: 16px;
}

.pj-smart-action {
  align-items: start;
  flex-direction: column;
  justify-content: center;
}

.pj-smart-action strong {
  color: var(--bm-ink-strong);
  font-size: 0.75rem;
  font-weight: 890;
}

.pj-smart-action span,
.pj-ai-score,
.pj-assistant-card p {
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 740;
}

.pj-ai-score strong {
  color: var(--bm-green-dark);
}

.pj-assistant-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.pj-assistant-input input {
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-control);
  color: var(--bm-ink);
  font-size: 0.82rem;
}

.pj-assistant-input button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
  color: var(--bm-blue);
}

.pj-assistant-input .ui-icon {
  width: 15px;
  height: 15px;
}

.pj-assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pj-assistant-prompts button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--bm-blue);
  font-size: 0.68rem;
  font-weight: 640;
}

.pj-assistant-prompts button:hover {
  border-color: rgba(212, 164, 55, 0.42);
  background: rgba(212, 164, 55, 0.12);
  color: var(--bm-gold-dark);
}

.pj-timeline-card {
  gap: 10px;
}

.pj-intelligence-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pj-intelligence-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 2px 9px;
  padding: 0 0 11px 14px;
  border-left: 1px solid rgba(148, 163, 184, 0.24);
}

.pj-intelligence-timeline li:last-child {
  padding-bottom: 0;
}

.pj-intelligence-timeline li::before {
  content: "";
  position: absolute;
  top: 2px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bm-raised);
  border-radius: 999px;
  background: var(--bm-blue);
  box-shadow: 0 0 0 3px rgba(49, 95, 143, 0.08);
}

.pj-intelligence-timeline time {
  grid-row: 1 / span 2;
  color: var(--bm-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}

.pj-intelligence-timeline strong {
  color: var(--bm-ink-strong);
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1.2;
}

.pj-intelligence-timeline span {
  color: var(--bm-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.pj-intelligence-timeline li.success::before {
  background: var(--bm-green);
  box-shadow: 0 0 0 3px rgba(30, 166, 75, 0.1);
}

.pj-intelligence-timeline li.warning::before {
  background: var(--bm-gold);
  box-shadow: 0 0 0 3px rgba(212, 164, 55, 0.12);
}

.pj-intelligence-timeline li.danger::before {
  background: var(--bm-red);
  box-shadow: 0 0 0 3px rgba(184, 64, 64, 0.1);
}

.purchase-journal-console :where(
  .section-kicker,
  .row-drill-button,
  .pj-date-window,
  .pj-readiness-copy h2,
  .pj-readiness-copy p,
  .pj-readiness-check span,
  .pj-register-head h2,
  .pj-register-head p,
  .pj-filter-pill,
  .pj-action-select span,
  .pj-action-select select,
  .pj-primary-action,
  .pj-metric span,
  .pj-metric strong,
  .pj-selected-count,
  .pj-table-footer,
  .pj-table td,
  .pj-supplier,
  .pj-ref,
  .pj-description,
  .pj-status,
  .pj-insight,
  .pj-evidence-action,
  .pj-icon-action,
  .pj-table-footer button,
  .pj-summary-lines span,
  .pj-side-link,
  .pj-smart-action strong,
  .pj-smart-action span,
  .pj-ai-score,
  .pj-ai-score strong,
  .pj-assistant-card p,
  .pj-assistant-prompts button,
  .pj-intelligence-timeline time,
  .pj-intelligence-timeline strong,
  .pj-intelligence-timeline span
) {
  font-weight: 500;
}

.purchase-journal-console .pj-table th {
  font-weight: 800;
}

.purchase-journal-console .page-actions .row-drill-button,
.purchase-journal-console .pj-table td,
.purchase-journal-console .pj-table td span,
.purchase-journal-console .pj-table td strong,
.purchase-journal-console .pj-table td a,
.purchase-journal-console .pj-table td button {
  font-weight: 400;
}

.purchase-journal-console .section-kicker,
.purchase-journal-console .pj-date-window,
.purchase-journal-console .pj-readiness-check span,
.purchase-journal-console .pj-filter-pill,
.purchase-journal-console .pj-action-select span,
.purchase-journal-console .pj-action-select select,
.purchase-journal-console .pj-primary-action,
.purchase-journal-console .pj-supplier,
.purchase-journal-console .pj-table-footer,
.purchase-journal-console .pj-table-footer button,
.purchase-journal-console .pj-side-link,
.purchase-journal-console .pj-smart-action strong {
  font-weight: 500;
}

.purchase-journal-console .pj-summary-lines span,
.purchase-journal-console .pj-readiness-copy p,
.purchase-journal-console .pj-register-head p,
.purchase-journal-console .pj-smart-action span,
.purchase-journal-console .pj-ai-score,
.purchase-journal-console .pj-ai-score strong,
.purchase-journal-console .pj-assistant-card p,
.purchase-journal-console .pj-intelligence-timeline time,
.purchase-journal-console .pj-intelligence-timeline span,
.purchase-journal-console .phase-support-text {
  font-weight: 400;
}

.purchase-journal-console .pj-table th,
.purchase-journal-console .pj-readiness-copy h2,
.purchase-journal-console .pj-register-head h2,
.purchase-journal-console .pj-filter-pill {
  font-weight: 800;
}

.purchase-journal-console .pj-metric-mark,
.purchase-journal-console .pj-summary-icon {
  font-weight: 600;
}

.purchase-journal-console .pj-metric strong,
.purchase-journal-console .pj-money-cell,
.purchase-journal-console .pj-status,
.purchase-journal-console .pj-insight {
  font-weight: 500;
}

.purchase-journal-console .pj-filter-pill {
  font-weight: 800;
}

.purchase-manual-capture {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.purchase-manual-capture summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--bm-ink-strong);
  font-weight: 840;
  list-style-position: inside;
}

.purchase-manual-capture summary small {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 620;
}

.purchase-manual-capture[open] {
  padding-bottom: 16px;
}

.purchase-manual-capture[open] summary {
  border-bottom: 1px solid var(--bm-line);
  margin-bottom: 14px;
}

.purchase-manual-capture .purchase-capture-form {
  padding: 0 16px;
}

.purchase-review-assist {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.purchase-review-command {
  top: 12px;
}

.purchase-review-assist h2 {
  margin: 2px 0 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 860;
}

.purchase-review-assist p {
  margin: 8px 0 0;
  color: var(--bm-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

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

.purchase-assist-grid span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  align-content: center;
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  color: var(--bm-muted);
  font-size: 0.74rem;
}

.purchase-assist-grid strong {
  color: var(--bm-ink-strong);
  font-size: 1.1rem;
  line-height: 1;
}

.purchase-assist-note {
  padding-top: 12px;
  border-top: 1px solid var(--bm-line);
}

.purchase-register-panel {
  padding: 16px;
}

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

.purchase-register-table {
  min-width: 1220px;
}

.purchase-register-table th:nth-child(1),
.purchase-register-table td:nth-child(1) {
  width: 170px;
}

.purchase-register-table th:nth-child(2),
.purchase-register-table td:nth-child(2) {
  width: 180px;
}

.purchase-register-table th:nth-child(8),
.purchase-register-table td:nth-child(8),
.purchase-register-table th:nth-child(9),
.purchase-register-table td:nth-child(9) {
  width: 126px;
}

.purchase-register-table th:nth-child(10),
.purchase-register-table td:nth-child(10),
.purchase-register-table th:nth-child(11),
.purchase-register-table td:nth-child(11) {
  width: 130px;
}

.period-pill.open {
  border-color: rgba(30, 166, 75, 0.28);
  color: var(--bm-green-dark);
  background: var(--bm-green-soft);
}

.period-pill.restricted {
  border-color: #e0cb89;
  color: #7b5d15;
  background: var(--bm-gold-soft);
}

.period-pill.closed {
  border-color: #e9c5cc;
  color: var(--bm-red);
  background: var(--bm-red-soft);
}

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

.view-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--bm-muted);
  border-bottom: 2px solid var(--bm-muted);
  transform: translateY(-2px) rotate(45deg);
}

.view-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 236px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow-strong);
}

.view-menu-panel button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}

.view-menu-panel a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--bm-ink);
  text-decoration: none;
  font-weight: 760;
}

.view-menu-panel form {
  margin: 0;
}

.view-menu-panel form button {
  width: 100%;
}

.view-menu-panel .danger {
  color: #b42318;
}

.view-menu-panel a:hover {
  background: var(--bm-raised);
}

.view-menu-panel button:hover {
  background: var(--bm-raised);
}

.icon-button {
  position: relative;
  width: 36px;
  min-width: 36px;
  min-height: 35px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-weight: 900;
}

.notification-button b {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-red);
  color: #ffffff;
  font-size: 0.68rem;
  line-height: 1;
}

.notice {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 750;
}

.notice.success {
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
  border: 1px solid rgba(30, 166, 75, 0.25);
}

.notice-flash {
  max-width: 760px;
  padding: 8px 11px;
  background: rgba(240, 253, 250, 0.78);
  border-color: rgba(12, 117, 111, 0.18);
  color: var(--bm-teal);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.045);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 260ms ease,
    margin 260ms ease,
    padding 260ms ease,
    border-width 260ms ease;
}

.notice-flash.is-dismissing {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
}

.notice.error {
  background: var(--bm-red-soft);
  color: var(--bm-red);
  border: 1px solid #e9c5cc;
}

.workbench-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(30, 166, 75, 0.25);
  border-radius: 8px;
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
  box-shadow: 0 18px 45px rgba(7, 19, 31, 0.18);
  font-weight: 850;
}

.workbench-toast[data-state="warning"] {
  border-color: rgba(211, 166, 43, 0.35);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.workbench-toast[hidden] {
  display: none !important;
}

.daily-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.ai-entry-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.24fr) minmax(420px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.ai-entry-copy h2 {
  margin: 2px 0 0;
  color: var(--bm-ink-strong);
  font-size: 1.16rem;
  line-height: 1.15;
  font-weight: 860;
}

.ai-entry-copy p {
  max-width: 260px;
  margin: 6px 0 0;
  color: var(--bm-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.ai-prompt-field textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  padding: 10px;
  color: var(--bm-ink);
  font-size: 0.96rem;
  line-height: 1.4;
}

.ai-prompt-field textarea:focus {
  border-color: var(--bm-teal);
  outline: 2px solid rgba(13, 116, 109, 0.13);
}

.ai-entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.lookup {
  position: relative;
  min-width: 0;
}

.quick-select-host {
  position: relative;
  min-width: 0;
}

.lookup-trigger {
  width: 100%;
  height: var(--bm-field-height);
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-field-radius);
  background-color: var(--bm-control);
  color: var(--bm-ink);
  padding: 0 32px 0 var(--bm-field-padding-x);
  cursor: pointer;
}

.lookup-caret {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--bm-muted);
  pointer-events: none;
}

.lookup-caret::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.lookup-panel {
  position: fixed;
  z-index: 1200;
  display: none;
  min-width: 280px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.1);
}

.lookup-panel.is-open {
  display: block;
}

.lookup-search {
  width: 100%;
  height: 32px;
  margin-bottom: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.82rem;
  line-height: 1.2;
}

.lookup-add {
  width: 100%;
  min-height: 30px;
  margin-bottom: 8px;
  border: 1px solid rgba(212, 164, 55, 0.34);
  border-radius: 6px;
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
}

.lookup-list {
  max-height: 200px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #eceff3;
  border-radius: 6px;
}

.lookup-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 0;
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  background: var(--bm-surface);
  color: var(--bm-ink);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
}

.lookup-option:last-child {
  border-bottom: 0;
}

.lookup-option:hover {
  background: var(--bm-silver-soft);
}

.lookup-option:focus,
.lookup-option.is-selected {
  outline: none;
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
  font-weight: 600;
}

.lookup-empty {
  padding: 9px 10px;
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.os-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-strip-item {
  min-height: 66px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  align-content: center;
  justify-content: stretch;
  padding: 11px 13px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
  text-align: left;
}

.status-strip-item::before {
  content: "+";
  grid-row: span 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 6px;
  background: var(--bm-raised);
  color: var(--bm-muted);
  font-weight: 900;
}

.status-strip-item span {
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
  font-weight: 860;
}

.status-strip-item strong {
  color: var(--bm-muted);
  font-size: 0.83rem;
  font-weight: 650;
}

.preview-strip {
  border-color: #c8e1dd;
  background: var(--bm-teal-soft);
}

.preview-strip::before {
  color: var(--bm-teal);
  background: var(--bm-teal-soft);
}

.truth-strip {
  border-color: var(--bm-line-strong);
}

.truth-strip::before {
  color: #ffffff;
  background: var(--bm-truth);
}

.evidence-strip::before {
  color: #7b5d15;
  background: var(--bm-gold-soft);
}

.work-surface {
  min-width: 0;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.journal-entry-surface,
.compact-panel {
  padding: 12px;
}

.gj-form {
  display: grid;
  gap: 10px;
}

.journal-header-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--bm-surface), var(--bm-raised));
}

.entry-command-row,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.entry-command-row h2,
.panel-head h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.05rem;
  font-weight: var(--bm-weight-heading);
}

.journal-state-chips {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.state-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  background: var(--bm-surface);
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: var(--bm-weight-control);
  white-space: nowrap;
}

.state-chip.draft {
  border-color: rgba(212, 164, 55, 0.38);
  color: #7b5d15;
  background: var(--bm-gold-soft);
}

.state-chip.primary-state {
  gap: 7px;
  cursor: pointer;
}

.state-chip.primary-state .state-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(12, 117, 111, 0.12);
}

.state-chip.primary-state.is-ready {
  border-color: rgba(12, 117, 111, 0.28);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.state-chip.primary-state.is-warning {
  border-color: rgba(212, 164, 55, 0.42);
  background: var(--bm-gold-soft);
  color: #7b5d15;
}

.state-chip.primary-state.is-blocked {
  border-color: rgba(184, 64, 64, 0.24);
  background: #fff1f1;
  color: var(--bm-red);
}

.state-chip.source,
.state-chip.evidence {
  border-color: rgba(12, 117, 111, 0.24);
  color: var(--bm-teal);
}

.state-chip.evidence.is-warning {
  border-color: rgba(212, 164, 55, 0.46);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.state-chip.evidence.has-evidence {
  border-color: rgba(12, 117, 111, 0.28);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.evidence-chip-button {
  gap: 6px;
  cursor: pointer;
}

.evidence-chip-button .ui-icon {
  width: 15px;
  height: 15px;
}

.state-chip.period {
  color: var(--bm-ink-strong);
}

.entry-meta-grid {
  display: grid;
  grid-template-columns:
    minmax(132px, 0.8fr)
    minmax(132px, 0.8fr)
    minmax(170px, 1fr)
    minmax(178px, 1fr)
    minmax(108px, 0.58fr)
    minmax(132px, 0.72fr);
  gap: 8px;
}

.workbench-flow-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-line);
}

.flow-step {
  position: relative;
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bm-raised);
}

.flow-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}

.flow-step strong {
  color: var(--bm-ink-strong);
  font-size: 0.84rem;
  line-height: 1.1;
}

.flow-step small {
  color: var(--bm-muted);
  font-size: 0.72rem;
  line-height: 1.1;
}

.flow-step.is-active::before {
  background: var(--bm-gold);
}

.flow-step.is-ready::before {
  background: var(--bm-teal);
}

.flow-step.is-ready small {
  color: var(--bm-teal);
  font-weight: 760;
}

label {
  display: grid;
  gap: 4px;
}

label span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: var(--bm-weight-control);
}

input,
select {
  width: 100%;
  min-width: 0;
  height: var(--bm-field-height);
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-field-radius);
  background-color: var(--bm-control);
  color: var(--bm-ink);
  padding: 0 var(--bm-field-padding-x);
}

select {
  appearance: none;
  padding-right: 32px;
  background-image: var(--bm-select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
}

input:focus,
select:focus {
  border-color: var(--bm-teal);
  outline: 2px solid rgba(13, 116, 109, 0.13);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
.lookup-trigger[aria-invalid="true"] {
  border-color: rgba(198, 31, 31, 0.65);
  background: var(--bm-danger-soft);
}

select:disabled,
input:read-only.ghost-input {
  background-color: var(--bm-control-muted);
  color: var(--bm-faint);
}

.journal-line-grid {
  overflow: auto;
  border: 1px solid var(--bm-line-strong);
  border-radius: 8px;
  background: var(--bm-surface);
}

.journal-line-head,
.journal-line-row {
  display: grid;
  grid-template-columns: 42px minmax(230px, 1.12fr) minmax(230px, 1.08fr) minmax(118px, 0.5fr) minmax(118px, 0.5fr) minmax(112px, 0.46fr) minmax(96px, 0.4fr) 68px 74px;
  gap: 8px;
  align-items: center;
  min-width: 1142px;
}

.journal-line-head {
  padding: 9px 10px 7px;
  background: var(--bm-raised);
  color: var(--bm-muted);
  border-bottom: 1px solid var(--bm-line-strong);
  font-size: 0.72rem;
  font-weight: var(--bm-weight-heading);
}

.journal-line-row {
  position: relative;
  min-height: 58px;
  padding: 7px 10px;
  border-bottom: 1px solid #edf1f5;
}

.journal-line-row:focus-within {
  background: #fffdf7;
  box-shadow: inset 2px 0 0 var(--bm-gold);
}

.journal-line-row:last-child {
  border-bottom: 0;
}

.journal-line-row.is-row-clear {
  box-shadow: inset 2px 0 0 rgba(12, 117, 111, 0.26);
}

.journal-line-row.is-row-warning {
  background: rgba(212, 164, 55, 0.055);
  box-shadow: inset 2px 0 0 var(--bm-gold);
}

.journal-line-row.is-row-blocked {
  background: #fff7f7;
  box-shadow: inset 2px 0 0 var(--bm-red);
}

.line-number {
  color: var(--bm-muted);
  font-weight: 820;
  text-align: center;
}

.money-input,
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.money-input.ghost-input {
  background: var(--bm-control-muted);
  color: var(--bm-faint);
}

.amount-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: center;
}

.amount-cell .money-input {
  width: 100%;
}

.field-assist {
  min-height: 12px;
  padding-left: 2px;
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1.05;
}

.field-assist[hidden] {
  display: none;
}

.field-assist.is-watch {
  color: #80601a;
}

.field-assist.is-blocked {
  color: var(--bm-red);
}

.amount-area-assist {
  grid-column: 4 / 6;
  grid-row: 2;
  justify-self: center;
  align-self: start;
  margin-top: -2px;
  padding: 0 6px;
  text-align: center;
  pointer-events: none;
}

.line-action-cluster {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.line-remove-button,
.line-duplicate-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--bm-muted);
}

.line-duplicate-button:hover {
  border-color: var(--bm-line);
  background: var(--bm-silver-soft);
  color: var(--bm-teal);
}

.line-remove-button:hover {
  border-color: var(--bm-line);
  background: var(--bm-silver-soft);
  color: var(--bm-red);
}

.line-evidence-button {
  position: relative;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  justify-self: center;
  padding: 0;
  border-color: var(--bm-line);
  background: var(--bm-surface);
  color: var(--bm-muted);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.line-evidence-button .ui-icon {
  width: 17px;
  height: 17px;
}

.line-evidence-button.has-evidence {
  border-color: rgba(12, 117, 111, 0.28);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.line-evidence-button.has-evidence:hover {
  border-color: rgba(12, 117, 111, 0.44);
  color: var(--bm-teal);
  transform: translateY(-1px);
}

.line-evidence-button.is-warning {
  border-color: #e0cb89;
  background: var(--bm-gold-soft);
  color: #7b5d15;
}

.line-evidence-button.is-empty {
  border-color: var(--bm-line);
  background: var(--bm-surface);
  color: var(--bm-muted);
}

.line-evidence-button.is-empty:hover {
  border-color: rgba(12, 117, 111, 0.28);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
  transform: translateY(-1px);
}

.line-evidence-button[aria-invalid="true"] {
  border-color: rgba(198, 31, 31, 0.65);
  background: var(--bm-danger-soft);
  color: var(--bm-red);
}

.line-evidence-count {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-gold);
  color: #07131f;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.grid-tool-row {
  display: grid;
  grid-template-columns: auto auto 166px 1fr;
  gap: 8px;
  align-items: end;
}

.journal-validation-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.journal-validation-panel strong {
  color: var(--bm-ink-strong);
  white-space: nowrap;
}

.journal-validation-panel span {
  color: var(--bm-muted);
  font-size: 0.86rem;
}

.journal-validation-panel.is-ready {
  border-color: rgba(30, 166, 75, 0.28);
  background: var(--bm-green-soft);
}

.journal-validation-panel.is-ready strong {
  color: var(--bm-teal);
}

.journal-validation-panel.is-warning {
  border-color: #e0cb89;
  background: var(--bm-gold-soft);
}

.journal-validation-panel.is-warning strong {
  color: #7b5d15;
}

.journal-validation-panel.is-blocked {
  border-color: #e9c5cc;
  background: var(--bm-danger-soft);
}

.journal-validation-panel.is-blocked strong {
  color: var(--bm-red);
}

.journal-total-bar {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(142px, 0.75fr) minmax(142px, 0.75fr) minmax(142px, 0.75fr) minmax(130px, 0.65fr) auto;
  overflow: visible;
  border: 1px solid var(--bm-line-strong);
  border-top-color: rgba(212, 164, 55, 0.34);
  border-radius: 8px;
  background: var(--bm-line-strong);
  box-shadow:
    inset 0 1px 0 rgba(212, 164, 55, 0.14),
    0 10px 24px rgba(17, 17, 17, 0.05);
}

.total-cell,
.balance-cell {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 11px 14px;
  background: var(--bm-raised);
}

.total-cell span,
.balance-cell span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.total-cell strong,
.balance-cell strong {
  color: var(--bm-ink-strong);
  font-size: 1.38rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.difference-cell strong,
.balance-cell.is-balanced strong {
  color: var(--bm-green-dark);
}

.balance-cell.is-warning strong {
  color: var(--bm-red);
}

.journal-actions {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  background: var(--bm-raised);
}

.action-button,
.action-split button,
.action-split a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--bm-ink);
  text-decoration: none;
  font-weight: 860;
  line-height: 1;
  white-space: nowrap;
}

.action-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  filter: drop-shadow(0 6px 14px rgba(17, 17, 17, 0.05));
}

.action-split .action-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  min-width: 84px;
}

.action-split .action-caret {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-left-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  font-size: 0.76rem;
}

.action-caret .ui-icon {
  width: 16px;
  height: 16px;
}

.action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 220;
  display: grid;
  min-width: 180px;
  padding: 5px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow-strong);
}

.journal-actions .action-menu {
  top: auto;
  bottom: calc(100% + 7px);
}

.action-menu[hidden] {
  display: none;
}

.action-menu button {
  justify-content: flex-start;
  min-height: 34px;
  width: 100%;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--bm-ink);
  box-shadow: none;
}

.action-menu button:hover {
  background: var(--bm-raised);
}

.validate-action-button {
  border-color: var(--bm-gold);
  background: var(--bm-gold);
  color: #111111;
}

.submit-review-button {
  border-color: var(--bm-gold);
  background: var(--bm-gold);
  color: #111111;
}

.save-action-split .action-main,
.save-action-split .action-caret {
  border-color: var(--bm-silver);
  background: var(--bm-silver);
  color: #111111;
}

.post-action-split .action-main,
.post-action-split .action-caret {
  border-color: var(--bm-green-dark);
  background: var(--bm-green);
  color: #ffffff;
}

.cancel-action-button {
  border-color: var(--bm-nav);
  background: var(--bm-nav);
  color: #ffffff;
}

.validate-action-button:hover,
.save-action-split button:hover,
.post-action-split button:hover,
.cancel-action-button:hover {
  filter: brightness(0.96);
}

.operational-side-rail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.side-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.side-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.side-panel-head h3 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 860;
  line-height: 1.15;
}

.side-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--bm-line);
  background: var(--bm-raised);
  color: var(--bm-ink);
}

.source-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(12, 117, 111, 0.22);
  border-radius: 8px;
  background: var(--bm-teal-soft);
}

.source-card span,
.side-row span,
.posting-state-grid span,
.mini-ledger-totals span,
.validation-mirror span,
.exception-list span {
  color: var(--bm-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.source-card strong,
.side-row strong,
.posting-state-grid strong,
.mini-ledger-totals strong {
  color: var(--bm-ink-strong);
  font-weight: 850;
}

.side-row,
.exception-list article {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--bm-line);
}

.validation-mirror {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.validation-mirror strong {
  color: var(--bm-ink-strong);
  line-height: 1.15;
}

.validation-mirror.is-ready {
  border-color: rgba(30, 166, 75, 0.28);
  background: var(--bm-green-soft);
}

.validation-mirror.is-ready strong {
  color: var(--bm-teal);
}

.validation-mirror.is-warning {
  border-color: #e0cb89;
  background: var(--bm-gold-soft);
}

.validation-mirror.is-warning strong {
  color: #7b5d15;
}

.validation-mirror.is-blocked {
  border-color: #e9c5cc;
  background: var(--bm-danger-soft);
}

.validation-mirror.is-blocked strong {
  color: var(--bm-red);
}

.exception-list {
  display: grid;
}

.exception-list article:first-child {
  border-top: 0;
}

.exception-list article strong {
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
}

.exception-list article::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--bm-muted);
}

.exception-list article {
  display: grid;
  grid-template-columns: 9px minmax(70px, 0.8fr) minmax(0, 1fr);
}

.exception-list article.is-clear::before {
  background: var(--bm-green);
}

.exception-list article.is-watch::before {
  background: var(--bm-gold);
}

.exception-list article.is-blocked::before {
  background: var(--bm-red);
}

.posting-state-grid,
.mini-ledger-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.posting-state-grid article,
.mini-ledger-totals div {
  display: grid;
  gap: 3px;
  min-height: 54px;
  align-content: center;
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.posting-state-grid strong,
.mini-ledger-totals strong {
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.mini-ledger-totals {
  grid-template-columns: 1fr 1fr 0.7fr;
}

.mini-ledger-totals strong {
  font-size: 0.94rem;
}

.side-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button,
.primary-button,
.secondary-button,
.plain-button {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-raised);
  color: var(--bm-ink);
  padding: 0 12px;
  text-decoration: none;
  font-weight: var(--bm-weight-control);
  white-space: nowrap;
}

button:disabled,
button[aria-disabled="true"],
.primary-button:disabled,
.secondary-button:disabled,
.plain-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  filter: grayscale(0.28);
}

.primary-button {
  border-color: var(--bm-green-dark);
  background: var(--bm-green-dark);
  color: #ffffff;
}

.secondary-button {
  border-color: var(--bm-nav);
  background: var(--bm-nav);
  color: #ffffff;
}

.plain-button {
  background: var(--bm-surface);
}

.post-gate-button {
  min-width: 74px;
}

.post-gate-button:not(:disabled) {
  border-color: var(--bm-green-dark);
  background: var(--bm-green);
  color: #ffffff;
}

.post-gate-button:disabled,
.post-action-split .action-caret:disabled {
  border-color: var(--bm-green-dark);
  background: var(--bm-green);
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.52;
}

.post-action-split.is-disabled {
  filter: saturate(0.65);
}

.post-action-split.is-disabled button:hover {
  filter: none;
}

.daily-side-panel {
  display: grid;
  gap: 10px;
}

.compact-panel {
  display: grid;
  gap: 10px;
}

.panel-head strong {
  min-width: 30px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-raised);
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
}

.empty-queue {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px dashed var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.empty-queue span,
.queue-card span,
.assurance-list span,
.evidence-timeline span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.queue-list,
.assurance-list {
  display: grid;
  gap: 7px;
}

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

.workflow-summary-grid article {
  display: grid;
  gap: 3px;
  min-height: 58px;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.workflow-summary-grid span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.workflow-summary-grid strong {
  color: var(--bm-ink-strong);
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}

.queue-card,
.review-journal-card,
.assurance-list article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.queue-card-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.queue-card-main strong {
  color: var(--bm-ink-strong);
}

.queue-card-amount {
  display: grid;
  justify-items: end;
  gap: 2px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.queue-card-amount strong {
  color: var(--bm-ink-strong);
}

.queue-state-pill {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  background: var(--bm-silver-soft);
  color: var(--bm-muted);
  font-size: 0.7rem;
  font-weight: 880;
  text-transform: uppercase;
}

.queue-state-pill.draft {
  border-color: rgba(212, 164, 55, 0.5);
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.queue-state-pill.approved {
  border-color: rgba(30, 166, 75, 0.34);
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.queue-state-pill.underreview {
  border-color: rgba(212, 164, 55, 0.45);
  background: rgba(212, 164, 55, 0.14);
  color: var(--bm-gold-dark);
}

.queue-state-pill.posted {
  border-color: rgba(17, 24, 39, 0.18);
  background: #eef0f3;
  color: var(--bm-truth);
}

.queue-card.draft {
  border-left: 4px solid var(--bm-gold);
}

.queue-card.approved {
  border-left: 4px solid var(--bm-blue);
}

.queue-card.underreview {
  border-left: 4px solid var(--bm-gold);
}

.queue-card.posted {
  border-left: 4px solid var(--bm-truth);
}

.queue-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.queue-actions button {
  min-height: 32px;
  padding-inline: 10px;
}

.review-journal-list {
  gap: 10px;
}

.review-journal-card {
  display: grid;
  align-items: stretch;
  gap: 10px;
}

.review-journal-card.draft {
  border-left: 4px solid var(--bm-gold);
}

.review-journal-card.approved {
  border-left: 4px solid var(--bm-blue);
}

.review-journal-card.underreview {
  border-left: 4px solid var(--bm-gold);
}

.review-journal-card.posted {
  border-left: 4px solid var(--bm-truth);
}

.review-journal-card-head,
.review-journal-meta {
  display: grid;
  gap: 8px;
}

.review-journal-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.review-journal-card-head > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-journal-card-head strong,
.review-journal-total strong,
.review-journal-meta strong {
  color: var(--bm-ink-strong);
}

.review-journal-card-head > div:first-child > strong {
  font-size: 1.02rem;
}

.review-journal-total {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.review-journal-card span,
.review-journal-total span,
.review-journal-meta span {
  color: var(--bm-muted);
  font-size: 0.76rem;
}

.review-journal-meta {
  grid-template-columns: minmax(90px, 0.55fr) minmax(120px, 0.8fr) minmax(180px, 1.6fr) minmax(90px, 0.55fr);
}

.review-journal-meta article {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
}

.review-journal-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.review-journal-lines {
  overflow: auto;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
}

.review-journal-line-head,
.review-journal-line-row {
  display: grid;
  grid-template-columns: 42px minmax(170px, 1.35fr) minmax(150px, 1.25fr) minmax(88px, 0.55fr) minmax(88px, 0.55fr) minmax(74px, 0.5fr);
  align-items: center;
  gap: 8px;
  min-width: 720px;
  padding: 7px 9px;
}

.review-journal-line-head {
  border-bottom: 1px solid var(--bm-line);
  background: var(--bm-raised);
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.review-journal-line-row {
  min-height: 35px;
  border-bottom: 1px solid var(--bm-line);
  color: var(--bm-ink);
  font-size: 0.8rem;
}

.review-journal-line-row:last-child {
  border-bottom: 0;
}

.review-journal-line-row span:nth-child(2),
.review-journal-line-row span:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-journal-actions {
  justify-content: flex-start;
}

.assurance-panel {
  box-shadow: none;
}

.assurance-list article {
  display: grid;
  justify-content: stretch;
  gap: 2px;
}

.period-admin {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bm-line);
}

.period-admin h4 {
  margin: 2px 0 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
}

.phase-support-text {
  margin: 2px 0 0;
  color: var(--bm-muted);
  font-weight: 500;
}

.documents-shell {
  gap: 14px;
}

.document-upload-panel,
.document-connection-panel article,
.document-card,
.document-learning-strip,
.document-work-summary article,
.document-result-hero article {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.document-upload-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  align-items: end;
}

.xtract-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 12px;
}

.xtract-upload-card {
  grid-template-columns: minmax(0, 0.65fr) minmax(420px, 1fr);
}

.document-upload-panel h2,
.document-card h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.05rem;
  font-weight: 900;
}

.document-upload-panel p {
  margin: 4px 0 0;
  color: var(--bm-muted);
}

.document-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.xtract-upload-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.xtract-drop-zone {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 16px;
  border: 1px dashed rgba(212, 164, 55, 0.62);
  border-radius: 8px;
  background: rgba(212, 164, 55, 0.08);
  color: var(--bm-ink);
  cursor: pointer;
}

.xtract-drop-zone strong {
  color: var(--bm-ink-strong);
  font-weight: 900;
}

.xtract-drop-zone span {
  color: var(--bm-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.xtract-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.document-work-summary article,
.document-result-hero article {
  min-height: 82px;
  align-content: center;
  box-shadow: none;
}

.document-work-summary span,
.document-result-hero span,
.document-recurring-suggestion span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-work-summary strong,
.document-result-hero strong {
  color: var(--bm-ink-strong);
  font-size: 1.35rem;
  font-weight: 950;
}

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

.document-upload-form input[type="file"] {
  min-height: 36px;
  padding: 7px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-raised);
  color: var(--bm-ink);
}

.document-connection-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.document-connection-panel article {
  align-content: start;
  min-height: 116px;
}

.document-connection-panel strong {
  color: var(--bm-ink-strong);
  font-size: 0.98rem;
  font-weight: 900;
}

.document-connection-panel small {
  color: var(--bm-muted);
  font-weight: 680;
}

.document-connection-panel form {
  margin-top: 2px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bm-muted);
  font-size: 0.82rem;
  font-weight: 760;
  white-space: nowrap;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 12px;
}

.xtract-dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.55fr);
}

.document-register-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bm-filter-input {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-raised);
  color: var(--bm-ink);
  font-weight: 700;
}

.xtract-inbox-item {
  border-left: 4px solid var(--bm-gold);
}

.document-result-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.document-card header,
.document-suggestion header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-card header > strong {
  min-width: 34px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.document-suggestion-list,
.document-result-list {
  display: grid;
  gap: 10px;
}

.document-suggestion,
.document-result-list section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.source-evidence-shell {
  gap: 14px;
}

.source-evidence-topline {
  align-items: center;
}

.source-evidence-topline .gj-title,
.source-evidence-actions,
.evidence-search {
  min-width: 0;
}

.source-evidence-topline .gj-title h1 {
  font-size: 2rem;
}

.source-evidence-topline .phase-support-text span {
  display: inline;
}

.source-evidence-actions {
  display: grid;
  grid-template-columns: auto minmax(280px, 380px);
  align-items: center;
}

.evidence-add-menu summary {
  min-height: 45px;
  gap: 9px;
  padding-inline: 14px;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.04);
}

.evidence-add-menu summary::after {
  margin-left: 6px;
}

.evidence-search {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
}

.evidence-search .ui-icon {
  position: absolute;
  left: 13px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--bm-muted);
}

.evidence-search input {
  width: 100%;
  min-height: 45px;
  padding: 0 62px 0 42px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.035);
}

.evidence-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-raised);
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.source-evidence-overview {
  display: grid;
  grid-template-columns: minmax(420px, 0.78fr) minmax(0, 1.45fr);
  gap: 14px;
}

.evidence-source-panel,
.evidence-pipeline-panel,
.evidence-signals-strip,
.evidence-archive-strip {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.evidence-source-panel,
.evidence-pipeline-panel {
  display: grid;
  gap: 14px;
  min-height: 196px;
  padding: 18px;
}

.evidence-source-panel header,
.evidence-pipeline-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.evidence-source-panel h2,
.evidence-pipeline-panel h2,
.evidence-register-panel h2,
.evidence-learning-grid h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.03rem;
  font-weight: 900;
}

.evidence-pipeline-panel p {
  margin: 4px 0 0;
  color: var(--bm-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.evidence-source-form {
  display: grid;
  gap: 12px;
}

.evidence-source-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(66px, 1fr));
  gap: 8px;
}

.evidence-source-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--bm-surface), var(--bm-raised));
  color: var(--bm-ink-strong);
  font-size: 0.76rem;
  font-weight: 840;
  text-align: center;
}

.evidence-source-card:hover,
.evidence-source-card:focus-visible {
  border-color: rgba(49, 95, 143, 0.36);
  background: var(--bm-blue-soft);
  outline: none;
}

.evidence-source-card .ui-icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
}

.evidence-source-whatsapp .ui-icon {
  color: var(--bm-green);
}

.evidence-upload-source {
  cursor: pointer;
}

.evidence-upload-source input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.evidence-source-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.evidence-info-dot {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.evidence-pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 42px minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.pipeline-step {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.pipeline-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--bm-line);
  background: var(--bm-raised);
}

.pipeline-icon .ui-icon {
  width: 29px;
  height: 29px;
}

.pipeline-step strong {
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
}

.pipeline-step b {
  color: var(--bm-ink-strong);
  font-size: 1.45rem;
  line-height: 1;
}

.pipeline-step small {
  color: var(--bm-muted);
  font-size: 0.78rem;
}

.pipeline-arrow {
  justify-self: center;
  color: var(--bm-muted);
  font-weight: 900;
}

.pipeline-step.is-new .pipeline-icon,
.evidence-source-icon.upload,
.evidence-status-pill.new {
  border-color: rgba(49, 95, 143, 0.24);
  background: var(--bm-blue-soft);
  color: #115bb5;
}

.pipeline-step.is-extracting .pipeline-icon,
.evidence-health-pill.processing,
.evidence-status-pill.extracting {
  border-color: rgba(49, 95, 143, 0.28);
  background: #eaf3ff;
  color: #0b63ce;
}

.pipeline-step.is-ready .pipeline-icon,
.evidence-health-pill.good,
.evidence-status-pill.ready {
  border-color: rgba(30, 166, 75, 0.26);
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.pipeline-step.is-review .pipeline-icon,
.evidence-health-pill.missing,
.evidence-status-pill.review {
  border-color: rgba(212, 121, 33, 0.28);
  background: #fff3e6;
  color: #bd5b00;
}

.pipeline-step.is-extracting b,
.pipeline-step.is-new b {
  color: #0b63ce;
}

.pipeline-step.is-ready b {
  color: var(--bm-green-dark);
}

.pipeline-step.is-review b {
  color: #bd5b00;
}

.evidence-register-panel {
  padding: 18px;
}

.evidence-register-header {
  align-items: center;
}

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

.evidence-register-table {
  min-width: 1540px;
  table-layout: fixed;
}

.evidence-register-table th,
.evidence-register-table td {
  vertical-align: middle;
}

.evidence-register-table th:first-child,
.evidence-register-table td:first-child {
  width: 42px;
  text-align: center;
}

.evidence-register-table th:nth-child(2),
.evidence-register-table td:nth-child(2) {
  width: 76px;
}

.evidence-register-table th:nth-child(3),
.evidence-register-table td:nth-child(3) {
  width: 112px;
}

.evidence-register-table th:nth-child(4),
.evidence-register-table td:nth-child(4) {
  width: 220px;
}

.evidence-register-table th:nth-child(10),
.evidence-register-table td:nth-child(10),
.evidence-register-table th:nth-child(11),
.evidence-register-table td:nth-child(11),
.evidence-register-table th:nth-child(12),
.evidence-register-table td:nth-child(12) {
  width: 150px;
}

.evidence-register-table th:nth-child(13),
.evidence-register-table td:nth-child(13) {
  width: 112px;
}

.evidence-document-cell strong,
.evidence-document-cell small {
  display: block;
}

.evidence-document-cell strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-source-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-raised);
  color: var(--bm-ink-strong);
}

.evidence-source-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.evidence-source-icon.whatsapp {
  border-color: rgba(30, 166, 75, 0.28);
  background: var(--bm-green-soft);
  color: var(--bm-green-dark);
}

.evidence-source-icon.scan {
  border-color: rgba(12, 117, 111, 0.24);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.evidence-source-icon.web {
  border-color: rgba(49, 95, 143, 0.28);
  background: var(--bm-blue-soft);
  color: var(--bm-blue);
}

.evidence-status-pill,
.evidence-health-pill,
.evidence-note-pill {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.evidence-health-pill.issue {
  border-color: rgba(198, 31, 31, 0.28);
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

.evidence-health-pill.duplicate,
.evidence-note-pill.duplicate {
  border-color: rgba(126, 72, 201, 0.24);
  background: #f3ebff;
  color: #6e39b7;
}

.evidence-status-pill.drafted,
.evidence-note-pill.learning {
  border-color: rgba(12, 117, 111, 0.22);
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.evidence-note-pill.none {
  border-color: transparent;
  background: transparent;
  color: var(--bm-muted);
}

.evidence-note-pill.tax,
.evidence-note-pill.payment {
  border-color: rgba(212, 121, 33, 0.24);
  background: #fff3e6;
  color: #bd5b00;
}

.evidence-note-pill.missing {
  border-color: rgba(198, 31, 31, 0.22);
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

.evidence-confidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.evidence-confidence strong {
  font-size: 0.74rem;
  font-weight: 900;
}

.evidence-confidence span {
  display: inline-flex;
  gap: 4px;
}

.evidence-confidence i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--bm-line);
}

.evidence-confidence.high strong {
  color: var(--bm-green-dark);
}

.evidence-confidence.medium strong {
  color: #bd5b00;
}

.evidence-confidence.low strong {
  color: var(--bm-danger);
}

.evidence-confidence.high i.is-filled {
  background: var(--bm-green);
}

.evidence-confidence.medium i.is-filled {
  background: #f3b15b;
}

.evidence-confidence.low i.is-filled {
  background: #ef6464;
}

.evidence-register-table form {
  margin: 0;
}

.evidence-register-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--bm-muted);
  font-size: 0.84rem;
}

.evidence-register-footer nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.evidence-register-footer nav strong {
  min-width: 32px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.evidence-signals-strip {
  display: grid;
  grid-template-columns: 190px repeat(5, minmax(160px, 1fr));
  gap: 14px;
  align-items: stretch;
  padding: 12px;
}

.evidence-signals-strip header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--bm-line);
}

.evidence-signals-strip header strong,
.evidence-archive-strip strong {
  display: block;
  color: var(--bm-ink-strong);
  font-weight: 900;
}

.evidence-signals-strip header span,
.evidence-archive-strip span,
.signal-card span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.signals-icon,
.archive-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bm-raised);
  color: var(--bm-ink-strong);
}

.signal-card {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.signal-card strong {
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
}

.signal-card a {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 860;
  text-decoration: none;
}

.signal-card.is-issue {
  border-color: rgba(198, 31, 31, 0.22);
  background: rgba(253, 234, 234, 0.45);
  color: var(--bm-danger);
}

.signal-card.is-duplicate {
  border-color: rgba(126, 72, 201, 0.22);
  background: rgba(243, 235, 255, 0.55);
  color: #6e39b7;
}

.signal-card.is-review {
  border-color: rgba(212, 121, 33, 0.24);
  background: rgba(255, 243, 230, 0.58);
  color: #bd5b00;
}

.signal-card.is-ready {
  border-color: rgba(30, 166, 75, 0.22);
  background: rgba(230, 246, 236, 0.58);
  color: var(--bm-green-dark);
}

.signal-card.is-learning {
  border-color: rgba(49, 95, 143, 0.24);
  background: rgba(231, 238, 247, 0.72);
  color: var(--bm-blue);
}

.evidence-archive-strip {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
}

.evidence-archive-strip > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.evidence-learning-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.7fr);
}

.document-review-card {
  gap: 12px;
}

.document-review-message,
.document-review-note,
.document-proposal-summary,
.document-result-facts {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.document-review-message {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 4px solid var(--bm-teal);
}

.document-review-message span,
.document-review-note span {
  color: var(--bm-muted);
  font-weight: 680;
}

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

.document-facts-grid article {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.document-facts-grid span,
.document-proposal-summary span,
.document-result-facts strong {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-facts-grid strong,
.document-proposal-summary strong {
  color: var(--bm-ink-strong);
  font-weight: 900;
}

.document-review-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-color: rgba(212, 164, 55, 0.45);
  background: rgba(212, 164, 55, 0.10);
}

.document-review-note.is-review {
  border-left: 4px solid var(--bm-gold);
}

.document-proposal-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(118px, 0.45fr));
  gap: 8px;
  padding: 10px;
}

.document-recurring-suggestion {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid rgba(212, 164, 55, 0.34);
  border-left: 4px solid var(--bm-gold);
  border-radius: 8px;
  background: rgba(212, 164, 55, 0.08);
}

.document-recurring-suggestion p {
  margin: 2px 0 0;
  color: var(--bm-muted);
  font-weight: 680;
  line-height: 1.35;
}

.document-recurring-suggestion strong {
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
}

.result-actions {
  justify-content: flex-end;
}

.xtract-review-workspace {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xtract-result-shell {
  height: auto;
  min-height: 100%;
  overflow: visible;
  padding-bottom: 8px;
}

.xtract-result-shell > .xtract-page-heading,
.xtract-result-shell > .workbench-alert,
.xtract-result-shell > .xtract-document-summary,
.xtract-result-shell > .xtract-supporting-details,
.xtract-result-shell > .xtract-bottom-actions {
  flex: 0 0 auto;
}

.xtract-page-heading {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 34px;
  padding-bottom: 0;
}

.xtract-page-heading h1 {
  font-size: 1.02rem;
  line-height: 1;
}

.xtract-page-heading .section-kicker {
  font-size: 0.66rem;
}

.xtract-page-heading .phase-support-text {
  max-width: 780px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.xtract-page-heading .plain-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.xtract-result-shell > .workbench-alert {
  min-height: 24px;
  padding-block: 3px;
  font-size: 0.78rem;
}

.xtract-document-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.96fr) minmax(360px, 1.32fr) minmax(380px, 1.32fr) minmax(170px, 0.58fr);
  gap: 0;
  height: 62px;
  max-height: 62px;
  align-items: center;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid rgba(199, 151, 34, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(212, 164, 55, 0.11), rgba(255, 255, 255, 0.98) 32%, rgba(255, 255, 255, 0.94)),
    #fffdf8;
  box-shadow: 0 9px 20px rgba(72, 60, 30, 0.055);
}

.xtract-party-block,
.xtract-summary-facts,
.xtract-money-strip,
.xtract-overview-panel {
  min-width: 0;
  overflow: hidden;
  height: 100%;
  padding-inline: 8px;
}

.xtract-party-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}

.xtract-party-avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(145deg, rgba(212, 164, 55, 0.34), rgba(246, 236, 211, 0.92));
  color: var(--bm-ink-strong);
  font-size: 0.92rem;
  font-weight: 950;
}

.xtract-party-block h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 0.76rem;
  line-height: 1.15;
  font-weight: 880;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.xtract-party-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.xtract-party-badges span,
.xtract-source-chip,
.xtract-summary-warning {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(212, 164, 55, 0.2);
  color: var(--bm-gold-dark);
  font-size: 0.66rem;
  font-weight: 800;
}

.xtract-party-badges span + span {
  background: var(--bm-blue-soft);
  color: var(--bm-blue);
}

.xtract-summary-facts,
.xtract-money-strip,
.xtract-overview-panel {
  border-left: 1px solid rgba(168, 135, 55, 0.18);
}

.xtract-summary-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-content: center;
}

.xtract-summary-facts article,
.xtract-money-strip article,
.xtract-overview-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.xtract-summary-facts span,
.xtract-money-strip span,
.xtract-overview-grid span {
  color: rgba(71, 85, 105, 0.86);
  font-size: 0.58rem;
  font-weight: 720;
  letter-spacing: 0;
}

.xtract-summary-facts strong,
.xtract-money-strip strong,
.xtract-overview-grid strong {
  color: var(--bm-ink-strong);
  font-size: clamp(0.68rem, 0.62vw, 0.78rem);
  font-weight: 760;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xtract-summary-facts .needs-review strong {
  color: var(--bm-gold-dark);
}

.xtract-money-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-content: center;
}

.xtract-money-strip .is-total strong {
  font-size: clamp(0.78rem, 0.68vw, 0.9rem);
  font-weight: 920;
  line-height: 1.08;
}

.xtract-money-strip strong,
.xtract-overview-grid strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xtract-overview-panel {
  display: grid;
  gap: 3px;
  align-content: center;
  padding-right: 4px;
}

.xtract-ai-confidence {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  align-items: start;
  min-width: 0;
}

.xtract-ai-confidence strong {
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  line-height: 1.05;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xtract-ai-confidence span,
.xtract-ai-signals span {
  color: rgba(71, 85, 105, 0.9);
  font-size: 0.56rem;
  font-weight: 760;
  text-transform: uppercase;
  white-space: nowrap;
}

.xtract-ai-confidence .xtract-confidence-bar {
  grid-column: 1;
}

.xtract-ai-signals {
  display: flex;
  align-items: center;
  gap: 6px;
}

.xtract-ai-signals strong {
  color: var(--bm-ink-strong);
  font-size: 0.7rem;
  font-weight: 900;
}

.xtract-confidence-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(212, 164, 55, 0.18);
}

.xtract-confidence-bar::before {
  content: "";
  display: block;
  width: var(--confidence-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bm-gold), var(--bm-gold-dark));
}

.xtract-summary-warning {
  justify-content: center;
  border-radius: 7px;
  min-height: 17px;
  padding: 1px 5px;
  font-size: 0.62rem;
  background: rgba(212, 164, 55, 0.14);
  color: var(--bm-gold-dark);
}

.xtract-accountant-canvas {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.72fr) minmax(430px, 0.92fr);
  gap: 5px;
  align-items: stretch;
  flex: 0 0 auto;
  height: auto;
  min-height: clamp(430px, calc(100vh - 302px), 620px);
  overflow: hidden;
  padding: 2px;
  border: 1px solid rgba(17, 24, 39, 0.018);
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.52)),
    rgba(255, 255, 255, 0.28);
}

.xtract-result-shell:has(.xtract-payment-source:not([hidden])) .xtract-accountant-canvas {
  min-height: clamp(300px, calc(100vh - 535px), 390px);
}

.xtract-accountant-canvas.is-focused {
  grid-template-columns: minmax(0, 1fr);
}

.xtract-accountant-canvas.is-focused > [data-xtract-panel] {
  display: none;
}

.xtract-accountant-canvas.is-focused[data-focus-panel="source"] > [data-xtract-panel="source"],
.xtract-accountant-canvas.is-focused[data-focus-panel="lines"] > [data-xtract-panel="lines"],
.xtract-accountant-canvas.is-focused[data-focus-panel="impact"] > [data-xtract-panel="impact"] {
  display: grid;
}

.xtract-source-panel,
.xtract-lines-card,
.xtract-impact-card {
  gap: 5px;
  min-width: 0;
  box-shadow: none;
  padding: 6px;
  border-color: rgba(17, 24, 39, 0.02);
  background: rgba(255, 255, 255, 0.62);
}

.xtract-source-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.xtract-numbered-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.018);
}

.xtract-numbered-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.xtract-numbered-header strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  font-weight: 860;
  text-transform: uppercase;
}

.xtract-numbered-header small {
  color: var(--bm-muted);
  font-weight: 760;
}

.xtract-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.xtract-panel-focus-button {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--bm-muted);
  cursor: pointer;
}

.xtract-panel-focus-button::before,
.xtract-panel-focus-button::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: currentColor;
  opacity: 0.78;
}

.xtract-panel-focus-button::before {
  top: 7px;
  right: 7px;
  border-top: 1.5px solid;
  border-right: 1.5px solid;
}

.xtract-panel-focus-button::after {
  bottom: 7px;
  left: 7px;
  border-bottom: 1.5px solid;
  border-left: 1.5px solid;
}

.xtract-panel-focus-button:hover,
.xtract-panel-focus-button:focus-visible,
.xtract-panel-focus-button[aria-pressed="true"] {
  border-color: rgba(168, 135, 55, 0.34);
  background: rgba(212, 164, 55, 0.12);
  color: var(--bm-gold-dark);
}

.xtract-accountant-canvas.is-focused .xtract-panel-focus-button[aria-pressed="true"]::before {
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-top: 0;
  border-right: 0;
  border-bottom: 1.5px solid;
  border-left: 1.5px solid;
}

.xtract-accountant-canvas.is-focused .xtract-panel-focus-button[aria-pressed="true"]::after {
  bottom: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-bottom: 0;
  border-left: 0;
  border-top: 1.5px solid;
  border-right: 1.5px solid;
}

.xtract-step-number {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.045);
  color: rgba(49, 95, 143, 0.88);
  font-size: 0.76rem;
  font-weight: 880;
}

.xtract-source-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding: 5px 7px;
  border: 1px solid rgba(17, 24, 39, 0.026);
  border-radius: 8px;
  background: rgba(247, 248, 250, 0.42);
}

.xtract-source-toolbar strong {
  min-width: 0;
  flex: 1;
  color: var(--bm-ink);
  font-size: 0.72rem;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xtract-source-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
}

.xtract-source-toolbar .xtract-source-chip {
  background: var(--bm-gold-soft);
  color: var(--bm-gold-dark);
}

.xtract-source-zoom {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bm-surface);
}

.xtract-source-zoom button,
.xtract-source-zoom span {
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bm-ink);
  font-size: 0.7rem;
  font-weight: 880;
}

.xtract-source-zoom button {
  width: 28px;
  cursor: pointer;
}

.xtract-source-zoom button:hover,
.xtract-source-zoom button:focus-visible {
  background: var(--bm-gold-soft);
  color: var(--bm-ink-strong);
}

.xtract-source-zoom span {
  min-width: 48px;
  padding: 0 8px;
  border-inline: 1px solid var(--bm-line);
  color: var(--bm-muted);
  white-space: nowrap;
}

.xtract-document-viewer {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 5px;
  min-height: 0;
  height: 100%;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.018), transparent 16%),
    #f8f9fb;
  overflow: hidden;
}

.xtract-page-thumb {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.xtract-page-thumb iframe {
  width: 42px;
  height: 60px;
  border: 1px solid rgba(168, 135, 55, 0.42);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.06);
}

.xtract-original-document {
  --source-frame-size: 125%;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border: 0;
  border-radius: 4px;
  background: #ffffff;
  box-shadow:
    0 12px 30px rgba(17, 24, 39, 0.055),
    inset 0 0 0 1px rgba(17, 24, 39, 0.018);
}

.xtract-original-document iframe {
  display: block;
  width: var(--source-frame-size);
  height: var(--source-frame-size);
  min-width: 100%;
  min-height: 100%;
  border: 0;
  background: #ffffff;
  transform-origin: top left;
}

.xtract-lines-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.xtract-impact-flow {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.xtract-impact-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.xtract-lines-card .document-proposal-table,
.xtract-impact-card .document-proposal-table {
  table-layout: fixed;
  font-size: 0.74rem;
}

.xtract-lines-card .document-proposal-table-wrap,
.xtract-impact-card .document-proposal-table-wrap {
  border-color: rgba(17, 24, 39, 0.026);
  background: rgba(255, 255, 255, 0.24);
  min-height: 0;
}

.xtract-lines-card .document-proposal-table-wrap,
.xtract-impact-card .document-proposal-table-wrap {
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.xtract-original-document,
.xtract-lines-card .document-proposal-table-wrap,
.xtract-impact-card .document-proposal-table-wrap {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.xtract-original-document::-webkit-scrollbar,
.xtract-lines-card .document-proposal-table-wrap::-webkit-scrollbar,
.xtract-impact-card .document-proposal-table-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.xtract-original-document:hover,
.xtract-original-document:focus-within,
.xtract-lines-card .document-proposal-table-wrap:hover,
.xtract-lines-card .document-proposal-table-wrap:focus-within,
.xtract-impact-card .document-proposal-table-wrap:hover,
.xtract-impact-card .document-proposal-table-wrap:focus-within {
  scrollbar-width: thin;
}

.xtract-original-document:hover::-webkit-scrollbar,
.xtract-original-document:focus-within::-webkit-scrollbar,
.xtract-lines-card .document-proposal-table-wrap:hover::-webkit-scrollbar,
.xtract-lines-card .document-proposal-table-wrap:focus-within::-webkit-scrollbar,
.xtract-impact-card .document-proposal-table-wrap:hover::-webkit-scrollbar,
.xtract-impact-card .document-proposal-table-wrap:focus-within::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.xtract-original-document:hover::-webkit-scrollbar-thumb,
.xtract-original-document:focus-within::-webkit-scrollbar-thumb,
.xtract-lines-card .document-proposal-table-wrap:hover::-webkit-scrollbar-thumb,
.xtract-lines-card .document-proposal-table-wrap:focus-within::-webkit-scrollbar-thumb,
.xtract-impact-card .document-proposal-table-wrap:hover::-webkit-scrollbar-thumb,
.xtract-impact-card .document-proposal-table-wrap:focus-within::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.32);
}

.xtract-lines-card .document-proposal-table {
  min-width: 0;
  width: 100%;
}

.xtract-impact-card .document-proposal-table {
  min-width: 0;
  width: 100%;
}

.xtract-source-lines-table th:first-child,
.xtract-source-lines-table td:first-child {
  width: 24px;
}

.xtract-source-lines-table th:nth-child(2),
.xtract-source-lines-table td:nth-child(2) {
  width: 42%;
}

.xtract-source-lines-table th:nth-child(3),
.xtract-source-lines-table td:nth-child(3) {
  width: 38px;
}

.xtract-source-lines-table th:nth-child(n + 4),
.xtract-source-lines-table td:nth-child(n + 4) {
  width: 64px;
}

.xtract-source-lines-table td:nth-child(n + 3),
.xtract-source-lines-table th:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.xtract-source-lines-table td:nth-child(n + 4) {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.xtract-lines-card .document-proposal-table th,
.xtract-lines-card .document-proposal-table td,
.xtract-impact-card .document-proposal-table th,
.xtract-impact-card .document-proposal-table td {
  padding: 5px 7px;
  border-bottom-color: rgba(17, 24, 39, 0.075);
  line-height: 1.22;
}

.xtract-impact-card .document-proposal-table th,
.xtract-impact-card .document-proposal-table td {
  padding-inline: 6px;
}

.xtract-lines-card .document-proposal-table th,
.xtract-impact-card .document-proposal-table th {
  color: var(--bm-muted);
  background: rgba(247, 248, 250, 0.34);
  font-size: 0.63rem;
}

.xtract-lines-card .document-proposal-table tfoot td,
.xtract-impact-card .document-proposal-table tfoot td {
  padding-block: 5px;
}

.xtract-payment-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.32fr) auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  margin-top: 0;
  margin-bottom: 8px;
  border: 1px solid rgba(212, 164, 55, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(212, 164, 55, 0.12), rgba(255, 255, 255, 0.84) 44%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.035);
}

.xtract-payment-source[hidden] {
  display: none;
}

.xtract-payment-source-icon {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--bm-gold-dark);
  box-shadow: inset 0 0 0 1px rgba(212, 164, 55, 0.22);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.xtract-payment-source-icon:hover,
.xtract-payment-source-icon:focus-visible,
.xtract-payment-source-icon[aria-expanded="true"] {
  background: rgba(212, 164, 55, 0.16);
  color: var(--bm-ink-strong);
}

.xtract-payment-source-icon[aria-expanded="true"] {
  transform: translateY(1px);
}

.xtract-payment-source-icon span {
  width: 16px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.xtract-payment-source-icon span::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.8;
}

.xtract-payment-source-icon::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.82;
}

.xtract-payment-source-icon[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.xtract-payment-source-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.xtract-payment-source-copy span,
.xtract-payment-source-fields label {
  color: var(--bm-muted);
  font-size: 0.58rem;
  font-weight: 780;
  text-transform: uppercase;
}

.xtract-payment-source-copy strong {
  color: var(--bm-ink-strong);
  font-size: 0.82rem;
  font-weight: 860;
}

.xtract-payment-source-copy small {
  color: rgba(71, 85, 105, 0.92);
  font-size: 0.68rem;
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xtract-payment-source-fields {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.xtract-payment-source-picker {
  position: relative;
  min-width: 0;
}

.xtract-payment-source-choice {
  min-height: 30px;
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.98), rgba(250, 244, 229, 0.88));
  color: var(--bm-ink);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 9px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.44);
  cursor: pointer;
}

.xtract-payment-source-choice:focus-visible,
.xtract-payment-source-choice[aria-expanded="true"] {
  outline: 2px solid rgba(212, 164, 55, 0.26);
  border-color: rgba(168, 135, 55, 0.42);
}

.xtract-payment-source-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 120;
  display: grid;
  gap: 1px;
  max-height: 190px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.14);
}

.xtract-payment-source-menu[hidden] {
  display: none;
}

.xtract-payment-source-menu button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bm-ink);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: left;
  padding: 5px 8px;
  cursor: pointer;
}

.xtract-payment-source-menu button:hover,
.xtract-payment-source-menu button:focus-visible,
.xtract-payment-source-menu button[aria-selected="true"] {
  outline: none;
  background: rgba(212, 164, 55, 0.16);
  color: var(--bm-ink-strong);
}

.xtract-payment-source-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--bm-muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.xtract-payment-source-meta span,
.xtract-payment-source-meta strong {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.xtract-payment-source-meta strong {
  color: var(--bm-success);
}

.xtract-payment-source-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 8px 2px 42px;
  border-top: 1px solid rgba(168, 135, 55, 0.13);
}

.xtract-payment-source-details[hidden] {
  display: none;
}

.xtract-payment-source-details div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.xtract-payment-source-details span {
  color: var(--bm-muted);
  font-size: 0.58rem;
  font-weight: 780;
  text-transform: uppercase;
}

.xtract-payment-source-details strong {
  color: rgba(15, 23, 42, 0.82);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.25;
}

.xtract-secondary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.xtract-add-payment-source {
  min-height: 32px;
  border-color: rgba(168, 135, 55, 0.28);
  background: rgba(255, 248, 232, 0.78);
  color: var(--bm-gold-dark);
}

.xtract-supporting-details {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding-bottom: 44px;
}

.xtract-bottom-actions {
  position: fixed;
  left: calc(312px + 12px);
  right: 12px;
  bottom: 0;
  z-index: 90;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 4px 7px;
  margin: 0;
  border: 1px solid rgba(17, 24, 39, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -12px 24px rgba(17, 24, 39, 0.052), 0 8px 20px rgba(17, 24, 39, 0.04);
  backdrop-filter: blur(14px);
}

.xtract-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.xtract-primary-actions form {
  margin: 0;
}

.xtract-create-draft-button {
  min-width: 210px;
  justify-content: center;
  border-color: var(--bm-gold-dark);
  background: linear-gradient(180deg, var(--bm-gold), #b88418);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(168, 135, 55, 0.18);
}

.xtract-create-draft-button:hover,
.xtract-create-draft-button:focus-visible {
  border-color: #8f6818;
  background: linear-gradient(180deg, #c99b2f, #a87514);
  color: #ffffff;
}

.xtract-reject-button {
  border-color: rgba(198, 31, 31, 0.28);
  color: var(--bm-danger);
}

.xtract-result-header {
  align-items: center;
}

.xtract-confidence-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(220px, 0.6fr));
  gap: 10px;
}

.xtract-status-card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.xtract-status-card.is-primary {
  border-color: rgba(12, 117, 111, 0.26);
  background: linear-gradient(180deg, rgba(12, 117, 111, 0.08), var(--bm-surface));
}

.xtract-status-card strong {
  color: var(--bm-ink-strong);
  font-size: 1.16rem;
  font-weight: 950;
}

.xtract-status-card small {
  color: var(--bm-muted);
  font-weight: 720;
}

.xtract-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.34fr);
  gap: 14px;
  align-items: start;
}

.xtract-main-flow {
  display: grid;
  gap: 12px;
}

.xtract-review-rail {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
}

.xtract-section-card {
  gap: 14px;
  box-shadow: none;
}

.xtract-section-header {
  align-items: center;
}

.xtract-section-header h2,
.xtract-decision-card h2 {
  margin: 0;
}

.xtract-key-facts {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(160px, 0.55fr));
  gap: 8px;
}

.xtract-fact {
  display: grid;
  gap: 5px;
  min-height: 74px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.xtract-fact span,
.xtract-confidence-meter span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.xtract-fact strong {
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 950;
}

.xtract-fact.is-money strong {
  font-variant-numeric: tabular-nums;
}

.xtract-disclosure {
  border-top: 1px solid var(--bm-line);
  padding-top: 8px;
}

.xtract-disclosure summary {
  cursor: pointer;
  color: var(--bm-ink-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

.xtract-disclosure summary::marker {
  color: var(--bm-gold-dark);
}

.xtract-disclosure[open] summary {
  margin-bottom: 10px;
}

.xtract-more-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.xtract-proposal-message {
  background: linear-gradient(90deg, rgba(12, 117, 111, 0.08), var(--bm-surface));
}

.xtract-impact-summary {
  border-color: rgba(17, 24, 39, 0.14);
  background: var(--bm-raised);
}

.xtract-proposal-table th:nth-child(4),
.xtract-proposal-table th:nth-child(5),
.xtract-proposal-table td:nth-child(4),
.xtract-proposal-table td:nth-child(5),
.xtract-source-lines-table th:nth-child(3),
.xtract-source-lines-table th:nth-child(4),
.xtract-source-lines-table th:nth-child(5),
.xtract-source-lines-table th:nth-child(6),
.xtract-source-lines-table th:nth-child(7),
.xtract-source-lines-table td:nth-child(3),
.xtract-source-lines-table td:nth-child(4),
.xtract-source-lines-table td:nth-child(5),
.xtract-source-lines-table td:nth-child(6),
.xtract-source-lines-table td:nth-child(7),
.xtract-source-lines-table tfoot td,
.xtract-proposal-table tfoot td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xtract-source-lines-table th:nth-child(2),
.xtract-source-lines-table td:nth-child(2),
.xtract-proposal-table th:nth-child(2),
.xtract-proposal-table td:nth-child(2),
.xtract-proposal-table th:nth-child(3),
.xtract-proposal-table td:nth-child(3) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.xtract-source-lines-table th:nth-child(1),
.xtract-source-lines-table td:nth-child(1),
.xtract-proposal-table th:nth-child(1),
.xtract-proposal-table td:nth-child(1) {
  width: 24px;
}

.xtract-source-lines-table th:nth-child(2),
.xtract-source-lines-table td:nth-child(2) {
  width: 42%;
  line-height: 1.22;
  overflow: hidden;
}

.xtract-source-lines-table th:nth-child(3),
.xtract-source-lines-table td:nth-child(3) {
  width: 38px;
}

.xtract-source-lines-table th:nth-child(n + 4),
.xtract-source-lines-table td:nth-child(n + 4) {
  width: 64px;
}

.xtract-proposal-table th:nth-child(2),
.xtract-proposal-table td:nth-child(2) {
  width: 29%;
}

.xtract-proposal-table th:nth-child(3),
.xtract-proposal-table td:nth-child(3) {
  width: 35%;
}

.xtract-proposal-table th:nth-child(n + 4),
.xtract-proposal-table td:nth-child(n + 4) {
  width: 18%;
}

.xtract-proposal-table td:nth-child(2) strong {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.xtract-proposal-table td:nth-child(3) {
  line-height: 1.25;
}

.xtract-impact-card .xtract-proposal-table tbody tr {
  transition: background-color 140ms ease;
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-debit {
  background: linear-gradient(90deg, rgba(30, 166, 75, 0.055), rgba(255, 255, 255, 0) 48%);
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-tax {
  background: linear-gradient(90deg, rgba(76, 132, 222, 0.06), rgba(255, 255, 255, 0) 48%);
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-credit {
  background: linear-gradient(90deg, rgba(212, 164, 55, 0.085), rgba(255, 255, 255, 0) 48%);
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-debit td:first-child {
  box-shadow: inset 3px 0 0 rgba(30, 166, 75, 0.52);
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-tax td:first-child {
  box-shadow: inset 3px 0 0 rgba(76, 132, 222, 0.52);
}

.xtract-impact-card .xtract-proposal-table tbody tr.is-credit td:first-child {
  box-shadow: inset 3px 0 0 rgba(212, 164, 55, 0.66);
}

.xtract-impact-card .xtract-proposal-table td:nth-child(4),
.xtract-impact-card .xtract-proposal-table td:nth-child(5),
.xtract-impact-card .xtract-proposal-table tfoot td:nth-child(n + 4) {
  color: var(--bm-ink-strong);
  font-weight: 760;
}

.xtract-proposal-table tfoot td:first-child {
  text-align: right;
}

.xtract-reasoning-disclosure,
.xtract-history-disclosure {
  display: block;
  max-height: 24px;
  overflow: hidden;
  padding-block: 3px;
  border-color: rgba(17, 24, 39, 0.018);
  background: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.xtract-reasoning-disclosure[open],
.xtract-history-disclosure[open] {
  max-height: none;
  overflow: visible;
}

.xtract-reasoning-disclosure summary,
.xtract-history-disclosure summary {
  min-height: 18px;
  color: rgba(71, 85, 105, 0.78);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0;
}

.xtract-reasoning-disclosure summary::marker,
.xtract-history-disclosure summary::marker {
  color: rgba(168, 135, 55, 0.78);
}

.xtract-reasoning-disclosure[open] summary,
.xtract-history-disclosure[open] summary {
  margin-bottom: 8px;
  color: var(--bm-ink);
}

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

.xtract-history-grid article {
  display: grid;
  gap: 10px;
}

.xtract-decision-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow);
}

.xtract-decision-card h2 {
  color: var(--bm-ink-strong);
  font-size: 1.16rem;
  font-weight: 950;
}

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

.xtract-confidence-meter div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.xtract-confidence-meter strong {
  color: var(--bm-ink-strong);
  font-weight: 950;
}

.xtract-checklist {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.xtract-checklist li {
  position: relative;
  padding-left: 20px;
  color: var(--bm-muted);
  font-size: 0.84rem;
  font-weight: 740;
}

.xtract-checklist li::before {
  content: "";
  position: absolute;
  top: 0.42em;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--bm-silver);
}

.xtract-checklist li.is-ok::before {
  background: var(--bm-green);
}

.xtract-checklist li.is-watch::before {
  background: var(--bm-gold);
}

.xtract-decision-actions {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--bm-line);
}

.xtract-decision-actions form,
.xtract-decision-actions button {
  width: 100%;
}

.xtract-review-guide {
  box-shadow: none;
}

.xtract-loading-screen {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.5), rgba(244, 246, 250, 0.3) 38%, rgba(226, 231, 238, 0.52)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(232, 236, 242, 0.5));
  backdrop-filter: blur(4px) saturate(1.04) brightness(1.01);
  opacity: 0;
  transition:
    opacity 360ms cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.xtract-loading-screen[hidden] {
  display: none;
}

.xtract-loading-active {
  cursor: progress;
}

.xtract-loading-screen.xtract-loading-visible {
  opacity: 1;
}

.xtract-loading-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(560px, 100%);
  padding: 42px 44px 40px;
  border: 1px solid rgba(212, 164, 55, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 164, 55, 0.11), transparent 42%),
    #ffffff;
  box-shadow:
    0 18px 58px rgba(9, 18, 34, 0.11),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;
  text-align: center;
  opacity: 0;
  filter: blur(5px);
  transform: translateY(28px) scale(0.94);
  transition:
    opacity 360ms cubic-bezier(0.16, 1, 0.3, 1) 90ms,
    filter 420ms cubic-bezier(0.16, 1, 0.3, 1) 90ms,
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1) 90ms,
    box-shadow 480ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

.xtract-loading-screen.xtract-loading-visible .xtract-loading-card {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.xtract-loading-logo {
  width: min(390px, 84vw);
  height: auto;
  display: block;
  object-fit: contain;
}

.xtract-loading-divider {
  width: 42px;
  height: 2px;
  margin-top: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--bm-gold), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition:
    opacity 360ms ease 240ms,
    transform 500ms cubic-bezier(0.16, 1, 0.3, 1) 240ms;
}

.xtract-loading-screen.xtract-loading-visible .xtract-loading-divider {
  opacity: 1;
  transform: scaleX(1);
}

.xtract-loading-card h2 {
  margin: 12px 0 0;
  color: var(--bm-ink-strong);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.16;
  font-weight: 950;
}

.xtract-loading-card p {
  margin: 0;
  color: var(--bm-muted);
  max-width: 430px;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 720;
}

.xtract-loading-progress {
  width: min(330px, 74vw);
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(212, 164, 55, 0.08), rgba(142, 142, 147, 0.22), rgba(212, 164, 55, 0.08));
  box-shadow: inset 0 1px 2px rgba(9, 18, 34, 0.08);
}

.xtract-loading-progress span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.62) 48%, transparent 100%),
    linear-gradient(90deg, #b9811d, var(--bm-gold), #f1ce75);
  box-shadow:
    0 0 20px rgba(212, 164, 55, 0.36),
    0 0 2px rgba(255, 255, 255, 0.72) inset;
  animation: xtract-progress 1.9s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

@keyframes xtract-progress {
  0% {
    transform: translateX(-125%);
  }

  42% {
    transform: translateX(112%);
  }

  100% {
    transform: translateX(325%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xtract-loading-screen,
  .xtract-loading-card,
  .xtract-loading-progress span,
  .purchase-reading-card::after,
  .purchase-reading-mark,
  .purchase-evidence-reading-lens {
    transition: none;
    animation: none;
  }

  .xtract-loading-progress span {
    width: 100%;
    transform: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .purchase-evidence-reading-lens {
    display: none;
  }
}

.document-proposal-summary > div,
.document-result-facts span {
  display: grid;
  gap: 3px;
}

.document-proposal-table-wrap {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.document-proposal-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.document-proposal-table th,
.document-proposal-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bm-line);
  color: var(--bm-ink);
  text-align: left;
  vertical-align: top;
}

.document-proposal-table th {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--bm-soft);
}

.document-proposal-table td:nth-child(4),
.document-proposal-table td:nth-child(5),
.document-proposal-table td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.document-proposal-table small {
  display: block;
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.technical-json {
  border-top: 1px solid var(--bm-line);
  padding-top: 2px;
}

.technical-json summary {
  cursor: pointer;
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.document-result-review header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.document-result-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 9px;
}

.queue-state-pill.low {
  border-color: rgba(5, 150, 105, 0.32);
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

.queue-state-pill.medium {
  border-color: rgba(212, 164, 55, 0.42);
  background: rgba(212, 164, 55, 0.14);
  color: var(--bm-gold-dark);
}

.queue-state-pill.high {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.document-suggestion strong,
.document-result-list strong,
.document-learning-strip strong {
  color: var(--bm-ink-strong);
}

.document-suggestion span,
.document-result-list span,
.document-result-list small,
.document-learning-strip span {
  color: var(--bm-muted);
}

.document-suggestion p {
  margin: 0;
  color: var(--bm-muted);
}

.document-suggestion pre {
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.document-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.document-learning-strip {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.period-list {
  display: grid;
  gap: 8px;
}

.period-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.period-card.open {
  border-left: 4px solid var(--bm-teal);
}

.period-card.restricted {
  border-left: 4px solid var(--bm-gold);
}

.period-card.closed {
  border-left: 4px solid var(--bm-red);
}

.period-card > div,
.period-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.period-card span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.period-status {
  justify-self: start;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bm-surface);
  border: 1px solid var(--bm-line);
  color: var(--bm-ink);
  font-weight: 820;
}

.period-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--bm-line);
  vertical-align: middle;
}

th {
  color: var(--bm-muted);
  background: var(--bm-raised);
  font-size: 0.72rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.preview-table-wrap {
  border-style: dashed;
  border-color: #b9d9d4;
}

.preview-table-wrap th {
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
}

.ledger-table-wrap {
  border-color: var(--bm-line-strong);
}

.ledger-table-wrap th {
  background: var(--bm-raised);
  color: var(--bm-truth);
}

.preview-status {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bm-teal-soft);
  color: var(--bm-teal);
  font-weight: 820;
  font-size: 0.74rem;
}

.evidence-drawer-sections {
  display: grid;
  gap: 12px;
}

.drawer-action-row {
  display: flex;
  justify-content: flex-end;
}

.drilldown-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.drill-context-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 164, 55, 0.3);
  border-radius: 8px;
  background: var(--bm-gold-soft);
  color: var(--bm-ink);
}

.drill-context-card[hidden] {
  display: none;
}

.drill-context-card strong {
  color: var(--bm-ink-strong);
  font-size: 0.94rem;
}

.drill-context-card span:last-child {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.row-drill-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

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

.row-drill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--bm-line);
  border-radius: 6px;
  background: var(--bm-surface);
  color: var(--bm-ink);
  font-size: 0.72rem;
  font-weight: var(--bm-weight-control);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.purchase-review-topline .page-actions .purchase-header-action {
  font-weight: 560;
}

.row-drill-button:hover {
  border-color: var(--bm-gold);
  color: var(--bm-gold-dark);
  background: var(--bm-gold-soft);
  text-decoration: none;
}

.row-drill-button .ui-icon {
  width: 14px;
  height: 14px;
}

.row-drill-primary {
  border-color: rgba(212, 164, 55, 0.55);
  background: var(--bm-gold-soft);
  color: #5f4510;
}

.row-drill-button.xtract-create-draft-button {
  border-color: var(--bm-gold-dark);
  background: linear-gradient(180deg, var(--bm-gold), #b88418);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(168, 135, 55, 0.13);
}

.row-drill-button.xtract-create-draft-button:hover,
.row-drill-button.xtract-create-draft-button:focus-visible {
  border-color: #8f6818;
  background: linear-gradient(180deg, #c99b2f, #a87514);
  color: #ffffff;
}

.inspector-drill-caption {
  margin: 3px 0 0;
  color: var(--bm-muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.is-drill-highlight {
  outline: 2px solid rgba(212, 164, 55, 0.74);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px rgba(212, 164, 55, 0.12);
}

tr.is-drill-highlight td {
  background: var(--bm-gold-soft);
}

.evidence-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.evidence-block.is-shortcut-focus {
  border-color: rgba(213, 164, 52, 0.72);
  box-shadow: 0 0 0 3px rgba(213, 164, 52, 0.14);
}

.evidence-block > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.evidence-block h4 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 0.98rem;
}

.evidence-block > header > strong {
  color: var(--bm-muted);
  font-size: 0.78rem;
}

.evidence-doc-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.evidence-doc-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bm-gold-soft);
  color: #7b5d15;
}

.evidence-doc-card strong,
.evidence-doc-card span {
  display: block;
}

.evidence-doc-card > div:last-child > strong {
  color: var(--bm-ink-strong);
  font-size: 0.94rem;
}

.evidence-doc-card > div:last-child > span {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.evidence-meta-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}

.evidence-meta-list div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
}

.evidence-meta-list dt,
.evidence-meta-list dd {
  margin: 0;
  font-size: 0.8rem;
}

.evidence-meta-list dt {
  color: var(--bm-muted);
  font-weight: 760;
}

.evidence-meta-list dd {
  color: var(--bm-ink);
}

.evidence-ai-note {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(12, 117, 111, 0.22);
  border-radius: 8px;
  background: var(--bm-teal-soft);
}

.evidence-ai-note strong {
  color: var(--bm-teal);
}

.evidence-ai-note span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.line-evidence-list {
  display: grid;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  overflow: hidden;
}

.line-evidence-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--bm-line);
  background: var(--bm-raised);
}

.line-evidence-row:last-child {
  border-bottom: 0;
}

.line-evidence-row strong {
  color: var(--bm-ink-strong);
}

.line-evidence-row span {
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.line-evidence-row.is-warning {
  background: var(--bm-gold-soft);
}

.line-evidence-row.is-selected {
  box-shadow: inset 3px 0 0 var(--bm-gold);
}

.evidence-timeline {
  position: relative;
  display: grid;
  gap: 8px;
}

.client-audit-events {
  display: contents;
}

.evidence-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--bm-line);
}

.evidence-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--bm-teal);
  box-shadow: 0 0 0 4px #eaf6f3;
}

.timeline-dot.tax-dot {
  background: var(--bm-gold);
  box-shadow: 0 0 0 4px var(--bm-gold-soft);
}

.evidence-timeline strong,
.evidence-timeline span {
  display: block;
}

.modal-backdrop[hidden],
.inspector-shell[hidden],
.inspector-section[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 19, 31, 0.34);
}

.ai-suggestion-dialog,
.validation-dialog,
.evidence-wizard-dialog,
.pj-confirm-dialog {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 24px 70px rgba(7, 19, 31, 0.24);
}

.ai-suggestion-dialog header,
.ai-suggestion-dialog footer,
.validation-dialog header,
.validation-dialog footer,
.evidence-wizard-dialog header,
.evidence-wizard-dialog footer,
.pj-confirm-dialog header,
.pj-confirm-dialog footer,
.inspector-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.ai-suggestion-dialog h2,
.validation-dialog h2,
.evidence-wizard-dialog h2,
.pj-confirm-dialog h2,
.inspector-panel h2,
.inspector-section h3 {
  margin: 0;
  color: var(--bm-ink-strong);
}

.ai-suggestion-dialog h2,
.validation-dialog h2,
.evidence-wizard-dialog h2,
.pj-confirm-dialog h2 {
  font-size: 1.24rem;
}

.validation-dialog,
.pj-confirm-dialog {
  width: min(560px, 100%);
}

.pj-confirm-dialog {
  gap: 13px;
  padding: 20px 22px;
}

.pj-confirm-dialog h2 {
  font-size: 1.08rem;
  font-weight: 720;
  letter-spacing: 0;
}

.evidence-wizard-dialog {
  width: min(680px, 100%);
}

.validation-dialog > p {
  margin: 0;
  color: var(--bm-muted);
  line-height: 1.45;
}

.pj-confirm-dialog > p {
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pj-confirm-details[hidden] {
  display: none !important;
}

.pj-confirm-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.46);
}

.pj-confirm-details div {
  min-width: 0;
}

.pj-confirm-details dt {
  margin: 0 0 4px;
  color: var(--bm-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.pj-confirm-details dd {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.pj-confirm-dialog footer {
  justify-content: flex-end;
}

.pj-confirm-support {
  padding: 9px 11px;
  border: 1px solid rgba(212, 164, 55, 0.16);
  border-radius: 8px;
  background: rgba(212, 164, 55, 0.08);
  color: var(--bm-gold-dark) !important;
  font-size: 0.86rem;
  font-weight: 650;
}

.pj-confirm-primary {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(184, 132, 24, 0.34);
  border-radius: 7px;
  background: linear-gradient(180deg, #efd37a, #d8aa3a);
  color: #4a3511;
  font-weight: 720;
  box-shadow: 0 8px 18px rgba(184, 132, 24, 0.14);
}

.validation-dialog.is-ready {
  border-top: 4px solid var(--bm-green);
}

.validation-dialog.is-warning {
  border-top: 4px solid var(--bm-gold);
}

.validation-dialog.is-blocked {
  border-top: 4px solid var(--bm-red);
}

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

.validation-summary-grid article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.validation-summary-grid span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.validation-summary-grid strong {
  color: var(--bm-ink-strong);
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.validation-exception-list {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  padding: 0 10px;
}

.validation-line-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
}

.validation-line-list[hidden] {
  display: none;
}

.validation-line-list > strong {
  color: var(--bm-ink-strong);
  font-size: 0.9rem;
}

.validation-line-list div {
  display: grid;
  gap: 6px;
}

.validation-line-list article {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--bm-line);
  border-radius: 7px;
  background: var(--bm-raised);
}

.validation-line-list article.is-watch {
  border-color: #e0cb89;
  background: var(--bm-gold-soft);
}

.validation-line-list article.is-blocked {
  border-color: #e9c5cc;
  background: var(--bm-danger-soft);
}

.validation-line-list article strong {
  color: var(--bm-ink-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.validation-line-list article span {
  color: var(--bm-ink);
  font-size: 0.86rem;
}

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

.suggestion-grid article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.suggestion-grid span {
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.suggestion-grid strong {
  color: var(--bm-ink-strong);
  font-variant-numeric: tabular-nums;
}

.suggestion-notes {
  margin: 0;
  padding-left: 18px;
  color: var(--bm-ink);
}

.suggestion-notes li + li {
  margin-top: 5px;
}

.ai-suggestion-dialog footer {
  justify-content: flex-end;
}

.validation-dialog footer {
  justify-content: flex-end;
}

.evidence-wizard-step {
  display: grid;
  gap: 14px;
}

.evidence-upload-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.evidence-upload-card strong,
.evidence-upload-card span {
  display: block;
}

.evidence-upload-card strong {
  color: var(--bm-ink-strong);
}

.evidence-upload-card span {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.82rem;
}

.evidence-link-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.evidence-link-options legend {
  margin-bottom: 4px;
  color: var(--bm-ink-strong);
  font-weight: 850;
}

.evidence-link-options label {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  cursor: pointer;
}

.evidence-link-options input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.evidence-link-options span,
.evidence-link-options small {
  grid-column: 2;
}

.evidence-link-options span {
  color: var(--bm-ink-strong);
  font-weight: 850;
}

.evidence-link-options small {
  color: var(--bm-muted);
  line-height: 1.35;
}

.quiet-ai-mapping {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(12, 117, 111, 0.24);
  border-radius: 8px;
  background: var(--bm-teal-soft);
}

.quiet-ai-mapping strong,
.quiet-ai-mapping span {
  display: block;
}

.quiet-ai-mapping strong {
  color: var(--bm-teal);
}

.quiet-ai-mapping span,
.wizard-helper {
  color: var(--bm-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.quiet-ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.wizard-helper {
  margin: 0;
}

.evidence-line-map {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
}

.evidence-line-map-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--bm-line);
  background: var(--bm-surface);
}

.evidence-line-map-row:last-child {
  border-bottom: 0;
}

.evidence-line-map-row input {
  width: 16px;
  height: 16px;
}

.evidence-line-map-row span,
.evidence-line-map-row strong,
.evidence-line-map-row em,
.evidence-line-map-row small {
  display: block;
}

.evidence-line-map-row strong {
  color: var(--bm-ink-strong);
}

.evidence-line-map-row em {
  color: var(--bm-ink);
  font-style: normal;
  font-weight: 760;
}

.evidence-line-map-row small {
  color: var(--bm-muted);
}

.evidence-wizard-dialog footer {
  justify-content: flex-end;
}

.inspector-shell {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 560px);
}

.inspector-backdrop {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(7, 19, 31, 0.2);
}

.inspector-panel {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--bm-line);
  background: var(--bm-surface);
  box-shadow: -18px 0 48px rgba(7, 19, 31, 0.16);
}

.inspector-section {
  display: grid;
  align-content: start;
  gap: 10px;
}

.inspector-section p {
  margin: 0;
  color: var(--bm-muted);
}

.operational-state-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-raised);
}

.operational-state-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--bm-ink-strong);
  font-size: 1.04rem;
}

.operational-state-summary p {
  line-height: 1.45;
}

.operational-state-summary.is-ready {
  border-color: rgba(12, 117, 111, 0.24);
  background: var(--bm-teal-soft);
}

.operational-state-summary.is-warning {
  border-color: rgba(212, 164, 55, 0.38);
  background: var(--bm-gold-soft);
}

.operational-state-summary.is-blocked {
  border-color: rgba(184, 64, 64, 0.24);
  background: #fff1f1;
}

.state-event-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
}

.state-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--bm-line);
  background: var(--bm-surface);
}

.state-event:last-child {
  border-bottom: 0;
}

.state-event-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--bm-line-strong);
}

.state-event strong,
.state-event span {
  display: block;
}

.state-event strong {
  color: var(--bm-ink-strong);
}

.state-event span {
  margin-top: 2px;
  color: var(--bm-muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.state-event.is-current .state-event-dot {
  background: var(--bm-gold);
}

.state-event.is-clear .state-event-dot {
  background: var(--bm-teal);
}

.state-event.is-watch .state-event-dot {
  background: var(--bm-gold);
}

.state-event.is-blocked .state-event-dot {
  background: var(--bm-red);
}

.home-intro {
  max-width: 760px;
  padding: 48px 0;
}

html[data-theme="dark"] .command-bar {
  background: rgba(15, 20, 27, 0.94);
}

html[data-theme="dark"] .app-rail::after {
  background:
    linear-gradient(180deg, rgba(3, 8, 12, 0.96) 0%, rgba(7, 12, 18, 0.88) 54%, rgba(3, 8, 12, 0.97) 100%),
    radial-gradient(circle at 18% 18%, rgba(212, 164, 55, 0.16), transparent 28%);
}

html[data-theme="dark"] .global-search input,
html[data-theme="dark"] .lookup-trigger,
html[data-theme="dark"] .lookup-search,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: var(--bm-control);
  color: var(--bm-ink);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--bm-faint);
}

html[data-theme="dark"] .journal-line-head,
html[data-theme="dark"] th {
  background: #202936;
  color: #c5ceda;
}

html[data-theme="dark"] .journal-line-row,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-color: var(--bm-line);
}

html[data-theme="dark"] .journal-line-row.is-row-warning {
  background: rgba(212, 164, 55, 0.09);
}

html[data-theme="dark"] .journal-line-row.is-row-blocked {
  background: rgba(184, 64, 64, 0.12);
}

html[data-theme="dark"] .field-assist.is-watch {
  color: #e7c96d;
}

html[data-theme="dark"] .field-assist.is-blocked {
  color: #f0a7ad;
}

html[data-theme="dark"] .total-cell,
html[data-theme="dark"] .balance-cell,
html[data-theme="dark"] .journal-actions,
html[data-theme="dark"] .journal-header-panel,
html[data-theme="dark"] .flow-step,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .source-card,
html[data-theme="dark"] .validation-mirror,
html[data-theme="dark"] .posting-state-grid article,
html[data-theme="dark"] .mini-ledger-totals div,
html[data-theme="dark"] .evidence-block,
html[data-theme="dark"] .evidence-doc-card,
html[data-theme="dark"] .evidence-upload-card,
html[data-theme="dark"] .document-upload-panel,
html[data-theme="dark"] .document-connection-panel article,
html[data-theme="dark"] .document-card,
html[data-theme="dark"] .document-learning-strip,
html[data-theme="dark"] .document-work-summary article,
html[data-theme="dark"] .document-result-hero article,
html[data-theme="dark"] .document-suggestion,
html[data-theme="dark"] .document-result-list section,
html[data-theme="dark"] .document-review-message,
html[data-theme="dark"] .document-review-note,
html[data-theme="dark"] .document-facts-grid article,
html[data-theme="dark"] .document-proposal-summary,
html[data-theme="dark"] .document-proposal-table-wrap,
html[data-theme="dark"] .document-result-facts,
html[data-theme="dark"] .document-recurring-suggestion,
html[data-theme="dark"] .xtract-document-summary,
html[data-theme="dark"] .xtract-source-toolbar,
html[data-theme="dark"] .xtract-document-viewer,
html[data-theme="dark"] .xtract-status-card,
html[data-theme="dark"] .xtract-decision-card,
html[data-theme="dark"] .xtract-fact,
html[data-theme="dark"] .xtract-confidence-meter div,
html[data-theme="dark"] .document-suggestion pre,
html[data-theme="dark"] .evidence-line-map-row,
html[data-theme="dark"] .line-evidence-row,
html[data-theme="dark"] .empty-queue,
html[data-theme="dark"] .queue-card,
html[data-theme="dark"] .review-journal-card,
html[data-theme="dark"] .review-journal-meta article,
html[data-theme="dark"] .review-journal-lines,
html[data-theme="dark"] .workflow-summary-grid article,
html[data-theme="dark"] .assurance-list article,
html[data-theme="dark"] .period-card,
html[data-theme="dark"] .suggestion-grid article,
html[data-theme="dark"] .validation-summary-grid article,
html[data-theme="dark"] .validation-line-list,
html[data-theme="dark"] .validation-line-list article,
html[data-theme="dark"] .operational-state-summary,
html[data-theme="dark"] .state-event,
html[data-theme="dark"] .evidence-timeline article {
  background: var(--bm-raised);
}

html[data-theme="dark"] .pj-metrics,
html[data-theme="dark"] .pj-readiness-panel,
html[data-theme="dark"] .pj-table-surface,
html[data-theme="dark"] .pj-side-card,
html[data-theme="dark"] .purchase-upload-panel {
  border-color: var(--bm-line);
  background: rgba(24, 31, 41, 0.88);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .purchase-file-picker {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(32, 41, 54, 0.66);
}

html[data-theme="dark"] .purchase-file-picker:hover,
html[data-theme="dark"] .purchase-file-picker:focus-within {
  border-color: rgba(12, 117, 111, 0.38);
  background: rgba(12, 117, 111, 0.16);
  color: #78d7cf;
}

html[data-theme="dark"] .purchase-reading-card {
  border-color: rgba(212, 164, 55, 0.28);
  border-left-color: var(--bm-gold);
  background: linear-gradient(180deg, rgba(71, 53, 19, 0.38), rgba(15, 23, 42, 0.84));
  box-shadow: none;
}

html[data-theme="dark"] .purchase-reading-card strong {
  color: rgba(248, 250, 252, 0.94);
}

html[data-theme="dark"] .purchase-upload-submit {
  border-color: rgba(212, 164, 55, 0.38);
  background: rgba(212, 164, 55, 0.14);
  color: #f1d27b;
}

html[data-theme="dark"] .pj-readiness-check {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(32, 41, 54, 0.66);
  color: var(--bm-ink-strong);
}

html[data-theme="dark"] .pj-readiness-check.is-clear {
  border-color: rgba(30, 166, 75, 0.28);
  background: rgba(30, 166, 75, 0.1);
  color: #55c878;
}

html[data-theme="dark"] .pj-readiness-check.is-warning {
  border-color: rgba(212, 164, 55, 0.36);
  background: rgba(212, 164, 55, 0.12);
  color: #f1d27b;
}

html[data-theme="dark"] .pj-readiness-check.is-posted {
  border-color: rgba(91, 151, 213, 0.26);
  background: rgba(49, 95, 143, 0.18);
  color: #9ec6ef;
}

html[data-theme="dark"] .pj-why-action {
  border-color: rgba(91, 151, 213, 0.28);
  background: rgba(49, 95, 143, 0.16);
  color: #9ec6ef;
}

html[data-theme="dark"] .pj-why-action:hover {
  border-color: rgba(91, 151, 213, 0.42);
  background: rgba(49, 95, 143, 0.24);
}

html[data-theme="dark"] .pj-why-row td {
  background: rgba(49, 95, 143, 0.09);
}

html[data-theme="dark"] .pj-why-panel {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(32, 41, 54, 0.76);
}

html[data-theme="dark"] .pj-why-support span {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(24, 31, 41, 0.66);
}

html[data-theme="dark"] .pj-why-source-link {
  border-color: rgba(158, 198, 239, 0.24);
  background: rgba(49, 95, 143, 0.16);
  color: #9ec6ef;
}

html[data-theme="dark"] .pj-table th,
html[data-theme="dark"] .pj-smart-action,
html[data-theme="dark"] .pj-side-link {
  background: rgba(32, 41, 54, 0.72);
}

html[data-theme="dark"] .pj-assistant-prompts button {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(32, 41, 54, 0.72);
  color: #9ec6ef;
}

html[data-theme="dark"] .pj-assistant-prompts button:hover {
  border-color: rgba(212, 164, 55, 0.45);
  background: rgba(212, 164, 55, 0.14);
  color: #f1d27b;
}

html[data-theme="dark"] .pj-intelligence-timeline li {
  border-left-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .pj-intelligence-timeline li::before {
  border-color: rgba(24, 31, 41, 0.98);
}

html[data-theme="dark"] .pj-column-info::after {
  border-color: var(--bm-line);
  background: rgba(24, 31, 41, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  color: var(--bm-ink);
}

html[data-theme="dark"] .pj-edit-row td {
  background: linear-gradient(180deg, rgba(49, 95, 143, 0.14), rgba(24, 31, 41, 0.92));
}

html[data-theme="dark"] .preview-strip {
  background: rgba(12, 117, 111, 0.08);
}

html[data-theme="dark"] .drill-context-card {
  border-color: rgba(212, 164, 55, 0.38);
  background: rgba(212, 164, 55, 0.12);
}

html[data-theme="dark"] .truth-strip,
html[data-theme="dark"] .evidence-strip {
  background: var(--bm-surface);
}

html[data-theme="dark"] .plain-button,
html[data-theme="dark"] .row-drill-button,
html[data-theme="dark"] .system-health-chip,
html[data-theme="dark"] .view-menu summary,
html[data-theme="dark"] .view-menu-panel,
html[data-theme="dark"] .action-menu,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .period-pill,
html[data-theme="dark"] .lookup-option {
  background: var(--bm-surface);
  color: var(--bm-ink);
}

html[data-theme="dark"] .queue-state-pill.posted {
  border-color: var(--bm-line);
  background: var(--bm-surface);
  color: var(--bm-ink-strong);
}

html[data-theme="dark"] .review-journal-line-head {
  background: #202936;
  color: #c5ceda;
}

html[data-theme="dark"] .review-journal-line-row {
  border-color: var(--bm-line);
}

html[data-theme="dark"] .row-drill-primary {
  border-color: rgba(212, 164, 55, 0.48);
  background: rgba(212, 164, 55, 0.14);
  color: #f1d27b;
}

html[data-theme="dark"] tr.is-drill-highlight td {
  background: rgba(212, 164, 55, 0.12);
}

html[data-theme="dark"] .system-health-chip {
  border-color: rgba(30, 166, 75, 0.35);
  color: #9be7b3;
}

html[data-theme="dark"] .post-gate-button:disabled {
  border-color: var(--bm-green-dark);
  background: var(--bm-green);
  color: #ffffff;
}

html[data-theme="dark"] .xtract-status-card.is-primary,
html[data-theme="dark"] .xtract-proposal-message {
  background: linear-gradient(180deg, rgba(12, 117, 111, 0.14), var(--bm-raised));
}

html[data-theme="dark"] .xtract-impact-summary {
  border-color: var(--bm-line);
  background: var(--bm-surface);
}

html[data-theme="dark"] .xtract-accountant-canvas {
  border-color: rgba(255, 255, 255, 0.035);
  background:
    linear-gradient(90deg, rgba(18, 24, 34, 0.62), rgba(15, 20, 28, 0.48)),
    rgba(17, 24, 39, 0.36);
}

html[data-theme="dark"] .xtract-source-panel,
html[data-theme="dark"] .xtract-lines-card,
html[data-theme="dark"] .xtract-impact-card,
html[data-theme="dark"] .xtract-reasoning-disclosure,
html[data-theme="dark"] .xtract-history-disclosure {
  border-color: rgba(255, 255, 255, 0.045);
  background: rgba(20, 27, 38, 0.64);
}

html[data-theme="dark"] .xtract-bottom-actions {
  background: rgba(17, 24, 32, 0.92);
}

html[data-theme="dark"] .xtract-payment-source {
  border-color: rgba(212, 164, 55, 0.34);
  background:
    linear-gradient(90deg, rgba(212, 164, 55, 0.16), rgba(24, 28, 36, 0.84) 48%),
    rgba(17, 24, 32, 0.82);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .xtract-payment-source-icon,
html[data-theme="dark"] .xtract-payment-source-meta span,
html[data-theme="dark"] .xtract-payment-source-meta strong {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .xtract-payment-source-icon:hover,
html[data-theme="dark"] .xtract-payment-source-icon:focus-visible,
html[data-theme="dark"] .xtract-payment-source-icon[aria-expanded="true"] {
  background: rgba(212, 164, 55, 0.18);
  color: var(--bm-ink);
}

html[data-theme="dark"] .xtract-payment-source-copy strong,
html[data-theme="dark"] .xtract-payment-source-choice {
  color: var(--bm-ink);
}

html[data-theme="dark"] .xtract-payment-source-copy small {
  color: var(--bm-muted);
}

html[data-theme="dark"] .xtract-payment-source-choice {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .xtract-payment-source-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(20, 27, 38, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .xtract-payment-source-menu button {
  color: var(--bm-ink);
}

html[data-theme="dark"] .xtract-payment-source-menu button:hover,
html[data-theme="dark"] .xtract-payment-source-menu button:focus-visible,
html[data-theme="dark"] .xtract-payment-source-menu button[aria-selected="true"] {
  background: rgba(212, 164, 55, 0.2);
}

html[data-theme="dark"] .xtract-payment-source-details {
  border-top-color: rgba(212, 164, 55, 0.2);
}

html[data-theme="dark"] .xtract-payment-source-details strong {
  color: rgba(226, 232, 240, 0.86);
}

html[data-theme="dark"] .xtract-add-payment-source {
  background: rgba(212, 164, 55, 0.13);
  color: var(--bm-ink);
}

html[data-theme="dark"] .xtract-source-zoom span {
  background: var(--bm-raised);
}

html[data-theme="dark"] .xtract-document-summary {
  background:
    linear-gradient(90deg, rgba(212, 164, 55, 0.28), rgba(42, 34, 18, 0.88) 48%, rgba(212, 164, 55, 0.18)),
    var(--bm-raised);
  border-color: rgba(212, 164, 55, 0.38);
}

html[data-theme="dark"] .xtract-page-thumb iframe,
html[data-theme="dark"] .xtract-original-document,
html[data-theme="dark"] .xtract-original-document iframe,
html[data-theme="dark"] .purchase-evidence-paper,
html[data-theme="dark"] .purchase-evidence-paper img,
html[data-theme="dark"] .purchase-evidence-inspector-frame,
html[data-theme="dark"] .purchase-evidence-inspector-frame img {
  background: #ffffff;
}

html[data-theme="dark"] .purchase-evidence-surface {
  background: var(--bm-surface);
  background: color-mix(in srgb, var(--bm-surface) 90%, var(--bm-raised));
  box-shadow: none;
}

html[data-theme="dark"] .purchase-bundle-card {
  border-color: rgba(212, 164, 55, 0.34);
  background:
    linear-gradient(180deg, rgba(212, 164, 55, 0.12), rgba(18, 24, 33, 0.94)),
    var(--bm-surface);
  box-shadow: none;
}

html[data-theme="dark"] .purchase-bundle-icon {
  border-color: rgba(212, 164, 55, 0.28);
  background: rgba(212, 164, 55, 0.12);
  color: var(--bm-gold);
}

html[data-theme="dark"] .purchase-bundle-chevron {
  border-color: var(--bm-ink);
}

html[data-theme="dark"] .purchase-bundle-action {
  color: #111827;
}

html[data-theme="dark"] .purchase-bundle-action:hover,
html[data-theme="dark"] .purchase-bundle-action:focus-visible {
  border-color: rgba(212, 164, 55, 0.68);
  background: linear-gradient(180deg, #d5a437, #a87514);
  color: #111827;
}

html[data-theme="dark"] .purchase-inline-action summary {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.82);
}

html[data-theme="dark"] .purchase-inline-action summary:hover,
html[data-theme="dark"] .purchase-inline-action summary:focus-visible,
html[data-theme="dark"] .purchase-inline-action[open] summary {
  border-color: rgba(12, 117, 111, 0.38);
  background: rgba(12, 117, 111, 0.16);
  color: #78d7cf;
}

html[data-theme="dark"] .purchase-inline-action-panel {
  border-color: rgba(12, 117, 111, 0.24);
  background: rgba(15, 23, 42, 0.74);
}

html[data-theme="dark"] .purchase-side-panel-action .purchase-side-panel {
  border-color: rgba(212, 164, 55, 0.28);
  background:
    linear-gradient(180deg, rgba(212, 164, 55, 0.12), rgba(15, 23, 42, 0.96)),
    var(--bm-surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .purchase-side-panel-heading strong {
  color: var(--bm-ink);
}

html[data-theme="dark"] .purchase-inline-action-panel input,
html[data-theme="dark"] .purchase-inline-action-panel select,
html[data-theme="dark"] .purchase-match-field select {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
}

html[data-theme="dark"] .purchase-inline-link {
  color: #78d7cf;
}

html[data-theme="dark"] .purchase-inline-link:hover,
html[data-theme="dark"] .purchase-inline-link:focus-visible {
  background: rgba(12, 117, 111, 0.16);
}

html[data-theme="dark"] .purchase-supplier-match-add,
html[data-theme="dark"] .purchase-supplier-match-list button {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
}

html[data-theme="dark"] .purchase-supplier-match-add {
  border-color: rgba(212, 164, 55, 0.36);
  color: var(--bm-gold);
}

html[data-theme="dark"] .purchase-supplier-match-list button:hover,
html[data-theme="dark"] .purchase-supplier-match-list button:focus-visible,
html[data-theme="dark"] .purchase-supplier-match-add:hover,
html[data-theme="dark"] .purchase-supplier-match-add:focus-visible {
  border-color: rgba(12, 117, 111, 0.34);
  background: rgba(12, 117, 111, 0.14);
}

html[data-theme="dark"] .purchase-supplier-match-workspace summary {
  border-color: rgba(12, 117, 111, 0.28);
  background: rgba(12, 117, 111, 0.12);
  color: #78d7cf;
}

html[data-theme="dark"] .purchase-supplier-match-workspace summary:hover,
html[data-theme="dark"] .purchase-supplier-match-workspace summary:focus-visible,
html[data-theme="dark"] .purchase-supplier-match-workspace[open] summary {
  border-color: rgba(12, 117, 111, 0.42);
  background: rgba(12, 117, 111, 0.18);
  color: #a6eee8;
}

html[data-theme="dark"] .purchase-supplier-match-panel {
  border-color: rgba(12, 117, 111, 0.24);
  background: rgba(15, 23, 42, 0.74);
}

html[data-theme="dark"] .purchase-supplier-match-panel input {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
}

html[data-theme="dark"] .purchase-duplicate-review summary {
  border-color: rgba(212, 164, 55, 0.36);
  background: rgba(212, 164, 55, 0.12);
  color: #f1d27b;
}

html[data-theme="dark"] .purchase-duplicate-review summary:hover,
html[data-theme="dark"] .purchase-duplicate-review summary:focus-visible,
html[data-theme="dark"] .purchase-duplicate-review[open] summary {
  border-color: rgba(212, 164, 55, 0.58);
  background: rgba(212, 164, 55, 0.2);
  color: #ffe6a3;
}

html[data-theme="dark"] .purchase-duplicate-review-panel {
  border-color: rgba(212, 164, 55, 0.28);
  background: rgba(30, 25, 15, 0.74);
}

html[data-theme="dark"] .purchase-duplicate-actions button {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
  color: var(--bm-ink);
}

html[data-theme="dark"] .purchase-duplicate-actions button:hover,
html[data-theme="dark"] .purchase-duplicate-actions button:focus-visible {
  border-color: rgba(12, 117, 111, 0.34);
  background: rgba(12, 117, 111, 0.14);
  color: #78d7cf;
}

html[data-theme="dark"] .purchase-duplicate-actions form:first-child button {
  border-color: rgba(212, 164, 55, 0.36);
  background: rgba(212, 164, 55, 0.14);
  color: #f1d27b;
}

html[data-theme="dark"] .purchase-duplicate-actions form:first-child button:hover,
html[data-theme="dark"] .purchase-duplicate-actions form:first-child button:focus-visible {
  border-color: rgba(212, 164, 55, 0.58);
  background: rgba(212, 164, 55, 0.22);
  color: #ffe6a3;
}

html[data-theme="dark"] .purchase-evidence-surface::before {
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.04), rgba(17, 24, 39, 0.52) 78%),
    linear-gradient(110deg, rgba(212, 164, 55, 0.035), rgba(12, 117, 111, 0.04));
}

html[data-theme="dark"] .purchase-evidence-highlight {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 39, 0.78);
  color: var(--bm-ink);
}

html[data-theme="dark"] .purchase-evidence-reading-lens {
  border-color: rgba(255, 255, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

html[data-theme="dark"] .purchase-evidence-inspector-panel {
  background:
    linear-gradient(180deg, rgba(17, 24, 32, 0.98), rgba(15, 20, 27, 0.98)),
    var(--bm-surface);
  box-shadow: -26px 0 60px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .workbench-toast {
  border-color: rgba(30, 166, 75, 0.38);
  background: rgba(30, 166, 75, 0.16);
  color: #9be7b3;
}

html[data-theme="dark"] .workbench-toast[data-state="warning"] {
  border-color: rgba(212, 164, 55, 0.42);
  background: rgba(212, 164, 55, 0.16);
  color: #e7c96d;
}

html[data-theme="dark"] .lookup-option:hover,
html[data-theme="dark"] .view-menu-panel button:hover {
  background: var(--bm-raised);
}

@media (max-width: 1380px) {
  .daily-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    min-width: 0;
  }

  .app-rail {
    position: relative;
    height: auto;
    grid-template-rows: auto;
    max-width: 100vw;
    min-width: 0;
  }

  .rail-nav {
    grid-auto-flow: column;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .rail-section,
  .rail-status {
    display: none;
  }

  .command-bar {
    grid-template-columns: 1fr;
    max-width: 100vw;
    min-width: 0;
    padding-block: 12px;
  }

  .command-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .gj-topline,
  .ai-entry-panel,
  .entry-meta-grid,
  .grid-tool-row,
  .journal-total-bar,
  .document-upload-panel,
  .xtract-workspace-grid,
  .document-connection-panel,
  .document-upload-form,
  .xtract-upload-form,
  .document-grid,
  .document-facts-grid,
  .document-proposal-summary,
  .document-result-facts,
  .document-work-summary,
  .document-result-hero,
  .xtract-document-summary,
  .xtract-summary-facts,
  .xtract-money-strip,
  .xtract-accountant-canvas,
  .xtract-document-viewer,
  .xtract-paper-boxes,
  .xtract-confidence-strip,
  .xtract-review-layout,
  .xtract-key-facts,
  .xtract-more-fields,
  .xtract-history-grid,
  .xtract-confidence-meter,
  .document-recurring-suggestion,
  .document-learning-strip,
  .source-evidence-topline,
  .source-evidence-overview,
  .source-evidence-actions,
  .evidence-source-grid,
  .evidence-pipeline,
  .evidence-signals-strip,
  .evidence-archive-strip,
  .posting-state-grid,
  .mini-ledger-totals,
  .os-status-strip,
  .purchase-upload-panel,
  .purchase-review-layout,
  .purchase-bundle-summary,
  .pj-commandbar,
  .pj-workspace,
  .pj-metrics,
  .purchase-review-card,
  .purchase-metric-grid,
  .purchase-capture-grid,
  .validation-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .purchase-review-signal {
    justify-content: flex-start;
    grid-column: 1 / -1;
  }

  .purchase-upload-form {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .purchase-bundle-summary {
    gap: 12px;
  }

  .purchase-bundle-copy,
  .purchase-bundle-total,
  .purchase-bundle-state,
  .purchase-bundle-action {
    grid-column: 1 / -1;
  }

  .purchase-bundle-copy strong {
    white-space: normal;
  }

  .purchase-capture-wide {
    grid-column: auto;
  }

  .purchase-review-assist {
    position: static;
  }

  .purchase-intelligence {
    padding-left: 0;
    border-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--bm-line);
  }

  .purchase-evidence-surface {
    min-height: 320px;
  }

  .purchase-evidence-paper,
  .purchase-evidence-paper img,
  .purchase-evidence-placeholder {
    min-height: 240px;
  }

  .purchase-evidence-inspector {
    grid-template-columns: 1fr;
  }

  .purchase-evidence-inspector-backdrop {
    display: none;
  }

  .purchase-evidence-inspector-panel {
    border-left: 0;
  }

  .operational-side-rail {
    position: static;
  }

  .xtract-review-rail {
    position: static;
  }

  .page-actions,
  .ai-entry-actions {
    justify-content: flex-start;
  }

  .quiet-ai-mapping {
    align-items: stretch;
    flex-direction: column;
  }

  .quiet-ai-actions {
    white-space: normal;
  }

  .journal-actions {
    justify-content: flex-start;
  }

  .pj-bulk-form,
  .pj-filter-pills,
  .pj-edit-form header,
  .pj-edit-form footer,
  .pj-table-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .pj-date-window,
  .pj-action-select,
  .pj-primary-action,
  .pj-search {
    width: 100%;
  }

  .pj-action-select {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pj-action-select select {
    width: 100%;
  }

  .pj-edit-strip,
  .pj-edit-grid {
    grid-template-columns: 1fr;
  }

  .pj-edit-strip .supplier-field,
  .pj-edit-strip .wide-field,
  .pj-edit-grid .wide-field {
    grid-column: auto;
  }

  .pj-metric {
    border-right: 0;
    border-bottom: 1px solid var(--bm-line);
  }

  .pj-metric:last-child {
    border-bottom: 0;
  }

  .xtract-party-block,
  .xtract-summary-facts,
  .xtract-money-strip,
  .xtract-overview-panel {
    padding-inline: 0;
    border-left: 0;
  }

  .xtract-bottom-actions {
    left: 12px;
    right: 12px;
    bottom: 0;
  }

  .xtract-bottom-actions,
  .xtract-primary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .evidence-signals-strip header {
    border-right: 0;
    border-bottom: 1px solid var(--bm-line);
    padding: 0 0 12px;
  }

  .evidence-archive-strip {
    justify-items: stretch;
  }

  .xtract-primary-actions,
  .xtract-primary-actions form,
  .xtract-primary-actions button,
  .xtract-create-draft-button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .app-workspace {
    padding: 12px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .entry-command-row {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 10px;
  }

  .global-search,
  .user-chip {
    width: 100%;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .evidence-source-footer,
  .evidence-register-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .source-evidence-topline .gj-title h1 {
    font-size: 1.75rem;
  }

  .source-evidence-topline .gj-title,
  .source-evidence-topline .phase-support-text {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    overflow-wrap: anywhere;
  }

  .source-evidence-topline .phase-support-text span {
    display: block;
  }

  .inspector-shell {
    grid-template-columns: 1fr;
  }

  .inspector-backdrop {
    display: none;
  }
}

/* Source Evidence register cleanup */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-main:has(.source-evidence-shell) .app-workspace {
  padding-top: 24px;
}

.evidence-register-workspace {
  gap: 14px;
}

.evidence-page-header {
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}

.evidence-page-header .gj-title {
  display: grid;
  gap: 5px;
}

.evidence-page-header .gj-title h1 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1.82rem;
  line-height: 1.18;
  font-weight: 820;
  letter-spacing: 0;
}

.evidence-page-header .gj-title p {
  margin: 0;
  color: var(--bm-muted);
  font-size: 0.92rem;
  font-weight: 560;
}

.source-evidence-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.evidence-add-menu summary {
  min-height: 38px;
  border-color: rgba(212, 164, 55, 0.34);
  background: rgba(255, 250, 240, 0.82);
  color: var(--bm-gold-dark);
  font-size: 0.88rem;
  font-weight: 760;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.035);
}

.evidence-drop-form {
  margin: 0;
}

.evidence-drop-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.evidence-drop-zone {
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 16px 20px;
  border: 1px dashed rgba(142, 151, 165, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--bm-ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.evidence-drop-zone:hover,
.evidence-drop-zone.is-dragging,
.evidence-drop-zone.is-processing,
.evidence-drop-zone:focus-within {
  border-color: rgba(212, 164, 55, 0.46);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.045);
}

.evidence-drop-zone.is-processing {
  border-color: rgba(12, 117, 111, 0.34);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.86), rgba(255, 255, 255, 0.94));
}

.evidence-upload-busy .evidence-register-table,
.evidence-upload-busy .evidence-pipeline-card,
.evidence-upload-busy .evidence-live-signals {
  opacity: 0.62;
  pointer-events: none;
}

.evidence-reading-queue {
  display: grid;
  gap: 8px;
}

.evidence-reading-queue[hidden] {
  display: none;
}

.evidence-reading-card {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(212, 164, 55, 0.26);
  border-left: 2px solid var(--bm-gold);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.74), rgba(255, 255, 255, 0.94));
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.032);
}

.evidence-reading-card-notice {
  border-color: rgba(12, 117, 111, 0.24);
  border-left-color: var(--bm-teal);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.86), rgba(255, 255, 255, 0.94));
}

.evidence-reading-card strong {
  display: block;
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-size: 0.86rem;
  font-weight: 740;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-reading-card span {
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 620;
}

.evidence-reading-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bm-teal);
  box-shadow: 0 0 0 0 rgba(12, 117, 111, 0.26);
  animation: bm-reading-pulse 1.2s ease-in-out infinite;
}

.evidence-reading-status {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 117, 111, 0.08);
  color: var(--bm-teal-dark);
  font-size: 0.72rem;
  font-weight: 720;
}

.evidence-drop-zone strong {
  color: var(--bm-ink-strong);
  font-size: 0.96rem;
  font-weight: 760;
}

.evidence-drop-zone span:not(.drop-zone-icon),
.evidence-drop-zone small {
  color: var(--bm-muted);
  font-size: 0.84rem;
  font-weight: 520;
}

.drop-zone-icon {
  width: 30px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  color: #1d2734;
}

.drop-zone-icon .ui-icon {
  width: 26px;
  height: 26px;
  stroke-width: 1.8;
}

.evidence-pipeline-card,
.evidence-live-signals,
.evidence-register-panel {
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: var(--bm-surface);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.045);
}

.evidence-pipeline-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.evidence-pipeline-card header {
  display: block;
  min-width: 0;
}

.evidence-pipeline-card h2,
.evidence-register-panel h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: 1rem;
  font-weight: 780;
}

.evidence-pipeline-card p,
.evidence-register-panel p {
  margin: 4px 0 0;
  color: var(--bm-muted);
  font-size: 0.84rem;
  font-weight: 520;
}

.evidence-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-items: center;
  gap: 12px;
}

.pipeline-step {
  min-height: 62px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 221, 228, 0.82);
  border-radius: 8px;
  background: rgba(247, 248, 250, 0.72);
  text-align: center;
}

.pipeline-step strong {
  font-size: 0.72rem;
  font-weight: 720;
}

.pipeline-step b {
  font-size: 1.34rem;
  font-weight: 760;
  line-height: 1;
}

.pipeline-step.is-new {
  border-color: rgba(49, 95, 143, 0.15);
  background: rgba(231, 238, 247, 0.64);
  color: #115bb5;
}

.pipeline-step.is-extracting {
  border-color: rgba(212, 164, 55, 0.2);
  background: rgba(255, 248, 232, 0.68);
  color: var(--bm-gold-dark);
}

.pipeline-step.is-ready {
  border-color: rgba(30, 166, 75, 0.18);
  background: rgba(230, 246, 236, 0.64);
  color: var(--bm-green-dark);
}

.pipeline-step.is-review {
  border-color: rgba(198, 31, 31, 0.16);
  background: rgba(253, 234, 234, 0.66);
  color: var(--bm-danger);
}

.pipeline-arrow {
  display: none;
}

.evidence-live-signals {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.evidence-live-signals > header,
.evidence-live-signals > span {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-right: 0;
  color: var(--bm-ink);
  font-size: 0.82rem;
  font-weight: 520;
  min-width: 0;
  overflow: hidden;
}

.evidence-live-signals > header {
  color: var(--bm-ink-strong);
  font-weight: 650;
}

.evidence-live-signals .signal-metric {
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-live-signals .signal-metric strong,
.evidence-live-signals .signal-metric em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-live-signals .signal-metric strong {
  flex: 0 0 auto;
  color: var(--bm-ink-strong);
  font-style: normal;
  font-weight: 780;
}

.evidence-live-signals .signal-metric em {
  color: var(--bm-muted);
  font-style: normal;
  font-weight: 500;
}

.evidence-live-signals .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--bm-green-dark);
  stroke-width: 1.9;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  min-height: 8px;
  padding: 0;
  border-right: 0;
  border-radius: 999px;
  background: var(--bm-green);
  box-shadow: 0 0 0 4px rgba(30, 166, 75, 0.11);
}

html[data-theme="dark"] .evidence-add-menu summary {
  border-color: rgba(212, 164, 55, 0.36);
  background: rgba(212, 164, 55, 0.08);
  color: #f2d27a;
  box-shadow: none;
}

html[data-theme="dark"] .evidence-drop-zone {
  border-color: rgba(148, 163, 184, 0.32);
  background-color: #151d27;
  background-image: linear-gradient(180deg, rgba(21, 29, 39, 0.94), rgba(17, 24, 32, 0.94));
  color: var(--bm-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .evidence-drop-zone:hover,
html[data-theme="dark"] .evidence-drop-zone.is-dragging,
html[data-theme="dark"] .evidence-drop-zone.is-processing,
html[data-theme="dark"] .evidence-drop-zone:focus-within {
  border-color: rgba(212, 164, 55, 0.5);
  background-color: #18212d;
  background-image: linear-gradient(180deg, rgba(24, 33, 45, 0.98), rgba(18, 26, 35, 0.98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .drop-zone-icon,
html[data-theme="dark"] .evidence-drop-zone strong {
  color: #f8fafc;
}

html[data-theme="dark"] .evidence-drop-zone span:not(.drop-zone-icon),
html[data-theme="dark"] .evidence-drop-zone small {
  color: #a8b2bf;
}

html[data-theme="dark"] .evidence-reading-card {
  border-color: rgba(212, 164, 55, 0.26);
  border-left-color: var(--bm-gold);
  background: linear-gradient(180deg, rgba(71, 53, 19, 0.34), rgba(15, 23, 42, 0.84));
  box-shadow: none;
}

html[data-theme="dark"] .evidence-reading-card-notice {
  border-color: rgba(20, 184, 166, 0.24);
  border-left-color: var(--bm-teal);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.18), rgba(15, 23, 42, 0.84));
}

html[data-theme="dark"] .evidence-reading-card strong {
  color: rgba(248, 250, 252, 0.94);
}

html[data-theme="dark"] .evidence-reading-card span {
  color: #a8b2bf;
}

html[data-theme="dark"] .evidence-reading-status {
  background: rgba(20, 184, 166, 0.1);
  color: #7dd3c7;
}

html[data-theme="dark"] .evidence-pipeline-card,
html[data-theme="dark"] .evidence-live-signals,
html[data-theme="dark"] .evidence-register-panel {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(23, 29, 37, 0.98), rgba(18, 25, 34, 0.98)),
    var(--bm-surface);
  box-shadow: none;
}

html[data-theme="dark"] .pipeline-step {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 32, 0.82);
}

html[data-theme="dark"] .pipeline-step.is-new {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(37, 99, 235, 0.12);
  color: #7db4ff;
}

html[data-theme="dark"] .pipeline-step.is-extracting {
  border-color: rgba(212, 164, 55, 0.28);
  background: rgba(212, 164, 55, 0.1);
  color: #e7c96d;
}

html[data-theme="dark"] .pipeline-step.is-ready {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(30, 166, 75, 0.13);
  color: #5fd184;
}

html[data-theme="dark"] .pipeline-step.is-review {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(198, 31, 31, 0.12);
  color: #f28b82;
}

html[data-theme="dark"] .evidence-live-signals {
  background:
    linear-gradient(180deg, rgba(23, 31, 42, 0.97), rgba(17, 24, 32, 0.97)),
    var(--bm-surface);
}

html[data-theme="dark"] .evidence-live-signals > header,
html[data-theme="dark"] .evidence-live-signals > span {
  color: #dbe3ec;
}

html[data-theme="dark"] .evidence-live-signals .signal-metric strong {
  color: #f8fafc;
}

html[data-theme="dark"] .evidence-live-signals .signal-metric em {
  color: #a8b2bf;
}

html[data-theme="dark"] .evidence-live-signals .ui-icon {
  color: #4fc978;
}

html[data-theme="dark"] .live-dot {
  background: #35c86f;
  box-shadow: 0 0 0 4px rgba(53, 200, 111, 0.14);
}

.evidence-register-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(185, 190, 198, 0.55);
}

.evidence-register-header {
  align-items: center;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(216, 221, 228, 0.7);
}

.evidence-register-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.document-register-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.document-register-tools .bm-filter-input {
  width: 160px;
  min-width: 160px;
  flex: 0 0 160px;
  min-height: 34px;
  background-color: #fafbfc;
  font-size: 0.84rem;
  font-weight: 620;
}

html[data-theme="dark"] .document-register-tools .bm-filter-input {
  border-color: rgba(148, 163, 184, 0.24);
  background-color: #111820;
  color: #dbe3ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .document-register-tools .bm-filter-input:focus {
  border-color: rgba(212, 164, 55, 0.48);
  outline-color: rgba(212, 164, 55, 0.2);
}

.evidence-table-wrap {
  overflow: auto;
  border-top: 0;
}

.evidence-register-table {
  width: 100%;
  min-width: 1076px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.evidence-register-table th,
.evidence-register-table td {
  vertical-align: middle;
  min-width: 0;
}

.evidence-register-table th {
  height: 46px;
  overflow: hidden;
  background: rgba(247, 248, 250, 0.72);
  color: var(--bm-muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.evidence-register-table td {
  height: auto;
  padding-top: 12px;
  padding-bottom: 12px;
  border-color: rgba(216, 221, 228, 0.64);
  font-size: 0.86rem;
  overflow: visible;
}

.evidence-register-table th:first-child,
.evidence-register-table td:first-child {
  width: 38px;
  text-align: center;
}

.evidence-register-table th:nth-child(2),
.evidence-register-table td:nth-child(2) {
  width: 72px;
}

.evidence-register-table th:nth-child(3),
.evidence-register-table td:nth-child(3) {
  width: 205px;
}

.evidence-register-table th:nth-child(4),
.evidence-register-table td:nth-child(4) {
  width: 138px;
}

.evidence-register-table th:nth-child(5),
.evidence-register-table td:nth-child(5) {
  width: 96px;
}

.evidence-register-table th:nth-child(6),
.evidence-register-table td:nth-child(6) {
  width: 96px;
}

.evidence-register-table th:nth-child(7),
.evidence-register-table td:nth-child(7),
.evidence-register-table th:nth-child(8),
.evidence-register-table td:nth-child(8) {
  width: 88px;
}

.evidence-register-table th:nth-child(9),
.evidence-register-table td:nth-child(9) {
  width: 150px;
  overflow: hidden;
}

.evidence-register-table th:nth-child(10),
.evidence-register-table td:nth-child(10) {
  width: 132px;
}

.evidence-register-table td:nth-child(9),
.evidence-register-table td:nth-child(10) {
  vertical-align: top;
}

.evidence-document-cell {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.evidence-document-cell strong,
.evidence-document-cell small {
  display: block;
  min-width: 0;
}

.evidence-document-cell strong {
  overflow: hidden;
  color: var(--bm-ink-strong);
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-document-cell small {
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-file-icon {
  width: 32px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(216, 221, 228, 0.8);
  border-radius: 7px;
  background: rgba(247, 248, 250, 0.8);
  color: var(--bm-ink-strong);
}

.evidence-file-icon .ui-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.evidence-supplier-cell span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--bm-ink);
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.evidence-type-cell span,
.evidence-amount-cell span,
.evidence-date-cell span,
.evidence-uploaded-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-type-cell span,
.evidence-amount-cell span,
.evidence-date-cell span {
  white-space: nowrap;
}

.evidence-type-cell span {
  color: var(--bm-ink);
}

.evidence-amount-cell span {
  color: var(--bm-ink-strong);
  font-variant-numeric: tabular-nums;
}

.evidence-uploaded-cell span {
  line-height: 1.28;
}

.evidence-status-pill {
  min-height: 22px;
  padding-inline: 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 680;
  max-width: 86px;
  white-space: normal;
  text-align: center;
  line-height: 1.1;
}

.evidence-status-pill.review {
  border-color: rgba(198, 31, 31, 0.2);
  background: var(--bm-danger-soft);
  color: var(--bm-danger);
}

.evidence-signal-list {
  display: grid;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  align-content: start;
  line-height: 1.25;
}

.evidence-signal-list span {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--bm-muted);
  font-size: 0.76rem;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-signal-list span::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--bm-green);
}

.evidence-signal-list .issue::before,
.evidence-signal-list .missing::before,
.evidence-signal-list .low::before {
  background: var(--bm-danger);
}

.evidence-signal-list .duplicate::before,
.evidence-signal-list .medium::before,
.evidence-signal-list .processing::before {
  background: #f3a43b;
}

.evidence-signal-list .confidence {
  color: var(--bm-muted);
}

.evidence-actions-cell {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.evidence-actions-cell form {
  margin: 0;
}

.evidence-actions-cell .row-drill-button {
  width: 90px;
  min-height: 42px;
  padding-inline: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: normal;
  line-height: 1.08;
  text-align: center;
}

.evidence-row-menu {
  position: relative;
}

.evidence-row-menu summary.icon-button {
  list-style: none;
}

.evidence-row-menu summary.icon-button::after {
  display: none;
}

.evidence-register-footer {
  padding: 11px 18px 12px;
  border-top: 1px solid rgba(216, 221, 228, 0.64);
  font-size: 0.82rem;
}

@media (max-width: 1200px) {
  .evidence-pipeline-card,
  .evidence-live-signals {
    grid-template-columns: 1fr;
  }

  .evidence-live-signals > header,
  .evidence-live-signals > span {
    min-height: 46px;
    border-right: 0;
    border-bottom: 1px solid var(--bm-line);
  }

  .evidence-live-signals > span {
    justify-content: flex-start;
  }

  .evidence-live-signals > span:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .evidence-page-header {
    align-items: stretch;
  }

  .source-evidence-actions,
  .document-register-tools {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .source-evidence-actions > *,
  .document-register-tools > * {
    flex: 1 1 auto;
  }

  .evidence-page-header .gj-title h1 {
    font-size: 1.65rem;
  }

  .evidence-drop-zone {
    min-height: 128px;
    padding: 18px 14px;
  }

  .evidence-pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline-arrow {
    display: none;
  }
}

/* Authentication */
.auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(232, 229, 218, 0.78), transparent 18%),
    linear-gradient(180deg, #ffffff, #eef1f5);
  color: var(--bm-ink-strong);
  overflow-x: hidden;
}

.auth-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(520px, 0.95fr) minmax(440px, 0.85fr);
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

.auth-brand-panel {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: space-between;
  gap: 48px;
  padding: clamp(34px, 5vw, 68px);
  overflow: hidden;
  isolation: isolate;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(7, 13, 20, 0.74), rgba(7, 13, 20, 0.88)),
    var(--bm-sidebar-image) center / cover no-repeat;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bm-sidebar-image) center / cover no-repeat;
  filter: saturate(0.9) contrast(1.02);
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, rgba(5, 10, 16, 0.94), rgba(14, 25, 32, 0.74) 52%, rgba(8, 13, 19, 0.9)),
    radial-gradient(circle at 72% 14%, rgba(212, 164, 55, 0.22), transparent 24%);
}

.auth-brand-logo {
  width: min(460px, 82%);
  height: auto;
  display: block;
  mix-blend-mode: screen;
}

.auth-brand-copy {
  max-width: 620px;
  align-self: center;
}

.auth-product-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: #f2c95b;
  font-size: 0.82rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-product-mark span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--bm-gold);
  box-shadow: 0 0 0 8px rgba(212, 164, 55, 0.16);
}

.auth-brand-copy h1 {
  max-width: 620px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(3.1rem, 5.25vw, 5.45rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-brand-copy p {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1.05rem, 1.35vw, 1.32rem);
  line-height: 1.55;
  font-weight: 420;
}

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

.auth-proof-grid article {
  min-height: 132px;
  padding: 22px;
  display: grid;
  align-content: end;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.auth-proof-grid strong {
  display: block;
  color: #ffffff;
  font-size: 1.42rem;
  line-height: 1.1;
  font-weight: 760;
}

.auth-proof-grid span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  line-height: 1.28;
  font-weight: 430;
}

.auth-form-panel {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: clamp(34px, 6vw, 80px);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.auth-card {
  width: min(100%, 620px);
  justify-self: center;
}

.auth-tabs {
  width: fit-content;
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  margin-bottom: 42px;
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  background: #eef2f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-tabs a {
  min-width: 112px;
  padding: 12px 24px;
  border-radius: 999px;
  color: var(--bm-muted);
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1;
}

.auth-tabs a.active {
  color: var(--bm-ink-strong);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.auth-heading h2 {
  margin: 0;
  color: var(--bm-ink-strong);
  font-size: clamp(2.35rem, 4vw, 3.75rem);
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-heading p {
  max-width: 540px;
  margin: 18px 0 34px;
  color: var(--bm-muted);
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 430;
}

.auth-status {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(212, 164, 55, 0.32);
  border-radius: 8px;
  background: rgba(212, 164, 55, 0.12);
  color: #7a5b12;
  font-weight: 560;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  margin: 0;
}

.auth-form label > span,
.auth-options,
.auth-checkbox {
  color: #2f3744;
  font-size: 0.92rem;
  font-weight: 690;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--bm-ink-strong);
  font-size: 1.05rem;
  font-weight: 430;
  outline: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-form input:focus {
  border-color: rgba(212, 164, 55, 0.76);
  box-shadow: 0 0 0 4px rgba(212, 164, 55, 0.14);
}

.auth-form input::placeholder {
  color: #8d94a0;
  font-weight: 400;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 8px;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--bm-gold);
}

.auth-options a {
  color: #8b6a1d;
  font-weight: 720;
  text-decoration: none;
}

.auth-primary,
.auth-provider-row button {
  min-height: 58px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 760;
}

.auth-primary {
  border: 0;
  color: #16120a;
  background: linear-gradient(135deg, #edcf60, #a98424);
  box-shadow: 0 18px 32px rgba(169, 132, 36, 0.22);
}

.auth-primary:hover {
  filter: saturate(1.03) contrast(1.02);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 30px 0 22px;
  color: var(--bm-muted);
  font-size: 0.92rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--bm-line);
}

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

.auth-provider-row button {
  border: 1px solid var(--bm-line);
  background: #ffffff;
  color: #252b36;
}

.auth-provider-row button:hover {
  border-color: var(--bm-line-strong);
  box-shadow: var(--bm-shadow);
}

.auth-note {
  margin: 30px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--bm-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--bm-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 430;
}

@media (max-width: 1120px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    min-height: auto;
    gap: 36px;
  }

  .auth-form-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .auth-brand-panel,
  .auth-form-panel {
    padding: 26px 18px;
  }

  .auth-proof-grid {
    grid-template-columns: 1fr;
  }

  .auth-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-tabs a {
    min-width: 0;
  }

  .auth-options,
  .auth-provider-row {
    grid-template-columns: 1fr;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
  }
}
.chart-readiness,
.chart-import-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid #d9dee7;
    border-radius: 14px;
    background: #f8fafc;
}

.chart-readiness > div { display: flex; gap: .65rem; align-items: baseline; flex-wrap: wrap; }
.chart-onboarding-form, .chart-import-form { margin: 1rem 0; }
.admin-primary-action { margin-top: 1rem; }

.account-dialog {
    width: min(850px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}
.account-dialog::backdrop { background: rgba(15, 23, 42, .58); }
.account-dialog-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1.5rem; }
.account-dialog-form header, .account-dialog-form footer, .account-dialog-wide { grid-column: 1 / -1; }
.account-dialog-form header, .account-dialog-form footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.account-dialog-form footer { justify-content: flex-end; }
.dialog-close { border: 0; background: transparent; font-size: 1.75rem; line-height: 1; }
.account-dialog-form textarea { min-height: 84px; resize: vertical; }
@media (max-width: 700px) { .account-dialog-form { grid-template-columns: 1fr; } .account-dialog-form > * { grid-column: 1; } }
/* Sales: invoice-first, calm operational workspace. */
.sales-shell { width: min(100%, 1480px); margin: 0 auto; padding: 34px 40px 64px; color: var(--ink, #101827); }
.sales-heading, .sales-compose > header, .sales-register > header, .sales-balances > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.sales-heading { margin-bottom: 22px; }
.sales-heading h1 { margin: 2px 0 5px; font-size: clamp(2rem, 3vw, 2.75rem); letter-spacing: -.035em; }
.sales-heading p { margin: 0; color: #667085; }
.sales-heading-summary { min-width: 210px; text-align: right; }
.sales-heading-summary span, .sales-company { display: block; color: #667085; font-size: .82rem; }
.sales-heading-summary strong { display: block; margin-top: 4px; font-size: 1.22rem; }
.sales-compose, .sales-register, .sales-balances { margin-top: 18px; background: #fff; border: 1px solid #dfe4ea; border-radius: 14px; box-shadow: 0 10px 28px rgba(16,24,40,.045); }
.sales-compose > header, .sales-register > header, .sales-balances > header { padding: 19px 22px 16px; border-bottom: 1px solid #e7ebf0; }
.sales-compose h2, .sales-register h2, .sales-balances h2 { margin: 1px 0 0; font-size: 1.12rem; letter-spacing: -.01em; }
.sales-register > header > span, .sales-balances > header > span { color: #667085; font-size: .82rem; }
.sales-invoice-form { display: grid; grid-template-columns: 1.35fr 1.35fr 1fr 1fr; gap: 15px 16px; padding: 20px 22px 22px; }
.sales-field { min-width: 0; }
.sales-field-wide { grid-column: span 2; }
.sales-field-notes { grid-column: span 3; }
.sales-field label { display: flex; justify-content: space-between; margin: 0 0 7px; color: #344054; font-size: .78rem; font-weight: 650; }
.sales-field label span { color: #98a2b3; font-weight: 500; }
.sales-field input, .sales-field select { width: 100%; height: 43px; border: 1px solid #d7dde5; border-radius: 8px; background: #fff; padding: 0 12px; color: #182230; font: inherit; font-size: .9rem; outline: none; }
.sales-field input:focus, .sales-field select:focus { border-color: #c99516; box-shadow: 0 0 0 3px rgba(217,164,34,.12); }
.sales-money { display: flex; align-items: center; height: 43px; border: 1px solid #d7dde5; border-radius: 8px; overflow: hidden; }
.sales-money:focus-within { border-color: #c99516; box-shadow: 0 0 0 3px rgba(217,164,34,.12); }
.sales-money span { padding: 0 10px; color: #667085; font-size: .78rem; border-right: 1px solid #e5e9ef; }
.sales-money input { height: 41px; border: 0; border-radius: 0; text-align: right; box-shadow: none !important; }
.sales-compose-action { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding-top: 3px; }
.sales-compose-action span { margin-right: auto; color: #667085; font-size: .8rem; }
.sales-primary, .sales-primary-small { border: 1px solid #c8900b !important; background: linear-gradient(135deg, #edc34c, #d59b0c) !important; color: #17130a !important; box-shadow: 0 7px 18px rgba(193,137,5,.18); }
.sales-primary { min-height: 43px; border-radius: 8px; padding: 0 19px; font-weight: 700; }
.sales-table-wrap { overflow-x: auto; }
.sales-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.sales-table th { padding: 11px 16px; color: #667085; background: #f8fafc; border-bottom: 1px solid #e5e9ef; font-size: .72rem; font-weight: 650; text-align: left; text-transform: uppercase; letter-spacing: .035em; }
.sales-table td { padding: 14px 16px; border-bottom: 1px solid #edf0f3; color: #344054; vertical-align: middle; }
.sales-table tbody tr:last-child td { border-bottom: 0; }
.sales-table td > strong { display: block; color: #182230; }
.sales-table td > span:not(.sales-status) { display: block; color: #98a2b3; font-size: .75rem; }
.sales-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.sales-table .actions { text-align: right; white-space: nowrap; }
.sales-table form { display: inline; }
.sales-table button { border: 1px solid #d7dde5; border-radius: 7px; background: #fff; padding: 7px 11px; color: #344054; font: inherit; font-weight: 650; }
.sales-status { display: inline-flex; align-items: center; min-height: 25px; border-radius: 999px; padding: 0 9px; background: #f2f4f7; color: #475467; font-size: .75rem; font-weight: 650; }
.sales-status-posted { background: #edf7f2; color: #176b48; }
.sales-status-approved { background: #fff6df; color: #7c5704; }
.sales-status-underreview { background: #eef4ff; color: #315eaa; }
.sales-empty { display: grid; place-items: center; gap: 4px; min-height: 150px; color: #667085; text-align: center; }
.sales-empty strong { color: #344054; }
.sales-balance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.sales-balance-grid article { display: flex; justify-content: space-between; gap: 20px; padding: 17px 22px; border-right: 1px solid #edf0f3; border-bottom: 1px solid #edf0f3; }
.sales-balance-grid article:nth-child(3n) { border-right: 0; }
.sales-balance-grid span { color: #667085; }
.sales-balance-grid strong { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .sales-invoice-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sales-field-notes { grid-column: span 2; } .sales-balance-grid { grid-template-columns: 1fr 1fr; } .sales-balance-grid article:nth-child(3n) { border-right: 1px solid #edf0f3; } }
@media (max-width: 720px) { .sales-shell { padding: 24px 16px 48px; } .sales-heading { align-items: flex-start; } .sales-heading-summary { display: none; } .sales-invoice-form { grid-template-columns: 1fr; } .sales-field-wide, .sales-field-notes { grid-column: auto; } .sales-compose-action { align-items: stretch; flex-direction: column; } .sales-balance-grid { grid-template-columns: 1fr; } }

/* Sales workspace — action-first, calm-density BooksMate experience. */
.sales-workspace { width: min(100%, 1480px); margin: 0 auto; padding: 34px 40px 64px; color: var(--ink, #101827); }
.sales-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.sales-page-header h1 { margin: 0 0 5px; font-size: clamp(2rem,3vw,2.65rem); letter-spacing: -.035em; }
.sales-page-header p { margin: 0; color: #667085; }
.sales-signal-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; background: #fff; border: 1px solid #dfe4ea; border-radius: 14px; box-shadow: 0 10px 28px rgba(16,24,40,.04); }
.sales-signal-strip article { padding: 18px 22px; border-right: 1px solid #e7ebf0; }
.sales-signal-strip article:last-child { border: 0; }
.sales-signal-strip span,.sales-signal-strip small { display: block; color: #667085; font-size: .78rem; }
.sales-signal-strip strong { display: block; margin: 5px 0 2px; font-size: 1.22rem; font-variant-numeric: tabular-nums; }
.sales-attention { margin-bottom: 18px; background: #fff; border: 1px solid #e3d7b7; border-radius: 14px; box-shadow: 0 10px 28px rgba(16,24,40,.04); overflow: hidden; }
.sales-attention > header { display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 22px 15px; border-bottom: 1px solid #eee6d3; }
.sales-attention h2 { margin: 2px 0 0; font-size: 1.08rem; }
.sales-attention > header > span { color: #667085; font-size: .8rem; }
.sales-attention-list article { display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #edf0f3; }
.sales-attention-list article:last-child { border: 0; }
.sales-evidence-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff7e2; color: #956900; }
.sales-evidence-copy strong,.sales-evidence-copy span,.sales-evidence-copy small,.sales-confidence span,.sales-confidence small { display: block; }
.sales-evidence-copy span,.sales-evidence-copy small,.sales-confidence { color: #667085; font-size: .78rem; }
.sales-evidence-copy small { margin-top: 3px; }
.sales-confidence { min-width: 132px; text-align: right; }
.sales-confidence span { color: #344054; font-weight: 650; }
.sales-secondary { min-height: 40px; padding: 0 14px; border: 1px solid #d7dde5; border-radius: 8px; background: #fff; color: #344054; font: inherit; font-size: .84rem; font-weight: 650; }
.sales-balances { margin-top: 18px; background: #fff; border: 1px solid #dfe4ea; border-radius: 14px; overflow: hidden; }
.sales-balances summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; cursor: pointer; list-style: none; }
.sales-balances summary strong,.sales-balances summary small { display: block; }
.sales-balances summary small,.sales-balances summary > span:last-child { margin-top: 3px; color: #667085; font-size: .78rem; }
.sales-dialog { width: min(760px,calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 28px 90px rgba(10,18,30,.28); color: #182230; }
.sales-dialog::backdrop { background: rgba(13,24,38,.58); backdrop-filter: blur(3px); }
.sales-dialog .sales-invoice-form { display: block; max-height: calc(100vh - 48px); padding: 0; overflow-y: auto; }
.sales-dialog header { display: flex; justify-content: space-between; gap: 24px; padding: 16px 24px 12px; border-bottom: 1px solid #e7ebf0; }
.sales-dialog header h2 { margin: 2px 0 5px; font-size: 1.42rem; letter-spacing: -.02em; }
.sales-dialog header p,.sales-form-section > p { margin: 0; color: #667085; font-size: .83rem; }
.sales-dialog header > button { align-self: flex-start; width: 34px; height: 34px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; color: #475467; font-size: 1.35rem; }
.sales-form-section { padding: 11px 24px; border-bottom: 1px solid #edf0f3; }
.sales-form-section h3 { margin: 0 0 4px; font-size: .92rem; }
.sales-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px 16px; margin-top: 8px; }
.sales-dialog footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 24px; border-top: 1px solid #edf0f3; background: #fbfcfd; }
.sales-dialog footer > span { margin-right: auto; color: #667085; font-size: .78rem; }
@media (max-width: 800px) { .sales-workspace { padding: 24px 16px 48px; } .sales-signal-strip { grid-template-columns: 1fr; } .sales-signal-strip article { border-right: 0; border-bottom: 1px solid #e7ebf0; } .sales-attention-list article { grid-template-columns: 38px minmax(0,1fr); } .sales-confidence,.sales-attention-list .sales-secondary { grid-column: 2; text-align: left; justify-self: start; } .sales-form-grid { grid-template-columns: 1fr; } .sales-field-wide { grid-column: auto; } .sales-dialog footer > span { display: none; } }
.document-batch-status { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 16px; padding: 15px 18px; border: 1px solid #dfe4ea; border-radius: 12px; background: #fff; }
.document-batch-status strong,.document-batch-status small { display: block; }
.document-batch-status strong { margin: 3px 0; font-size: .9rem; }
.document-batch-status small { color: #667085; font-size: .78rem; }
.document-batch-state { padding: 5px 9px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: .75rem; font-weight: 650; }
.document-batch-state-completed { background: #edf7f2; color: #176b48; }
.document-batch-state-needsattention { background: #fff4e5; color: #8a5a00; }

.sales-workspace .section-kicker { color: var(--bm-gold-dark); }
html[data-theme="dark"] .sales-workspace { color: var(--bm-ink); }
html[data-theme="dark"] .sales-page-header p,
html[data-theme="dark"] .sales-signal-strip span,
html[data-theme="dark"] .sales-signal-strip small,
html[data-theme="dark"] .sales-attention > header > span,
html[data-theme="dark"] .sales-evidence-copy span,
html[data-theme="dark"] .sales-evidence-copy small,
html[data-theme="dark"] .sales-confidence,
html[data-theme="dark"] .sales-balances summary small,
html[data-theme="dark"] .sales-balances summary > span:last-child,
html[data-theme="dark"] .sales-dialog header p,
html[data-theme="dark"] .sales-form-section > p,
html[data-theme="dark"] .sales-dialog footer > span { color: var(--bm-muted); }
html[data-theme="dark"] .sales-signal-strip,
html[data-theme="dark"] .sales-attention,
html[data-theme="dark"] .sales-register,
html[data-theme="dark"] .sales-balances,
html[data-theme="dark"] .sales-dialog { background: var(--bm-surface); border-color: var(--bm-line); color: var(--bm-ink); }
html[data-theme="dark"] .sales-signal-strip article,
html[data-theme="dark"] .sales-attention > header,
html[data-theme="dark"] .sales-attention-list article,
html[data-theme="dark"] .sales-register > header,
html[data-theme="dark"] .sales-table th,
html[data-theme="dark"] .sales-table td,
html[data-theme="dark"] .sales-dialog header,
html[data-theme="dark"] .sales-form-section { border-color: var(--bm-line); }
html[data-theme="dark"] .sales-table th,
html[data-theme="dark"] .sales-dialog footer { background: var(--bm-raised); }
html[data-theme="dark"] .sales-table td,
html[data-theme="dark"] .sales-table td > strong,
html[data-theme="dark"] .sales-attention h2,
html[data-theme="dark"] .sales-evidence-copy strong,
html[data-theme="dark"] .sales-confidence span,
html[data-theme="dark"] .sales-empty strong,
html[data-theme="dark"] .sales-dialog header h2,
html[data-theme="dark"] .sales-form-section h3 { color: var(--bm-ink); }
html[data-theme="dark"] .sales-table td > span:not(.sales-status),
html[data-theme="dark"] .sales-empty,
html[data-theme="dark"] .sales-balance-grid span { color: var(--bm-muted); }
html[data-theme="dark"] .sales-secondary,
html[data-theme="dark"] .sales-dialog header > button { background: var(--bm-control); border-color: var(--bm-line); color: var(--bm-ink); }
html[data-theme="dark"] .sales-evidence-icon { background: var(--bm-gold-soft); color: var(--bm-gold); }
html[data-theme="dark"] .document-batch-status { background: var(--bm-surface); border-color: var(--bm-line); color: var(--bm-ink); }
html[data-theme="dark"] .document-batch-status small { color: var(--bm-muted); }
