:root {
  --portal-navy: #102c55;
  --portal-blue: #245fca;
  --portal-blue-soft: #eaf2ff;
  --portal-green: #157b65;
  --portal-violet: #7450c9;
  --portal-text: #17283f;
  --portal-muted: #6f7e92;
  --portal-border: #dce5f0;
  --portal-surface: #ffffff;
  --portal-bg: #07192d;
}

.preqlab-boot #root {
  visibility: hidden;
}

html.preqlab-portal-mode,
html.preqlab-portal-mode body {
  min-height: 100%;
  background: var(--portal-bg);
}

html.preqlab-portal-mode #root {
  display: none;
}

html.preqlab-workspace-mode #preqlab-portal {
  display: none;
}

#preqlab-portal {
  min-height: 100svh;
  color: var(--portal-text);
  background:
    radial-gradient(circle at 12% -4%, rgba(54, 112, 215, 0.35), transparent 31rem),
    radial-gradient(circle at 100% 78%, rgba(123, 63, 184, 0.22), transparent 30rem),
    var(--portal-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#preqlab-portal * {
  box-sizing: border-box;
}

.portal-page {
  width: min(100%, 1180px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.portal-login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 18, 35, 0.66) 0%, rgba(6, 24, 45, 0.43) 49%, rgba(5, 20, 38, 0.52) 100%),
    linear-gradient(180deg, rgba(4, 17, 32, 0.07), rgba(4, 17, 32, 0.38)),
    url("/preqlab-login-background.jpg") center center / cover no-repeat;
}

.portal-login-page > * {
  position: relative;
  z-index: 1;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-app-topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.portal-app-topbar .portal-profile-actions {
  justify-self: end;
}

.portal-header-brand {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: transparent;
  font: inherit;
}

.portal-header-brand > span {
  width: clamp(50px, 4.2vw, 58px);
  height: clamp(50px, 4.2vw, 58px);
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.portal-header-brand img {
  width: clamp(44px, 3.6vw, 50px);
  height: clamp(44px, 3.6vw, 50px);
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

.portal-nav-wrap {
  position: relative;
  justify-self: start;
}

.portal-nav-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(205, 220, 239, 0.3);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.portal-nav-toggle:hover,
.portal-nav-toggle[aria-expanded="true"] {
  border-color: rgba(225, 236, 249, 0.72);
  background: rgba(255, 255, 255, 0.18);
}

.portal-nav-toggle svg {
  width: 20px;
  height: 20px;
}

.portal-nav-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  width: min(272px, calc(100vw - 26px));
  padding: 7px;
  border: 1px solid #d8e2ee;
  border-radius: 15px;
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 55px rgba(1, 12, 28, 0.3);
  backdrop-filter: blur(18px);
}

.portal-nav-menu button {
  min-height: 45px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #29425f;
  background: transparent;
  font: 750 11px/1.2 inherit;
  text-align: left;
}

.portal-nav-menu button:hover,
.portal-nav-menu button:focus-visible {
  color: #153f7d;
  background: #edf4ff;
}

.portal-nav-menu svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: #2869bd;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.portal-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.portal-brand-mark img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

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

.portal-brand strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
}

.portal-brand span {
  margin-top: 3px;
  color: #aebed3;
  font-size: 10px;
}

.portal-icon-button,
.portal-language,
.portal-text-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.portal-language,
.portal-text-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(190, 210, 235, 0.3);
  border-radius: 10px;
  color: #f5f8fc;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 750;
}

.portal-language:hover,
.portal-text-button:hover {
  border-color: rgba(222, 234, 248, 0.7);
  background: rgba(255, 255, 255, 0.18);
}

.portal-centered-brand {
  margin: 0 auto 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.portal-centered-brand img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 15px 24px rgba(0, 0, 0, 0.3));
}

.portal-centered-brand strong {
  color: #fff;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.portal-centered-brand span {
  max-width: 330px;
  color: #b9c8db;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0.015em;
}

.portal-intro .portal-centered-brand {
  margin-left: 0;
  margin-right: 0;
  align-items: flex-start;
  text-align: left;
}

.portal-login-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.72fr);
  align-items: center;
  gap: clamp(36px, 8vw, 110px);
  padding: 64px 5vw;
}

.portal-eyebrow {
  margin: 0 0 13px;
  color: var(--portal-blue);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 850;
}

.portal-intro h1,
.portal-menu-heading h1,
.portal-calculator-title h1 {
  margin: 0;
  color: #fff;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.portal-intro h1 {
  max-width: 650px;
  font-size: clamp(42px, 5.7vw, 73px);
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.35);
}

.portal-intro > p:not(.portal-eyebrow) {
  max-width: 580px;
  margin: 23px 0 0;
  color: #bdc9d9;
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.7;
}

.portal-benefits {
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  list-style: none;
}

.portal-benefits li {
  padding: 8px 11px;
  border: 1px solid rgba(205, 220, 239, 0.23);
  border-radius: 999px;
  color: #d9e3f0;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
}

.portal-card {
  border: 1px solid rgba(210, 221, 235, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(30, 53, 84, 0.13);
}

.portal-login-card {
  padding: 30px;
}

.portal-login-card h2 {
  margin: 0;
  color: var(--portal-navy);
  font-size: 24px;
  letter-spacing: -0.035em;
}

.portal-login-card > p {
  margin: 9px 0 24px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.55;
}

.portal-field {
  display: grid;
  gap: 7px;
}

.portal-field + .portal-field {
  margin-top: 14px;
}

.portal-field label {
  color: #41546e;
  font-size: 11px;
  font-weight: 750;
}

.portal-input {
  width: 100%;
  height: 48px;
  border: 1px solid #cfdbe8;
  border-radius: 12px;
  outline: none;
  color: var(--portal-text);
  background: #fbfdff;
  padding: 0 13px;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.portal-input:focus {
  border-color: #6c95d6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(36, 95, 202, 0.1);
}

.portal-code-input {
  text-align: center;
  letter-spacing: 0.34em;
  font-size: 23px;
  font-weight: 800;
}

.portal-primary,
.portal-secondary,
.portal-program-card {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.portal-primary,
.portal-secondary {
  width: 100%;
  min-height: 49px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.portal-primary {
  margin-top: 18px;
  color: #fff;
  background: linear-gradient(145deg, #17458a, #2869d5);
  box-shadow: 0 12px 24px rgba(32, 87, 177, 0.23);
}

.portal-primary:hover,
.portal-program-card:hover {
  transform: translateY(-1px);
}

.portal-primary:disabled,
.portal-secondary:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.portal-secondary {
  margin-top: 10px;
  border: 1px solid rgba(190, 210, 235, 0.3);
  color: #37516f;
  background: #fff;
}

.portal-help {
  margin: 15px 0 0;
  color: #8a96a6;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
}

.portal-auth-links {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 15px;
}

.portal-auth-links a,
.portal-auth-links button {
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #245fca;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.portal-auth-links a:hover,
.portal-auth-links a:focus-visible,
.portal-auth-links button:hover,
.portal-auth-links button:focus-visible {
  color: #153f7d;
  text-decoration: underline;
}

.portal-register-layout {
  grid-template-columns: minmax(0, 0.82fr) minmax(440px, 0.9fr);
  align-items: start;
  padding-top: 42px;
  padding-bottom: 42px;
}

.portal-register-layout .portal-intro {
  position: sticky;
  top: 42px;
  padding-top: 35px;
}

.portal-register-card {
  padding: 27px;
}

.portal-account-types {
  margin: 17px 0 14px;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.portal-account-types legend {
  width: 100%;
  margin-bottom: 7px;
  color: #41546e;
  font-size: 11px;
  font-weight: 750;
}

.portal-account-type {
  min-height: 106px;
  padding: 14px;
  border: 1px solid #cfdbe8;
  border-radius: 13px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fbfdff;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.portal-account-type.selected {
  border-color: #3673cf;
  background: #edf4ff;
  box-shadow: 0 0 0 3px rgba(36, 95, 202, 0.08);
}

.portal-account-type input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #245fca;
}

.portal-account-type span,
.portal-account-type strong,
.portal-account-type small {
  display: block;
}

.portal-account-type strong {
  color: #16385f;
  font-size: 12px;
}

.portal-account-type small {
  margin-top: 5px;
  color: #6f7e92;
  font-size: 10px;
  line-height: 1.45;
}

.portal-loan-officer-fields {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.portal-loan-officer-fields .portal-field + .portal-field {
  margin-top: 0;
}

.portal-registration-disclaimer {
  margin: 15px 0 0;
  padding: 11px 12px;
  border: 1px solid #d7e5f8;
  border-radius: 11px;
  color: #375678;
  background: #f2f7ff;
  font-size: 10px;
  line-height: 1.5;
}

.portal-trial-notice {
  margin: 15px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(58, 113, 198, 0.24);
  border-radius: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #274a73;
  background: #edf5ff;
  font-size: 11px;
  line-height: 1.45;
}

.portal-trial-notice strong {
  flex: 0 0 auto;
  color: #17458a;
}

.portal-menu-content > .portal-trial-notice {
  max-width: 700px;
  margin: 24px auto 0;
}

.portal-calculator-content > .portal-trial-notice {
  margin-bottom: 14px;
}

.portal-message {
  margin: 13px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.portal-message.error {
  color: #a0374b;
  background: #fcebee;
}

.portal-message.success {
  color: #14634f;
  background: #e8f6f0;
}

/* ─── Authenticated Dashboard ─── */
.portal-dashboard-page {
  width: min(100%, 1480px);
}

.portal-dashboard-shell {
  min-height: calc(100svh - 104px);
  margin-top: 23px;
  border: 1px solid rgba(208, 220, 235, 0.88);
  border-radius: 25px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: #eef3f8;
  box-shadow: 0 28px 65px rgba(0, 9, 24, 0.25);
}

.portal-dashboard-sidebar {
  padding: 23px 15px 18px;
  border-right: 1px solid #dde6f0;
  display: flex;
  flex-direction: column;
  color: #304966;
  background: rgba(255, 255, 255, 0.96);
}

.portal-dashboard-sidebar-brand {
  min-height: 54px;
  padding: 0 8px 20px;
  border-bottom: 1px solid #e5ebf2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-dashboard-sidebar-brand img {
  width: 37px;
  height: 37px;
  object-fit: contain;
}

.portal-dashboard-sidebar-brand div,
.portal-dashboard-sidebar-brand strong,
.portal-dashboard-sidebar-brand span {
  min-width: 0;
  display: block;
}

.portal-dashboard-sidebar-brand strong {
  color: #152b48;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.portal-dashboard-sidebar-brand span {
  margin-top: 2px;
  overflow: hidden;
  color: #8290a3;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  font-weight: 700;
}

.portal-dashboard-sidebar nav {
  margin-top: 20px;
  display: grid;
  gap: 5px;
}

.portal-dashboard-sidebar nav button {
  min-height: 45px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #53657c;
  background: transparent;
  font: 750 10px/1.2 inherit;
  text-align: left;
  transition: 0.16s ease;
}

.portal-dashboard-sidebar nav button:hover,
.portal-dashboard-sidebar nav button:focus-visible,
.portal-dashboard-sidebar nav button.active {
  color: #174f9d;
  background: #eaf2ff;
}

.portal-dashboard-sidebar nav button.active {
  box-shadow: inset 3px 0 #2d6ccb;
}

.portal-dashboard-sidebar nav svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.portal-dashboard-account {
  margin-top: auto;
  padding: 13px 8px 0;
  border-top: 1px solid #e5ebf2;
  display: flex;
  align-items: center;
  gap: 9px;
}

.portal-dashboard-account > i {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #245fca, #153d7a);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.portal-dashboard-account div,
.portal-dashboard-account strong,
.portal-dashboard-account span {
  min-width: 0;
  display: block;
}

.portal-dashboard-account strong {
  overflow: hidden;
  color: #223953;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.portal-dashboard-account span {
  margin-top: 3px;
  color: #7a899d;
  font-size: 8px;
}

.portal-dashboard-account b {
  color: #245fca;
}

.portal-dashboard-main {
  min-width: 0;
  padding: 30px;
}

.portal-dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.portal-dashboard-heading .portal-eyebrow {
  margin-bottom: 8px;
}

.portal-dashboard-heading h1 {
  margin: 0;
  color: #142a47;
  font-size: clamp(28px, 3vw, 41px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.portal-dashboard-heading > div:first-child > p:last-child {
  max-width: 560px;
  margin: 10px 0 0;
  color: #6d7d91;
  font-size: 11px;
  line-height: 1.55;
}

.portal-dashboard-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.portal-dashboard-primary,
.portal-dashboard-refresh {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #245fca;
  box-shadow: 0 10px 22px rgba(36, 95, 202, 0.2);
  font: 800 10px/1.2 inherit;
}

.portal-dashboard-primary {
  padding: 0 15px;
  gap: 8px;
}

.portal-dashboard-refresh {
  width: 42px;
  color: #31506f;
  background: #fff;
  box-shadow: 0 7px 16px rgba(25, 51, 81, 0.08);
}

.portal-dashboard-primary:hover,
.portal-dashboard-primary:focus-visible {
  background: #1d52b2;
}

.portal-dashboard-refresh:hover,
.portal-dashboard-refresh:focus-visible {
  color: #245fca;
}

.portal-dashboard-refresh:disabled {
  cursor: wait;
  opacity: 0.55;
}

.portal-dashboard-primary svg,
.portal-dashboard-refresh svg {
  width: 17px;
  height: 17px;
}

.portal-dashboard-message {
  margin-top: 18px;
}

.portal-dashboard-main > section {
  margin-top: 28px;
}

.portal-dashboard-section-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.portal-dashboard-section-heading h2 {
  margin: 0;
  color: #1b324f;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.portal-dashboard-section-heading p {
  margin: 4px 0 0;
  color: #7a899b;
  font-size: 9px;
  line-height: 1.45;
}

.portal-dashboard-loading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6c7d91;
  font-size: 9px;
  font-weight: 750;
}

.portal-dashboard-loading .portal-spinner {
  width: 14px;
  height: 14px;
}

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

.portal-dashboard-stat {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(34, 62, 94, 0.06);
}

.portal-dashboard-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--stat-color);
}

.portal-dashboard-stat.blue { --stat-color: #3478d4; --stat-soft: #eaf2ff; }
.portal-dashboard-stat.green { --stat-color: #27a07e; --stat-soft: #e5f6f0; }
.portal-dashboard-stat.peach { --stat-color: #dc8b5c; --stat-soft: #fff0e7; }
.portal-dashboard-stat.violet { --stat-color: #7450c9; --stat-soft: #f0ebfb; }

.portal-dashboard-stat > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--stat-color);
  background: var(--stat-soft);
}

.portal-dashboard-stat svg {
  width: 18px;
  height: 18px;
}

.portal-dashboard-stat small {
  margin-top: 13px;
  display: block;
  color: #8390a2;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 7px;
  font-weight: 850;
}

.portal-dashboard-stat strong {
  margin-top: 4px;
  display: block;
  color: #1c304b;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.portal-dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.portal-dashboard-action {
  position: relative;
  min-height: 95px;
  padding: 16px;
  border: 1px solid #dce5ef;
  border-radius: 15px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #1b334f;
  background: #fff;
  box-shadow: 0 7px 19px rgba(34, 62, 94, 0.05);
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.portal-dashboard-action:hover,
.portal-dashboard-action:focus-visible {
  transform: translateY(-2px);
  border-color: #b8cbe3;
  box-shadow: 0 13px 27px rgba(34, 62, 94, 0.11);
}

.portal-dashboard-action > i {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--action-color);
  background: var(--action-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.portal-dashboard-action.conventional { --action-color: #245fca; --action-soft: #eaf2ff; }
.portal-dashboard-action.fha { --action-color: #157b65; --action-soft: #e6f3ef; }
.portal-dashboard-action.va { --action-color: #7450c9; --action-soft: #f0ebfb; }
.portal-dashboard-action.blue { --action-color: #245fca; --action-soft: #eaf2ff; }
.portal-dashboard-action.violet { --action-color: #7450c9; --action-soft: #f0ebfb; }
.portal-dashboard-action.green { --action-color: #157b65; --action-soft: #e6f3ef; }

.portal-dashboard-action svg {
  width: 21px;
  height: 21px;
}

.portal-dashboard-action > span,
.portal-dashboard-action strong,
.portal-dashboard-action small {
  min-width: 0;
  display: block;
}

.portal-dashboard-action strong {
  color: #203750;
  font-size: 10px;
}

.portal-dashboard-action small {
  margin-top: 4px;
  overflow: hidden;
  color: #7c8a9d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  line-height: 1.4;
}

.portal-dashboard-action > b {
  color: #9aabba;
  font-size: 15px;
}

.portal-dashboard-activity-card {
  padding: 18px 20px;
  border: 1px solid #dce5ef;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(34, 62, 94, 0.05);
}

.portal-dashboard-activity-list article {
  min-height: 55px;
  padding: 8px 0;
  border-top: 1px solid #edf1f5;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.portal-dashboard-activity-list article:first-child {
  border-top: 0;
}

.portal-dashboard-activity-list article > i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #245fca;
  background: #eaf2ff;
}

.portal-dashboard-activity-list article > i.lead {
  color: #157b65;
  background: #e6f3ef;
}

.portal-dashboard-activity-list svg {
  width: 17px;
  height: 17px;
}

.portal-dashboard-activity-list strong,
.portal-dashboard-activity-list span {
  display: block;
}

.portal-dashboard-activity-list strong {
  color: #273e58;
  font-size: 9px;
}

.portal-dashboard-activity-list span,
.portal-dashboard-activity-list time {
  margin-top: 3px;
  color: #8491a2;
  font-size: 8px;
}

.portal-dashboard-activity-list time {
  margin: 0;
  white-space: nowrap;
}

.portal-dashboard-empty {
  min-height: 115px;
  border: 1px dashed #d4dfeb;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #607289;
  background: #f9fbfd;
}

.portal-dashboard-empty > svg {
  width: 29px;
  height: 29px;
  color: #8193a7;
}

.portal-dashboard-empty strong {
  color: #304761;
  font-size: 10px;
}

.portal-dashboard-empty p {
  max-width: 480px;
  margin: 4px 0 0;
  font-size: 8px;
  line-height: 1.45;
}

.portal-menu-page {
  padding-bottom: 48px;
}

.portal-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-user-pill {
  max-width: 220px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.portal-user-pill i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1b568f;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.portal-user-pill span {
  min-width: 0;
  overflow: hidden;
  color: #eff4fa;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
}

.portal-menu-content {
  width: min(100%, 850px);
  margin: auto;
  padding: 70px 0 30px;
}

.portal-menu-heading {
  text-align: center;
}

.portal-menu-heading h1 {
  max-width: 440px;
  margin-inline: auto;
  font-size: clamp(32px, 5vw, 50px);
}

.portal-menu-heading > p:not(.portal-eyebrow) {
  max-width: 530px;
  margin: 14px auto 0;
  color: #bdc9d9;
  font-size: 13px;
  line-height: 1.6;
}

.portal-programs {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.portal-program-card {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-top: 4px solid var(--program-color);
  border-radius: 18px;
  padding: 21px;
  text-align: left;
  background: #fff;
  box-shadow: 0 11px 30px rgba(30, 54, 84, 0.08);
  transition: transform 0.16s, box-shadow 0.16s;
}

.portal-program-card:hover {
  box-shadow: 0 16px 38px rgba(30, 54, 84, 0.13);
}

.portal-program-card::after {
  content: "";
  position: absolute;
  right: -43px;
  bottom: -56px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--program-color) 9%, transparent);
}

.portal-program-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--program-color);
  background: color-mix(in srgb, var(--program-color) 10%, white);
  font-size: 11px;
  font-weight: 850;
}

.portal-program-card strong {
  position: relative;
  z-index: 1;
  margin-top: 23px;
  display: block;
  color: var(--portal-navy);
  font-size: 19px;
  letter-spacing: -0.025em;
}

.portal-program-card span:last-child {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  display: block;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.45;
}

.portal-computer-button {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  border: 1px solid #cad7e6;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #304966;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.portal-crm-button {
  width: 100%;
  min-height: 74px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(116, 80, 201, 0.38);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #fff;
  background: linear-gradient(135deg, rgba(42, 70, 118, 0.94), rgba(80, 58, 140, 0.92));
  box-shadow: 0 14px 32px rgba(3, 13, 29, 0.24);
  font: inherit;
  text-align: left;
}

.portal-crm-button svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.portal-crm-button span,
.portal-crm-button strong,
.portal-crm-button small {
  display: block;
}

.portal-crm-button strong {
  font-size: 13px;
}

.portal-crm-button small {
  margin-top: 3px;
  color: #d4ddec;
  font-size: 9px;
  font-weight: 600;
}

.portal-computer-button svg,
.portal-back svg,
.portal-calculator-actions .portal-primary svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.portal-credit-line {
  margin: 14px 0 0;
  color: #b4c2d5;
  text-align: center;
  font-size: 10px;
}

.portal-crm-page {
  width: min(100%, 1320px);
}

.portal-crm-content {
  flex: 1;
  padding: 34px 0 30px;
}

.portal-crm-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.portal-crm-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(31px, 5vw, 47px);
  letter-spacing: -0.045em;
}

.portal-crm-heading p:not(.portal-eyebrow) {
  margin: 9px 0 0;
  color: #bdc9d9;
  font-size: 12px;
}

.portal-icon-action {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(210, 225, 243, 0.28);
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font: 700 20px/1 inherit;
}

.portal-crm-layout {
  margin-top: 23px;
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}

.portal-crm-leads,
.portal-crm-panel,
.portal-crm-form-card,
.portal-crm-lead-header,
.portal-empty-card {
  border-color: rgba(210, 221, 235, 0.74);
  background: rgba(255, 255, 255, 0.96);
}

.portal-crm-leads {
  position: sticky;
  top: 20px;
  overflow: hidden;
  padding: 17px;
}

.portal-crm-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-crm-section-title h2 {
  margin: 0;
  color: var(--portal-navy);
  font-size: 15px;
}

.portal-crm-section-title > span {
  min-width: 25px;
  height: 25px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #315174;
  background: #eaf1fa;
  font-size: 9px;
  font-weight: 800;
}

.portal-crm-search {
  margin-top: 13px;
}

.portal-crm-search .portal-input {
  height: 40px;
  font-size: 12px;
}

.portal-lead-list {
  max-height: 625px;
  margin-top: 10px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
}

.portal-lead-item {
  width: 100%;
  min-height: 62px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  background: transparent;
  text-align: left;
  font: inherit;
}

.portal-lead-item:hover,
.portal-lead-item.selected {
  border-color: #cbd9e9;
  background: #f1f6fc;
}

.portal-lead-item i,
.portal-lead-avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #215794, #7450c9);
  font-style: normal;
  font-weight: 800;
}

.portal-lead-item i {
  width: 35px;
  height: 35px;
  font-size: 9px;
}

.portal-lead-item span,
.portal-lead-item strong,
.portal-lead-item small {
  min-width: 0;
  display: block;
}

.portal-lead-item strong {
  overflow: hidden;
  color: #263c57;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.portal-lead-item small,
.portal-lead-item time {
  margin-top: 3px;
  overflow: hidden;
  color: #7a8798;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.portal-crm-main {
  min-width: 0;
}

.portal-crm-lead-header {
  padding: 17px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.portal-lead-avatar {
  width: 46px;
  height: 46px;
  font-size: 11px;
}

.portal-crm-lead-header h2 {
  margin: 0;
  color: var(--portal-navy);
  font-size: 18px;
}

.portal-crm-lead-header p {
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 9px;
}

.portal-status-pill,
.portal-priority,
.portal-overdue {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  color: #415975;
  background: #eaf1f8;
  font-size: 8px;
  font-weight: 800;
  text-transform: capitalize;
}

.portal-crm-tabs {
  margin: 11px 0;
  padding: 4px;
  border: 1px solid rgba(205, 220, 238, 0.28);
  border-radius: 12px;
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.09);
}

.portal-crm-tabs button {
  min-height: 35px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #b9c7d9;
  background: transparent;
  font: 750 9px/1 inherit;
}

.portal-crm-tabs button.active {
  color: #274562;
  background: #fff;
}

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

.portal-crm-column {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.portal-crm-panel {
  overflow: hidden;
  padding: 17px;
}

.portal-followup-list,
.portal-timeline {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.portal-followup-item {
  padding: 13px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fbfdff;
}

.portal-followup-item.overdue {
  border-color: #f0bec8;
  background: #fff9fa;
}

.portal-followup-item > div:first-child {
  display: flex;
  gap: 5px;
}

.portal-priority.high,
.portal-overdue {
  color: #9b3548;
  background: #fde8ed;
}

.portal-priority.low {
  color: #426f63;
  background: #e5f3ef;
}

.portal-followup-item h3 {
  margin: 9px 0 0;
  color: #253b55;
  font-size: 12px;
}

.portal-followup-item p,
.portal-timeline-item p {
  margin: 5px 0 0;
  color: #6f7d8f;
  font-size: 9px;
  line-height: 1.5;
}

.portal-followup-item time {
  margin-top: 8px;
  display: block;
  color: #4f6480;
  font-size: 8px;
  font-weight: 750;
}

.portal-followup-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.portal-followup-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cad8e7;
  border-radius: 8px;
  cursor: pointer;
  color: #315070;
  background: #fff;
  font: 750 8px/1 inherit;
}

.portal-followup-actions button:first-child {
  color: #fff;
  border-color: #277b66;
  background: #277b66;
}

.portal-timeline-item {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 9px;
}

.portal-timeline-item > i {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #31577e;
  background: #e7f0fa;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.portal-timeline-item > div > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.portal-timeline-item strong {
  color: #2d425c;
  font-size: 10px;
}

.portal-timeline-item time,
.portal-timeline-item small {
  color: #8a96a5;
  font-size: 7px;
}

.portal-timeline-item small {
  margin-top: 5px;
  display: block;
}

.portal-crm-form-card {
  padding: 16px;
}

.portal-crm-form-card summary {
  cursor: pointer;
  color: var(--portal-navy);
  font-size: 12px;
  font-weight: 800;
}

.portal-crm-form-card form {
  margin-top: 14px;
}

.portal-crm-form-card .portal-field + .portal-field {
  margin-top: 10px;
}

.portal-crm-form-card .portal-input {
  height: 42px;
  font-size: 12px;
}

.portal-crm-form-card .portal-textarea {
  min-height: 76px;
  padding-top: 10px;
  resize: vertical;
}

.portal-crm-form-card .portal-primary {
  min-height: 42px;
  margin-top: 12px;
}

.portal-empty {
  margin: 18px 0;
  color: #8995a5;
  text-align: center;
  font-size: 9px;
  line-height: 1.55;
}

.portal-empty-card,
.portal-crm-loading {
  padding: 36px;
  color: #718096;
  text-align: center;
  font-size: 11px;
}

.portal-crm-loading {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #d7e1ee;
}

.portal-calculator-page {
  width: min(100%, 700px);
}

.portal-calculator-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-back {
  min-height: 40px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #eef4fb;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.portal-calculator-content {
  flex: 1;
  padding: 34px 0 24px;
}

.portal-calculator-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.portal-calculator-title h1 {
  font-size: clamp(30px, 7vw, 42px);
}

.portal-calculator-title p:not(.portal-eyebrow) {
  margin: 9px 0 0;
  color: #bdc9d9;
  font-size: 11px;
}

.portal-program-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--program-color);
  background: color-mix(in srgb, var(--program-color) 10%, white);
  font-size: 10px;
  font-weight: 850;
}

.portal-mobile-calculator {
  margin-top: 23px;
  overflow: hidden;
}

.portal-quick-inputs {
  padding: 20px;
}

.portal-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.portal-input-grid .portal-field + .portal-field {
  margin-top: 0;
}

.portal-number-wrap {
  position: relative;
}

.portal-number-wrap > span {
  position: absolute;
  top: 50%;
  color: #7d8999;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 12px;
  font-weight: 650;
}

.portal-number-wrap > span:first-child {
  left: 12px;
}

.portal-number-wrap > span:last-child {
  right: 12px;
}

.portal-number-wrap.prefix .portal-input {
  padding-left: 25px;
}

.portal-number-wrap.suffix .portal-input {
  padding-right: 29px;
}

.portal-select {
  cursor: pointer;
  appearance: auto;
  font-weight: 750;
}

.portal-results {
  padding: 21px;
  border-top: 1px solid var(--portal-border);
  background: linear-gradient(145deg, #f9fbfe, #eef4fb);
}

.portal-calculation-status {
  margin: 0 0 12px;
  color: #63748b;
  font-size: 10px;
  font-weight: 750;
}

.portal-results.pending .portal-calculation-status {
  color: var(--program-color);
}

.portal-calculate-button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: var(--program-color);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--program-color) 28%, transparent);
  font: 800 13px/1 Inter, ui-sans-serif, sans-serif;
}

.portal-calculate-button:hover,
.portal-calculate-button:focus-visible {
  filter: brightness(1.08);
}

.portal-calculate-button:disabled,
.workspace-calculate-action:disabled {
  cursor: wait;
  opacity: 0.68;
  filter: none;
}

.portal-total-label {
  color: #607087;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
  font-weight: 850;
}

.portal-total-payment {
  margin: 4px 0 17px;
  color: var(--portal-navy);
  font-size: 38px;
  font-weight: 830;
  letter-spacing: -0.05em;
}

.portal-total-payment small {
  margin-left: 4px;
  color: #748197;
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 650;
}

.portal-result-list {
  display: grid;
  gap: 0;
}

.portal-result-row {
  min-height: 34px;
  border-bottom: 1px solid #dfe7f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #66758a;
  font-size: 10px;
}

.portal-result-row:last-child {
  border-bottom: 0;
}

.portal-result-row strong {
  color: #253952;
  font-size: 11px;
}

.portal-result-note {
  margin: 12px 0 0;
  color: #8490a0;
  font-size: 9px;
  line-height: 1.55;
}

.portal-calculation-status.error {
  color: #b42318;
}

.portal-closing-cost-source {
  margin: 14px 0 0;
  padding: 10px 11px;
  border: 1px solid #cbdcf0;
  border-radius: 10px;
  display: grid;
  gap: 4px;
  color: #53657c;
  background: #f5f9fe;
  font-size: 9px;
  line-height: 1.45;
}

.portal-closing-cost-source strong {
  color: #234f88;
  font-size: 10px;
}

.portal-ratio-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.portal-ratio-grid > div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid #d7e3ef;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: #fff;
}

.portal-ratio-grid span {
  color: #68788e;
  font-size: 9px;
  font-weight: 750;
}

.portal-ratio-grid strong {
  color: var(--program-color);
  font-size: 21px;
  letter-spacing: -0.03em;
}

.portal-ratio-hint {
  margin: 8px 0 0;
  color: #7e8c9e;
  font-size: 9px;
}

.portal-ratio-hint[hidden] {
  display: none;
}

.portal-calculator-actions {
  padding: 0 20px 20px;
  background: #fff;
}

.portal-calculator-actions .portal-primary {
  margin-top: 0;
}

.portal-return-button {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: 14px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cfdbea;
  border-radius: 999px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 7px;
  color: #294765;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(24, 46, 77, 0.18);
  font: 750 10px/1 Inter, ui-sans-serif, sans-serif;
  backdrop-filter: blur(12px);
}

html.preqlab-workspace-mode .portal-return-button {
  display: none;
}

.workspace-nav,
.workspace-nav-menu {
  display: none;
}

html.preqlab-workspace-mode .workspace-nav {
  display: block;
}

html.preqlab-workspace-mode .workspace-nav-toggle {
  position: fixed;
  z-index: 151;
  top: 8px;
  left: 13px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(205, 220, 239, 0.8);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #17375f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 20px rgba(24, 46, 77, 0.12);
  list-style: none;
}

.workspace-nav-toggle::-webkit-details-marker {
  display: none;
}

html.preqlab-workspace-mode .workspace-nav-toggle:hover,
html.preqlab-workspace-mode .workspace-nav[open] .workspace-nav-toggle {
  color: #185aa8;
  border-color: #a9c5e8;
  background: #f2f7ff;
}

.workspace-nav-toggle svg {
  width: 21px;
  height: 21px;
}

html.preqlab-workspace-mode .workspace-nav[open] .workspace-nav-menu {
  position: fixed;
  z-index: 152;
  top: 58px;
  left: 13px;
  width: min(272px, calc(100vw - 26px));
  padding: 7px;
  border: 1px solid #d8e2ee;
  border-radius: 15px;
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 55px rgba(1, 12, 28, 0.3);
  backdrop-filter: blur(18px);
}

.workspace-nav-menu button {
  min-height: 45px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #29425f;
  background: transparent;
  font: 750 11px/1.2 Inter, ui-sans-serif, sans-serif;
  text-align: left;
}

.workspace-nav-menu button:hover,
.workspace-nav-menu button:focus-visible {
  color: #153f7d;
  background: #edf4ff;
}

.workspace-nav-menu svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: #2869bd;
}

html.preqlab-workspace-mode .app-header .brand-mark {
  position: relative;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

html.preqlab-workspace-mode .app-header {
  padding-left: 68px;
}

html.preqlab-workspace-mode .app-header .brand-mark span {
  visibility: hidden;
}

html.preqlab-workspace-mode .app-header .brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: url("/logo-Pre-Q-Lab.webp") center / contain no-repeat;
}

.workspace-manual-calculate {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  display: grid;
  gap: 7px;
}

.workspace-calculate-action {
  width: 100%;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: #225db5;
  box-shadow: 0 10px 22px rgba(27, 81, 161, 0.22);
  font: 800 12px/1 Inter, ui-sans-serif, sans-serif;
}

.workspace-manual-calculate > span {
  color: #718096;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.workspace-closing-cost-source {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #cbdcf0;
  border-radius: 9px;
  display: grid;
  gap: 3px;
  color: #607087;
  background: #f5f9fe;
  font-size: 9px;
  line-height: 1.45;
}

.workspace-closing-cost-source strong {
  color: #225db5;
  font-size: 10px;
}

.workspace-closing-cost-disclaimer {
  color: #66758a;
  font-size: 9px;
  line-height: 1.45;
}

@media (min-width: 821px) {
  html.preqlab-workspace-mode #root .worksheet-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  html.preqlab-workspace-mode #root .inputs-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  html.preqlab-workspace-mode #root .inputs-card .field-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  html.preqlab-workspace-mode #root .payment-card,
  html.preqlab-workspace-mode #root .cash-card {
    grid-column: span 6;
  }

  html.preqlab-workspace-mode #root .loan-summary-card {
    grid-column: 1 / -1;
  }
}

html.workspace-calculation-pending .payment-card,
html.workspace-calculation-pending .cash-card,
html.workspace-calculation-pending .loan-summary-card,
html.workspace-calculation-pending .comparison-view {
  display: none;
}

html.workspace-calculation-pending .action-bar {
  display: none;
}

html.workspace-calculation-pending .ratio-pills strong {
  font-size: 0;
}

html.workspace-calculation-pending .ratio-pills strong::after {
  content: "—";
  font-size: 12px;
}

html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(3) svg,
html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(4) svg {
  display: none;
}

html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(3)::before,
html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(4)::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
}

html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(3)::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/%3E%3Cpath d='M17 21v-8H7v8M7 3v5h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/%3E%3Cpath d='M17 21v-8H7v8M7 3v5h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

html.preqlab-workspace-mode .app-header .header-actions button:nth-of-type(4)::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06a1.7 1.7 0 0 0-1.88-.34 1.7 1.7 0 0 0-1.03 1.56V21h-4v-.08A1.7 1.7 0 0 0 8.97 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.56-1.03H3v-4h.08A1.7 1.7 0 0 0 4.6 8.94a1.7 1.7 0 0 0-.34-1.88L4.2 7l2.83-2.83.06.06a1.7 1.7 0 0 0 1.88.34H9A1.7 1.7 0 0 0 10 3.03V3h4v.08a1.7 1.7 0 0 0 1.03 1.52 1.7 1.7 0 0 0 1.88-.34l.06-.06L19.8 7l-.06.06a1.7 1.7 0 0 0-.34 1.88v.03A1.7 1.7 0 0 0 20.97 10H21v4h-.08A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06a1.7 1.7 0 0 0-1.88-.34 1.7 1.7 0 0 0-1.03 1.56V21h-4v-.08A1.7 1.7 0 0 0 8.97 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.56-1.03H3v-4h.08A1.7 1.7 0 0 0 4.6 8.94a1.7 1.7 0 0 0-.34-1.88L4.2 7l2.83-2.83.06.06a1.7 1.7 0 0 0 1.88.34H9A1.7 1.7 0 0 0 10 3.03V3h4v.08a1.7 1.7 0 0 0 1.03 1.52 1.7 1.7 0 0 0 1.88-.34l.06-.06L19.8 7l-.06.06a1.7 1.7 0 0 0-.34 1.88v.03A1.7 1.7 0 0 0 20.97 10H21v4h-.08A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.portal-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}

@keyframes portal-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .portal-dashboard-page {
    width: 100%;
  }

  .portal-dashboard-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .portal-dashboard-sidebar {
    display: none;
  }

  .portal-dashboard-main {
    padding: 24px;
  }

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

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

  html.preqlab-workspace-mode .app-header {
    position: relative;
    justify-content: flex-end;
    padding-left: 62px;
  }

  html.preqlab-workspace-mode .app-header .brand-lockup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  html.preqlab-workspace-mode .app-header .brand-lockup > div:last-child {
    display: none;
  }

  html.preqlab-workspace-mode .app-header .header-actions {
    margin-left: auto;
  }

  html.preqlab-workspace-mode .app-header .workspace-back-action {
    padding-inline: 8px;
  }

  html.preqlab-workspace-mode .app-header .workspace-back-action svg {
    width: 18px;
    height: 18px;
  }

  .workspace-manual-calculate {
    order: 2;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }

  html.preqlab-workspace-mode #root .payment-card {
    order: 3;
  }

  html.preqlab-workspace-mode #root .cash-card {
    order: 4;
  }

  html.preqlab-workspace-mode #root .loan-summary-card {
    order: 5;
  }

  .workspace-calculate-action {
    width: 100%;
  }

  .workspace-manual-calculate > span {
    text-align: center;
  }

  .portal-login-page::before {
    background:
      linear-gradient(90deg, rgba(4, 18, 35, 0.82), rgba(6, 24, 45, 0.68)),
      linear-gradient(180deg, rgba(4, 17, 32, 0.12), rgba(4, 17, 32, 0.6)),
      url("/preqlab-login-background.jpg") center center / cover no-repeat;
  }

  .portal-page {
    padding: 18px 16px;
  }

  .portal-login-layout {
    grid-template-columns: 1fr;
    gap: 33px;
    padding: 55px 0 28px;
  }

  .portal-intro {
    text-align: center;
  }

  .portal-intro .portal-centered-brand {
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    text-align: center;
  }

  .portal-intro h1,
  .portal-intro > p:not(.portal-eyebrow) {
    margin-left: auto;
    margin-right: auto;
  }

  .portal-intro h1 {
    font-size: clamp(37px, 10vw, 55px);
  }

  .portal-benefits {
    justify-content: center;
  }

  .portal-login-card {
    width: min(100%, 480px);
    margin: 0 auto;
  }

  .portal-register-layout .portal-intro {
    position: static;
    padding-top: 0;
  }

  .portal-register-card {
    width: min(100%, 620px);
  }

  .portal-menu-content {
    padding-top: 52px;
  }

  .portal-crm-layout {
    grid-template-columns: 1fr;
  }

  .portal-crm-leads {
    position: static;
  }

  .portal-lead-list {
    max-height: 230px;
  }
}

@media (max-width: 620px) {
  .portal-page {
    padding: 15px 13px calc(22px + env(safe-area-inset-bottom));
  }

  .portal-dashboard-shell {
    margin-top: 15px;
    border-radius: 20px;
  }

  .portal-dashboard-main {
    padding: 19px 15px 22px;
  }

  .portal-dashboard-heading {
    display: block;
  }

  .portal-dashboard-heading h1 {
    font-size: 31px;
  }

  .portal-dashboard-heading-actions {
    margin-top: 16px;
  }

  .portal-dashboard-primary {
    flex: 1;
  }

  .portal-dashboard-main > section {
    margin-top: 23px;
  }

  .portal-dashboard-stats {
    gap: 8px;
  }

  .portal-dashboard-stat {
    min-height: 110px;
    padding: 14px;
  }

  .portal-dashboard-stat small {
    min-height: 18px;
  }

  .portal-dashboard-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portal-dashboard-action {
    min-height: 82px;
  }

  .portal-dashboard-activity-card {
    padding: 16px;
  }

  .portal-dashboard-activity-list article {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .portal-dashboard-activity-list time {
    grid-column: 2;
    margin-top: -5px;
  }

  .portal-brand-mark {
    width: 39px;
    height: 39px;
  }

  .portal-brand span,
  .portal-user-pill span {
    display: none;
  }

  .portal-user-pill {
    width: 38px;
    padding: 0 6px;
    justify-content: center;
  }

  .portal-profile-actions .portal-back-button {
    width: 38px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .portal-profile-actions .portal-back-button span {
    display: none;
  }

  .portal-profile-actions .portal-back-button svg {
    width: 17px;
    height: 17px;
  }

  .portal-profile-actions {
    gap: 5px;
  }

  .portal-login-layout {
    align-content: center;
    padding: 39px 0 20px;
  }

  .portal-intro > p:not(.portal-eyebrow),
  .portal-benefits {
    display: none;
  }

  .portal-login-card {
    padding: 23px 19px;
    border-radius: 20px;
  }

  .portal-account-types,
  .portal-loan-officer-fields {
    grid-template-columns: 1fr;
  }

  .portal-account-type {
    min-height: 88px;
  }

  .portal-trial-notice {
    display: grid;
    gap: 4px;
  }

  .portal-menu-content {
    padding-top: 44px;
  }

  .portal-menu-heading h1 {
    max-width: 330px;
    font-size: 34px;
  }

  .portal-programs {
    grid-template-columns: 1fr;
    margin-top: 28px;
    gap: 10px;
  }

  .portal-program-card {
    min-height: 106px;
    padding: 16px 17px 15px 76px;
  }

  .portal-program-icon {
    position: absolute;
    top: 19px;
    left: 18px;
    width: 42px;
    height: 42px;
  }

  .portal-program-card strong {
    margin-top: 0;
    font-size: 18px;
  }

  .portal-program-card span:last-child {
    max-width: 235px;
  }

  .portal-computer-button {
    min-height: 52px;
  }

  .portal-crm-button {
    min-height: 68px;
  }

  .portal-crm-content {
    padding-top: 27px;
  }

  .portal-crm-heading h1 {
    font-size: 32px;
  }

  .portal-crm-columns {
    grid-template-columns: 1fr;
  }

  .portal-crm-tabs {
    overflow-x: auto;
  }

  .portal-crm-tabs button {
    flex: 1 0 auto;
  }

  .portal-crm-lead-header {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .portal-crm-lead-header > .portal-status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .portal-calculator-content {
    padding-top: 27px;
  }

  .portal-input-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 9px;
  }

  .portal-quick-inputs,
  .portal-results {
    padding: 17px;
  }

  .portal-calculator-actions {
    padding: 0 17px 17px;
  }

  .portal-input {
    height: 46px;
  }
}

@media (max-width: 520px) {
  html.preqlab-workspace-mode .app-header .header-actions button:first-of-type {
    font-size: 0;
  }

  html.preqlab-workspace-mode .app-header .header-actions button:first-of-type > svg {
    display: none;
  }

  html.preqlab-workspace-mode .app-header .header-actions button:first-of-type::after {
    content: attr(data-short-language);
    font: 750 11px/1 Inter, ui-sans-serif, sans-serif;
  }
}

@media (max-width: 380px) {
  .portal-language,
  .portal-text-button {
    padding: 0 9px;
  }

  .portal-input-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #preqlab-portal *,
  .portal-return-button,
  .workspace-nav-toggle,
  .workspace-nav-menu {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}

/* v17: client header, visible mobile return, and qualification colors */
html.preqlab-workspace-mode .portal-return-button {
  z-index: 1001;
  top: 8px;
  bottom: auto;
  left: 64px;
  right: auto;
  min-height: 42px;
  display: inline-flex;
  color: #17375f;
  background: rgba(255, 255, 255, 0.97);
}

html.preqlab-workspace-mode .portal-return-button:hover,
html.preqlab-workspace-mode .portal-return-button:focus-visible {
  color: #185aa8;
  border-color: #a9c5e8;
  background: #f2f7ff;
}

html.preqlab-workspace-mode .portal-return-button svg {
  width: 17px;
  height: 17px;
}

html.preqlab-workspace-mode .app-header {
  padding-left: 190px;
}

html.preqlab-workspace-mode .workspace-back-action {
  display: none !important;
}

html.preqlab-workspace-mode #root .scenario-price .field-stack {
  gap: 5px;
}

html.preqlab-workspace-mode #root .scenario-price .number-shell input {
  color: #fff;
  caret-color: #fff;
  background: #225db5;
  border-color: #225db5;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(34, 93, 181, 0.2);
}

html.preqlab-workspace-mode #root .scenario-price .number-shell input:focus-visible {
  outline: 3px solid rgba(34, 93, 181, 0.22);
  outline-offset: 2px;
}

html.preqlab-workspace-mode #root .scenario-price .number-shell > span {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

html.preqlab-workspace-mode #root .ratio-pills.within-baseline span,
html.preqlab-workspace-mode #root .payment-band.within-baseline span {
  color: #fff;
  background: #225db5;
}

html.preqlab-workspace-mode #root .ratio-pills.review span,
html.preqlab-workspace-mode #root .payment-band.review span {
  color: #fff;
  background: #b42318;
}

html.preqlab-workspace-mode #root .ratio-pills.within-baseline strong,
html.preqlab-workspace-mode #root .ratio-pills.review strong,
html.preqlab-workspace-mode #root .payment-band.within-baseline strong,
html.preqlab-workspace-mode #root .payment-band.review strong {
  color: #fff;
}

html.preqlab-workspace-mode.workspace-calculation-pending #root .ratio-pills span,
html.preqlab-workspace-mode.workspace-calculation-pending #root .payment-band span {
  color: #65738a;
  background: #f1f5fa;
}

html.preqlab-workspace-mode.workspace-calculation-pending #root .ratio-pills strong,
html.preqlab-workspace-mode.workspace-calculation-pending #root .payment-band strong {
  color: #183b70;
}

@media (min-width: 821px) {
  html.preqlab-workspace-mode #root .scenario-bar {
    grid-template-columns: auto minmax(180px, 0.8fr) minmax(0, 2.4fr);
  }

  html.preqlab-workspace-mode #root .prepared-grid {
    grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.15fr) minmax(180px, 1fr);
  }
}

@media (max-width: 820px) {
  html.preqlab-workspace-mode .app-header {
    padding-left: 62px;
  }

  html.preqlab-workspace-mode .portal-return-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  html.preqlab-workspace-mode .portal-return-button span {
    display: none;
  }
}

/* v20: lender-managed closing-cost profiles */
.portal-dashboard-action.peach {
  --action-color: #b75f32;
  --action-soft: #fff0e7;
}

/* v22: optional client-report branding */
.portal-dashboard-action.branding {
  --action-color: #7d3fa0;
  --action-soft: #f5eafb;
}

.portal-branding-page {
  width: min(100%, 1220px);
}

.portal-branding-content {
  padding: 54px 0 64px;
}

.portal-branding-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(380px, 1.2fr);
  gap: 20px;
  align-items: stretch;
}

.portal-branding-preview-card,
.portal-branding-control-card {
  padding: 30px;
  border: 1px solid var(--portal-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(3, 17, 35, 0.16);
}

.portal-branding-preview-card {
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 17px;
  text-align: center;
}

.portal-branding-preview-card > p,
.portal-branding-control-card > p {
  margin: 0;
  color: #687a91;
  font-size: 13px;
  line-height: 1.55;
}

.portal-report-brand-preview {
  width: 132px;
  height: 132px;
  border-radius: 21px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #050505;
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.22);
}

.portal-report-brand-preview strong {
  color: #fff;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.portal-report-brand-preview.has-logo {
  padding: 12px;
  border: 1px solid #dce4ee;
  background: #fff;
}

.portal-report-brand-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portal-branding-preview-copy {
  display: grid;
  gap: 4px;
}

.portal-branding-preview-copy strong {
  color: #17283f;
  font-size: 20px;
}

.portal-branding-preview-copy span,
.portal-branding-preview-card > small {
  color: #718096;
  font-size: 12px;
  line-height: 1.5;
}

.portal-branding-preview-card > small {
  max-width: 360px;
}

.portal-branding-control-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.portal-branding-control-card h2 {
  margin: 4px 0 0;
  color: #17283f;
  font-size: 26px;
}

.portal-branding-status {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-branding-status.active {
  color: #12634f;
  background: #dff4ec;
}

.portal-branding-status.inactive {
  color: #654817;
  background: #fff0c8;
}

.portal-branding-price {
  display: grid;
  gap: 3px;
}

.portal-branding-price strong {
  color: #102847;
  font-size: clamp(36px, 6vw, 58px);
  letter-spacing: -0.05em;
}

.portal-branding-price span {
  color: #718096;
  font-size: 13px;
}

.portal-branding-control-card .portal-primary {
  width: auto;
  min-width: 250px;
  margin: 4px 0 0;
}

.portal-branding-control-card .portal-primary svg,
.portal-branding-file-button svg {
  width: 20px;
  height: 20px;
}

.portal-branding-file-button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid #245fca;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: #245fca;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.portal-branding-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.portal-branding-admin-note {
  margin: 0;
  padding: 13px;
  border-radius: 12px;
  color: #5e4930;
  background: #fff7e7;
  font-size: 13px;
  line-height: 1.5;
}

.workspace-report-branding {
  display: none;
}

@media print {
  html.preqlab-workspace-mode #root .workspace::before {
    display: none !important;
  }

  html.preqlab-workspace-mode #root .workspace-report-branding {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 0 0 9px;
    border-bottom: 2px solid #174ea6;
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: #111827;
    break-inside: avoid;
  }

  .workspace-report-mark {
    width: 62px;
    height: 62px;
    border-radius: 9px;
    overflow: hidden;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
  }

  .workspace-report-mark.initials {
    color: #fff;
    background: #050505;
    font-size: 20px;
    font-weight: 800;
  }

  .workspace-report-mark.logo {
    padding: 5px;
    border: 1px solid #d7dfeb;
    background: #fff;
  }

  .workspace-report-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .workspace-report-branding > span:nth-child(2) {
    display: grid;
    gap: 2px;
  }

  .workspace-report-branding strong {
    font-size: 14px;
  }

  .workspace-report-branding small {
    color: #5f6d80;
    font-size: 9px;
  }

  .workspace-report-branding > b {
    margin-left: auto;
    color: #123463;
    font-size: 18px;
  }
}

@media (max-width: 760px) {
  .portal-branding-content {
    padding-top: 30px;
  }

  .portal-branding-layout {
    grid-template-columns: 1fr;
  }

  .portal-branding-preview-card,
  .portal-branding-control-card {
    padding: 22px;
    border-radius: 17px;
  }

  .portal-branding-preview-card {
    min-height: 330px;
  }

  .portal-branding-control-card .portal-primary,
  .portal-branding-file-button,
  .portal-branding-control-card .portal-danger-secondary {
    width: 100%;
    justify-content: center;
  }
}

.portal-profile-config-button {
  border-color: rgba(226, 180, 148, 0.5);
  background: rgba(255, 240, 231, 0.97);
}

.portal-profile-config-button svg {
  color: #a94f25;
}

.portal-lender-page {
  width: min(100%, 1440px);
}

.portal-lender-content {
  padding: 54px 0 44px;
}

.portal-lender-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.portal-lender-heading h1 {
  margin: 5px 0 9px;
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.portal-lender-heading p:not(.portal-eyebrow) {
  max-width: 720px;
  margin: 0;
  color: #b9c8da;
  font-size: 15px;
  line-height: 1.6;
}

.portal-lender-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-lender-heading-actions .portal-dashboard-primary {
  white-space: nowrap;
}

.portal-lender-heading-actions .portal-dashboard-primary svg,
.portal-profile-empty svg,
.portal-profile-section-heading svg {
  width: 20px;
  height: 20px;
}

.portal-lender-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.portal-profile-list-card,
.portal-profile-section,
.portal-profile-actions-bar,
.portal-profile-loading {
  border: 1px solid var(--portal-border);
  background: #fff;
  box-shadow: 0 18px 50px rgba(3, 17, 35, 0.14);
}

.portal-profile-list-card {
  position: sticky;
  top: 20px;
  padding: 16px;
  border-radius: 18px;
}

.portal-profile-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.portal-profile-list-item {
  width: 100%;
  padding: 13px;
  border: 1px solid #dde6f1;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  color: #53657b;
  background: #f8fafc;
  font: 650 12px/1.35 inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.portal-profile-list-item:hover,
.portal-profile-list-item:focus-visible {
  border-color: #8fb3e7;
  background: #f1f6ff;
  transform: translateY(-1px);
}

.portal-profile-list-item.selected {
  border-color: #245fca;
  background: #eaf2ff;
  box-shadow: inset 3px 0 0 #245fca;
}

.portal-profile-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--portal-text);
}

.portal-profile-list-title strong {
  font-size: 14px;
}

.portal-profile-list-title i,
.portal-profile-status {
  padding: 4px 7px;
  border-radius: 999px;
  color: #765314;
  background: #fff2c7;
  font: 800 9px/1 inherit;
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portal-profile-list-title i.active,
.portal-profile-status.active {
  color: #12634f;
  background: #dff4ec;
}

.portal-profile-list-title i.archived,
.portal-profile-status.archived {
  color: #66758a;
  background: #e9eef4;
}

.portal-profile-empty,
.portal-profile-loading {
  min-height: 190px;
  padding: 26px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #738299;
  text-align: center;
}

.portal-profile-empty p {
  max-width: 240px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.portal-profile-empty.compact {
  min-height: 110px;
  padding: 16px;
  border: 1px dashed #cfd9e5;
  border-radius: 12px;
}

.portal-profile-loading {
  border-radius: 18px;
}

.portal-lender-form {
  display: grid;
  gap: 16px;
}

.portal-profile-section {
  padding: 22px;
  border-radius: 18px;
}

.portal-profile-section-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-profile-section-heading > div {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.portal-profile-section-heading > div > span {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #245fca;
  background: #eaf2ff;
}

.portal-profile-section-heading h2 {
  margin: 0;
  color: #17283f;
  font-size: 18px;
  line-height: 1.3;
}

.portal-profile-section-heading p {
  max-width: 700px;
  margin: 4px 0 0;
  color: #6f7e92;
  font-size: 12px;
  line-height: 1.5;
}

.portal-profile-section-heading.compact {
  margin-bottom: 16px;
}

.portal-profile-section-heading.compact > div > span {
  width: 32px;
  height: 32px;
}

.portal-profile-grid {
  display: grid;
  gap: 15px;
}

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

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

.portal-profile-grid .portal-field label {
  min-height: 16px;
  color: #44566d;
  font-size: 12px;
}

.portal-profile-default-toggle {
  margin-top: 17px;
  padding: 13px 14px;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #314760;
  background: #f8fafc;
  cursor: pointer;
}

.portal-profile-default-toggle input,
.portal-fee-checks input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #245fca;
}

.portal-profile-default-toggle span {
  display: grid;
  gap: 3px;
}

.portal-profile-default-toggle strong {
  font-size: 13px;
}

.portal-profile-default-toggle small {
  color: #718096;
  font-size: 11px;
  line-height: 1.45;
}

.portal-profile-notes {
  margin-top: 16px;
}

.portal-fees-heading {
  align-items: center;
}

.portal-add-fee {
  width: auto;
  min-width: 120px;
  margin: 0;
}

.portal-fee-list {
  display: grid;
  gap: 12px;
}

.portal-fee-item {
  padding: 16px;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #f8fafc;
}

.portal-fee-item-header {
  margin-bottom: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #263d59;
  font-size: 13px;
}

.portal-fee-item-header button {
  padding: 0;
  border: 0;
  cursor: pointer;
  color: #a63b32;
  background: transparent;
  font: 750 11px/1.3 inherit;
}

.portal-profile-grid.fee-primary-grid {
  grid-template-columns: minmax(180px, 1.6fr) repeat(4, minmax(125px, 1fr));
}

.portal-fee-advanced {
  margin-top: 13px;
  border-top: 1px solid #dce5f0;
}

.portal-fee-advanced summary {
  padding: 13px 0 0;
  cursor: pointer;
  color: #385575;
  font: 750 12px/1.4 inherit;
}

.portal-profile-grid.fee-secondary-grid {
  margin-top: 13px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-fee-checks {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}

.portal-fee-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #43566f;
  font-size: 12px;
  font-weight: 700;
}

.portal-profile-actions-bar {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  padding: 12px;
  border-radius: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  box-shadow: 0 14px 40px rgba(3, 17, 35, 0.22);
}

.portal-profile-actions-bar .portal-primary {
  width: auto;
  min-width: 190px;
  margin: 0;
}

.portal-danger-secondary {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #e3aaa5;
  border-radius: 12px;
  cursor: pointer;
  color: #a32b23;
  background: #fff;
  font: 800 12px/1 inherit;
}

.portal-danger-secondary:hover,
.portal-danger-secondary:focus-visible {
  border-color: #b42318;
  background: #fff2f0;
}

@media (max-width: 1180px) {
  .portal-profile-grid.fee-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-profile-grid.fee-primary-grid .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .portal-lender-layout {
    grid-template-columns: 1fr;
  }

  .portal-profile-list-card {
    position: static;
  }

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

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

@media (max-width: 620px) {
  .portal-lender-content {
    padding-top: 30px;
  }

  .portal-lender-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-lender-heading-actions {
    justify-content: flex-end;
  }

  .portal-profile-list,
  .portal-profile-grid.two-columns,
  .portal-profile-grid.three-columns,
  .portal-profile-grid.fee-primary-grid,
  .portal-profile-grid.fee-secondary-grid {
    grid-template-columns: 1fr;
  }

  .portal-profile-grid.fee-primary-grid .wide {
    grid-column: auto;
  }

  .portal-profile-section,
  .portal-profile-list-card {
    padding: 16px;
    border-radius: 15px;
  }

  .portal-profile-section-heading,
  .portal-fees-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-add-fee {
    width: 100%;
  }

  .portal-profile-actions-bar {
    bottom: 8px;
    flex-direction: column;
  }

  .portal-profile-actions-bar .portal-primary,
  .portal-profile-actions-bar .portal-danger-secondary {
    width: 100%;
  }
}
