/*
  Airlend Flow v10
  Refined corporate console + async submit guard: white, navy, precise, compact.
  Designed for Wappler content pages inside views/layouts/main.ejs.
*/

:root {
  --af-navy: #202a4f;
  --af-ink: #253150;
  --af-text: #33405f;
  --af-muted: #768098;
  --af-blue: #436dff;
  --af-blue-deep: #2b49d4;
  --af-blue-soft: #eef4ff;
  --af-bg: #f6f8fc;
  --af-card: #ffffff;
  --af-line: #e5eaf3;
  --af-line-strong: #d6deec;
  --af-green: #0fa672;
  --af-green-soft: #e9f8f2;
  --af-shadow: 0 16px 34px rgba(32, 42, 79, .075);
  --af-shadow-soft: 0 8px 22px rgba(32, 42, 79, .055);
  --af-radius: 18px;
  --af-radius-sm: 12px;
  --af-container: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--af-bg); color: var(--af-text); }

.af-page,
.af-page * {
  box-sizing: border-box;
}

.af-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(67, 109, 255, .08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7f9fd 48%, #f5f7fb 100%);
  color: var(--af-text);
  font-family: inherit;
  padding: 22px 22px 70px;
}

.af-container {
  width: min(var(--af-container), calc(100vw - 44px));
  margin: 0 auto;
}

.af-page a,
.af-page a:hover,
.af-page a:focus {
  text-decoration: none;
}

/* Navigation */
.af-nav {
  width: min(var(--af-container), calc(100vw - 44px));
  margin: 0 auto 26px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
}

.af-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--af-navy) !important;
  min-width: max-content;
}

.af-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5177ff, #2c50de);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -.04em;
  box-shadow: 0 9px 20px rgba(67, 109, 255, .26);
}

.af-logo-text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.af-logo-text strong {
  color: var(--af-navy);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.055em;
}

.af-logo-text small {
  color: var(--af-blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.af-nav-segment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--af-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--af-shadow-soft);
}

.af-nav-segment a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #5b647a !important;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.af-nav-segment a:hover,
.af-nav-segment a.is-active {
  color: var(--af-navy) !important;
  background: #fff;
  box-shadow: 0 6px 14px rgba(32, 42, 79, .08);
}

/* Buttons */
.af-btn {
  appearance: none;
  border: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.af-btn:hover { transform: translateY(-1px); }
.af-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.af-btn--primary { background: linear-gradient(135deg, #5f86ff, var(--af-blue-deep)); color: #fff !important; box-shadow: 0 12px 24px rgba(67, 109, 255, .24); }
.af-btn--quiet { background: #fff; color: var(--af-navy) !important; border: 1px solid var(--af-line); box-shadow: var(--af-shadow-soft); }
.af-btn--sm { min-height: 38px; padding: 0 14px; font-size: 12px; }
.af-btn--block { width: 100%; margin-top: 18px; }

/* Page heading */
.af-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 0 20px;
}

.af-page-head--compact { padding-bottom: 14px; }
.af-head-copy { max-width: 760px; }

.af-kicker {
  margin: 0 0 8px;
  color: var(--af-blue);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.af-page-head h1 {
  margin: 0;
  color: var(--af-navy);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.03;
  letter-spacing: -.06em;
  font-weight: 950;
}

.af-page-head p:not(.af-kicker) {
  margin: 12px 0 0;
  color: #5f687c;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.55;
  max-width: 700px;
}

.af-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Metric strip */
.af-signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 18px;
}

.af-signal-strip article {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--af-radius-sm);
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--af-line);
  box-shadow: var(--af-shadow-soft);
}

.af-signal-strip span {
  display: block;
  color: #6f7890;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.af-signal-strip strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--af-navy);
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.06em;
}

.af-signal-strip small {
  color: #8a92a5;
  font-size: 12px;
  font-weight: 700;
}

/* Cards */
.af-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  box-shadow: var(--af-shadow);
  padding: 24px;
}

.af-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.af-card-head--stacked {
  display: block;
}

.af-card h2,
.af-card-head h2 {
  margin: 0;
  color: var(--af-navy);
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 950;
}

.af-link {
  color: var(--af-blue) !important;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Dashboard */
.af-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr);
  gap: 18px;
}

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

.af-lane {
  min-height: 206px;
  border: 1px solid var(--af-line);
  background: linear-gradient(180deg, #fff, #f8faff);
  border-radius: 14px;
  padding: 14px;
}

.af-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--af-line);
}

.af-lane-head span {
  color: var(--af-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.af-lane-head strong {
  color: var(--af-navy);
  font-size: 13px;
  font-weight: 950;
}

.af-empty-mini {
  height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: #81899a;
  gap: 9px;
}

.af-empty-mini i {
  color: var(--af-blue);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--af-blue-soft);
}

.af-empty-mini p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.af-intel-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.af-intel-list div {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px 12px;
  padding: 13px;
  background: #f8faff;
  border: 1px solid var(--af-line);
  border-radius: 13px;
}

.af-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--af-green);
  box-shadow: 0 0 0 4px var(--af-green-soft);
}

.af-intel-list strong {
  display: block;
  color: var(--af-navy);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.af-intel-list small {
  grid-column: 2;
  color: #717b92;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.af-build-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--af-navy), #314176);
  color: #fff;
}

.af-build-card span,
.af-build-card small {
  display: block;
  color: rgba(255, 255, 255, .74);
  font-weight: 750;
  font-size: 12px;
}

.af-build-card strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.035em;
  font-weight: 950;
  margin: 7px 0;
}

/* Capture page */
.af-capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .7fr);
  gap: 18px;
  align-items: start;
  margin-top: 6px;
}

.af-form-card { padding: 24px; }
.af-label,
.af-field label {
  display: block;
  margin: 0 0 7px;
  color: var(--af-navy);
  font-size: 12px;
  font-weight: 900;
}

.af-textarea,
.af-input {
  width: 100%;
  border: 1px solid var(--af-line-strong);
  background: #fff;
  color: var(--af-ink);
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.af-textarea {
  display: block;
  min-height: 190px;
  padding: 14px 15px;
  line-height: 1.55;
  resize: vertical;
}

.af-input {
  height: 43px;
  padding: 0 13px;
}

.af-textarea:focus,
.af-input:focus {
  border-color: rgba(67, 109, 255, .72);
  box-shadow: 0 0 0 4px rgba(67, 109, 255, .1);
}

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

.af-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.af-form-actions > span {
  color: #8992a5;
  font-size: 12px;
  font-weight: 750;
}

.af-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: #fff;
  color: var(--af-blue);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--af-shadow-soft);
}

.af-preview-card {
  position: sticky;
  top: 18px;
}

.af-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.af-preview-card h2 {
  max-width: 330px;
}

.af-preview-card p:not(.af-kicker) {
  color: #687288;
  font-size: 14px;
  line-height: 1.55;
  margin: 12px 0 0;
}

.af-chip {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--af-green-soft);
  color: var(--af-green);
  font-size: 11px;
  font-weight: 950;
}

.af-signal-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.af-signal-map div {
  min-height: 78px;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--af-line);
  background: #f8faff;
}

.af-signal-map span {
  display: block;
  color: #7b8497;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.af-signal-map strong {
  display: block;
  margin-top: 8px;
  color: var(--af-navy);
  font-size: 19px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.035em;
  word-break: break-word;
}

.af-next-action {
  margin-top: 14px;
  padding: 15px;
  border-radius: 14px;
  background: var(--af-blue-soft);
  border: 1px solid #dce7ff;
}

.af-next-action span,
.af-next-action small {
  display: block;
  color: #6d7890;
  font-size: 12px;
  font-weight: 800;
}

.af-next-action strong {
  display: block;
  color: var(--af-navy);
  font-size: 16px;
  font-weight: 950;
  margin: 5px 0;
}

/* Workspace */
.af-score-tile {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 18px;
  border-radius: var(--af-radius);
  background: linear-gradient(135deg, #5177ff, #2747d0);
  color: #fff;
  box-shadow: 0 14px 28px rgba(67, 109, 255, .24);
}

.af-score-tile span,
.af-score-tile small {
  display: block;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
}

.af-score-tile strong {
  display: block;
  margin: 8px 0;
  font-size: 38px;
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.06em;
}

.af-stage-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.af-stage-rail div {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  display: flex;
  align-items: center;
  gap: 10px;
}

.af-stage-rail div.is-active {
  border-color: rgba(67, 109, 255, .42);
  background: var(--af-blue-soft);
}

.af-stage-rail span {
  color: var(--af-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
}

.af-stage-rail strong {
  color: var(--af-navy);
  font-size: 13px;
  font-weight: 950;
}

.af-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .65fr);
  gap: 18px;
}

.af-card--snapshot { grid-row: span 2; }

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

.af-fact-grid div {
  padding: 14px;
  border: 1px solid var(--af-line);
  background: #f8faff;
  border-radius: 13px;
}

.af-fact-grid dt {
  color: #768098;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin: 0 0 7px;
}

.af-fact-grid dd {
  margin: 0;
  color: var(--af-navy);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: -.03em;
}

.af-card--next h2 {
  max-width: 290px;
}

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

.af-action-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5d6678;
  font-size: 13px;
  font-weight: 800;
}

.af-action-list i {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--af-green-soft);
  color: var(--af-green);
  font-size: 10px;
}

.af-check-empty {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: #7c8495;
}

.af-check-empty i {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--af-blue);
  background: var(--af-blue-soft);
}

.af-check-empty strong {
  color: var(--af-navy);
  font-size: 15px;
  font-weight: 950;
}

.af-check-empty span,
.af-scenario-text {
  color: #697386;
  font-size: 13px;
  line-height: 1.6;
}

.af-scenario-text {
  margin: 0;
}

code {
  color: var(--af-blue-deep);
  background: var(--af-blue-soft);
  padding: 2px 5px;
  border-radius: 6px;
}

@media (max-width: 1040px) {
  .af-console-grid,
  .af-capture-grid,
  .af-workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .af-preview-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .af-page {
    padding: 14px 14px 54px;
  }

  .af-container,
  .af-nav {
    width: min(100%, calc(100vw - 28px));
  }

  .af-nav {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
  }

  .af-nav-segment {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .af-nav-segment a {
    flex: 1 0 auto;
  }

  .af-page-head {
    display: block;
    padding-top: 8px;
  }

  .af-head-actions {
    justify-content: flex-start;
    margin-top: 18px;
  }

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

  .af-lane-grid,
  .af-field-grid,
  .af-signal-map,
  .af-fact-grid,
  .af-stage-rail {
    grid-template-columns: 1fr;
  }

  .af-card {
    padding: 18px;
    border-radius: 16px;
  }

  .af-stage-rail {
    gap: 7px;
  }

  .af-stage-rail div {
    min-height: 46px;
  }

  .af-form-actions .af-btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .af-logo-text strong { font-size: 20px; }
  .af-logo-text small { display: none; }
  .af-btn--sm span { display: none; }
  .af-signal-strip { grid-template-columns: 1fr; }
}

/* Airlend Flow v9 data layer additions */
.af-card-head--with-search {
  gap: 18px;
  align-items: center;
}

.af-inline-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.af-search-compact {
  width: min(260px, 100%);
  min-height: 38px;
  border: 1px solid var(--af-line);
  border-radius: 999px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--af-muted);
}

.af-search-compact input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--af-ink);
}

.af-lane-body {
  display: grid;
  gap: 10px;
}

.af-deal-mini-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--af-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(32, 42, 79, .045);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.af-deal-mini-card:hover {
  color: inherit;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(67, 109, 255, .32);
  box-shadow: 0 14px 28px rgba(32, 42, 79, .08);
}

.af-deal-mini-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.af-deal-mini-top strong {
  display: block;
  font-size: 13px;
  line-height: 1.22;
  color: var(--af-navy);
}

.af-deal-mini-top small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--af-muted);
}

.af-deal-mini-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.af-deal-mini-meta span {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--af-muted);
}

.af-deal-mini-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--af-ink);
}

.af-status-chip,
.af-score-chip,
.af-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--af-line);
  background: var(--af-blue-soft);
  color: var(--af-blue-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.01em;
  padding: 5px 9px;
}

.af-score-chip {
  min-width: 36px;
  background: #fff;
  color: var(--af-navy);
}

.af-build-card--complete {
  border-color: rgba(15, 166, 114, .22);
  background: linear-gradient(180deg, #fff 0%, var(--af-green-soft) 100%);
}

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

.af-workspace-head .af-head-copy h1 {
  max-width: 760px;
}

.af-stage-rail button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.af-stage-rail button:focus-visible {
  outline: 3px solid rgba(67, 109, 255, .22);
  outline-offset: 3px;
}

.af-stage-rail button.is-active {
  background: #fff;
  border-color: rgba(67, 109, 255, .28);
  box-shadow: var(--af-shadow-soft);
}

.af-card--checklist {
  min-height: 340px;
}

.af-checklist {
  display: grid;
  gap: 9px;
}

.af-checklist-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--af-line);
  border-radius: 14px;
  background: #fff;
}

.af-check-status {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--af-blue-soft);
  color: var(--af-blue-deep);
  font-size: 12px;
}

.af-checklist-row.is-supplied .af-check-status,
.af-checklist-row.is-approved .af-check-status,
.af-checklist-row.is-waived .af-check-status {
  background: var(--af-green-soft);
  color: var(--af-green);
}

.af-check-main strong {
  display: block;
  color: var(--af-navy);
  font-size: 13px;
  line-height: 1.25;
}

.af-check-main small {
  display: block;
  margin-top: 3px;
  color: var(--af-muted);
  font-size: 11px;
}

.af-check-action {
  border: 1px solid var(--af-line);
  background: #fff;
  color: var(--af-blue-deep);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  cursor: pointer;
}

.af-check-action:hover {
  border-color: rgba(67, 109, 255, .4);
  background: var(--af-blue-soft);
}

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

.af-intelligence-grid h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--af-navy);
  letter-spacing: -.01em;
}

.af-copy-block {
  min-height: 120px;
  border: 1px solid var(--af-line);
  border-radius: 14px;
  background: #fbfcff;
  padding: 14px;
  color: var(--af-text);
  font-size: 13px;
  line-height: 1.58;
}

.af-copy-block ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.af-copy-block li + li {
  margin-top: 4px;
}

.af-borrower-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  overflow-wrap: anywhere;
  border: 1px solid var(--af-line);
  border-radius: 14px;
  background: #fbfcff;
  padding: 12px 14px;
  color: var(--af-text);
  font-size: 13px;
}

.af-page.is-loading .af-card,
.af-page.is-loading .af-stage-rail {
  opacity: .78;
}

.af-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--af-navy);
  color: #fff;
  box-shadow: 0 18px 42px rgba(32, 42, 79, .22);
  font-size: 13px;
  font-weight: 700;
}

.af-toast.is-error {
  background: #8f1d2c;
}

@media (max-width: 980px) {
  .af-field-grid--three,
  .af-intelligence-grid {
    grid-template-columns: 1fr;
  }

  .af-card-head--with-search {
    align-items: stretch;
  }

  .af-inline-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .af-search-compact {
    width: 100%;
  }

  .af-checklist-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .af-check-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .af-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

.af-stage-rail button {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  display: flex;
  align-items: center;
  gap: 10px;
}

.af-stage-rail button.is-active {
  border-color: rgba(67, 109, 255, .42);
  background: var(--af-blue-soft);
}

@media (max-width: 760px) {
  .af-stage-rail button { min-height: 46px; }
}

.af-form-note {
  margin: -2px 0 0;
  color: var(--af-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.af-result-panel.is-processing {
  position: relative;
  overflow: hidden;
}

.af-progress-line {
  height: 7px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(67, 109, 255, .10);
  overflow: hidden;
}

.af-progress-line span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--af-blue), var(--af-sky));
  animation: af-progress-sweep 1.1s ease-in-out infinite;
}

@keyframes af-progress-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}

/* Airlend Flow v11 — compact pipeline card fix
   Keeps deal cards inside each lane and reduces vertical card height. */
.af-card--pipeline {
  overflow: hidden;
}

.af-lane-grid,
.af-lane,
.af-lane-body,
.af-deal-mini-card,
.af-deal-mini-card * {
  min-width: 0;
}

.af-lane-grid {
  gap: 10px;
  grid-template-columns: repeat(4, minmax(158px, 1fr));
}

.af-lane {
  min-height: 188px;
  padding: 10px;
  border-radius: 13px;
  overflow: hidden;
}

.af-lane-head {
  margin-bottom: 10px;
  padding-bottom: 9px;
}

.af-lane-head span {
  font-size: 10px;
}

.af-lane-head strong {
  font-size: 12px;
}

.af-lane-body {
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.af-lane-body::-webkit-scrollbar {
  width: 5px;
}

.af-lane-body::-webkit-scrollbar-thumb {
  background: #d8e1f2;
  border-radius: 999px;
}

.af-deal-mini-card {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 5px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}

.af-deal-mini-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(32, 42, 79, .075);
}

.af-deal-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}

.af-deal-mini-ref {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--af-navy);
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 950;
}

.af-deal-mini-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--af-muted);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
}

.af-deal-mini-row--bottom {
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: nowrap;
}

.af-mini-money,
.af-mini-lvr {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--af-ink);
  background: #f7f9fe;
  border: 1px solid var(--af-line);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
}

.af-mini-lvr {
  max-width: 48px;
}

.af-deal-mini-card .af-status-chip,
.af-deal-mini-card .af-score-chip {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
}

.af-deal-mini-card .af-score-chip {
  min-width: 32px;
}

.af-deal-mini-card .af-status-chip {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.af-empty-mini {
  height: 104px;
}

@media (max-width: 1180px) {
  .af-console-grid {
    grid-template-columns: 1fr;
  }

  .af-lane-grid {
    grid-template-columns: repeat(4, minmax(176px, 1fr));
  }
}

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

@media (max-width: 520px) {
  .af-lane-grid {
    grid-template-columns: 1fr;
  }

  .af-lane-body {
    max-height: none;
  }
}

/* Airlend Flow v11 density pass: compact pipeline cards + safer responsive lanes. */
.af-card--pipeline {
  padding: 22px 24px 24px;
  overflow: hidden;
}

.af-card--pipeline .af-card-head {
  margin-bottom: 16px;
}

.af-lane-grid {
  gap: 10px;
}

.af-lane {
  min-width: 0;
  min-height: 224px;
  padding: 10px;
  overflow: hidden;
  border-radius: 13px;
  background: #ffffff;
}

.af-lane-head {
  margin-bottom: 10px;
  padding: 0 0 9px;
}

.af-lane-head span {
  font-size: 10px;
  letter-spacing: .08em;
}

.af-lane-head strong {
  font-size: 12px;
  letter-spacing: -.01em;
}

.af-lane-body {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.af-deal-mini-card {
  width: 100%;
  min-width: 0;
  display: block;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border-color: #e6ebf5;
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(32, 42, 79, .035);
}

.af-deal-mini-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(32, 42, 79, .07);
}

.af-deal-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.af-deal-card-head strong {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--af-navy);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: -.02em;
}

.af-deal-card-sub {
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #748097;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 750;
}

.af-deal-card-foot {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.af-deal-card-foot small {
  margin-left: auto;
  color: #8b94a8;
  font-size: 10px;
  font-weight: 800;
}

.af-money-chip,
.af-lvr-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f7f9fd;
  border: 1px solid #e7ecf6;
  color: var(--af-ink);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.af-deal-mini-card .af-status-chip,
.af-deal-mini-card .af-score-chip {
  height: 22px;
  min-width: 0;
  padding: 0 7px;
  font-size: 10.5px;
  line-height: 1;
  border-color: #e0e7f6;
}

.af-deal-mini-card .af-score-chip {
  flex: 0 0 auto;
  min-width: 30px;
  background: #ffffff;
  color: var(--af-navy);
  font-weight: 950;
}

.af-deal-mini-card .af-status-chip {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--af-blue-soft);
  color: var(--af-blue-deep);
}

.af-deal-mini-top,
.af-deal-mini-meta {
  min-width: 0;
}

@media (max-width: 1280px) {
  .af-console-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1140px) {
  .af-lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .af-card--pipeline {
    padding: 16px;
  }

  .af-lane-grid {
    grid-template-columns: 1fr;
  }

  .af-card-head--with-search {
    align-items: flex-start;
  }

  .af-inline-tools,
  .af-search-compact {
    width: 100%;
  }
}


/* Airlend Flow v12 — priority deal cards.
   Deal cards now lead with the three recognition fields users need:
   loan amount, borrower/entity, and location. These fields are not truncated. */
.af-card--pipeline {
  padding: 22px 24px 24px;
}

.af-lane-grid {
  grid-template-columns: repeat(4, minmax(192px, 1fr));
  gap: 10px;
}

.af-lane {
  min-width: 0;
  padding: 10px;
  overflow: hidden;
}

.af-lane-body {
  min-width: 0;
  padding: 0;
  gap: 8px;
}

.af-deal-mini-card.af-deal-mini-card--priority {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px 10px 9px;
  overflow: visible;
  border-radius: 12px;
}

.af-deal-mini-card--priority .af-deal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.af-deal-mini-card--priority .af-deal-amount {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  color: var(--af-navy);
  font-size: 16px;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -.04em;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.af-deal-mini-card--priority .af-score-chip {
  flex: 0 0 auto;
  height: 24px;
  min-width: 34px;
  padding: 0 8px;
  font-size: 11px;
}

.af-deal-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.af-deal-borrower,
.af-deal-location {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.af-deal-borrower {
  color: var(--af-ink);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: -.015em;
}

.af-deal-borrower.is-ref {
  color: #526078;
  font-size: 11.5px;
  font-weight: 900;
}

.af-deal-location {
  color: #69758c;
  font-size: 11.2px;
  line-height: 1.22;
  font-weight: 800;
}

.af-deal-card-foot.af-deal-card-foot--priority {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  margin-top: 1px;
}

.af-security-chip,
.af-deal-card-foot--priority .af-lvr-chip,
.af-deal-card-foot--priority .af-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 0;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid #e7ecf6;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.af-security-chip {
  max-width: 100%;
  background: #f8faff;
  color: #526078;
  overflow: visible;
  text-overflow: clip;
}

.af-deal-card-foot--priority .af-lvr-chip {
  background: #fff;
  color: var(--af-ink);
}

.af-deal-card-foot--priority .af-status-chip {
  max-width: none;
  background: var(--af-blue-soft);
  color: var(--af-blue-deep);
}

.af-deal-card-foot--priority small {
  margin-left: auto;
  color: #8b94a8;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

@media (max-width: 1240px) {
  .af-lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .af-lane-grid {
    grid-template-columns: 1fr;
  }

  .af-deal-mini-card--priority .af-deal-amount {
    font-size: 17px;
  }
}


/* Airlend Flow v13 — wide corporate pipeline
   Gives the console more horizontal real estate and keeps all four lanes visible on desktop. */
:root {
  --af-container: 1440px;
  --af-container-wide: 1640px;
}

#content > .af-page {
  width: 100%;
  max-width: none;
}

.af-page--console {
  padding-left: 16px;
  padding-right: 16px;
}

.af-container,
.af-nav {
  width: min(var(--af-container), calc(100vw - 32px));
}

.af-container--wide,
.af-page--console .af-nav {
  width: min(var(--af-container-wide), calc(100vw - 32px));
}

.af-page--console .af-signal-strip,
.af-page--console .af-console-grid {
  width: min(var(--af-container-wide), calc(100vw - 32px));
}

.af-page--console .af-console-grid {
  grid-template-columns: 1fr !important;
  gap: 18px;
}

.af-card--pipeline {
  width: 100%;
  padding: 20px 24px 24px;
  overflow: visible;
}

.af-card--pipeline .af-card-head {
  margin-bottom: 17px;
}

.af-card--pipeline .af-inline-tools {
  flex-wrap: nowrap;
}

.af-card--pipeline .af-search-compact {
  width: clamp(220px, 26vw, 360px);
}

.af-lane-grid {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px;
  align-items: stretch;
}

.af-lane {
  min-width: 0;
  padding: 11px;
  overflow: hidden;
}

.af-lane-body {
  max-height: 64vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.af-deal-mini-card.af-deal-mini-card--priority {
  padding: 11px 11px 10px;
  gap: 7px;
}

.af-deal-mini-card--priority .af-deal-amount {
  font-size: 17px;
  line-height: 1.05;
}

.af-deal-borrower {
  font-size: 12.2px;
}

.af-deal-location {
  font-size: 11.4px;
}

.af-security-chip {
  max-width: 100%;
  height: auto;
  min-height: 22px;
  padding-top: 4px;
  padding-bottom: 4px;
  line-height: 1.12;
  white-space: normal;
  text-align: left;
}

.af-deal-card-foot--priority .af-status-chip,
.af-deal-card-foot--priority .af-lvr-chip {
  flex: 0 0 auto;
}

.af-card--intelligence {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1.7fr) minmax(240px, .72fr);
  gap: 16px;
  align-items: start;
  padding: 20px 24px;
}

.af-card--intelligence .af-card-head {
  margin: 0;
}

.af-card--intelligence .af-intel-list {
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.af-card--intelligence .af-build-card {
  margin: 0;
  min-height: 100%;
}

@media (max-width: 1180px) {
  .af-page--console {
    padding-left: 12px;
    padding-right: 12px;
  }

  .af-container,
  .af-nav,
  .af-container--wide,
  .af-page--console .af-nav,
  .af-page--console .af-signal-strip,
  .af-page--console .af-console-grid {
    width: min(100%, calc(100vw - 24px));
  }

  .af-card--pipeline {
    padding: 18px;
  }

  .af-lane-grid {
    gap: 10px;
  }

  .af-card--intelligence {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .af-page--console {
    padding-left: 8px;
    padding-right: 8px;
  }

  .af-container,
  .af-nav,
  .af-container--wide,
  .af-page--console .af-nav,
  .af-page--console .af-signal-strip,
  .af-page--console .af-console-grid {
    width: min(100%, calc(100vw - 16px));
  }

  .af-card--pipeline {
    padding: 16px 14px 16px;
  }

  .af-lane-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .af-lane {
    padding: 8px;
  }

  .af-lane-head {
    gap: 6px;
  }

  .af-deal-mini-card.af-deal-mini-card--priority {
    padding: 9px 8px 9px;
  }

  .af-deal-mini-card--priority .af-deal-amount {
    font-size: 15.5px;
  }

  .af-deal-borrower {
    font-size: 11.2px;
  }

  .af-deal-location {
    font-size: 10.8px;
  }

  .af-security-chip,
  .af-deal-card-foot--priority .af-lvr-chip,
  .af-deal-card-foot--priority .af-status-chip {
    font-size: 9.8px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .af-deal-card-foot--priority small {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
  }
}

@media (max-width: 760px) {
  .af-lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .af-card--pipeline .af-card-head,
  .af-card--pipeline .af-inline-tools {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .af-card--pipeline .af-search-compact,
  .af-card--pipeline .af-inline-tools {
    width: 100%;
  }

  .af-card--intelligence .af-intel-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .af-lane-grid {
    grid-template-columns: 1fr !important;
  }

  .af-lane-body {
    max-height: none;
  }
}

/* Airlend Flow v13 — wide pipeline workspace.
   Gives the deal pipeline more horizontal real estate and prevents the 4th lane being clipped. */
:root {
  --af-container: 1480px;
  --af-container-wide: 1580px;
  --af-page-gutter: clamp(12px, 2vw, 34px);
}

.af-page {
  padding-left: var(--af-page-gutter);
  padding-right: var(--af-page-gutter);
}

.af-container,
.af-nav {
  width: min(var(--af-container), calc(100vw - (var(--af-page-gutter) * 2)));
  max-width: none;
}

.af-container--wide {
  width: min(var(--af-container-wide), calc(100vw - (var(--af-page-gutter) * 2)));
  max-width: none;
}

.af-console-grid--wide-pipeline {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.af-console-grid--wide-pipeline .af-card--pipeline {
  width: 100%;
  overflow: visible;
}

.af-console-grid--wide-pipeline .af-card--intelligence {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1fr) minmax(240px, .55fr);
  align-items: start;
  gap: 18px;
}

.af-card--pipeline {
  padding: 22px 26px 24px;
}

.af-card--pipeline .af-card-head {
  gap: 18px;
}

.af-lane-grid {
  width: 100%;
  grid-template-columns: repeat(4, minmax(218px, 1fr));
  gap: 12px;
}

.af-lane {
  min-height: 250px;
  padding: 12px;
}

.af-lane-body {
  max-height: 58vh;
  padding-right: 3px;
}

.af-deal-mini-card.af-deal-mini-card--priority {
  padding: 10px 11px 9px;
}

.af-deal-mini-card--priority .af-deal-amount {
  font-size: 17px;
}

.af-deal-borrower {
  font-size: 12.2px;
}

.af-deal-location {
  font-size: 11.4px;
}

.af-security-chip,
.af-deal-card-foot--priority .af-lvr-chip,
.af-deal-card-foot--priority .af-status-chip {
  height: 23px;
  font-size: 10.6px;
}

@media (min-width: 1500px) {
  .af-lane-grid {
    grid-template-columns: repeat(4, minmax(270px, 1fr));
  }

  .af-card--pipeline {
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 1180px) {
  .af-card--pipeline {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .af-card--pipeline .af-card-head,
  .af-lane-grid {
    min-width: 940px;
  }

  .af-lane-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }

  .af-card--pipeline::-webkit-scrollbar {
    height: 7px;
  }

  .af-card--pipeline::-webkit-scrollbar-thumb {
    background: #d6deec;
    border-radius: 999px;
  }

  .af-console-grid--wide-pipeline .af-card--intelligence {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --af-page-gutter: 12px;
  }

  .af-card--pipeline {
    padding: 18px 16px 18px;
  }

  .af-card--pipeline .af-card-head,
  .af-lane-grid {
    min-width: 900px;
  }
}

/* Airlend Flow v14 — unified shell width
   Every top-level page section now uses one shared width so nav, headers,
   metric strip, pipeline, capture form and workspace panels line up exactly. */
:root {
  --af-shell-max: 1640px;
  --af-container: var(--af-shell-max);
  --af-container-wide: var(--af-shell-max);
  --af-page-gutter: clamp(18px, 4vw, 80px);
}

.af-page {
  padding-left: var(--af-page-gutter) !important;
  padding-right: var(--af-page-gutter) !important;
}

.af-nav,
.af-container,
.af-container--wide,
.af-page-head,
.af-signal-strip,
.af-console-grid,
.af-console-grid--wide-pipeline,
.af-capture-grid,
.af-stage-rail,
.af-workspace-grid {
  width: min(var(--af-shell-max), calc(100vw - var(--af-page-gutter) - var(--af-page-gutter))) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.af-page--console .af-nav,
.af-page--console .af-signal-strip,
.af-page--console .af-console-grid,
.af-page--console .af-container,
.af-page--console .af-container--wide {
  width: min(var(--af-shell-max), calc(100vw - var(--af-page-gutter) - var(--af-page-gutter))) !important;
  max-width: none !important;
}

.af-nav {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.af-page-head {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.af-page-head .af-head-copy {
  max-width: 760px;
}

.af-page-head .af-head-actions,
.af-workspace-head .af-score-tile {
  margin-left: auto;
}

.af-signal-strip,
.af-console-grid,
.af-capture-grid,
.af-stage-rail,
.af-workspace-grid {
  box-sizing: border-box;
}

/* Dashboard: the pipeline should occupy the exact same shell as every section. */
.af-page--console .af-console-grid,
.af-console-grid--wide-pipeline {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px;
}

.af-card--pipeline {
  width: 100% !important;
}

.af-card--pipeline .af-card-head,
.af-lane-grid {
  width: 100%;
}

@media (min-width: 1181px) {
  .af-card--pipeline {
    overflow: visible !important;
  }

  .af-card--pipeline .af-card-head,
  .af-lane-grid {
    min-width: 0 !important;
  }

  .af-lane-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}

@media (max-width: 1180px) {
  :root {
    --af-page-gutter: 16px;
  }

  .af-card--pipeline {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .af-card--pipeline .af-card-head,
  .af-lane-grid {
    min-width: 940px !important;
  }
}

@media (max-width: 760px) {
  :root {
    --af-page-gutter: 12px;
  }

  .af-page-head,
  .af-workspace-head {
    display: block;
  }

  .af-workspace-head .af-score-tile {
    margin-left: 0;
    margin-top: 16px;
    width: 100%;
  }

  .af-card--pipeline .af-card-head,
  .af-lane-grid {
    min-width: 900px !important;
  }
}

/* Airlend Flow v15 — one-line console heading
   Keeps the dashboard hero copy on one line on desktop while preserving mobile wrapping. */
.af-page--console .af-page-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 36px;
}

.af-page--console .af-page-head .af-head-copy {
  max-width: none !important;
  min-width: 0;
}

@media (min-width: 1181px) {
  .af-page--console .af-page-head h1,
  .af-page--console .af-page-head .af-head-copy > p:not(.af-kicker) {
    max-width: none !important;
    white-space: nowrap;
  }

  .af-page--console .af-page-head h1 {
    font-size: clamp(38px, 3.05vw, 48px);
    line-height: 1.02;
  }

  .af-page--console .af-page-head .af-head-copy > p:not(.af-kicker) {
    margin-top: 12px;
    font-size: clamp(15px, 1.08vw, 17px);
    line-height: 1.35;
  }
}

@media (max-width: 1320px) and (min-width: 761px) {
  .af-page--console .af-page-head {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .af-page--console .af-head-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .af-page--console .af-page-head h1,
  .af-page--console .af-page-head .af-head-copy > p:not(.af-kicker) {
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .af-page--console .af-page-head {
    display: block !important;
  }

  .af-page--console .af-page-head h1,
  .af-page--console .af-page-head .af-head-copy > p:not(.af-kicker) {
    white-space: normal;
  }
}

/* Airlend Flow v16 — borrower application portal */
.af-nav--borrower {
  margin-bottom: 18px;
}

.af-secure-pill,
.af-flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--af-navy);
  background: #fff;
  border: 1px solid var(--af-line);
  box-shadow: var(--af-shadow-soft);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.af-secure-pill i { color: var(--af-blue); }

.af-page--borrower .af-page-head {
  align-items: stretch;
}

.af-borrower-ref-tile {
  width: 230px;
  min-height: 98px;
  padding: 18px 18px 16px;
  border-radius: var(--af-radius-sm);
  background: #fff;
  border: 1px solid var(--af-line);
  box-shadow: var(--af-shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.af-borrower-ref-tile span,
.af-borrower-ref-tile small {
  color: var(--af-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.af-borrower-ref-tile strong {
  margin: 8px 0 6px;
  color: var(--af-navy);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.af-borrower-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.af-card--borrower-summary {
  position: sticky;
  top: 18px;
}

.af-borrower-facts {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.af-borrower-facts div {
  padding: 12px 13px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: #fbfcff;
}

.af-borrower-facts dt {
  margin: 0 0 5px;
  color: #7a8397;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.af-borrower-facts dd {
  margin: 0;
  color: var(--af-navy);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.025em;
}

.af-borrower-checklist-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--af-line);
}

.af-card-head--micro {
  margin-bottom: 10px;
}

.af-card-head--micro h3 {
  margin: 0;
  color: var(--af-navy);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.04em;
}

.af-borrower-checklist {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.af-borrower-check-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: #fff;
}

.af-borrower-check-row.is-supplied,
.af-borrower-check-row.is-approved,
.af-borrower-check-row.is-waived {
  background: var(--af-green-soft);
  border-color: rgba(15, 166, 114, .22);
}

.af-borrower-check-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--af-blue);
  background: var(--af-blue-soft);
  font-size: 12px;
}

.af-borrower-check-row.is-supplied .af-borrower-check-icon,
.af-borrower-check-row.is-approved .af-borrower-check-icon,
.af-borrower-check-row.is-waived .af-borrower-check-icon {
  color: var(--af-green);
  background: #dff6ed;
}

.af-borrower-check-main {
  min-width: 0;
}

.af-borrower-check-main strong {
  display: block;
  color: var(--af-navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.af-borrower-check-main small {
  display: block;
  margin-top: 3px;
  color: var(--af-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.af-borrower-check-row .af-status-chip {
  white-space: nowrap;
}

.af-borrower-form {
  padding: 24px;
}

.af-form-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--af-line);
}

.af-field--span {
  grid-column: 1 / -1;
}

.af-textarea--sm {
  min-height: 96px;
  resize: vertical;
}

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

.af-doc-ready-grid label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: #fbfcff;
  color: var(--af-navy);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.af-doc-ready-grid input,
.af-declaration-row input {
  accent-color: var(--af-blue);
}

.af-declaration-row {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--af-line);
  border-radius: 13px;
  background: #fbfcff;
  color: #4e5871;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.af-borrower-success {
  padding: 26px;
  border-radius: var(--af-radius);
  border: 1px solid rgba(15, 166, 114, .22);
  background: linear-gradient(180deg, #ffffff 0%, #f1fbf7 100%);
}

.af-borrower-success-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--af-green);
  background: #dff6ed;
  font-size: 18px;
  margin-bottom: 14px;
}

.af-borrower-success h2 {
  margin: 0 0 8px;
  color: var(--af-navy);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -.055em;
}

.af-borrower-success p {
  margin: 0 0 16px;
  color: #5f687c;
  font-size: 14px;
  line-height: 1.5;
}

.af-invalid-link {
  width: min(780px, calc(100vw - 32px));
  margin: 32px auto;
  padding: 34px;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: #fff;
  box-shadow: var(--af-shadow-soft);
}

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

@media (max-width: 980px) {
  .af-borrower-grid {
    grid-template-columns: 1fr;
  }

  .af-card--borrower-summary {
    position: static;
  }

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

@media (max-width: 760px) {
  .af-nav--borrower {
    align-items: flex-start;
  }

  .af-secure-pill {
    width: 100%;
    justify-content: center;
  }

  .af-borrower-ref-tile {
    width: 100%;
    margin-top: 14px;
  }

  .af-borrower-facts,
  .af-doc-ready-grid {
    grid-template-columns: 1fr;
  }

  .af-borrower-form {
    padding: 18px;
  }
}
