:root {
  --bg: #f6f1e8;
  --panel: #ffffff;
  --panel-muted: #fbf8f2;
  --ink: #181818;
  --muted: #746e63;
  --muted-strong: #4c463e;
  --line: #e6dccc;
  --line-soft: #eee5d8;
  --brand: #1c1a17;
  --brand-strong: #0f0e0c;
  --brand-dark: #181510;
  --brand-soft: #eee8dc;
  --surface: #ffffff;
  --surface-soft: #fbf8f2;
  --surface-muted: #f4f6f8;
  --surface-subtle: #f7f9fb;
  --accent: #8a7a66;
  --accent-strong: #6b5d4b;
  --accent-soft: #eee8dc;
  --blue: #315fba;
  --amber: #b76519;
  --red: #b84242;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(17, 31, 42, 0.05);
  --shadow-md: 0 12px 30px rgba(17, 31, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(17, 31, 42, 0.14);
  --shadow-hover: 0 16px 38px rgba(17, 31, 42, 0.11);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.settlement-metrics {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  margin: 16px 0;
}

.settlement-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.deal-report-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(260px, 1fr) max-content;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.risk-report-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(240px, 0.9fr) minmax(220px, auto);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.reversal-request-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) max-content;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.deal-report-row.selected {
  border-color: var(--accent, #2864dc);
  box-shadow: inset 3px 0 0 var(--accent, #2864dc);
}

.deal-report-row h4,
.risk-report-row h4,
.reversal-request-row h4,
.settlement-confirmation h4,
.finance-detail-sections h4 {
  margin: 7px 0;
  letter-spacing: 0;
}

.deal-report-number-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.deal-report-number-link:hover,
.deal-report-number-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.deal-report-row p,
.deal-report-row small,
.risk-report-row p,
.risk-report-row small,
.reversal-request-row p,
.reversal-request-row small {
  margin: 4px 0 0;
  color: var(--muted);
}

.settlement-readiness {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 7px;
}

.deal-report-row .settlement-readiness {
  min-width: 260px;
}

.deal-report-row .inline-actions,
.risk-report-row .inline-actions,
.reversal-request-row .inline-actions {
  justify-content: flex-end;
  margin-bottom: 0;
}

.deal-report-row .inline-action,
.risk-report-row .inline-action,
.reversal-request-row .inline-action {
  margin-bottom: 0;
  white-space: nowrap;
}

.deal-report-row > .inline-action {
  justify-self: end;
}

.deal-report-row .inline-action {
  white-space: nowrap;
}

.risk-report-row .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reversal-request-row .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settlement-readiness span {
  font-size: 12px;
  color: var(--muted);
}

.settlement-readiness b {
  display: block;
  margin-top: 2px;
  color: var(--success, #167850);
}

.settlement-detail,
.settlement-confirmation,
.reversal-list {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.settlement-detail-grid,
.finance-detail-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settlement-detail-grid > div,
.finance-detail-sections > article,
.settlement-form-grid > article {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
}

.settlement-detail-grid span,
.settlement-detail-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.settlement-detail-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 18px;
}

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

.step-index {
  color: var(--accent, #2864dc);
  font-size: 12px;
  font-weight: 700;
}

.settlement-form-grid dl,
.finance-detail-sections dl {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr;
  gap: 7px 10px;
  margin: 10px 0 0;
  font-size: 13px;
}

.settlement-form-grid dt,
.finance-detail-sections dt {
  color: var(--muted);
}

.settlement-form-grid dd,
.finance-detail-sections dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.settlement-split-list {
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.settlement-split-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.voucher-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.backoffice-report-detail .workflow-heading {
  align-items: flex-start;
}

.backoffice-report-grid {
  margin-top: 12px;
}

.detail-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.36);
}

.detail-drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 92vw);
  height: 100vh;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -22px 0 56px rgba(15, 23, 42, 0.24);
}

.detail-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-drawer-header h3 {
  margin: 3px 0 8px;
  letter-spacing: 0;
}

.detail-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 20px 0;
}

.detail-drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}

.backoffice-detail-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.backoffice-detail-tabs .page-tab {
  flex: 0 0 auto;
}

.backoffice-detail-tab-content {
  min-height: 260px;
}

.backoffice-report-detail.compact {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.backoffice-report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.backoffice-report-summary-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}

.backoffice-report-summary-grid span,
.backoffice-report-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.backoffice-report-summary-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-detail-card {
  margin-top: 12px;
}

.stage-b1-exception-panel {
  min-height: 0;
  margin-top: 12px;
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line-soft));
  background: color-mix(in srgb, var(--brand) 4%, #fff);
}

.stage-b1-exception-panel .detail-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stage-b1-exception-panel details {
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.stage-b1-exception-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.stage-b1-timeline {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.stage-b1-timeline li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.stage-b1-timeline li strong,
.stage-b1-timeline li small {
  margin: 0;
}

.stage-b1-timeline li em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.detail-collapse {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.detail-collapse summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 700;
}

.detail-collapse > :not(summary) {
  margin: 0 14px 14px;
}

.finance-performance-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.finance-performance-shortcut h4 {
  margin: 4px 0 6px;
}

.audit-mini-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.performance-table-shell {
  overflow-x: auto;
}

.performance-ledger-scroll {
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.performance-ledger-table {
  min-width: 1280px;
}

.performance-ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

.performance-ledger-table th:last-child,
.performance-ledger-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.tone-pending { color: #9a6700; border-color: #f2cf87; background: #fff7df; }
.tone-processing { color: #1d4ed8; border-color: #b8d4ff; background: #edf5ff; }
.tone-success { color: #167447; border-color: #a9dec1; background: #ecf9f0; }
.tone-danger { color: #b42318; border-color: #f0b4ae; background: #fff0ef; }
.tone-muted, .tone-neutral { color: var(--muted-strong); border-color: var(--line-soft); background: var(--panel-muted); }

@media (max-width: 760px) {
  .detail-drawer-panel {
    width: 100vw;
  }

  .detail-drawer-header,
  .finance-performance-shortcut {
    flex-direction: column;
  }

  .backoffice-report-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .finance-lock-scroll-list {
    max-height: 480px;
  }
}

.settlement-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.finance-settlement-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(560px, 1.6fr);
  min-height: 560px;
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.finance-settlement-queue {
  padding: 14px;
  border-right: 1px solid var(--line-soft);
  background: var(--surface-subtle, #f8fafc);
  overflow: auto;
}

.queue-head,
.finance-settlement-item > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-settlement-item {
  width: 100%;
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface, #fff);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.finance-settlement-item:hover,
.finance-settlement-item.active {
  border-color: var(--accent, #2864dc);
}

.finance-settlement-item i,
.finance-settlement-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.finance-settlement-detail {
  padding: 18px;
  overflow: auto;
  max-height: min(760px, calc(100vh - 280px));
}

.finance-lock-grid {
  align-items: start;
}

.finance-lock-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.finance-lock-scroll-list {
  max-height: min(680px, calc(100vh - 360px));
  overflow-y: auto;
  padding-right: 6px;
}

.finance-lock-list-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  background: var(--surface-subtle, #f8fafc);
  border-bottom: 1px solid var(--line-soft);
}

.finance-detail-sections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.finance-detail-summary-card {
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface, #fff);
}

.finance-detail-summary-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-detail-summary-card strong {
  display: block;
  color: var(--ink);
}

.finance-detail-summary-card p {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.finance-detail-action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 0 0;
  background: var(--surface-subtle, #f8fafc);
  border-top: 1px solid var(--line-soft);
}

.review-flow-panel {
  grid-column: 1 / -1;
}

.review-flow-panel .review-timeline span {
  display: grid;
  gap: 3px;
}

.review-flow-panel .review-timeline small {
  color: var(--muted);
}

.settlement-progress {
  margin-top: 14px;
}

.settlement-progress span {
  display: grid;
  gap: 3px;
}

.settlement-progress small {
  color: var(--muted);
}

.review-flow-panel .review-timeline .approved {
  color: var(--success, #167850);
}

.queue-empty {
  padding: 40px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .settlement-form-grid,
  .settlement-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-settlement-shell {
    grid-template-columns: 1fr;
  }

  .finance-lock-grid {
    grid-template-columns: 1fr;
  }

  .finance-detail-summary-grid {
    grid-template-columns: 1fr;
  }

  .finance-settlement-queue {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

@media (max-width: 900px) {
  .deal-report-row,
  .risk-report-row,
  .reversal-request-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .deal-report-row .inline-action,
  .risk-report-row .inline-actions,
  .reversal-request-row .inline-actions {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .deal-report-row > .inline-action {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .settlement-form-grid,
  .settlement-detail-grid,
  .finance-detail-sections {
    grid-template-columns: 1fr;
  }

  .settlement-form-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }
}

.station-workspace {
  display: grid;
  gap: 18px;
}

.station-page-head {
  align-items: flex-end;
}

.station-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.station-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 16px;
}

.station-task-card,
.station-card,
.station-boundary-grid article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.station-task-card {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.station-task-card + .station-task-card {
  margin-top: 8px;
}

.station-task-card p,
.station-card p,
.station-boundary-grid p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.station-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.station-card h4 {
  margin: 10px 0 0;
  font-size: 17px;
}

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

.station-card dt {
  color: var(--muted);
  font-size: 12px;
}

.station-card dd {
  margin: 3px 0 0;
  font-weight: 650;
}

.station-booking-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.station-booking-form label {
  display: grid;
  gap: 7px;
}

.station-booking-form label > span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.station-booking-form input,
.station-booking-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface, #fff);
  color: var(--ink);
  padding: 0 10px;
}

.offline-service-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.offline-service-form label {
  display: grid;
  align-content: start;
  gap: 7px;
}

.offline-service-form label > span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.offline-service-form input,
.offline-service-form select,
.offline-service-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.offline-service-form textarea {
  min-height: 88px;
  resize: vertical;
}

.offline-service-form .wide,
.offline-form-actions {
  grid-column: 1 / -1;
}

.offline-service-form .check-field {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.offline-service-form .check-field input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.offline-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.offline-form-actions span {
  color: var(--muted);
  font-size: 12px;
}

.record-type-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-type-summary span {
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--muted-strong);
  font-size: 12px;
}

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

.station-boundary-grid article {
  padding: 18px;
}

.station-boundary-grid article:last-child {
  border-color: rgba(185, 74, 72, .28);
}

@media (max-width: 1100px) {
  .station-metrics,
  .station-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .station-two-column,
  .station-booking-form,
  .offline-service-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .offline-service-form,
  .station-card-grid {
    grid-template-columns: 1fr;
  }

  .offline-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .property-media-gallery {
    min-height: 0;
  }

  .property-gallery-main,
  .property-gallery-main > img,
  .property-gallery-main > .property-gallery-placeholder {
    min-height: 220px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 320px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button,
select,
input {
  outline: none;
}

button {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--focus);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

.toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(37, 111, 76, 0.28);
  border-radius: 8px;
  background: #f5fbf7;
  color: #174e35;
  box-shadow: 0 14px 36px rgba(18, 31, 25, 0.16);
}

.toast-host[data-type="error"] {
  border-color: rgba(176, 61, 58, 0.3);
  background: #fff7f6;
  color: #9f302f;
}

.result-card-host {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1150;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
}

.result-card-host > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #bed8c8;
  border-radius: 8px;
  background: #f8fcf9;
  box-shadow: 0 16px 42px rgba(21, 42, 31, 0.18);
}

.result-card-host p {
  margin: 3px 0 0;
  color: var(--muted);
}

.action-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 22, 20, 0.48);
}

.action-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 24px 70px rgba(15, 18, 16, 0.24);
}

.action-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.action-dialog > p {
  margin: 10px 0 18px;
  color: var(--muted);
  white-space: pre-line;
}

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

.action-dialog-fields label:not(.check-field) {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
}

.action-dialog-fields label:has(textarea) {
  grid-column: 1 / -1;
}

.action-dialog-fields input,
.action-dialog-fields select,
.action-dialog-fields textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft, #fafafa);
  color: var(--ink);
  font: inherit;
}

.action-dialog-fields textarea {
  min-height: 84px;
  resize: vertical;
}

.action-dialog-readonly {
  grid-column: 1 / -1;
}

.bank-reversal-impact {
  border: 1px solid var(--line-soft);
  background: var(--surface-soft, #fafafa);
  padding: 14px;
  border-radius: 8px;
}

.bank-reversal-impact.is-blocked {
  border-color: rgba(185, 74, 72, 0.32);
  background: rgba(185, 74, 72, 0.05);
}

.bank-reversal-impact .detail-card-title h4 {
  margin: 2px 0 0;
  font-size: 15px;
}

.bank-reversal-impact > p,
.bank-reversal-impact li p,
.bank-reversal-impact li small {
  margin: 5px 0 0;
}

.impact-blockers {
  margin: 10px 0;
  padding: 10px 12px 10px 30px;
  color: var(--red);
  background: rgba(185, 74, 72, 0.06);
  border-radius: 6px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.check-field input {
  width: 18px;
  min-height: 18px;
}

.governed-empty-state {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 24px;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft, #fafafa);
}

.empty-state-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ec;
  color: #245f45;
  font-size: 20px;
}

.governed-empty-state h3,
.governed-empty-state p {
  margin: 0 0 6px;
}

.governed-empty-state small {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.filter-stack {
  display: grid;
  gap: 8px;
}

.filter-bar button.active {
  border-color: #286949;
  background: #eaf4ee;
  color: #1d573b;
  font-weight: 700;
}

.selected-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.disabled-action,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none !important;
}

@media (max-width: 720px) {
  .action-dialog-fields {
    grid-template-columns: 1fr;
  }

  .action-dialog-fields label:has(textarea) {
    grid-column: auto;
  }

  .result-card-host > div {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .result-card-host .inline-actions {
    grid-column: 1 / -1;
  }

  .toast-host {
    right: 16px;
    bottom: 16px;
  }

  .selected-filters {
    align-items: flex-start;
    flex-direction: column;
  }
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(28, 26, 23, 0.96), rgba(59, 53, 46, 0.92)),
    radial-gradient(circle at 18% 16%, rgba(214, 181, 107, 0.24), transparent 30%),
    var(--bg);
}

.login-visual {
  color: #fbf6e9;
}

.login-brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border: 1px solid rgba(214, 181, 107, 0.56);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5c775;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-visual h1 {
  max-width: 560px;
  margin: 8px 0 12px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.96;
}

.login-visual p:not(.eyebrow) {
  max-width: 500px;
  color: rgba(251, 246, 233, 0.72);
  font-size: 18px;
  line-height: 1.7;
}

.login-proof-grid {
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 34px;
}

.login-proof-grid span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 181, 107, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(251, 246, 233, 0.82);
  font-weight: 800;
}

.login-panel {
  width: 100%;
  max-width: 460px;
  justify-self: end;
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(214, 181, 107, 0.28);
  border-radius: 10px;
  background: #fbf8f0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-panel h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

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

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.login-submit,
.test-account-toggle {
  min-height: 44px;
  border: 1px solid #1c1a17;
  border-radius: var(--radius);
  background: #1c1a17;
  color: #fff9eb;
  font-weight: 900;
  cursor: pointer;
}

.test-account-toggle {
  background: #fff;
  color: #1c1a17;
}

.device-auth-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.device-auth-toggle:hover {
  color: var(--brand-strong);
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #ad3f34;
  font-size: 13px;
  font-weight: 800;
}

.backend-status {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.backend-status::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #8b8f95;
  content: "";
  flex: 0 0 auto;
}

.backend-status[data-status="connected"] {
  border-color: rgba(35, 125, 82, 0.22);
  color: #237d52;
}

.backend-status[data-status="connected"]::before {
  background: #237d52;
}

.backend-status[data-status="disconnected"] {
  border-color: rgba(185, 74, 72, 0.22);
  background: rgba(185, 74, 72, 0.06);
  color: var(--red);
}

.backend-status[data-status="disconnected"]::before {
  background: var(--red);
}

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

.test-account-panel {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.device-auth-panel {
  display: grid;
  gap: 10px;
}

.quick-login-unlock-panel {
  display: grid;
}

.quick-login-unlock-form {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

.quick-login-unlock-form > label {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.quick-login-unlock-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.quick-login-unlock-form input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
}

.quick-login-unlock-form button {
  min-width: 64px;
  border: 0;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.device-auth-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.device-auth-card strong {
  font-size: 13px;
}

.device-auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.device-auth-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.device-auth-actions button:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.test-device-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.test-device-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.test-device-form label.wide {
  grid-column: span 2;
}

.test-device-form input {
  min-height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.test-device-feature-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.test-device-feature-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
}

.test-device-table {
  margin-top: 12px;
}

.test-account-group {
  display: grid;
  gap: 8px;
}

.test-account-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.test-account-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.test-account-card strong,
.test-account-card small {
  display: block;
}

.test-account-card small,
.test-account-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.test-account-actions {
  display: grid;
  gap: 8px;
  min-width: 92px;
}

.test-account-card button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  background: #fff8e6;
  color: #7a5a12;
  font-weight: 900;
  cursor: pointer;
}

.test-account-card button[data-copy-credential] {
  border-color: var(--line-soft);
  background: #fff;
  color: var(--muted-strong);
}

.forgot-password {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.app-shell.auth-hidden {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    var(--brand-dark);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 18px;
  padding: 0 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aab8c6;
  font-size: 12px;
}

.module-nav {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-button,
.nav-child-button,
.nav-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #c8d3df;
  text-align: left;
  cursor: pointer;
}

.nav-group-button {
  min-height: 38px;
  color: #d3deea;
}

.nav-group-button:hover,
.nav-group.active .nav-group-button,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-group.active .nav-group-button,
.nav-button.active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm);
}

.nav-chevron {
  color: #91a2b2;
  font-size: 16px;
}

.nav-children {
  display: none;
  gap: 3px;
  margin-left: 15px;
  padding: 2px 0 4px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-children.expanded {
  display: grid;
}

.nav-child-button {
  min-height: 34px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 9px;
  border-radius: 9px;
  color: #aebdcc;
}

.nav-child-button:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.nav-child-button.active {
  border-color: rgba(243, 213, 141, 0.2);
  background: rgba(243, 213, 141, 0.12);
  color: #fff;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #9fb0bf;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-group-button:hover .nav-icon,
.nav-group.active .nav-icon,
.nav-button:hover .nav-icon {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f3d58d;
}

.nav-group.active .nav-icon,
.nav-button.active .nav-icon {
  border-color: rgba(243, 213, 141, 0.28);
  background: rgba(243, 213, 141, 0.12);
  color: #f3d58d;
}

.nav-child-button small,
.nav-button small {
  color: #91a2b2;
  font-size: 11px;
}

.sidebar-account {
  margin-top: auto;
  padding: 14px 6px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-account-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #f4d889;
  font-size: 13px;
  font-weight: 900;
}

.sidebar-account-name,
.sidebar-account-workspace {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account-name {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.sidebar-account-workspace {
  margin-top: 3px;
  color: #91a2b2;
  font-size: 12px;
}

.sidebar-logout-button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #aab8c6;
  text-align: left;
  cursor: pointer;
}

.sidebar-logout-button:hover {
  background: rgba(184, 66, 66, 0.12);
  color: #ffb5b5;
}

.sidebar-logout-button:active {
  transform: translateY(1px);
}

.sidebar-logout-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  line-height: 1;
}

.workspace {
  min-width: 0;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 28px;
}

.topbar,
.hero-panel,
.main-grid,
.design-grid {
  display: grid;
  gap: 16px;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px) minmax(210px, 260px) auto;
  align-items: center;
  margin: -22px -24px 16px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid rgba(219, 228, 234, 0.8);
  background: rgba(242, 245, 246, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.global-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: end;
}

.global-tools label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.global-tools input {
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.global-search-results {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.global-results-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.global-results-head span {
  color: var(--muted);
}

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

.global-result {
  min-height: 82px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e4e9ef;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.global-result:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
  background: #fff;
}

.global-result span,
.global-result small {
  color: var(--muted);
}

.notification-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.notification-center {
  display: grid;
  gap: 12px;
}

.notification-center .global-results-head > div {
  display: grid;
  gap: 2px;
}

.notification-center .global-results-head > div span {
  font-size: 12px;
}

.notification-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-filters button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted-strong);
  cursor: pointer;
}

.notification-filters button.active,
.notification-filters button:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, transparent);
  background: var(--brand-soft);
  color: var(--brand);
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.notification-card.priority-high {
  border-left-color: var(--red);
}

.notification-card.priority-medium {
  border-left-color: var(--amber);
}

.notification-card.read {
  background: var(--panel-muted);
}

.notification-main {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notification-main span,
.notification-main small {
  color: var(--muted);
  line-height: 1.45;
}

.workspace-switcher {
  position: relative;
  display: grid;
  gap: 6px;
}

.workspace-current {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.workspace-current span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.workspace-current b {
  color: var(--brand);
  font-size: 14px;
}

.workspace-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  width: min(360px, 86vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
}

.workspace-option {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.workspace-option:hover,
.workspace-option.active {
  border-color: color-mix(in srgb, var(--brand) 36%, transparent);
  background: var(--surface-soft);
}

.workspace-option small {
  color: var(--muted);
  line-height: 1.45;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.workspace-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.role-login {
  display: grid;
  gap: 6px;
}

.role-login label {
  color: var(--muted);
  font-size: 12px;
}

.role-simulator-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-login select {
  min-width: 188px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  min-height: 176px;
  padding: 22px;
  border: 1px solid rgba(16, 39, 53, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--brand-dark), var(--brand-strong) 52%, color-mix(in srgb, var(--accent) 82%, var(--brand))),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  color: #fff;
  box-shadow: 0 18px 42px rgba(16, 39, 53, 0.12);
}

.hero-panel h2 {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1.18;
}

.hero-panel p {
  max-width: 760px;
  margin-bottom: 0;
  color: #dce9ef;
  line-height: 1.7;
}

.role-card {
  min-height: 124px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  background: rgba(8, 23, 32, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.role-card span,
.role-card p {
  color: #c9d8e2;
}

.role-card strong {
  display: block;
  margin: 10px 0;
  font-size: 24px;
  line-height: 1.2;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.kpi-card {
  min-height: 104px;
  padding: 16px;
  border-top: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  box-shadow: var(--shadow-md);
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--muted);
}

.kpi-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.main-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  margin-bottom: 16px;
}

.main-grid.immersive {
  grid-template-columns: minmax(0, 1fr);
}

.design-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 16px;
}

.panel {
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.large-panel > .panel-header {
  display: none;
}

.workspace-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.breadcrumb-link {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  cursor: pointer;
  padding: 2px 0;
}

.breadcrumb-link:hover {
  color: var(--brand-strong);
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 650;
}

.breadcrumb-separator {
  color: var(--muted);
}

.submodule-scope-header {
  margin: 0 0 18px;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.submodule-scope-header .eyebrow {
  margin-bottom: 4px;
}

.submodule-scope-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.submodule-scope-header p:last-child {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted-strong);
}

.followup-timeline-card {
  border-left: 3px solid var(--brand);
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, transparent);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 14, 12, 0.48);
}

.confirm-dialog {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.confirm-cancel,
.confirm-danger {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.confirm-cancel {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted-strong);
}

.confirm-cancel:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.confirm-danger {
  border: 1px solid rgba(184, 66, 66, 0.28);
  background: rgba(184, 66, 66, 0.08);
  color: var(--red);
  font-weight: 800;
}

.confirm-danger:hover {
  background: rgba(184, 66, 66, 0.14);
  border-color: rgba(184, 66, 66, 0.4);
}

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

.module-detail.property-workspace-shell {
  grid-template-columns: 1fr;
}

.module-detail.module-workspace-shell {
  grid-template-columns: 1fr;
}

.module-summary,
.agent-status-strip,
.cap-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-chip,
.agent-status-strip > div,
.cap-panel > div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
  box-shadow: var(--shadow-sm);
}

.summary-chip span,
.agent-status-strip span,
.cap-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.summary-chip strong,
.agent-status-strip strong,
.cap-panel strong {
  font-size: 20px;
}

.summary-chip.risk {
  border-color: rgba(184, 66, 66, 0.38);
  background: #fff7f7;
}

.summary-chip.warn {
  border-color: rgba(183, 101, 25, 0.38);
  background: #fff9ef;
}

.summary-chip.ok {
  border-color: color-mix(in srgb, var(--brand) 36%, transparent);
  background: var(--brand-soft);
}

.property-workbench {
  display: grid;
  gap: 14px;
}

.business-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.business-path button {
  min-height: 28px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.business-path button:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.business-path i {
  color: var(--muted);
  font-style: normal;
}

.business-path span {
  color: var(--ink);
}

.back-path-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-soft);
}

.icon-back-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.icon-back-button span {
  font-size: 18px;
  line-height: 1;
}

.icon-back-button:hover {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--brand-soft);
}

.icon-back-button.compact {
  width: 34px;
  justify-content: center;
  padding: 0;
}

.high-frequency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.esign-entry {
  min-height: 74px;
  min-width: 180px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.esign-entry > span {
  grid-row: span 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
}

.esign-entry strong {
  margin: 0;
  font-size: 15px;
}

.esign-entry small,
.esign-entry em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.esign-entry:hover {
  border-color: color-mix(in srgb, var(--brand) 46%, transparent);
  background: var(--brand-soft);
}

.esign-entry.static-entry {
  cursor: default;
}

.esign-drawer {
  position: fixed;
  right: 18px;
  top: 78px;
  z-index: 40;
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

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

.drawer-head h3 {
  margin: 0;
}

.template-grid,
.contract-list {
  display: grid;
  gap: 10px;
}

.template-chip,
.contract-card {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.template-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.template-chip span {
  grid-row: span 2;
  color: var(--brand);
  font-size: 18px;
}

.template-chip small,
.contract-card p {
  color: var(--muted);
}

.signer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.signer-list span {
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.agent-workbench,
.workflow-section {
  display: grid;
  gap: 14px;
}

.agent-home-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #f5faf8 100%);
  box-shadow: var(--shadow-sm);
}

.agent-home-head h3 {
  margin: 2px 0 6px;
  font-size: 24px;
}

.agent-home-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.identity-pill {
  flex: 0 0 auto;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

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

.work-metric-card {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  text-align: left;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.work-metric-card:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  background: var(--brand-soft);
}

.work-metric-card span,
.work-metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.work-metric-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

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

.risk-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(183, 101, 25, 0.28);
  border-radius: var(--radius);
  background: #fffaf2;
  box-shadow: var(--shadow-sm);
}

.risk-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.growth-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

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

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

.growth-panel summary span {
  color: var(--ink);
  font-weight: 900;
}

.growth-panel summary b {
  color: var(--muted);
  font-size: 12px;
}

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

.growth-grid > div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.growth-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.growth-grid strong {
  font-size: 18px;
}

.growth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.settings-workspace {
  gap: 16px;
}

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

.account-center-card,
.account-current-card,
.account-boundary-note {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.account-center-card,
.account-current-card {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.account-current-card {
  grid-template-columns: minmax(0, 1fr) auto;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 52%, #fff), #fff 58%),
    var(--panel);
}

.account-center-card span,
.account-current-card span {
  color: var(--muted);
  font-size: 12px;
}

.account-center-card strong,
.account-current-card strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
}

.account-center-card p,
.account-current-card p,
.account-boundary-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.account-boundary-note {
  padding: 14px;
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: var(--accent-soft);
}

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

.workflow-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.todo-list,
.customer-list {
  display: grid;
  gap: 10px;
}

.todo-card,
.customer-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
  box-shadow: var(--shadow-sm);
}

.todo-card:hover,
.customer-card:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  background: #fff;
}

.todo-card > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.todo-card.priority-high > span {
  background: #fbecec;
  color: var(--red);
}

.todo-card.priority-medium > span {
  background: #fff4e3;
  color: var(--amber);
}

.todo-card p,
.customer-card p {
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.45;
}

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

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.customer-profile {
  display: grid;
  gap: 8px;
}

.customer-profile p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.customer-profile p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.customer-profile span {
  color: var(--muted);
}

.customer-profile b {
  color: var(--ink);
  text-align: right;
}

.match-card,
.timeline-card {
  min-height: 0;
  margin-bottom: 10px;
}

.match-score {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.match-score span,
.match-score b {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.match-score span {
  background: var(--brand);
  color: #fff;
}

.match-score b {
  background: var(--brand-soft);
  color: var(--brand);
}

.as-button {
  width: 100%;
  display: block;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.as-button:hover {
  border-color: color-mix(in srgb, var(--brand) 32%, transparent);
  background: #fff;
}

.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.form-row input {
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.property-page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.property-page-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.property-page-head p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.property-actions button,
.text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}

.property-actions button {
  padding: 0 10px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.property-actions button:hover,
.filter-bar button:hover,
.tab-button:hover,
.inline-action:hover {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

.filter-bar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.audit-note {
  padding: 10px 12px;
  border: 1px solid rgba(199, 119, 32, 0.28);
  border-radius: var(--radius);
  background: #fff8ec;
  color: #7a4d18;
  font-size: 13px;
  line-height: 1.5;
}

.text-button {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
}

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

.property-category-card,
.quick-entry,
.property-list-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.property-category-card {
  min-height: 164px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 7px;
  padding: 14px;
}

.property-category-card:hover,
.quick-entry:hover,
.property-list-card:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  background: #fff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.property-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.property-category-card strong {
  font-size: 18px;
}

.property-category-card b {
  color: var(--brand-dark);
  font-size: 20px;
}

.property-category-card small,
.property-list-card small {
  color: var(--muted);
  line-height: 1.45;
}

.property-category-card i {
  color: var(--brand);
  font-style: normal;
  font-weight: 800;
}

.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.quick-entry {
  min-height: 92px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.quick-entry span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #eef3f6;
  color: var(--blue);
  font-weight: 900;
}

.quick-entry b {
  color: var(--muted);
  font-size: 12px;
}

.property-list {
  display: grid;
  gap: 10px;
}

.property-list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 14px;
}

.property-list-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
}

.property-list-card p {
  margin-bottom: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.property-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 220px;
}

.property-badges span {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
}

.detail-card,
.deal-report-row,
.risk-report-row,
.reversal-request-row,
.doc-item,
.schema-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
  box-shadow: var(--shadow-sm);
}

.detail-card {
  min-height: 150px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-card:hover {
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
  background: #fff;
}

.detail-card strong {
  display: block;
  margin-bottom: 8px;
}

.detail-card p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.detail-card small {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-card-grid {
  display: grid;
  gap: 14px;
  align-items: stretch;
}

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

.detail-card-body {
  display: grid;
  gap: 8px;
}

.detail-card-footer,
.detail-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-metric-grid,
.customer-summary-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.detail-metric-card,
.customer-summary-card {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.customer-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-summary-card strong {
  font-size: 22px;
  color: var(--ink);
}

.customer-detail-head {
  gap: 16px;
}

.customer-detail-card {
  min-height: 168px;
}

.customer-detail-card.compact {
  min-height: 140px;
}

.customer-detail-card.large {
  min-height: 220px;
}

.phone-history-list {
  display: grid;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 1100px) {
  .customer-summary-metrics,
  .detail-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.status-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-flow span {
  padding: 7px 10px;
  border: 1px solid #dce7ef;
  border-radius: var(--radius);
  background: #f7fafb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.cap-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.compact-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cap-panel .progress-track {
  grid-column: 1 / -1;
  min-height: 10px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e7edf2;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.cap-panel p {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.inline-action {
  min-height: 32px;
  margin: 0 0 10px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.settlement-list {
  display: grid;
  gap: 10px;
}

.legacy-settlement-row {
  display: grid;
  grid-template-columns: 1fr 56px 98px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
}

.legacy-settlement-row b {
  color: var(--amber);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tab-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f9;
  color: var(--muted);
  font-weight: 800;
}

tbody tr:hover {
  background: #f8fbfa;
}

tr:last-child td {
  border-bottom: 0;
}

.doc-list,
.schema-list {
  display: grid;
  gap: 8px;
}

.doc-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.doc-method {
  color: var(--blue);
  font-weight: 800;
}

.doc-item p,
.schema-item {
  color: var(--muted);
  line-height: 1.55;
}

.schema-item {
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.download-page {
  min-height: 100dvh;
  padding: 28px;
  background: var(--bg);
}

.download-hero,
.download-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.download-hero {
  max-width: 980px;
  margin: 0 auto 16px;
  padding: 28px;
}

.download-hero h1 {
  margin-bottom: 10px;
}

.download-hero p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.download-grid {
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto;
}

.download-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.download-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.download-card p {
  color: var(--muted);
  line-height: 1.6;
}

.download-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.download-link:hover {
  background: var(--brand-strong);
}

.download-card code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: var(--radius);
  background: #f3f6f8;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .module-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel,
  .main-grid,
  .design-grid {
    grid-template-columns: 1fr;
  }

  .property-core-grid,
  .property-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-metric-grid,
  .growth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-center-grid,
  .workflow-columns,
  .customer-detail-grid,
  .detail-card-grid {
    grid-template-columns: 1fr;
  }

  .risk-list {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .login-visual h1 {
    font-size: 42px;
  }

  .detail-card-grid,
  .customer-detail-grid,
  .customer-summary-metrics,
  .detail-metric-grid {
    grid-template-columns: 1fr;
  }

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

  .login-panel {
    max-width: none;
    justify-self: stretch;
  }

  .test-account-card {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    position: static;
    margin: 0 0 12px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .module-nav,
  .kpi-grid,
  .module-detail,
  .work-metric-grid,
  .workflow-columns,
  .customer-detail-grid,
  .risk-list,
  .account-center-grid,
  .growth-grid,
  .property-core-grid,
  .quick-entry-grid,
  .property-detail-grid {
    grid-template-columns: 1fr;
  }

  .agent-home-head,
  .back-path-row,
  .property-page-head,
  .risk-card,
  .notification-card,
  .account-current-card,
  .account-center-card,
  .property-list-card {
    grid-template-columns: 1fr;
  }

  .agent-home-head {
    display: grid;
  }

  .identity-pill {
    max-width: none;
    text-align: left;
  }

  .growth-panel summary {
    display: grid;
  }

  .property-page-head {
    display: grid;
  }

  .back-path-row {
    align-items: flex-start;
    gap: 6px;
  }

  .business-path {
    min-width: 0;
    font-size: 11px;
  }

  .icon-back-button b {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .high-frequency-actions,
  .esign-entry {
    width: 100%;
  }

  .esign-drawer {
    inset: auto 10px 10px;
    top: 72px;
    width: auto;
    max-height: calc(100vh - 86px);
  }

  .property-actions,
  .property-badges {
    justify-content: flex-start;
  }

  .todo-card,
  .customer-card,
  .property-list-card {
    align-items: start;
  }

  .todo-card,
  .customer-card {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    width: 100%;
  }

  .inline-action,
  .property-actions button,
  .filter-bar button {
    min-height: 36px;
  }

  .hero-panel {
    padding: 20px;
  }

  .hero-panel h2 {
    font-size: 28px;
  }

  .download-page {
    padding: 14px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }
}

.stage-b3-panel {
  display: grid;
  gap: 14px;
  border-left: 3px solid #35705a;
}

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

.stage-b3-summary span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft, #f7f8f8);
}

.stage-b3-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.stage-b3-history {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-b3-history li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stage-b3-history li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-b3-history p,
.stage-b3-history small {
  margin: 5px 0 0;
}

.stage-b3-actions {
  justify-content: flex-start;
}

.stage-b3-workbench {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .stage-b3-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.payment-workbench-grid {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(270px, 1fr) minmax(330px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.payment-workbench-column {
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.payment-workbench-column > header {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.payment-workbench-column h4,
.payment-workbench-column h5 { margin: 2px 0 0; }

.payment-scroll-list {
  max-height: 620px;
  overflow: auto;
  padding: 8px;
}

.payment-transaction-row,
.payment-report-row {
  width: 100%;
  min-height: 92px;
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  margin: 0 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.payment-transaction-row {
  min-height: 56px;
  gap: 1px;
  padding: 4px 7px;
  margin-bottom: 4px;
  line-height: 1.1;
}

.payment-transaction-row small,
.payment-transaction-row em { font-size: 10.5px; }

.payment-transaction-row:hover,
.payment-report-row:hover,
.payment-transaction-row.active,
.payment-report-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.payment-transaction-row.active,
.payment-report-row.active {
  border-width: 2px;
  box-shadow: inset 3px 0 0 var(--accent);
}

.payment-transaction-row span,
.payment-report-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.payment-transaction-row i,
.payment-report-row i,
.payment-transaction-row em,
.payment-report-row em,
.payment-transaction-row small,
.payment-report-row small {
  color: var(--muted);
  font-style: normal;
}

.allocation-panel { padding-bottom: 12px; }

.payment-queue-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line-soft);
}

.payment-queue-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  white-space: nowrap;
}

.payment-queue-tabs button strong {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 12px;
}

.payment-queue-tabs button.active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 29, 38, 0.08);
}

.payment-efficiency-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--line-soft);
}

.payment-efficiency-strip span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 12px;
}

.payment-efficiency-strip strong { color: var(--ink); font-size: 16px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.finance-matching-header {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.1fr) minmax(300px, auto);
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.payment-inbox-mode {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-section.payment-inbox-mode { gap: 0; }

.payment-inbox-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line-soft);
}

.payment-inbox-header h3 { margin: 2px 0; font-size: 22px; }
.payment-inbox-header p { display: none; }
.payment-inbox-position { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.payment-inbox-position strong { min-width: 64px; text-align: center; }
.payment-inbox-tools { display: flex; align-items: center; gap: 8px; }
.payment-inbox-section-nav { display: flex; align-items: center; padding-right: 8px; border-right: 1px solid var(--line-soft); }
.payment-inbox-section-nav button { min-height: 34px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted-strong); cursor: pointer; font-size: 12px; }
.payment-inbox-section-nav button.active { border-bottom-color: var(--ink); color: var(--ink); font-weight: 700; }
.payment-inbox-tools details { position: relative; }
.payment-inbox-tools summary { list-style: none; cursor: pointer; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }
.payment-inbox-tools summary::-webkit-details-marker { display: none; }
.payment-inbox-tools details > div { position: absolute; right: 0; z-index: 10; display: grid; gap: 4px; min-width: 150px; margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.payment-inbox-tools details button { border: 0; background: transparent; padding: 9px 10px; text-align: left; cursor: pointer; }
.payment-inbox-tools details button:hover { background: var(--surface-soft); }

.finance-demo-scenario-bar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  margin: 2px 0 0;
  padding: 2px 8px;
  box-sizing: border-box;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-soft);
}
.finance-demo-scenario-bar > div:first-child { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 6px; }
.finance-demo-scenario-bar label { color: var(--muted); font-size: 12px; font-weight: 700; }
.finance-demo-scenario-bar select { min-width: 0; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 0 8px; color: var(--ink); }
.finance-demo-scenario-bar span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.finance-demo-scenario-bar p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.finance-demo-scenario-bar .inline-actions { flex-wrap: nowrap; justify-content: flex-end; }
.finance-demo-scenario-bar .inline-action { min-height: 30px; padding-top: 5px; padding-bottom: 5px; }
.finance-demo-guide-list { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.finance-demo-guide-list li { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 6px; }
.finance-demo-guide-list strong,
.finance-demo-guide-list span,
.finance-demo-guide-list small { display: block; }
.finance-demo-guide-list span,
.finance-demo-guide-list small { margin-top: 4px; color: var(--muted); }
.finance-demo-guide-list p { margin: 7px 0; font-size: 13px; }

.payment-inbox-toolbar {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}

.payment-inbox-tabs { display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); border-bottom: 1px solid var(--line-soft); }
.payment-inbox-tabs button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 34px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted-strong); cursor: pointer; }
.payment-inbox-tabs button.active { border-bottom-color: var(--ink); color: var(--ink); font-weight: 700; }
.payment-inbox-tabs strong { min-width: 20px; padding: 1px 5px; border-radius: 5px; background: var(--surface-soft); font-size: 12px; }
.payment-inbox-search { display: grid; grid-template-columns: minmax(0, 1fr) 38px; }
.payment-inbox-search input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px 0 0 6px; padding: 0 12px; }
.payment-inbox-search button { border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: var(--surface); cursor: pointer; }

.payment-inbox-main { min-height: min(500px, calc(100dvh - 300px)); }
.payment-inbox-card {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr);
  grid-template-rows: auto 1fr;
  min-height: min(500px, calc(100dvh - 300px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.payment-inbox-bank { grid-row: 1 / span 2; padding: 24px; border-right: 1px solid var(--line-soft); background: var(--surface-soft); }
.payment-inbox-bank > strong { display: block; margin: 8px 0 22px; font-size: 30px; line-height: 1; }
.payment-inbox-bank dl { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 11px 8px; margin: 0; font-size: 13px; }
.payment-inbox-bank dt { color: var(--muted); }
.payment-inbox-bank dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.payment-inbox-choice { grid-column: 2; padding: 18px 22px 0; }
.payment-inbox-choice h4 { margin: 3px 0 12px; font-size: 16px; }
.payment-inbox-choice > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-inbox-candidate { display: grid; gap: 7px; min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: left; cursor: pointer; }
.payment-inbox-candidate.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
.payment-inbox-candidate > span { display: flex; justify-content: space-between; gap: 8px; }
.payment-inbox-candidate em { color: var(--green, #2f7a57); font-style: normal; font-size: 12px; }
.payment-inbox-candidate small { color: var(--muted); }
.payment-inbox-candidate ul { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; list-style: none; font-size: 12px; }

.payment-inbox-conclusion { grid-column: 2; align-self: stretch; display: flex; flex-direction: column; padding: 22px 26px; min-width: 0; }
.payment-inbox-conclusion h4 { margin: 4px 0 6px; font-size: 22px; }
.payment-inbox-conclusion > p { margin: 0 0 12px; color: var(--muted-strong); }
.payment-judgement { align-self: flex-start; padding: 4px 8px; border-radius: 5px; background: var(--surface-soft); color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.payment-judgement.is-positive { background: rgba(42, 129, 91, .1); color: var(--green, #2f7a57); }
.payment-judgement.is-warning { background: rgba(180, 118, 31, .11); color: var(--amber); }
.payment-inbox-reasons { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 14px; font-size: 13px; }
.payment-inbox-reasons strong { width: 100%; }
.payment-inbox-reasons span::before { content: "✓"; margin-right: 5px; color: var(--green, #2f7a57); }
.payment-inbox-after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: 6px; font-size: 13px; }
.payment-inbox-after span { display: flex; justify-content: space-between; gap: 8px; }
.payment-inbox-primary { margin-top: auto; padding-top: 14px; }
.payment-inbox-primary button { width: 100%; min-height: 46px; justify-content: center; }
.payment-inbox-actions { display: flex; gap: 8px; margin-top: 8px; }
.payment-inbox-actions > * { flex: 1 1 0; justify-content: center; }
.payment-score-details { margin-top: 8px; color: var(--muted); font-size: 12px; }
.payment-score-details summary { cursor: pointer; }
.payment-inbox-exception .payment-inbox-conclusion,
.payment-inbox-completed .payment-inbox-conclusion { justify-content: center; }
.payment-inbox-allocation-list { display: grid; gap: 6px; margin-top: 10px; }
.payment-inbox-allocation-list span { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--surface-soft); border-radius: 5px; }
.payment-inbox-empty { display: grid; place-content: center; min-height: min(500px, calc(100dvh - 300px)); border: 1px dashed var(--line); text-align: center; }
.payment-inbox-empty strong { font-size: 18px; }
.payment-inbox-empty p { color: var(--muted); }
.payment-search-empty { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 8px 10px; border: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.payment-search-empty strong { color: var(--ink); }

.finance-inbox-shell > .workspace-breadcrumb { display: none; }

.payment-split-workspace { min-height: min(500px, calc(100dvh - 300px)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.payment-split-workspace > header { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.payment-split-workspace h3 { margin: 3px 0; }
.payment-split-workspace p { margin: 0; color: var(--muted); }
.payment-split-conservation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.payment-split-conservation span { display: grid; gap: 3px; padding: 10px 14px; background: var(--surface-soft); font-size: 12px; }
.payment-split-conservation strong { font-size: 16px; }
.payment-split-table { padding: 8px 18px; }
.payment-split-row { display: grid; grid-template-columns: 48px minmax(190px, 1fr) minmax(120px, .45fr) minmax(140px, .5fr); align-items: center; gap: 12px; min-height: 54px; border-bottom: 1px solid var(--line-soft); }
.payment-split-row small { display: block; color: var(--muted); }
.payment-split-row input[type="text"], .payment-split-row input[inputmode="decimal"] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 5px; padding: 0 10px; }
.payment-split-head { min-height: 34px; color: var(--muted); font-size: 12px; }
.payment-split-workspace form > footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.payment-split-workspace form > footer span { color: var(--muted); font-size: 12px; }

.payment-batch-preview {
  display: grid;
  max-height: min(420px, 52vh);
  overflow-y: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.payment-batch-preview-row {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(100px, .55fr) minmax(130px, .8fr) minmax(190px, 1.4fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.payment-batch-preview-row:last-child { border-bottom: 0; }
.payment-batch-preview-row.is-head { position: sticky; top: 0; z-index: 1; min-height: 34px; background: var(--surface-soft); color: var(--muted); }
.payment-batch-preview-row small { color: var(--muted-strong); }

.finance-matching-header h3 { margin: 2px 0 3px; font-size: 22px; }
.finance-matching-header p { margin: 0; }
.finance-matching-header > div:first-child > p:last-child { color: var(--muted); font-size: 13px; }
.demo-mode-badge { margin-left: 6px; font-weight: 600; }

.finance-search-hit-strip {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.stage-b2-payment-workbench .list-search-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 8px 0;
  padding: 0;
  border: 0;
}

.stage-b2-payment-workbench .list-search-field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.stage-b2-payment-workbench .list-search-field input { height: 38px; }
.stage-b2-payment-workbench .list-search-meta { white-space: nowrap; }

.finance-search-hit {
  display: grid;
  flex: 0 0 min(320px, 80vw);
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.finance-search-hit:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.finance-search-hit span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-context-report {
  display: grid;
  gap: 5px;
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-muted);
}

.payment-context-report > span,
.payment-context-report > small { color: var(--muted); }

.payment-context-report .inline-action { justify-self: start; }

.payment-smart-grid {
  display: grid;
  grid-template-columns: minmax(240px, 28fr) minmax(330px, 42fr) minmax(270px, 30fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.stage-b2-payment-workbench .property-page-head {
  align-items: flex-start;
  gap: 24px;
}

.payment-header-actions {
  min-width: max-content;
  align-items: center;
}

.payment-header-actions button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.stage-b2-payment-workbench:not(.matcher-v2-shell) .payment-smart-grid .payment-workbench-column {
  min-width: 0;
  height: clamp(440px, calc(100dvh - 280px), 560px);
  min-height: 440px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}

.payment-workbench-column > header {
  min-height: 50px;
  padding: 7px 10px;
}

.payment-workbench-column > header h4 { font-size: 15px; }

.payment-list-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.payment-inline-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
  margin: 0;
}

.payment-inline-search .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.payment-inline-search input {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 14px;
}

.payment-inline-search input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
  outline-offset: 0;
}

.payment-inline-search button {
  grid-column: 2;
  grid-row: 1;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
}

.payment-filter-row {
  display: none;
}

.payment-filter-row span {
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}

.payment-smart-grid .payment-scroll-list {
  max-height: none;
  height: calc(100% - 50px - 46px);
  padding: 7px;
  overscroll-behavior: contain;
}

[data-payment-exception-candidate-panel] {
  align-self: start;
  display: grid;
  grid-template-rows: auto auto minmax(210px, 1fr) auto;
  height: clamp(405px, calc(100dvh - 350px), 480px) !important;
  min-height: 405px !important;
}

[data-payment-exception-candidate-panel] .payment-scroll-list {
  height: auto;
  min-height: 210px;
  max-height: 310px;
}

[data-payment-exception-candidate-panel] > header {
  min-height: 62px;
}

[data-payment-exception-candidate-list] .payment-report-row {
  box-sizing: border-box;
  min-height: 126px;
  max-height: 142px;
  gap: 5px;
  padding: 10px 12px 12px;
  overflow: hidden;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

[data-payment-exception-candidate-list] .payment-report-row.active {
  border-width: 1px;
  box-shadow: inset 3px 0 0 var(--accent);
}

.payment-candidate-title b,
.payment-candidate-facts strong,
.payment-preview-facts dd,
.payment-result-summary dd,
.payment-result-summary > div strong,
.payment-split-preview td:nth-child(n+3) {
  font-variant-numeric: tabular-nums;
}

.payment-candidate-facts {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px !important;
}

.payment-candidate-facts small,
.payment-candidate-facts strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-candidate-facts strong {
  color: var(--ink);
  text-align: right;
}

[data-payment-exception-candidate-list] .payment-report-row ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 25px;
  margin: 2px 0 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

[data-payment-exception-candidate-list] .payment-report-row li {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 11px;
}

.confidence-high { color: var(--green) !important; }
.confidence-review { color: var(--blue) !important; }
.confidence-low { color: var(--amber) !important; }
.confidence-none { color: var(--muted) !important; }
.confidence-blocked { color: var(--red) !important; }
.payment-report-row.is-blocked {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, var(--surface));
}
.payment-report-row.is-blocked:disabled { opacity: 1; cursor: not-allowed; }
.payment-report-row.is-blocked .risk-text { margin: 8px 0 0; }

[data-payment-exception-candidate-panel] .candidate-more {
  align-self: center;
  width: calc(100% - 16px);
  min-height: 38px;
  margin: 4px 8px 8px;
  justify-content: center;
}

[data-payment-exception-candidate-panel] .candidate-more span {
  min-width: 20px;
  margin-left: 4px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.payment-extra-candidates {
  display: grid;
}

.payment-extra-candidates.hidden {
  display: none;
}

.selected-match-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0 12px 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.selected-match-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 12px 10px;
  padding: 12px;
  border-left: 3px solid var(--blue);
  background: var(--surface-muted);
}

.payment-suggestion strong { font-size: 22px; }
.payment-suggestion small { grid-column: 1 / -1; color: var(--muted); }
.payment-suggestion.is-blocked {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 6%, var(--surface));
}
.payment-suggestion.is-blocked strong { color: var(--red); }

.payment-secondary-actions,
.payment-more-menu { position: relative; }

.payment-secondary-actions { margin: 10px 12px; }

.payment-secondary-actions.is-visible {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.payment-action-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-secondary-actions.is-visible > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0;
}

.payment-secondary-actions.is-visible button {
  flex: 1 1 138px;
  text-align: center;
}

.payment-secondary-actions summary,
.payment-more-menu summary {
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 13px;
}

.payment-secondary-actions > div,
.payment-more-menu > div {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.payment-secondary-actions button,
.payment-more-menu button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--muted-strong);
  text-align: left;
}

.payment-keyboard-help {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-height: 0;
  margin: 3px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.payment-allocation-preview {
  position: sticky;
  top: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.payment-preview-scroll-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.payment-preview-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}

.payment-preview-facts section {
  min-width: 0;
  padding: 9px 10px;
}

.payment-preview-facts section + section {
  border-top: 1px solid var(--line-soft);
}

.payment-preview-facts .eyebrow {
  margin-bottom: 6px;
}

.payment-preview-facts dl,
.payment-result-summary dl {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(0, auto);
  gap: 4px 8px;
  margin: 0;
  font-size: 11px;
}

.payment-preview-facts dt,
.payment-result-summary dt {
  color: var(--muted);
}

.payment-preview-facts dd,
.payment-result-summary dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-result-summary {
  display: grid;
  gap: 7px;
  margin: 0 10px 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: var(--surface-soft);
}

.payment-result-summary.is-risk {
  border-left-color: var(--amber);
}

.payment-result-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.payment-result-summary > div span {
  color: var(--muted-strong);
  font-size: 12px;
}

.payment-result-summary > div strong {
  font-size: 18px;
}

.payment-result-summary p {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.4;
}

.payment-split-preview {
  margin: 0 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}

.payment-split-preview h5 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.payment-split-preview-scroll {
  max-height: 116px;
  overflow-x: hidden;
  overflow-y: auto;
}

.payment-split-preview table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 8.5px;
}

.payment-split-preview th,
.payment-split-preview td {
  box-sizing: border-box;
  padding: 5px 2px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  line-height: 1.2;
}

.payment-split-preview th:last-child,
.payment-split-preview td:last-child {
  border-right: 0;
}

.payment-split-preview th:first-child,
.payment-split-preview td:first-child {
  width: 24%;
  overflow-wrap: anywhere;
}

.payment-split-preview th:nth-child(2),
.payment-split-preview td:nth-child(2) {
  width: 16%;
  overflow-wrap: anywhere;
}

.payment-split-preview th:nth-child(n+3),
.payment-split-preview td:nth-child(n+3) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}

.payment-conservation-card {
  margin: 8px 10px;
  padding: 10px;
}

.payment-conservation-card dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  margin: 0;
  font-size: 12px;
}

.payment-conservation-card dt { color: var(--muted); }
.payment-conservation-card dd { margin: 0; font-weight: 700; text-align: right; }

.payer-explanation-status {
  display: grid;
  gap: 3px;
  margin: 8px 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--blue);
  background: var(--surface-muted);
  font-size: 12px;
}

.payer-explanation-status span { color: var(--muted-strong); }

.payment-action-blocker {
  display: grid;
  gap: 4px;
  min-width: min(100%, 320px);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
}

.payment-action-blocker strong { color: var(--ink); }
.payment-action-blocker .inline-action { justify-self: start; margin-top: 4px; }

.payment-decision-footer {
  position: static;
  display: grid;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.payment-decision-footer > .primary-action { width: 100%; min-height: 42px; }

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

.payment-decision-secondary .inline-action { justify-content: center; }

.payment-more-menu > div {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 8;
  width: min(280px, 80vw);
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(20, 29, 38, 0.16);
}

@media (max-width: 1180px) {
  .finance-matching-header { grid-template-columns: minmax(240px, 1fr) minmax(340px, 1.2fr); }
  .finance-matching-header .payment-header-actions { grid-column: 1 / -1; }
  .payment-smart-grid { grid-template-columns: minmax(230px, 28fr) minmax(310px, 42fr) minmax(250px, 30fr); }
}

@media (max-width: 1020px) {
  .stage-b2-payment-workbench .property-page-head { display: grid; }
  .payment-header-actions { min-width: 0; justify-content: flex-start; }
  .payment-smart-grid { grid-template-columns: minmax(280px, 0.8fr) minmax(380px, 1.2fr); }
  .payment-allocation-preview { position: static; grid-column: 1 / -1; height: auto !important; min-height: auto !important; }
}

@media (max-width: 760px) {
  .payment-efficiency-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-smart-grid { grid-template-columns: minmax(0, 1fr); }
  .payment-allocation-preview { grid-column: auto; }
  .payment-smart-grid .payment-workbench-column { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .payment-candidate-list .payment-report-row {
    transition: none;
  }
}

.payment-conservation-card,
.payment-allocation-list,
.payment-exception-list {
  margin: 8px 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.payment-allocation-list,
.payment-exception-list {
  max-height: 120px;
  overflow: auto;
}

.payment-conservation-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin: 0;
}

.payment-conservation-card dt { color: var(--muted); }
.payment-conservation-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.payment-primary-actions { padding: 0 12px; }
.payment-primary-actions + .muted-copy { margin: 8px 12px 0; }

.payment-allocation-list article,
.payment-exception-list article,
.payment-detail-section article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.payment-allocation-list article:last-child,
.payment-exception-list article:last-child,
.payment-detail-section article:last-child { border-bottom: 0; }

.payment-allocation-list article div,
.payment-exception-list article div { display: grid; gap: 4px; }

.payment-exception-list:has(.third-party-aggregate-card) {
  max-height: min(540px, 58vh);
}

.payment-exception-list .third-party-aggregate-card {
  display: grid;
  gap: 10px;
  width: 100%;
}

.third-party-aggregate-card > header,
.third-party-aggregate-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.third-party-aggregate-card > header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.third-party-aggregate-card > header small,
.third-party-aggregate-summary span { color: var(--muted-strong); }

.third-party-aggregate-summary {
  padding: 8px 0;
  border-block: 1px solid var(--line-soft);
  font-size: 12px;
}

.third-party-aggregate-card ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.third-party-aggregate-item {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 9px 64px 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.third-party-aggregate-item > div {
  display: flex !important;
  justify-content: space-between;
  gap: 8px;
}

.third-party-aggregate-item dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  margin: 0;
  font-size: 12px;
}

.third-party-aggregate-item dt { color: var(--muted); }
.third-party-aggregate-item dd { margin: 0; text-align: right; }
.third-party-aggregate-item > .tag { position: absolute; top: 9px; right: 0; }
.third-party-aggregate-item > p { margin: 0; color: var(--red); font-size: 12px; }
.third-party-aggregate-item.is-stale { background: rgba(185, 74, 72, 0.04); }
.third-party-aggregate-card > .inline-actions { display: flex; flex-wrap: wrap; }
.third-party-aggregate-card > .inline-actions .primary-action { flex: 1 1 220px; }
.payment-report-detail { display: grid; gap: 14px; }
.payment-detail-section { padding-top: 4px; }

@media (max-width: 1180px) {
  .payment-workbench-grid { grid-template-columns: 1fr 1fr; }
  .payment-workbench-column.allocation-panel { grid-column: 1 / -1; }
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--brand-strong);
}

.btn-secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: #b9aa95;
  background: var(--panel-muted);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.btn-ghost:hover {
  background: var(--brand-soft);
  color: var(--ink);
}

.btn-danger {
  border-color: rgba(184, 66, 66, 0.3);
  background: rgba(184, 66, 66, 0.07);
  color: var(--red);
}

.property-create-workspace,
.property-form {
  display: grid;
  gap: 18px;
}

.property-create-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.property-create-header h3,
.property-form-header h3 {
  margin: 4px 0 7px;
}

.property-create-header p:last-child,
.property-form-header > p:last-of-type,
.property-create-section-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.property-create-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.property-create-stats article {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 15px;
}

.property-create-stats article + article {
  border-left: 1px solid var(--line-soft);
}

.property-create-stats strong {
  font-size: 22px;
}

.property-create-stats span {
  color: var(--muted);
  font-size: 12px;
}

.property-create-section {
  display: grid;
  gap: 12px;
}

.property-create-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.property-create-section-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

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

.property-create-card {
  min-height: 240px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 13px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.property-create-card:hover {
  transform: translateY(-1px);
  border-color: #b7a68e;
  box-shadow: var(--shadow-md);
}

.property-create-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.property-create-card-icon .nav-icon {
  width: 22px;
  height: 22px;
}

.property-create-card strong {
  font-size: 17px;
}

.property-create-card p,
.property-create-card small,
.property-application-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.property-application-card {
  min-height: 166px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-muted);
}

.property-create-preparation,
.property-create-permission {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.property-create-preparation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
}

.property-create-preparation ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted-strong);
  line-height: 1.8;
}

.property-create-permission {
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--brand-soft);
}

.property-create-permission p {
  max-width: 850px;
  margin: 6px 0 0;
  color: var(--muted-strong);
  line-height: 1.65;
}

.property-create-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
}

.property-create-back-row > span {
  color: var(--muted);
  font-size: 13px;
}

.property-form {
  max-width: 1120px;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form-section-head {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.form-section-head strong {
  font-size: 16px;
}

.form-section-head p,
.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

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

.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-field > span,
.form-field > label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.form-field textarea {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}

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

.customer-create-form {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.customer-create-error {
  padding: 10px 12px;
  border: 1px solid rgba(185, 74, 72, 0.24);
  border-radius: 6px;
  background: rgba(185, 74, 72, 0.08);
  color: var(--red);
  font-weight: 700;
}

.customer-tag-picker {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-muted);
}

.customer-tag-picker legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.customer-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-tag-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.customer-create-notes {
  margin-top: 14px;
}

.form-check,
.form-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
}

.form-check input,
.form-check-grid input {
  width: 16px;
  height: 16px;
}

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

.payment-method-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-method-row label {
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.payment-method-row input {
  min-width: 0;
  height: 32px;
  padding: 0 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.form-preview {
  padding: 11px 13px;
  border-left: 3px solid var(--blue);
  background: #f2f6fd;
  color: #274878;
  font-weight: 700;
}

.property-upload-demo {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.property-upload-button {
  min-height: 68px;
  display: grid;
  gap: 4px;
}

.property-upload-button small {
  color: var(--muted);
  font-weight: 500;
}

.property-upload-button[data-uploaded="true"] {
  border-color: #80a98a;
  background: #f1f8f3;
  color: #285c34;
}

.property-form-notice {
  padding: 12px 14px;
  border-left: 3px solid #5d849b;
  background: #f4f7f9;
  color: var(--muted-strong);
  font-size: 13px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 8px;
  background: linear-gradient(to top, var(--bg) 68%, rgba(246, 241, 232, 0.82), transparent);
}

.status-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #edf3fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.property-submit-result {
  max-width: 760px;
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.property-result-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf7ef;
  color: #2f6f3e;
  font-size: 22px;
  font-weight: 800;
}

.property-submit-result h3,
.property-submit-result p {
  margin: 0;
}

.property-submit-result > p:not(.eyebrow) {
  color: var(--muted-strong);
  line-height: 1.65;
}

.property-result-meta {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 14px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-muted);
}

.property-result-meta span {
  color: var(--muted);
}

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

.new-home-project-list {
  display: grid;
  gap: 10px;
}

.new-home-project-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, auto);
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.new-home-project-row p,
.new-home-project-row small {
  margin: 5px 0 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .property-create-header,
  .property-create-permission {
    grid-template-columns: 1fr;
  }

  .property-application-grid,
  .form-grid.three,
  .form-check-grid,
  .property-upload-demo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .new-home-project-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .property-create-grid,
  .property-application-grid,
  .property-create-preparation,
  .form-grid,
  .form-grid.three,
  .form-check-grid,
  .property-upload-demo {
    grid-template-columns: 1fr;
  }

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

  .property-create-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .property-create-stats article {
    min-width: 0;
    padding: 10px;
  }

  .property-create-card {
    min-height: auto;
  }

  .form-actions,
  .property-result-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .property-result-meta {
    grid-template-columns: auto 1fr;
  }
}

.signature-status-card,
.property-customer-matches,
.finance-priority-queue {
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signature-status-list,
.match-customer-list,
.finance-queue-list {
  display: grid;
  gap: 0;
}

.signature-status-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 104px auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.signature-status-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.signature-state {
  padding: 5px 8px;
  border-radius: 4px;
  background: #edf2f8;
  color: #315477;
  font-size: 11px;
  text-align: center;
}

.signature-report-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-left: 3px solid #3e7d60;
  background: #eff7f2;
}

.signature-report-prompt div {
  flex: 1;
}

.signature-report-prompt p {
  margin: 3px 0 0;
  color: #4f6659;
  font-size: 12px;
}

.match-customer-row {
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) minmax(150px, 0.55fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.match-customer-score {
  display: grid;
  align-content: center;
  width: 66px;
  height: 66px;
  border: 1px solid #bfd0e6;
  border-radius: 50%;
  color: var(--blue);
  text-align: center;
}

.match-customer-score strong {
  font-size: 22px;
  line-height: 1;
}

.match-customer-score span {
  margin-top: 3px;
  font-size: 10px;
}

.match-customer-row h4 {
  margin: 0 0 5px;
  font-size: 15px;
}

.match-customer-row p,
.match-customer-row small {
  color: var(--muted);
  font-size: 11px;
}

.match-reasons,
.match-customer-actions,
.rejection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-reasons {
  margin: 7px 0;
}

.match-reasons span {
  padding: 3px 6px;
  border-radius: 4px;
  background: #edf4fa;
  color: #315477;
  font-size: 10px;
}

.match-customer-actions {
  justify-content: flex-end;
}

.recommendation-template {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  background: #f2f6fb;
}

.recommendation-template p {
  margin: 4px 0 0;
  color: #485b6e;
  font-size: 12px;
  line-height: 1.6;
}

.report-rejection-card {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #e8c3c3;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  background: #fffafa;
}

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

.rejection-status > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.rejection-status p,
.rejection-status h3 {
  margin: 0;
}

.rejection-status p {
  color: var(--red);
  font-size: 12px;
}

.rejection-status h3 {
  margin-top: 3px;
  font-size: 16px;
}

.rejection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 13px 0;
  background: #f0dede;
}

.rejection-grid > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #fff;
}

.rejection-grid span,
.finance-queue-row > div > span {
  color: var(--muted);
  font-size: 10px;
}

.rejection-grid strong {
  font-size: 12px;
}

.review-timeline {
  display: flex;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.review-timeline i {
  flex: 1;
  height: 1px;
  margin: 0 8px;
  background: #dfcaca;
}

.review-timeline strong {
  color: var(--red);
}

.finance-queue-row {
  display: grid;
  grid-template-columns: 72px minmax(150px, 1.25fr) repeat(3, minmax(100px, 0.7fr)) 100px minmax(110px, auto);
  align-items: center;
  gap: 10px;
  min-width: 940px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.finance-queue-list {
  overflow-x: auto;
}

.finance-queue-row > div {
  display: grid;
  gap: 3px;
}

.finance-queue-row p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.queue-priority {
  padding: 5px 7px;
  border-left: 3px solid var(--blue);
  background: #f0f4f9;
  font-size: 11px;
  font-weight: 700;
}

.finance-queue-row:first-child .queue-priority {
  border-color: var(--red);
  background: #fbefef;
  color: var(--red);
}

@media (max-width: 720px) {
  .signature-status-row,
  .match-customer-row {
    grid-template-columns: 1fr;
  }

  .match-customer-actions {
    justify-content: flex-start;
  }

  .rejection-grid {
    grid-template-columns: 1fr;
  }

  .signature-report-prompt {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

.business-review-list,
.risk-exception-list,
.audit-row-list {
  display: grid;
  gap: 10px;
}

.business-review-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.2fr) minmax(150px, 0.65fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.business-review-row h4,
.risk-exception-row h4 {
  margin: 7px 0 4px;
  font-size: 15px;
}

.business-review-row p,
.risk-exception-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.review-checks span {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: #f4f6f8;
  color: var(--muted);
  font-size: 10px;
}

.review-checks b {
  color: var(--ink);
  font-size: 11px;
}

.review-responsibility {
  display: grid;
  align-content: start;
  gap: 4px;
}

.review-responsibility span,
.review-responsibility small {
  color: var(--muted);
  font-size: 10px;
}

.business-review-row .rejection-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.risk-exception-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.audit-row-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(260px, 1.4fr) 90px;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}

.audit-row-list span {
  color: var(--muted);
}

@media (max-width: 780px) {
  .business-review-row {
    grid-template-columns: 1fr;
  }

  .business-review-row .rejection-actions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .risk-exception-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-row-list > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    height: auto;
    padding: 10px 12px;
  }

  .brand {
    min-height: 42px;
    margin: 0;
  }

  .module-nav {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding: 0 0 2px;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    width: auto;
    min-width: 106px;
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 0 8px;
  }

  .nav-group {
    min-width: 146px;
  }

  .nav-group-button {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: 0 8px;
  }

  .nav-children {
    margin-left: 9px;
  }

  .nav-child-button {
    min-height: 32px;
  }

  .nav-button small {
    display: none;
  }

  .sidebar-mobile-account {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .sidebar-mobile-account .sidebar-account-user {
    display: none;
  }

  .sidebar-mobile-account .sidebar-logout-button {
    width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-mobile-account .sidebar-logout-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

@media (max-width: 640px) {
  .sidebar {
    grid-template-columns: 42px minmax(0, 1fr) 40px;
    gap: 8px;
    padding: 8px;
  }

  .brand {
    padding: 0;
  }

  .brand > div:last-child {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .nav-button {
    min-width: 72px;
    min-height: 54px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 5px 4px;
    text-align: center;
  }

  .nav-button strong {
    max-width: 66px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-icon {
    width: 25px;
    height: 25px;
  }

  .nav-group {
    min-width: 128px;
  }

  .nav-group-button {
    min-height: 44px;
    grid-template-columns: 25px minmax(0, 1fr) auto;
  }

  .nav-group-button strong,
  .nav-child-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    padding-top: 10px;
  }
}

.demo-progress-host {
  position: sticky;
  top: 92px;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.65fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #cbd8eb;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.demo-progress-copy > div,
.demo-progress-actions,
.scenario-actions,
.pipeline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-progress-copy strong {
  margin-right: 10px;
  font-size: 14px;
}

.demo-progress-copy span,
.demo-progress-copy p,
.demo-progress-copy b {
  color: var(--muted);
  font-size: 12px;
}

.demo-progress-copy p {
  margin: 3px 0 0;
}

.demo-progress-copy b {
  margin-left: 8px;
  color: var(--blue);
  font-weight: 600;
}

.demo-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8edf4;
}

.demo-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-action .nav-icon {
  width: 16px;
  height: 16px;
}

.icon-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.demo-step-highlight {
  outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent);
  outline-offset: 3px;
  animation: demo-step-pulse 1.4s ease-in-out infinite;
}

@keyframes demo-step-pulse {
  50% { outline-color: color-mix(in srgb, var(--blue) 12%, transparent); }
}

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

.scenario-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 14px;
  min-height: 226px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.scenario-index {
  color: var(--blue);
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.scenario-card h4,
.pipeline-card h4 {
  margin: 8px 0 5px;
  font-size: 17px;
}

.scenario-card p,
.pipeline-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.scenario-card dl {
  grid-column: 2;
  display: flex;
  gap: 24px;
  margin: 0;
}

.scenario-card dl div {
  display: grid;
  gap: 3px;
}

.scenario-card dt,
.pipeline-meta span {
  color: var(--muted);
  font-size: 11px;
}

.scenario-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.scenario-actions {
  grid-column: 2;
  align-self: end;
}

.danger-quiet {
  color: var(--red);
}

.pipeline-stage-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  gap: 2px;
  overflow-x: auto;
  margin: 2px 0 14px;
  padding-bottom: 6px;
}

.pipeline-stage-track span {
  position: relative;
  min-height: 38px;
  padding: 11px 8px;
  border-bottom: 3px solid #d9dee7;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.pipeline-stage-track span.active {
  border-color: var(--blue);
  color: var(--ink);
  font-weight: 700;
}

.pipeline-list,
.active-deal-list {
  display: grid;
  gap: 10px;
}

.pipeline-card {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.pipeline-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.probability {
  display: grid;
  min-width: 92px;
  text-align: right;
}

.probability strong {
  color: var(--blue);
  font-size: 24px;
}

.probability span {
  color: var(--muted);
  font-size: 11px;
}

.pipeline-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0;
  background: var(--line-soft);
}

.pipeline-meta > div {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px;
  background: var(--panel-muted);
}

.pipeline-meta strong {
  font-size: 12px;
  line-height: 1.45;
}

.pipeline-meta .risk strong {
  color: var(--red);
}

.active-deal-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(340px, 1.5fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.active-deal-row strong {
  display: block;
  margin: 7px 0 3px;
  font-size: 14px;
}

.active-deal-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mini-stage-line {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.mini-stage-line i {
  flex: 1;
  min-width: 10px;
  height: 1px;
  margin: 0 5px;
  background: #c8d2df;
}

.demo-explanation {
  margin: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.demo-explanation summary {
  padding: 10px 2px;
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
}

.demo-explanation > div {
  padding: 0 2px 12px;
}

.demo-explanation p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.compact-risk-list {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .demo-progress-host {
    position: static;
    grid-template-columns: 1fr;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-deal-row {
    grid-template-columns: 1fr;
  }

  .mini-stage-line {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .demo-progress-actions span {
    display: none;
  }

  .scenario-card {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 13px;
  }

  .pipeline-main {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .pipeline-meta {
    grid-template-columns: 1fr;
  }
}

/* Real management pages */
.management-workspace {
  position: relative;
  min-width: 0;
  padding-bottom: 24px;
}

.management-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line);
}

.management-page-head h3 {
  margin: 4px 0 6px;
  font-size: 23px;
  letter-spacing: 0;
}

.management-page-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.management-scope {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
}

.management-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.management-metrics > div {
  display: grid;
  align-content: center;
  min-height: 78px;
  padding: 13px 15px;
  border-right: 1px solid var(--line-soft);
}

.management-metrics > div:last-child {
  border-right: 0;
}

.management-metrics span,
.management-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.management-metrics strong {
  margin-top: 5px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.management-filters {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 3px 0 10px;
  scrollbar-width: thin;
}

.management-facet-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 2px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.management-facet-bar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.management-facet-bar label > span {
  color: var(--muted);
  font-size: 10px;
}

.management-facet-bar select {
  width: 100%;
  min-height: 34px;
  padding: 6px 24px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
}

.management-filters button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
}

.management-filters button:hover {
  background: var(--panel-muted);
}

.management-filters button.active {
  border-color: var(--line);
  background: var(--ink);
  color: #fff;
}

.page-tabs {
  display: flex;
  gap: 4px;
  margin: 2px 0 14px;
  overflow-x: auto;
  padding: 3px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: thin;
}

.page-tab {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.page-tab:hover {
  background: var(--panel-muted);
  color: var(--ink);
}

.page-tab.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

.page-tab small {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--panel-muted);
  color: inherit;
  font-size: 10px;
  text-align: center;
}

.property-search-toolbar {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.list-search-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.list-search-field {
  display: grid;
  gap: 5px;
  flex: 1 1 420px;
  min-width: 260px;
}

.list-search-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.list-search-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.list-search-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.property-search-main,
.property-search-actions,
.property-advanced-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.property-search-main input {
  min-width: 280px;
  flex: 1 1 460px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.property-search-actions {
  justify-content: flex-end;
}

.property-advanced-filters label {
  display: grid;
  gap: 4px;
  min-width: 130px;
  flex: 1 1 130px;
}

.property-library-scope {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 130px;
  min-height: 56px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.property-library-scope span {
  color: var(--muted);
  font-size: 12px;
}

.property-library-scope strong {
  color: var(--ink);
  font-size: 13px;
}

.property-advanced-filters label span {
  font-size: 12px;
  color: var(--muted);
}

.property-advanced-filters select {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.property-search-results {
  border-top: 1px solid var(--line-soft);
}

.property-search-row {
  display: grid;
  grid-template-columns: 128px minmax(240px, 1.5fr) minmax(120px, 0.55fr) minmax(190px, 0.8fr) minmax(210px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.property-thumb {
  width: 128px;
  height: 92px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-weight: 700;
}

.property-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-thumb-empty {
  align-content: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.property-thumb-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.property-thumb-empty small {
  color: var(--muted);
  font-size: 11px;
}

.property-media-placeholder,
.property-gallery-placeholder {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--surface-soft)), var(--surface-soft)),
    repeating-linear-gradient(45deg, transparent 0 12px, color-mix(in srgb, var(--line) 30%, transparent) 12px 13px);
}

.property-thumb-type,
.property-thumb-count,
.property-gallery-count {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.76);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.property-thumb-type {
  top: 7px;
  left: 7px;
}

.property-thumb-count {
  right: 7px;
  bottom: 7px;
}

.property-media-gallery {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(300px, 1fr);
  min-height: 300px;
  margin: 14px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.property-gallery-main {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: var(--surface-soft);
}

.property-gallery-main > img,
.property-gallery-main > .property-gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.property-gallery-placeholder {
  display: grid;
  place-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.property-gallery-placeholder strong {
  color: var(--ink);
}

.property-gallery-count {
  right: 12px;
  bottom: 12px;
}

.property-gallery-side {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-left: 1px solid var(--line-soft);
}

.property-gallery-copy h4,
.property-gallery-copy p {
  margin: 0 0 6px;
}

.property-gallery-copy p:last-child {
  color: var(--muted);
  line-height: 1.65;
}

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

.property-gallery-thumbnails button {
  min-height: 72px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.property-gallery-thumbnails img,
.property-gallery-thumbnails .property-gallery-placeholder {
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.property-gallery-actions {
  align-self: end;
}

.property-search-info,
.property-search-price,
.property-search-status {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.property-search-info p,
.property-search-info small,
.property-search-status small {
  margin: 0;
  color: var(--muted);
}

.property-search-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.store-property-workspace .management-table td:first-child {
  min-width: 210px;
}

.store-property-workspace .management-table td:first-child small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.oa-workspace {
  position: relative;
}

.oa-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.oa-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.oa-form label.wide,
.oa-form-actions,
.oa-evidence-upload {
  grid-column: 1 / -1;
}

.oa-form label span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-strong);
}

.oa-form input,
.oa-form select,
.oa-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.oa-form textarea {
  min-height: 88px;
  resize: vertical;
}

.oa-form input:focus,
.oa-form select:focus,
.oa-form textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-color: var(--brand);
}

.oa-evidence-upload {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.oa-evidence-upload p {
  margin: 4px 0 10px;
  color: var(--muted);
}

.oa-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.oa-form-actions span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .property-search-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .property-search-price,
  .property-search-status,
  .property-search-actions-row {
    grid-column: 2;
  }

  .property-thumb {
    width: 112px;
    height: 84px;
  }

  .property-media-gallery {
    grid-template-columns: 1fr;
  }

  .property-gallery-side {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .property-search-actions-row {
    justify-content: flex-start;
  }

  .oa-form {
    grid-template-columns: 1fr;
  }

  .oa-form label.wide,
  .oa-form-actions,
  .oa-evidence-upload {
    grid-column: auto;
  }
}

.management-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.management-list-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.management-list-head strong {
  font-size: 14px;
}

.management-list-head span {
  color: var(--muted);
  font-size: 11px;
}

.management-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.management-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 12px;
}

.management-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.management-table td {
  max-width: 220px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  line-height: 1.45;
  vertical-align: top;
}

.management-table tr:last-child td {
  border-bottom: 0;
}

.management-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-soft) 44%, #fff);
}

.management-table tbody tr {
  cursor: pointer;
}

.management-table tbody tr:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.management-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.management-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 250px;
  flex-wrap: wrap;
}

.management-row-actions .inline-action {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}

.management-demo-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}

.management-demo-note strong {
  color: var(--ink);
}

.management-demo-note p {
  margin: 0;
  line-height: 1.5;
}

.platform-saas-page {
  display: grid;
  gap: 14px;
}

.platform-toolbar {
  justify-content: flex-start;
  padding: 10px 0;
}

.platform-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.platform-flow-card {
  display: grid;
  gap: 10px;
}

.platform-flow-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.platform-flow-card .status-flow {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.platform-section-title,
.platform-report-funnel h4 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.platform-report-funnel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.platform-table td {
  min-width: 100px;
}

.entity-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 92vw);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -18px 0 48px rgba(17, 31, 42, 0.16);
}

.entity-drawer::before {
  content: "";
  position: fixed;
  inset: 0 520px 0 0;
  background: rgba(24, 24, 24, 0.18);
  pointer-events: none;
}

.entity-drawer > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.entity-drawer > header h3 {
  margin: 4px 0 9px;
  font-size: 19px;
  letter-spacing: 0;
}

.entity-drawer-body {
  overflow-y: auto;
  padding: 8px 20px 22px;
}

.entity-drawer-body section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.entity-drawer-body h4 {
  margin: 0 0 9px;
  font-size: 13px;
}

.entity-drawer-body p {
  margin: 6px 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.55;
}

.entity-drawer > footer {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-muted);
}

.entity-drawer > footer button {
  flex: 0 0 auto;
}

.readonly-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .management-metrics {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .management-demo-note {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 640px) {
  .management-page-head {
    gap: 10px;
  }

  .management-page-head h3 {
    font-size: 19px;
  }

  .management-scope {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .management-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-facet-bar {
    display: flex;
    overflow-x: auto;
  }

  .management-facet-bar label {
    flex: 0 0 138px;
  }

  .management-metrics > div {
    min-height: 70px;
    border-bottom: 1px solid var(--line-soft);
  }

  .management-metrics strong {
    font-size: 17px;
  }

  .management-list-head {
    align-items: flex-start;
  }

  .management-table {
    min-width: 820px;
  }

  .entity-drawer {
    width: 100vw;
  }

  .entity-drawer::before {
    display: none;
  }
}

/* Taste refresh: enterprise SaaS polish for dense workbench screens */
:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-muted: #f7f9fb;
  --ink: #18202a;
  --muted: #6c7683;
  --muted-strong: #465160;
  --line: #dce3ea;
  --line-soft: #e8edf2;
  --brand: #17212b;
  --brand-strong: #0c1218;
  --brand-dark: #111922;
  --brand-soft: #eef2f6;
  --surface-soft: #f7f9fb;
  --accent: #9a6b2f;
  --accent-strong: #714a1f;
  --accent-soft: #f5ead8;
  --blue: #2f64c8;
  --amber: #a96318;
  --red: #b43d3d;
  --green: #2f7a57;
  --radius: 8px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 30, 42, 0.06);
  --shadow-md: 0 10px 24px rgba(18, 30, 42, 0.08);
  --shadow-lg: 0 22px 52px rgba(18, 30, 42, 0.16);
  --shadow-hover: 0 14px 30px rgba(18, 30, 42, 0.12);
  --focus: 0 0 0 3px rgba(47, 100, 200, 0.2);
}

html {
  background: var(--bg);
}

body {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 280px),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}

::selection {
  background: color-mix(in srgb, var(--blue) 22%, transparent);
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  box-shadow: none;
}

.login-screen {
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 28px;
  padding: clamp(24px, 4vw, 54px);
  background:
    linear-gradient(135deg, #111922 0%, #192635 48%, #eef2f6 48.2%, #f8fafb 100%);
}

.login-visual {
  min-height: 620px;
  align-content: end;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #101820, #1b2a38);
  color: #fff;
  box-shadow: 0 28px 70px rgba(12, 18, 24, 0.24);
}

.login-brand-mark,
.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #101820, #293746);
  color: #f4d18a;
}

.login-visual h1 {
  max-width: 660px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-visual p:not(.eyebrow) {
  max-width: 520px;
  color: #c6d2de;
}

.login-proof-grid {
  max-width: 560px;
  gap: 8px;
}

.login-proof-grid span {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #dce6ef;
}

.login-panel {
  align-self: center;
  width: min(100%, 480px);
  padding: clamp(24px, 4vw, 38px);
  border-color: rgba(220, 227, 234, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(18, 30, 42, 0.16);
}

.login-form input,
.quick-login-unlock-form input,
.global-tools input,
.role-login select,
.management-facet-bar select,
.form-row input {
  min-height: 40px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(18, 30, 42, 0.03);
}

.login-submit,
.quick-login-unlock-form button,
.download-link,
.primary-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 30, 42, 0.16);
}

.login-submit:hover,
.quick-login-unlock-form button:hover,
.download-link:hover,
.primary-action:hover {
  background: var(--brand-strong);
  color: #fff;
}

.test-account-card,
.device-auth-card {
  border-color: var(--line);
  background: var(--panel-muted);
}

.app-shell {
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    #111922;
  border-right-color: rgba(255, 255, 255, 0.08);
}

.brand {
  min-height: 56px;
  margin-bottom: 14px;
  padding: 0 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand span,
.nav-button small,
.sidebar-account-workspace {
  color: #91a1b2;
}

.module-nav {
  gap: 4px;
  padding: 4px 0 12px;
}

.nav-button {
  min-height: 44px;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  padding: 0 10px;
  color: #c9d3de;
}

.nav-button strong {
  font-size: 13px;
  font-weight: 760;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: #9eadbc;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.075);
}

.nav-button.active {
  border-color: rgba(244, 209, 138, 0.2);
  background: rgba(244, 209, 138, 0.12);
  color: #fff;
  box-shadow: inset 3px 0 0 #f4d18a;
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon {
  border-color: rgba(244, 209, 138, 0.25);
  background: rgba(244, 209, 138, 0.13);
  color: #f4d18a;
}

.sidebar-account {
  margin: auto -1px 0;
  padding: 14px 6px 4px;
}

.sidebar-account-avatar {
  background: rgba(244, 209, 138, 0.12);
  color: #f4d18a;
}

.sidebar-logout-button {
  min-height: 40px;
  color: #b8c4cf;
}

.workspace {
  max-width: 1560px;
  padding: 20px 26px 30px;
}

.topbar {
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 430px) minmax(220px, 280px) auto;
  gap: 14px;
  margin: -20px -26px 18px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(220, 227, 234, 0.9);
  background: rgba(248, 250, 252, 0.94);
}

h1 {
  font-size: 27px;
  font-weight: 820;
}

h2 {
  font-size: 19px;
  font-weight: 800;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 760;
}

.workspace-subtitle {
  max-width: 780px;
  color: var(--muted);
}

.global-tools {
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.icon-button,
.workspace-current,
.confirm-cancel,
.tab-button,
.filter-bar button,
.property-actions button,
.icon-back-button,
.inline-action,
.icon-action,
.switch-row,
.text-button {
  border-color: var(--line);
  background: #fff;
  color: var(--brand);
}

.icon-button,
.workspace-current {
  min-height: 40px;
}

.icon-button:hover,
.workspace-current:hover,
.confirm-cancel:hover,
.tab-button:hover,
.filter-bar button:hover,
.property-actions button:hover,
.icon-back-button:hover,
.inline-action:hover,
.icon-action:hover,
.switch-row:hover,
.text-button:hover {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: #f7faff;
  color: var(--blue);
}

.workspace-menu,
.global-search-results,
.esign-drawer,
.confirm-dialog,
.action-dialog,
.entity-drawer,
.result-card-host > div {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
}

.workspace-option:hover,
.workspace-option.active {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: #f5f8fc;
}

.hero-panel {
  min-height: 154px;
  padding: 20px;
  border-color: rgba(18, 30, 42, 0.12);
  background:
    linear-gradient(135deg, #111922, #1a2a38 58%, #2b3847),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  box-shadow: 0 16px 36px rgba(18, 30, 42, 0.14);
}

.hero-panel h2 {
  font-size: 28px;
}

.role-card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 12, 18, 0.58);
}

.kpi-grid {
  gap: 10px;
  margin: 14px 0;
}

.kpi-card,
.panel,
.module-summary,
.agent-status-strip > div,
.cap-panel,
.summary-chip,
.work-metric-card,
.detail-card,
.todo-card,
.customer-card,
.property-category-card,
.quick-entry,
.property-list-card,
.growth-panel,
.account-center-card,
.account-current-card,
.account-boundary-note,
.pipeline-card,
.scenario-card,
.report-rejection-card,
.download-card,
.download-hero {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  min-height: 98px;
  padding: 14px;
  border-top: 0;
  border-left: 3px solid var(--brand);
}

.kpi-card strong,
.work-metric-card strong,
.management-metrics strong,
.summary-chip strong,
.cap-panel strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.kpi-card strong {
  font-size: 23px;
}

.panel {
  padding: 16px;
}

.panel-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.module-detail,
.agent-workbench,
.workflow-section,
.property-workbench {
  gap: 12px;
}

.module-summary,
.agent-status-strip,
.cap-panel {
  gap: 8px;
}

.summary-chip,
.agent-status-strip > div,
.cap-panel > div,
.growth-grid > div,
.pipeline-meta > div,
.review-checks span {
  background: var(--panel-muted);
}

.summary-chip.ok,
.work-metric-card:hover,
.property-category-card:hover,
.quick-entry:hover,
.property-list-card:hover,
.detail-card:hover,
.todo-card:hover,
.customer-card:hover {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  background: #fff;
  box-shadow: var(--shadow-md);
}

.agent-home-head {
  padding: 16px;
  border-color: var(--line);
  background:
    linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
}

.identity-pill,
.tag,
.property-badges span,
.match-score b,
.management-status,
.readonly-chip,
.signature-state {
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 6px;
  background: #f3f7fc;
  color: #315477;
}

.filter-bar,
.notification-filters,
.management-filters,
.inline-actions,
.property-actions,
.high-frequency-actions,
.growth-actions,
.demo-progress-actions,
.scenario-actions,
.pipeline-actions {
  gap: 7px;
}

.filter-bar button.active,
.tab-button.active,
.notification-filters button.active,
.management-filters button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.business-path {
  position: sticky;
  top: 72px;
  z-index: 3;
  min-height: 34px;
  margin: -2px 0 2px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.back-path-row {
  min-height: 42px;
  border-bottom-color: var(--line);
}

.property-page-head,
.management-page-head {
  align-items: center;
}

.property-page-head h3,
.management-page-head h3,
.agent-home-head h3 {
  font-size: 22px;
  font-weight: 820;
}

.property-core-grid {
  gap: 10px;
}

.property-category-card {
  min-height: 150px;
}

.quick-entry-grid {
  gap: 8px;
}

.quick-entry {
  min-height: 86px;
}

.property-list,
.todo-list,
.customer-list,
.settlement-list,
.notification-list,
.pipeline-list,
.active-deal-list,
.business-review-list,
.risk-exception-list,
.audit-row-list {
  gap: 8px;
}

.property-list-card,
.todo-card,
.customer-card {
  min-height: 84px;
}

.table-wrap,
.management-table-wrap {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

th,
.management-table th {
  background: #f6f8fb;
  color: var(--muted-strong);
  font-weight: 760;
}

td,
.management-table td {
  border-bottom-color: var(--line-soft);
}

tbody tr:hover,
.management-table tbody tr:hover {
  background: #f8fbff;
}

.management-page-head {
  padding: 2px 0 16px;
  border-bottom-color: var(--line-soft);
}

.management-metrics {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.management-metrics > div {
  border-right-color: var(--line-soft);
  background: #fff;
}

.management-facet-bar {
  border-color: var(--line);
  background: #f7f9fb;
}

.management-list-head {
  padding: 10px 0;
}

.management-table th,
.management-table td {
  padding: 9px 10px;
}

.management-table td {
  vertical-align: middle;
}

.management-row-actions {
  min-width: 214px;
  gap: 3px;
}

.management-row-actions .inline-action {
  min-height: 24px;
  margin: 0;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.2;
  box-shadow: none;
}

.management-demo-note {
  border-top-color: var(--line-soft);
  background: transparent;
}

.esign-entry,
.template-chip,
.contract-card {
  border-color: var(--line);
  background: #fff;
}

.esign-entry > span,
.template-chip span,
.property-icon,
.quick-entry span,
.todo-card > span {
  background: #eef3f8;
  color: #315477;
}

.esign-drawer,
.entity-drawer {
  border-color: var(--line);
}

.drawer-head,
.entity-drawer > header {
  border-bottom: 1px solid var(--line-soft);
}

.entity-drawer > footer {
  background: #f7f9fb;
}

.confirm-overlay,
.action-dialog-overlay {
  background: rgba(15, 23, 31, 0.5);
}

.toast-host {
  border-color: rgba(47, 122, 87, 0.26);
  border-radius: var(--radius);
  background: #f3fbf7;
  color: #1f5d41;
}

.result-card-host > div {
  border-color: rgba(47, 122, 87, 0.24);
  background: #f7fcf9;
}

.demo-progress-host {
  top: 82px;
  border-color: #cfdbea;
  border-left-color: var(--blue);
  background: rgba(255, 255, 255, 0.96);
}

.demo-progress-track {
  background: #e7edf4;
}

.audit-note,
.summary-chip.warn,
.risk-card {
  border-color: rgba(169, 99, 24, 0.28);
  background: #fff8ed;
}

.summary-chip.risk,
.report-rejection-card {
  border-color: rgba(180, 61, 61, 0.28);
  background: #fff6f6;
}

.signature-status-card,
.property-customer-matches,
.finance-priority-queue,
.demo-explanation {
  border-top-color: var(--line);
  border-bottom-color: var(--line);
}

.match-customer-row,
.signature-status-row,
.finance-queue-row,
.business-review-row,
.risk-exception-row,
.audit-row-list > div,
.active-deal-row {
  border-bottom-color: var(--line-soft);
}

.scenario-card,
.pipeline-card {
  background: #fff;
}

.pipeline-stage-track span.active {
  border-color: var(--blue);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 10px 12px;
  }

  .brand {
    min-height: 42px;
    padding: 0;
    border-bottom: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .business-path {
    position: static;
  }
}

@media (max-width: 640px) {
  .login-screen {
    gap: 14px;
    padding: 16px;
    background: #f3f5f7;
  }

  .login-visual {
    min-height: 300px;
    padding: 22px;
  }

  .login-visual h1 {
    font-size: 42px;
  }

  .login-panel {
    padding: 20px;
  }

  .workspace {
    padding: 12px;
  }

  .hero-panel {
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 24px;
  }

  .panel {
    padding: 14px;
  }

  .panel-header,
  .property-page-head,
  .management-page-head,
  .workflow-heading,
  .pipeline-main,
  .global-results-head {
    display: grid;
    gap: 8px;
  }

  .property-actions,
  .inline-actions,
  .management-row-actions,
  .match-customer-actions {
    justify-content: flex-start;
  }

  .kpi-card,
  .work-metric-card,
  .property-category-card,
  .quick-entry,
  .detail-card {
    min-height: auto;
  }
}
/* Stage B4 commission payout records */
.stage-b4-panel { margin-top: 16px; border-left: 3px solid #2d6a5f; }
.stage-b4-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stage-b4-summary span, .stage-b4-payment-grid > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line-soft); background: #f7f9f8; }
.stage-b4-summary span { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.stage-b4-summary strong { overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.stage-b4-payment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stage-b4-payment-grid small, .stage-b4-payment-grid strong, .stage-b4-payment-grid p { display: block; margin: 0; }
.stage-b4-payment-grid strong { margin: 4px 0; }
.stage-b4-blocker { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(185, 74, 72, 0.22); border-radius: 6px; background: rgba(185, 74, 72, 0.06); color: var(--muted-strong); font-size: 13px; line-height: 1.5; }
.stage-b4-blocker strong { flex: 0 0 auto; color: var(--red); }
.stage-b4-attempt-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.stage-b4-attempt-list li { display: grid; grid-template-columns: 72px minmax(100px, .7fr) minmax(180px, 1.8fr); align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.stage-b4-attempt-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.stage-b4-actions { margin-top: 12px; }
@media (max-width: 900px) {
  .stage-b4-summary, .stage-b4-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-b4-attempt-list li { grid-template-columns: 64px minmax(92px, 1fr); }
  .stage-b4-attempt-list small { grid-column: 1 / -1; }
}

/* Finance matcher linking v2 */
.matcher-v2-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 142px);
  min-height: 560px;
  min-width: 0;
  overflow: hidden;
  overflow-x: hidden;
}
.matcher-v2-head, .matcher-v2-toolbar, .matcher-v2-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.matcher-v2-head h3 { margin: 3px 0 2px; }
.matcher-v2-head p { margin: 0; color: var(--muted); }
.matcher-v2-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 16px 0 12px; }
.matcher-v2-metrics > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-soft, #f7f9fb); }
.matcher-v2-metrics span, .matcher-v2-metrics strong { display: block; }
.matcher-v2-metrics span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-metrics strong { margin-top: 5px; font-size: 22px; }
.matcher-v2-toolbar { margin-bottom: 10px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fff; }
.matcher-v2-tabs, .matcher-v2-mode { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.matcher-v2-tabs button, .matcher-v2-mode button { border: 0; border-radius: 5px; background: transparent; color: var(--muted-strong); cursor: pointer; padding: 8px 10px; }
.matcher-v2-tabs button.active, .matcher-v2-mode button.active { background: var(--ink); color: #fff; }
.matcher-v2-tabs span { margin-left: 4px; opacity: .72; }
.matcher-v2-mode > span { margin-right: 4px; color: var(--muted); font-size: 12px; }
.matcher-v2-search { display: grid; grid-template-columns: minmax(280px, 1fr) 32px; align-items: center; flex: 1 1 520px; max-width: 680px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.matcher-v2-search input { min-width: 0; border: 0; outline: 0; padding: 9px 12px; }
.matcher-v2-search button { width: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.matcher-v2-workspace { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.matcher-v2-grid { display: grid; flex: 1 1 auto; grid-template-columns: minmax(300px, 42fr) minmax(420px, 58fr); gap: 10px; min-width: 0; min-height: 180px; height: auto; }
.matcher-v2-grid .payment-workbench-column { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 6px; background: #fff; }
.matcher-v2-grid .matcher-v2-candidates { grid-template-rows: auto 162px minmax(118px, 1fr); }
.matcher-v2-grid .payment-workbench-column > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.matcher-v2-grid h4 { margin: 2px 0 0; }
.matcher-v2-scroll { display: grid; align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; }
.matcher-v2-transaction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(116px, .65fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; color: var(--ink); cursor: pointer; padding: 9px 12px; text-align: left; }
.matcher-v2-transaction:hover { background: #f6f8fa; }
.matcher-v2-transaction.active { box-shadow: inset 3px 0 0 var(--accent, #176b5b); background: #f1f7f5; }
.matcher-v2-transaction span { min-width: 0; }
.matcher-v2-transaction strong, .matcher-v2-transaction small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-transaction small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.matcher-v2-transaction em { border-radius: 4px; background: #edf3f1; color: #23685b; font-size: 11px; font-style: normal; padding: 4px 6px; white-space: nowrap; }
.matcher-v2-candidate-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; overflow-anchor: none; padding: 6px; border-bottom: 1px solid var(--line-soft); }
.matcher-v2-candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 8px; min-width: 0; }
.matcher-v2-candidate-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 150px;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px;
  text-align: left;
}
.matcher-v2-candidate-card:hover { border-color: #aebdb9; background: #f8faf9; }
.matcher-v2-candidate-card.active { border-color: var(--accent, #176b5b); box-shadow: inset 0 0 0 1px var(--accent, #176b5b); background: #f1f7f5; }
.matcher-v2-candidate-card.blocked { cursor: not-allowed; opacity: .62; }
.matcher-v2-candidate-card__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.matcher-v2-candidate-card__top em { border-radius: 4px; background: #edf3f1; color: #23685b; font-size: 11px; font-style: normal; padding: 4px 6px; white-space: nowrap; }
.matcher-v2-candidate-card__body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; margin-top: 6px; }
.matcher-v2-candidate-card__body strong, .matcher-v2-candidate-card__body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-candidate-card__body strong { font-size: 13px; }
.matcher-v2-candidate-card__body small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.matcher-v2-candidate-card__footer { min-width: 0; margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.matcher-v2-candidate-card__footer small { display: -webkit-box; overflow: hidden; color: var(--muted-strong); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.matcher-v2-extra-candidates { margin-top: 8px; }
.matcher-v2-candidate-header-actions { display: flex; align-items: center; gap: 8px; }
.matcher-v2-other-candidates { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-soft); border-radius: 5px; background: #fff; color: var(--muted-strong); cursor: pointer; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.matcher-v2-other-candidates:hover { border-color: var(--accent, #176b5b); color: var(--accent, #176b5b); }
.matcher-v2-other-candidates span { display: inline-grid; min-width: 18px; height: 18px; place-items: center; border-radius: 4px; background: #edf3f1; font-size: 10px; }
.matcher-v2-allocation-preview { min-height: 118px; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; background: #fbfcfc; }
[data-payment-matcher-preview-root] { min-height: 0; overflow: hidden; }
[data-payment-matcher-preview-root] > .matcher-v2-allocation-preview { height: 100%; min-height: 0; max-height: none; }
.matcher-v2-allocation-preview > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.matcher-v2-allocation-preview h4 { margin: 2px 0 0; font-size: 14px; }
.matcher-v2-allocation-preview.is-empty { display: flex; align-items: center; }
.matcher-v2-allocation-preview.is-empty h4 { margin: 3px 0 4px; }
.matcher-v2-allocation-preview.is-empty p { margin: 0; color: var(--muted); font-size: 12px; }
.matcher-v2-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.matcher-v2-preview-grid article { min-width: 0; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 5px; background: #fff; }
.matcher-v2-preview-grid span, .matcher-v2-preview-grid strong, .matcher-v2-preview-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-preview-grid span { color: var(--muted); font-size: 10px; }
.matcher-v2-preview-grid strong { margin: 3px 0; font-size: 12px; }
.matcher-v2-preview-grid small { color: var(--muted-strong); font-size: 10px; line-height: 1.5; }
.matcher-v2-preview-result { border-color: rgba(23, 107, 91, .28) !important; background: #f3f8f6 !important; }
.matcher-v2-split-preview { max-height: 190px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 5px; background: #fff; }
.matcher-v2-split-preview table { width: 100%; border-collapse: collapse; font-size: 11px; }
.matcher-v2-split-preview th, .matcher-v2-split-preview td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.matcher-v2-split-preview th:first-child, .matcher-v2-split-preview td:first-child, .matcher-v2-split-preview th:nth-child(2), .matcher-v2-split-preview td:nth-child(2) { text-align: left; }
.matcher-v2-split-preview tr.is-proposed { background: #f1f7f5; }
.matcher-v2-split-preview footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 7px 8px; color: var(--muted); font-size: 11px; }
.matcher-v2-split-preview footer strong { color: var(--ink); }
.matcher-v2-footer { position: relative; flex: 0 0 auto; z-index: 1; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 -4px 14px rgba(28, 37, 43, .05); }
.matcher-v2-footer > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.matcher-v2-footer > div:first-child span { overflow: hidden; max-width: 220px; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-auto-list { display: grid; max-height: 620px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.matcher-v2-auto-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) minmax(160px, .8fr) minmax(190px, 1fr); align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.matcher-v2-auto-row > div { min-width: 0; }
.matcher-v2-auto-row strong, .matcher-v2-auto-row span, .matcher-v2-auto-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-auto-row span, .matcher-v2-auto-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.matcher-v2-scenarios { margin: 0 0 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fff; }
.matcher-v2-scenarios > summary { cursor: pointer; padding: 9px 12px; color: var(--muted-strong); font-size: 13px; font-weight: 600; }
.matcher-v2-scenarios > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 340px; overflow: auto; border-top: 1px solid var(--line-soft); }
.matcher-v2-scenarios article { display: grid; grid-template-columns: auto minmax(150px, 1.1fr) minmax(140px, 1fr) minmax(140px, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.matcher-v2-scenarios article > div, .matcher-v2-scenarios p { min-width: 0; margin: 0; }
.matcher-v2-scenarios strong, .matcher-v2-scenarios small, .matcher-v2-scenarios p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matcher-v2-scenarios small, .matcher-v2-scenarios p { color: var(--muted); font-size: 11px; }
.matcher-v2-scenarios b { display: block; color: var(--muted-strong); font-size: 10px; font-weight: 600; }
@media (max-height: 820px) and (min-width: 901px) {
  .matcher-v2-shell { height: calc(100dvh - 164px); min-height: 0; }
  .matcher-v2-head p { display: none; }
  .matcher-v2-metrics { display: none; }
  .matcher-v2-toolbar { margin-bottom: 6px; padding: 4px; }
  .matcher-v2-tabs button, .matcher-v2-mode button { padding: 6px 8px; }
  .matcher-v2-search input { padding: 7px 10px; }
  .matcher-v2-scenarios { display: none; }
  .matcher-v2-grid .payment-workbench-column > header { padding: 6px 8px; }
  .matcher-v2-footer { padding: 8px 10px; }
}
@media (max-width: 1450px) and (min-width: 1101px) {
  .matcher-v2-toolbar { gap: 8px; }
  .matcher-v2-tabs button, .matcher-v2-mode button { padding-right: 7px; padding-left: 7px; }
  .matcher-v2-mode > span { display: none; }
  .matcher-v2-search { min-width: 260px; flex-basis: 320px; }
}
@media (max-width: 1100px) {
  .matcher-v2-toolbar { align-items: stretch; flex-wrap: wrap; }
  .matcher-v2-search { order: 3; max-width: none; flex-basis: 100%; }
  .matcher-v2-grid { grid-template-columns: minmax(260px, 40fr) minmax(340px, 60fr); }
  .matcher-v2-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .matcher-v2-auto-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matcher-v2-scenarios > div { grid-template-columns: 1fr; }
}

/* Post-lock change workbench */
.post-lock-workspace { display: grid; gap: 14px; }
.post-lock-page-head { margin-bottom: 0; }
.post-lock-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface); }
.post-lock-metrics > div { min-width: 0; padding: 10px 14px; }
.post-lock-metrics > div + div { border-left: 1px solid var(--line-soft); }
.post-lock-metrics span, .post-lock-metrics strong { display: block; }
.post-lock-metrics span { color: var(--muted); font-size: 11px; }
.post-lock-metrics strong { margin-top: 3px; font-size: 20px; font-variant-numeric: tabular-nums; }
.post-lock-section { min-width: 0; border-top: 1px solid var(--line); background: var(--surface); }
.post-lock-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 0 10px; }
.post-lock-section-heading h3, .post-lock-section-heading p { margin: 0; }
.post-lock-section-heading h3 { font-size: 17px; }
.post-lock-section-heading p:last-child { margin-top: 4px; color: var(--muted); font-size: 12px; }
.post-lock-scope { display: inline-flex; padding: 3px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-muted); }
.post-lock-scope button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted-strong); }
.post-lock-scope button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(25, 34, 42, .08); }
.post-lock-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line-soft); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--surface-soft); }
.post-lock-toolbar > span { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.post-lock-search { display: grid; flex: 1 1 320px; grid-template-columns: minmax(0, 1fr) 34px; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.post-lock-search input { min-width: 0; height: 34px; padding: 0 10px; border: 0; outline: 0; background: transparent; }
.post-lock-search button { width: 34px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.post-lock-toolbar select { flex: 0 1 154px; width: auto; min-width: 132px; height: 36px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.post-lock-table-scroll { max-height: 390px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 0 0 6px 6px; }
.post-lock-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.post-lock-table th, .post-lock-table td { padding: 9px 10px; overflow: hidden; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.post-lock-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-soft); color: var(--muted-strong); font-weight: 650; }
.post-lock-table tbody tr:hover { background: var(--surface-subtle); }
.post-lock-table td > strong, .post-lock-table td > small { display: block; overflow-wrap: anywhere; }
.post-lock-table td > small { margin-top: 4px; overflow: hidden; color: var(--muted); line-height: 1.35; text-overflow: ellipsis; }
.post-lock-table th:first-child { width: 17%; }
.post-lock-table th:nth-child(2) { width: 18%; }
.post-lock-table th:nth-child(3) { width: 15%; }
.post-lock-table th:nth-child(4) { width: 14%; }
.post-lock-table th:nth-child(5) { width: 16%; }
.post-lock-table th:last-child { width: 20%; }
.post-lock-table:not(.post-lock-history-table) th:last-child,
.post-lock-table:not(.post-lock-history-table) td:last-child { position: sticky; right: 0; z-index: 1; border-left: 1px solid var(--line-soft); background: var(--surface); box-shadow: -5px 0 9px rgba(25, 34, 42, .05); }
.post-lock-table:not(.post-lock-history-table) th:last-child { z-index: 3; background: var(--surface-soft); }
.post-lock-table:not(.post-lock-history-table) tbody tr:hover td:last-child { background: var(--surface-subtle); }
.post-lock-history-table th:first-child { width: 14%; }
.post-lock-history-table th:nth-child(2) { width: 14%; }
.post-lock-history-table th:nth-child(3) { width: 23%; }
.post-lock-history-table th:nth-child(4) { width: 13%; }
.post-lock-history-table th:nth-child(5) { width: 12%; }
.post-lock-history-table th:nth-child(6) { width: 12%; }
.post-lock-history-table th:last-child { width: 12%; }
.post-lock-case-link { padding: 0; border: 0; background: transparent; color: var(--accent); font-weight: 750; text-align: left; }
.post-lock-row-actions, .post-lock-row-actions .stage-b3-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.post-lock-row-actions .inline-action { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.post-lock-drawer-layer, .post-lock-initiation-layer { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-end; }
.post-lock-drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(18, 25, 31, .36); }
.post-lock-drawer, .post-lock-initiation { position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(720px, calc(100vw - 280px)); height: 100%; background: var(--surface); box-shadow: -12px 0 30px rgba(18, 25, 31, .16); }
.post-lock-drawer > header, .post-lock-initiation > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.post-lock-drawer > header h3, .post-lock-drawer > header p, .post-lock-initiation > header h3, .post-lock-initiation > header p { margin: 0; }
.post-lock-drawer > header p:last-child, .post-lock-initiation > header p:last-child { margin-top: 4px; color: var(--muted); font-size: 12px; }
.post-lock-drawer-scroll { min-height: 0; overflow-y: auto; }
.post-lock-drawer > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.post-lock-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.post-lock-overview > div { min-width: 0; padding: 12px 16px; }
.post-lock-overview > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.post-lock-overview span, .post-lock-overview strong { display: block; }
.post-lock-overview span { color: var(--muted); font-size: 11px; }
.post-lock-overview strong { margin-top: 4px; font-size: 13px; }
.post-lock-detail-section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post-lock-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.post-lock-section-title h4, .post-lock-section-title p { margin: 0; }
.post-lock-section-title > span { color: var(--muted-strong); font-size: 12px; }
.post-lock-diff-table { border: 1px solid var(--line-soft); border-radius: 5px; overflow: hidden; }
.post-lock-diff-row { display: grid; grid-template-columns: minmax(130px, .7fr) repeat(2, minmax(0, 1fr)); }
.post-lock-diff-row + .post-lock-diff-row { border-top: 1px solid var(--line-soft); }
.post-lock-diff-row > * { min-width: 0; padding: 8px 10px; overflow-wrap: anywhere; }
.post-lock-diff-row > * + * { border-left: 1px solid var(--line-soft); }
.post-lock-diff-row.is-head { background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.post-lock-impact-lines, .post-lock-related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.post-lock-impact-lines span, .post-lock-related > div { padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 5px; color: var(--muted); font-size: 11px; }
.post-lock-impact-lines strong, .post-lock-related span, .post-lock-related strong { display: block; margin-top: 3px; color: var(--ink); }
.post-lock-version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 5px; }
.post-lock-version-grid > div { min-width: 0; padding: 10px; }
.post-lock-version-grid > div + div { border-left: 1px solid var(--line-soft); }
.post-lock-version-grid span, .post-lock-version-grid strong, .post-lock-version-grid small { display: block; }
.post-lock-version-grid span, .post-lock-version-grid small { color: var(--muted); font-size: 10px; }
.post-lock-version-grid strong { margin: 4px 0; font-size: 18px; }
.post-lock-version-grid small { line-height: 1.45; }
.post-lock-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.post-lock-timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding-bottom: 12px; }
.post-lock-timeline li::before { position: absolute; top: 12px; bottom: 0; left: 5px; width: 1px; background: var(--line); content: ""; }
.post-lock-timeline li:last-child::before { display: none; }
.post-lock-timeline li > span { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.post-lock-timeline strong, .post-lock-timeline small, .post-lock-timeline p { display: block; margin: 0; }
.post-lock-timeline small, .post-lock-timeline p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.post-lock-initiation { grid-template-rows: auto auto minmax(0, 1fr); width: min(860px, calc(100vw - 280px)); }
.post-lock-initiation > .post-lock-search { margin: 12px 16px 0; }
.post-lock-initiation-body { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); min-height: 0; margin-top: 12px; border-top: 1px solid var(--line); }
.post-lock-initiation-list { min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); }
.post-lock-initiation-list > button { display: grid; gap: 4px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); color: var(--ink); text-align: left; }
.post-lock-initiation-list > button:hover, .post-lock-initiation-list > button.active { background: var(--surface-subtle); }
.post-lock-initiation-list > button.active { box-shadow: inset 3px 0 0 var(--accent); }
.post-lock-initiation-list span { display: flex; justify-content: space-between; gap: 10px; }
.post-lock-initiation-list em { color: var(--muted); font-style: normal; }
.post-lock-initiation-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.post-lock-initiation-detail { min-height: 0; padding: 14px 16px; overflow-y: auto; }
.post-lock-initiation-detail dl { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, auto); gap: 0; margin: 0; border: 1px solid var(--line-soft); border-radius: 5px; overflow: hidden; }
.post-lock-initiation-detail dt, .post-lock-initiation-detail dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.post-lock-initiation-detail dt { color: var(--muted); }
.post-lock-initiation-detail dd { text-align: right; font-weight: 650; }
.post-lock-allowed-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.post-lock-allowed-types > * { padding: 5px 8px; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 11px; }
.post-lock-allowed-types span { border-color: transparent; color: var(--muted); }
.post-lock-initiation-actions { margin-top: 12px; }
@media (max-width: 1180px) {
  .post-lock-toolbar > span { text-align: left; }
  .post-lock-drawer, .post-lock-initiation { width: min(760px, calc(100vw - 64px)); }
}
@media (max-width: 760px) {
  .post-lock-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-lock-metrics > div:nth-child(3) { border-top: 1px solid var(--line-soft); border-left: 0; }
  .post-lock-metrics > div:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .post-lock-section-heading, .post-lock-drawer > footer { align-items: stretch; flex-direction: column; }
  .post-lock-toolbar select { flex: 1 1 150px; }
  .post-lock-initiation-body { grid-template-columns: minmax(0, 1fr); }
  .post-lock-initiation-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-lock-drawer, .post-lock-initiation { width: 100vw; }
  .post-lock-impact-lines, .post-lock-related, .post-lock-version-grid { grid-template-columns: minmax(0, 1fr); }
  .post-lock-version-grid > div + div { border-top: 1px solid var(--line-soft); border-left: 0; }
}
