/* AI financing guide. Scoped to this page. */

.aib-page {
  background: linear-gradient(180deg, #f3fafb 0%, #ffffff 14rem);
  color: var(--color-text);
}

.aib-guide {
  max-width: 40rem;
  padding-bottom: 2.75rem;
}

.aib-guide h1,
.aib-guide h2,
.aib-guide h3 {
  color: var(--color-navy);
  text-wrap: balance;
}

.aib-guide p,
.aib-guide li,
.aib-guide figcaption {
  margin: 0;
}

.aib-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 1rem 0 0.85rem;
  color: #3e5366;
  font-size: 0.92rem;
}

.aib-hero {
  margin: 0 0 0.35rem;
}

.aib-guide .aib-eyebrow,
.aib-guide .aib-kicker,
.aib-guide .aib-when,
.aib-guide .aib-scenario,
.aib-guide .aib-close-kicker {
  margin: 0;
  color: var(--color-teal-text);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.aib-guide h1 {
  max-width: 16ch;
  margin: 0.35rem 0 0;
  font-size: clamp(1.85rem, 7.4vw, 2.85rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.aib-guide .aib-prose {
  margin: 0.7rem 0 0;
  color: #1c2b3a;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.45;
}

.aib-guide .aib-lede {
  max-width: 28rem;
  margin-top: 0.7rem;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  color: #16324a;
}

.aib-source-line {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.75rem 0 0;
  color: #3e5366;
  font-size: 0.95rem;
  line-height: 1.4;
}

.aib-source-line a {
  font-weight: 700;
}

.aib-asof {
  display: block;
}

.aib-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.95rem;
  margin-top: 0.55rem;
}

.aib-path a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--color-teal-text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.aib-path a:hover {
  border-bottom-color: currentColor;
}

.aib-section {
  margin: 0.85rem 0 0;
  padding: 1.05rem 0 0.15rem;
  border-top: 1px solid #e3ebf2;
  scroll-margin-top: 5.25rem;
}

.aib-section h2 {
  max-width: 18ch;
  margin: 0 0 0.7rem;
  font-size: clamp(1.4rem, 4.6vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.aib-section h3 {
  margin: 0.15rem 0 0.2rem;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.aib-section--soft {
  margin-top: 1rem;
  padding: 1rem 0.9rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: #f4f7fa;
}

.aib-section--soft + .aib-section {
  border-top: 0;
}

.aib-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 0.65rem;
  margin: 0;
}

.aib-compare-col p:last-child {
  color: #3e5366;
  font-size: 0.92rem;
  line-height: 1.35;
}

.aib-illu {
  display: block;
  width: auto;
  max-width: 8.5rem;
  height: 4.25rem;
  margin: 0 0 0.45rem;
}

.aib-guide .aib-bridge,
.aib-guide .aib-ask {
  max-width: 24ch;
  font-size: clamp(1.2rem, 4.2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--color-navy);
}

.aib-guide .aib-note,
.aib-guide figcaption.aib-note,
.aib-guide .aib-sources,
.aib-guide .aib-disclaimer,
.aib-guide .aib-optional p {
  color: #3e5366;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
}

.aib-guide .aib-note,
.aib-guide figcaption.aib-note {
  margin-top: 0.7rem;
}

.aib-scene {
  margin-top: 0.75rem;
}

.aib-loop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "fwd fwd"
    "big small"
    "pay rev"
    "back back";
  gap: 0.4rem 0.55rem;
  margin: 0.7rem 0 0;
  align-items: stretch;
}

.aib-dir {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 1.55rem;
  margin: 0.1rem 0;
  color: var(--color-navy);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.aib-dir--right { grid-area: fwd; }
.aib-dir--left { grid-area: back; }

.aib-dir::before {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  background: currentColor;
}

.aib-dir--right::before { left: 0; right: 0.65rem; }
.aib-dir--left::before { left: 0.65rem; right: 0; }

.aib-dir::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.aib-dir--right::after {
  right: 0.05rem;
  transform: translateY(-50%) rotate(45deg);
}

.aib-dir--left::after {
  left: 0.05rem;
  transform: translateY(-50%) rotate(-135deg);
}

.aib-dir span {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 2.8rem);
  padding: 0 0.4rem;
  background: #f4f7fa;
}

.aib-node {
  min-width: 0;
  padding: 0.7rem 0.7rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  background: #fff;
}

.aib-node .aib-kicker {
  display: block;
  margin-bottom: 0.2rem;
}

.aib-node strong {
  display: block;
  color: var(--color-navy);
  font-size: 1.05rem;
  line-height: 1.25;
}

.aib-node--large {
  grid-area: big;
  border-top: 3px solid var(--color-navy);
}

.aib-node--small {
  grid-area: small;
  border-top: 3px solid var(--color-teal-text);
}

.aib-node--pay {
  grid-area: pay;
  border: 1.5px dashed var(--color-green-text);
  background: #f3faf4;
}

.aib-revenue {
  grid-area: rev;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  color: var(--color-green-text);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}

.aib-revenue svg {
  display: block;
  width: 100%;
  height: 2.7rem;
}

.aib-rev--short {
  display: none;
}

.aib-scene:has(#aib-short:checked) .aib-node--pay {
  border-color: #7a5b16;
  background: #fbf8f1;
}

.aib-scene:has(#aib-short:checked) .aib-revenue {
  color: #7a5b16;
}

.aib-scene:has(#aib-short:checked) .aib-rev--steady {
  display: none;
}

.aib-scene:has(#aib-short:checked) .aib-rev--short {
  display: block;
}

.aib-demand {
  position: relative;
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.8rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 0.9rem;
  background: #fff;
}

.aib-demand legend {
  padding: 0 0.25rem;
  color: #3e5366;
  font-size: 0.92rem;
  font-weight: 700;
}

.aib-demand > input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.aib-demand label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin: 0.35rem 0.4rem 0 0;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-navy);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.aib-demand input:checked + label {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: #fff;
}

.aib-demand input:focus-visible + label {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.aib-guide .aib-state {
  margin: 0.65rem 0 0;
  color: #16324a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.aib-state--short {
  display: none;
}

#aib-short:checked ~ .aib-state--steady {
  display: none;
}

#aib-short:checked ~ .aib-state--short {
  display: block;
}

.aib-debt {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bars"
    "stock"
    "prose"
    "note";
  gap: 0.75rem;
  margin: 0;
}

.aib-bars { grid-area: bars; margin: 0; }
.aib-debt .aib-stock { grid-area: stock; margin-top: 0; }
.aib-debt .aib-prose { grid-area: prose; margin-top: 0; }
.aib-debt .aib-note { grid-area: note; margin-top: 0; }

.aib-bar-block + .aib-bar-block {
  margin-top: 0.85rem;
}

.aib-bar-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  margin: 0 0 0.35rem;
  color: var(--color-navy);
  font-size: 0.92rem;
  font-weight: 600;
}

.aib-bar-label strong {
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.aib-track {
  height: 0.85rem;
  border-radius: 999px;
  background: #e7eef3;
  overflow: hidden;
}

.aib-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.aib-bar--past {
  background: #096c80;
}

.aib-bar--now {
  background: #0b2e6b;
}

.aib-times {
  display: inline-block;
  margin: 0.7rem 0 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid #e4d3a8;
  border-radius: 999px;
  background: #fbf8f1;
  color: #7a5b16;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.aib-stock {
  margin-top: 0.9rem;
  padding: 0.8rem 0.85rem 0.85rem;
  border-left: 4px solid var(--color-green-text);
  border-radius: 0.35rem;
  background: #f3faf4;
}

.aib-guide .aib-figure {
  margin: 0.2rem 0 0.15rem;
  color: var(--color-navy);
  font-size: clamp(1.35rem, 4.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.aib-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.aib-pair article {
  min-width: 0;
  padding: 0.75rem 0.7rem 0.8rem;
  border-radius: 0.85rem;
  background: #f4f7fa;
}

.aib-defs {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.aib-defs li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.aib-defs svg {
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  margin-top: 0.1rem;
}

.aib-defs strong {
  display: block;
  color: var(--color-navy);
  font-size: 0.95rem;
  line-height: 1.3;
}

.aib-defs span {
  display: block;
  margin-top: 0.1rem;
  color: #3e5366;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
}

.aib-guide .aib-caveat {
  margin-top: 0.85rem;
  padding: 0.7rem 0.75rem;
  border-left: 3px solid #7a5b16;
  border-radius: 0.25rem;
  background: #fbf8f1;
  color: #1c2b3a;
  font-weight: 650;
}

.aib-guide .aib-scenario {
  color: #7a5b16;
}

.aib-chain {
  position: relative;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.aib-chain li {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.8rem;
  background: #fff;
  color: var(--color-navy);
  font-weight: 700;
  line-height: 1.35;
}

.aib-chain li:not(:last-child) {
  margin-bottom: 0.95rem;
}

.aib-chain li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  bottom: -0.8rem;
  width: 0.75rem;
  height: 0.7rem;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath fill='%230b2e6b' d='M7 12 1 4.5h3.2V0h5.6v4.5H13z'/%3E%3C/svg%3E");
}

.aib-step {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.aib-counterpoint {
  margin-top: 0.85rem;
  padding: 0.75rem 0.8rem 0.85rem;
  border-left: 4px solid var(--color-green-text);
  border-radius: 0.35rem;
  background: #f3faf4;
}

.aib-counterpoint .aib-prose:first-child {
  margin-top: 0;
}

.aib-guide .aib-counter {
  font-weight: 700;
  color: var(--color-navy);
}

.aib-guide .aib-sub {
  font-size: 0.98rem;
}

.aib-branch-root {
  margin: 0;
  color: var(--color-navy);
  font-size: 0.92rem;
  font-weight: 800;
}

.aib-branch ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  padding: 0.55rem 0 0;
  list-style: none;
  border-top: 2px solid #c5d5e2;
}

.aib-branch li {
  padding: 0.65rem 0.7rem;
  border-radius: 0.75rem;
  background: #fff;
}

.aib-branch strong {
  display: block;
  color: var(--color-navy);
  font-size: 0.95rem;
  line-height: 1.3;
}

.aib-branch span {
  display: block;
  margin-top: 0.15rem;
  color: #3e5366;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.35;
}

.aib-close {
  margin-top: 1.1rem;
  padding: 1.15rem 1rem 1rem;
  border: 0;
  border-radius: 1.1rem;
  background: var(--color-navy);
  color: #fff;
}

.aib-close .aib-close-kicker {
  color: #9fd4ea;
}

.aib-close h2,
.aib-guide .aib-close .aib-takeaway {
  max-width: 22ch;
  margin: 0.35rem 0 0;
  color: #fff;
  font-size: clamp(1.5rem, 5.4vw, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.aib-guide .aib-close .aib-next {
  color: #e7eef8;
  font-size: 1.05rem;
  font-weight: 600;
}

.aib-guide .aib-close .aib-limit {
  color: #d5e2f2;
  font-size: 0.92rem;
}

.aib-links {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.aib-links a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.7rem;
  background: #fff;
  color: var(--color-navy);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.aib-optional {
  margin-top: 0.75rem;
}

.aib-optional summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--color-navy);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.aib-optional p {
  margin: 0.15rem 0 0.35rem;
}

.aib-optional a,
.aib-guide .aib-note a,
.aib-guide .aib-counter a,
.aib-sources a {
  font-weight: 700;
}

.aib-ig[hidden] {
  display: none !important;
}

.aib-stage {
  aspect-ratio: 4 / 5;
  max-width: 26rem;
  margin-top: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-gray);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.aib-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.aib-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  max-width: 26rem;
  margin-top: 0.85rem;
}

.aib-count {
  margin: 0;
  color: var(--color-navy);
  font-weight: 800;
  text-align: center;
}

.aib-controls .btn {
  min-height: 2.75rem;
}

.aib-ig-link {
  margin: 0.85rem 0 0;
}

.aib-disclaimer {
  margin: 1.15rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid #e3ebf2;
}

.aib-sources {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.aib-page a:focus-visible,
.aib-page button:focus-visible,
.aib-page summary:focus-visible,
.aib-stage:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.aib-close a:focus-visible {
  outline-color: #fff;
}

@media (min-width: 23.5rem) {
  .aib-branch ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) {
  .aib-hero {
    margin-bottom: 0.5rem;
  }

  .aib-source-line {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.7rem;
  }

  .aib-debt {
    grid-template-columns: minmax(0, 1.4fr) minmax(11.5rem, 0.78fr);
    grid-template-areas:
      "bars stock"
      "prose prose"
      "note note";
    align-items: stretch;
  }

  .aib-stock {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

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

  .aib-controls {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}

@media (max-width: 22.5rem) {
  .aib-compare,
  .aib-pair,
  .aib-loop {
    gap: 0.45rem 0.4rem;
  }

  .aib-node,
  .aib-section--soft,
  .aib-demand,
  .aib-close {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .aib-illu {
    height: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aib-guide * {
    scroll-behavior: auto;
  }
}
