:root {
  --bfr-navy: #071425;
  --bfr-blue: #0b3a6e;
  --bfr-line: #d9e1e8;
  --bfr-soft: #f4f7fa;
  --bfr-gold: #f6cc6d;
}

body.business-resolution-page {
  background: #f4f7fa;
  color: var(--bfr-navy);
}

.bfr-shell {
  max-width: 1120px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 14px 44px;
  display: grid;
  gap: 14px;
  align-content: start;
  flex: 0 0 auto;
  min-width: 0;
}

.bfr-shell .pill,
.bfr-hero .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid #0b3a6e;
  background: #ffffff;
  color: #0b3a6e;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
}

.bfr-shell [hidden],
.bfr-hero [hidden] {
  display: none !important;
}

.bfr-shell .pill.small,
.bfr-hero .pill.small {
  min-height: 28px;
  font-size: 0.78rem;
}

.bfr-shell .pill.gold,
.bfr-hero .pill.gold {
  background: var(--bfr-gold);
  border-color: #bc8a36;
  color: #0a274f;
}

.bfr-shell .pill.blue,
.bfr-hero .pill.blue {
  background: #0b315f;
  border-color: #0a2f58;
  color: #ffffff;
}

.bfr-shell .pill.outline,
.bfr-hero .pill.outline {
  background: #ffffff;
  border-color: #0b3a6e;
  color: #0b3a6e;
}

.bfr-hero {
  flex: 0 0 auto;
  min-height: 126px;
  padding-top: 22px !important;
  padding-bottom: 24px !important;
}

.bfr-hero-inner {
  display: block;
  text-align: center;
}

.bfr-hero h1 {
  margin: 0;
  font-size: 2rem !important;
  line-height: 1.15;
  text-align: center;
}

.bfr-message {
  padding: 10px 14px;
  border: 1px solid #dfd0a4;
  border-left: 4px solid #bc8a36;
  border-radius: 8px;
  background: #fffaf0;
  color: #29435f;
  font-size: 0.88rem;
  font-weight: 600;
}

.bfr-comparison {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.bfr-result-card {
  border: 1px solid var(--bfr-line);
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  display: grid;
  gap: 3px;
  cursor: pointer;
  min-height: 82px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bfr-result-card:hover,
.bfr-result-card:focus-visible {
  border-color: #0b66c3;
  outline: none;
}

.bfr-result-card span {
  font-size: 0.78rem;
  font-weight: 800;
  color: #60758c;
}

.bfr-result-card strong {
  font-size: 0.94rem;
  color: #0a274f;
  line-height: 1.2;
}

.bfr-result-card small {
  color: #4b627a;
  line-height: 1.3;
}

.bfr-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #6f879f;
  border-radius: 50%;
  font-style: normal;
  font-size: 0.68rem;
  color: #33506d;
  background: #ffffff;
  margin-left: 4px;
}

.bfr-tip:hover::after,
.bfr-tip:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 20;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  width: min(240px, 70vw);
  padding: 8px 10px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  background: #ffffff;
  color: #1b334d;
  box-shadow: 0 10px 24px rgba(7, 20, 37, 0.15);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.bfr-grid-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bfr-accordion {
  border: 1px solid var(--bfr-line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 2px 10px rgba(7, 20, 37, 0.04);
}

.bfr-accordion summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  color: #0a274f;
}

.bfr-accordion summary em {
  font-style: normal;
  font-size: 0.76rem;
  color: #5a7088;
  font-weight: 600;
}

.bfr-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid #edf1f4;
  min-width: 0;
}

.bfr-entity-fields {
  border-top: 1px solid #edf1f4;
  padding-bottom: 8px;
}

.bfr-pl-section {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
}

.bfr-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
  min-width: 0;
}

.bfr-subhead h3 {
  margin: 0;
  color: #123d73;
  font-size: 0.96rem;
  font-weight: 700;
}

.bfr-section-note {
  color: #5a7088;
  font-size: 0.82rem;
  font-weight: 500;
}

.bfr-income-fields {
  border: 0;
  padding: 0;
}

.bfr-fields.compact {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.bfr-fields label,
.bfr-asset-table label,
.bfr-expense-row label {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #425a73;
  min-width: 0;
  line-height: 1.25;
}

.bfr-fields label > span,
.bfr-asset-table label > span,
.bfr-expense-row label > span {
  min-height: 18px;
}

.bfr-fields input,
.bfr-fields select,
.bfr-asset-table input,
.bfr-asset-table select,
.bfr-expense-row input,
.bfr-expense-row select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  color: #102942;
  background: #ffffff;
}

.bfr-expense-table {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bfr-expense-header,
.bfr-expense-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 220px) 44px;
  gap: 10px;
  align-items: end;
}

.bfr-expense-header {
  padding: 8px 12px;
  border: 1px solid #d9e1e8;
  border-radius: 6px;
  background: #f8fafc;
  color: #536a82;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.bfr-expense-row {
  padding: 10px 12px;
  border: 1px solid #e2e8ef;
  border-radius: 6px;
  background: #ffffff;
  min-width: 0;
  position: relative;
}

.bfr-expense-row .bfr-icon-btn {
  width: 36px;
  align-self: end;
  justify-self: end;
}

.bfr-empty-row {
  padding: 9px 10px;
  border: 1px dashed #cfd9e5;
  border-radius: 6px;
  color: #5b7188;
  font-size: 0.84rem;
  font-weight: 500;
}

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

.bfr-totals {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  padding: 4px 14px 13px;
  color: #29435f;
  font-size: 0.86rem;
}

.bfr-asset-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border-top: 1px solid #edf1f4;
  min-width: 0;
}

.bfr-asset-group {
  display: grid;
  gap: 9px;
  min-width: 0;
  align-content: start;
  padding: 12px;
  border: 1px solid #e4ebf2;
  border-radius: 8px;
  background: #fbfdff;
}

.bfr-asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.bfr-asset-head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #123d73;
}

.bfr-asset-table {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bfr-asset-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(92px, 0.72fr)) minmax(128px, 0.95fr) 38px;
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #ffffff;
}

.bfr-asset-row .bfr-icon-btn {
  align-self: end;
}

.bfr-asset-table > small {
  display: block;
  padding: 9px 10px;
  border: 1px dashed #cfd9e5;
  border-radius: 6px;
  color: #5b7188;
  background: #ffffff;
}

.bfr-icon-btn {
  width: 36px;
  min-height: 36px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  color: #8a1f1f;
  font-weight: 900;
}

.bfr-result-detail {
  border-top: 1px solid #edf1f4;
  padding: 12px;
  display: grid;
  gap: 6px;
  color: #263d55;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
  min-width: 0;
}

.bfr-oic-form-action {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.bfr-result-detail ul {
  margin: 0;
  padding-left: 18px;
}

.bfr-result-detail li {
  margin: 3px 0;
}

.bfr-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 0 0;
  background: #f4f7fa;
}

.bfr-actions .pill:disabled {
  cursor: wait;
  opacity: 0.65;
}

.bfr-actions .pill.navy { background: #0a274f; border-color: #0a274f; color: #fff; }
.bfr-actions .pill.neutral { background: #e7ebef; border-color: #aab4bf; color: #24384d; }
.bfr-actions .pill.bright-blue { background: #1769c2; border-color: #1769c2; color: #fff; }

.bfr-financial-summary {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr);
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #d3dfeb;
  border-left: 5px solid #c99426;
  border-radius: 12px;
  background: #fffaf0;
  min-width: 0;
}

.bfr-financial-summary[hidden] { display: none; }
.bfr-financial-summary h2 { margin: 0; color: #0a274f; font-size: 1.12rem; }
.bfr-financial-summary p { margin: 4px 0 0; color: #526980; font-size: .88rem; }
.bfr-financial-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.bfr-financial-summary dl div { padding: 9px 11px; border: 1px solid #e2d4b2; border-radius: 8px; background: #fff; }
.bfr-financial-summary dt { color: #526980; font-size: .76rem; font-weight: 700; }
.bfr-financial-summary dd { margin: 3px 0 0; color: #0a274f; font-size: 1rem; font-weight: 700; }

body.bfr-standalone-mode #bfr-message,
body.bfr-standalone-mode #bfr-prerequisite-actions,
body.bfr-standalone-mode #bfr-comparison,
body.bfr-standalone-mode #result-hardship,
body.bfr-standalone-mode #result-ppia,
body.bfr-standalone-mode #result-oic { display: none !important; }

body.bfr-financial-mode #bfr-message,
body.bfr-financial-mode #bfr-prerequisite-actions,
body.bfr-financial-mode #bfr-comparison,
body.bfr-financial-mode #result-hardship,
body.bfr-financial-mode #result-ppia,
body.bfr-financial-mode #result-oic { display: none !important; }

#bfr-save-status {
  font-size: 0.84rem;
  color: #425a73;
  font-weight: 700;
}

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

.bfr-prerequisite-actions[hidden] {
  display: none;
}

body.bfr-results-mode #bfr-form > .bfr-accordion:not(#result-hardship):not(#result-ppia):not(#result-oic),
body.bfr-results-mode #bfr-form > .bfr-actions {
  display: none;
}

body.bfr-results-mode .bfr-comparison {
  display: none;
}

body.bfr-results-mode .bfr-shell {
  gap: 10px;
  padding-top: 14px;
}

body.bfr-results-mode .bfr-result-detail {
  min-height: 0;
  padding: 10px 12px;
}

body.bfr-results-mode .bfr-hero {
  min-height: 112px;
  padding-top: 17px !important;
  padding-bottom: 19px !important;
}

body.bfr-results-mode .bfr-hero-inner {
  display: block;
  text-align: center;
}

body.bfr-results-mode .bfr-hero h1 {
  margin: 0;
  text-align: center;
}

body.bfr-results-mode .tt-bottom-back a.bfr-results-profile-back {
  background: #0a274f;
  border-color: #0a274f;
  color: #fff;
}

body.bfr-results-mode .bfr-message,
body.bfr-results-mode .bfr-prerequisite-actions,
body.bfr-results-mode .bfr-accordion {
  align-self: start;
}

body.bfr-results-mode #bfr-message {
  display: none !important;
}

@media (max-width: 860px) {
  .bfr-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .bfr-asset-groups {
    grid-template-columns: 1fr;
  }

  .bfr-asset-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 38px;
  }

  .bfr-asset-description {
    grid-column: 1 / -1;
  }

  .bfr-expense-header,
  .bfr-expense-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) 44px;
  }
}

@media (max-width: 640px) {
  .bfr-totals {
    flex-direction: column;
    align-items: stretch;
  }

  .bfr-hero h1 { font-size: 1.62rem !important; }


  .bfr-comparison,
  .bfr-fields,
  .bfr-fields.compact {
    grid-template-columns: 1fr;
  }

  .bfr-asset-row {
    grid-template-columns: 1fr;
  }

  .bfr-asset-row .bfr-icon-btn,
  .bfr-expense-row .bfr-icon-btn {
    justify-self: start;
  }

  .bfr-expense-header {
    display: none;
  }

  .bfr-expense-row {
    grid-template-columns: 1fr;
  }

  .bfr-actions {
    gap: 8px;
  }

  .bfr-actions .pill {
    flex: 1 1 calc(50% - 8px);
  }

  #bfr-save-status {
    flex-basis: 100%;
  }

  .bfr-financial-summary,
  .bfr-financial-summary dl { grid-template-columns: 1fr; }
}

@media print {
  body.business-resolution-page,
  .bfr-shell,
  .bfr-actions {
    background: #ffffff;
  }

  .bfr-shell {
    max-width: none;
    padding: 0;
  }

  .bfr-accordion {
    break-inside: avoid;
  }
}
