/* Real Estimates section (before and after proof). Loaded by index.html only. */
.ep-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.ep-head .lede {
  max-width: 720px;
}
/* From tablets up the English / Español switch keeps its own column on the right, level with the caption,
   in both languages (the longer Spanish heading used to push it down to the left). */
@media (min-width: 700px) {
  .ep-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px 24px;
  }
  .ep-head .stack-head {
    display: contents;
  }
  .ep-head h2 {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .ep-head .lede {
    grid-column: 1;
    grid-row: 2;
  }
  .ep-head .ep-caption {
    grid-column: 1;
    grid-row: 3;
  }
  .ep-head .ep-lang {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: end;
  }
}
.ep-lang,
.ep-v-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
}
.ep-lang button,
.ep-v-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ep-lang button[aria-pressed="true"],
.ep-v-tabs button[aria-pressed="true"] {
  background: var(--raised);
  color: var(--text);
}
/* Heading in threes: the third part is the money part, in gold. */
.ep-gain {
  color: var(--gold);
}
.ep-caption {
  font-size: 15px;
  color: var(--steel);
}

/* Three cars, always one row on computers and tablets, one on top of another on phones. */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}
/* The whole card opens the viewer. */
.ep-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--raised);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.ep-card:hover {
  border-color: rgba(57, 191, 245, 0.55);
  transform: translateY(-2px);
}
.ep-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-radius: 12px;
}
/* Whole letter page, never cropped. */
.ep-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  aspect-ratio: 612 / 792;
}
.ep-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ep-thumb b {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(6, 10, 14, 0.82);
  color: var(--steel);
}
.ep-thumb--ours b {
  color: var(--gold);
}
.ep-car {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ep-car strong {
  font-size: 19px;
  font-weight: 700;
}
.ep-car span {
  font-size: 14px;
  color: var(--steel);
}
.ep-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ep-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ep-row-t {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 15px;
}
.ep-row-t span {
  color: var(--steel);
}
.ep-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--line-3);
}
.ep-bar i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--grey);
}
.ep-bar--gold i {
  background: var(--gold);
}
.ep-more {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  font-size: 16px;
  font-weight: 600;
}
.ep-more .num {
  font-size: 30px;
  line-height: 1.1;
}
.ep-fine {
  font-size: 13px;
  line-height: 1.45;
  color: var(--steel);
}
.ep-card .ep-fine {
  margin-top: auto;
}
/* One clear way in: full width, cyan, with an arrow that moves when the card is hovered. */
.ep-cta {
  align-self: stretch;
  gap: 10px;
  min-height: 50px;
  border-color: var(--cyan);
  background: rgba(57, 191, 245, 0.1);
  color: var(--cyan);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.ep-card:hover .ep-cta,
.ep-cta:focus-visible {
  background: var(--cyan);
  color: #04121a;
}
.ep-cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.ep-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.money-link .ep-arrow {
  margin-left: 6px;
}
.ep-card:hover .ep-arrow,
.money-link:hover .ep-arrow {
  transform: translateX(4px);
}
@media (prefers-reduced-motion: reduce) {
  .ep-card,
  .ep-arrow {
    transition: none;
  }
  .ep-card:hover {
    transform: none;
  }
}
.ep-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
}
.ep-foot p {
  font-size: 18px;
  color: var(--text-2);
}
/* Tablets: same one row, a little tighter. */
@media (max-width: 1023px) {
  .ep-grid {
    gap: 14px;
  }
  .ep-card {
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
  }
  .ep-car strong {
    font-size: 17px;
  }
  .ep-row-t {
    font-size: 14px;
  }
  .ep-more {
    font-size: 15px;
  }
  .ep-more .num {
    font-size: 24px;
  }
}

/* The closed chat button (78px, 16px from the edge until the page column leaves room) must not
   cover card 3: from 1000px up the section keeps a right margin that clears it. */
@media (min-width: 1000px) {
  #real-estimates > .inner {
    padding-right: calc(24px + max(0px, 78px - max(0px, (100vw - 1200px) / 2)));
  }
}
/* Tablets: two lines kept for the car name so the rows line up across the three cards. */
@media (min-width: 700px) and (max-width: 860px) {
  .ep-car strong {
    min-height: 2.5em;
    line-height: 1.25;
  }
}

/* Viewer: both estimates side by side, same step on both, whole pages the same size. */
.ep-viewer {
  width: min(1240px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--plate);
  color: var(--text);
}
.ep-viewer::backdrop {
  background: rgba(2, 4, 6, 0.9);
}
.ep-v-in {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 18px 20px;
}
.ep-v-top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 20px;
  margin: 0 -18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  background: var(--plate);
}
.ep-v-title strong {
  display: block;
  font-size: 20px;
}
.ep-v-title span {
  font-size: 14px;
  color: var(--steel);
}
.ep-v-close {
  justify-self: end;
}
/* Back / Next with "Page 1 of 2" in the middle of the top bar. */
.ep-v-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ep-v-count {
  min-width: 96px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ep-v-tabs {
  display: none;
  align-self: center;
}
/* Two whole pages, the same size, as large as the window allows without cutting the bottom off. */
.ep-v-stage {
  position: relative;
  width: min(100%, calc((100vh - 215px) * 1.5454 + 14px));
  margin: 0 auto;
}
.ep-viewer.is-zoomed .ep-v-stage {
  width: 100%;
}
.ep-v-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
/* Side arrows: overlaid on the left and right edges of the estimate pages, centered up and down. */
.ep-v-side {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  padding: 0;
  border: 1px solid rgba(237, 243, 246, 0.35);
  border-radius: 50%;
  background: rgba(60, 72, 80, 0.55);
  color: rgba(237, 243, 246, 0.8);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.ep-v-side[hidden] {
  display: none;
}
.ep-v-side--prev {
  left: 8px;
}
.ep-v-side--next {
  right: 8px;
}
.ep-v-side svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ep-v-side:hover,
.ep-v-side:focus-visible {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #04121a;
  opacity: 1;
}
.ep-v-side:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.ep-v-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ep-v-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}
.ep-v-label .num {
  font-size: 17px;
}
.ep-v-col--ours .ep-v-label {
  color: var(--gold);
}
.ep-v-page {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  aspect-ratio: 1275 / 1650;
  cursor: zoom-in;
}
.ep-v-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ep-v-page:focus-visible,
.ep-v-zoom-page:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
/* One page full size: as wide as the viewer, wider than a phone (scroll sideways). */
.ep-v-zoom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: auto;
}
.ep-v-zoom[hidden],
.ep-v-cols[hidden] {
  display: none;
}
.ep-v-zoom-bar {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 15px;
  font-weight: 700;
}
.ep-v-zoom-page {
  display: block;
  width: max(100%, 960px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  cursor: zoom-out;
}
.ep-v-zoom-page img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2550 / 3300;
}
.ep-v-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.ep-v-hint {
  font-size: 13px;
  color: var(--steel);
}
/* Tablets and small laptops (1024 x 768): the caption and the tap hint share one line, and the pages leave
   room for the footer so the viewer never needs scrolling. Spanish has a longer caption (two lines): its pages
   are a little smaller instead. */
@media (min-width: 700px) and (max-width: 1180px) {
  .ep-v-foot .ep-fine,
  .ep-v-hint {
    font-size: 12.5px;
  }
  .ep-v-foot {
    gap: 4px 12px;
  }
}
@media (min-width: 700px) {
  #real-estimates[lang="es"] .ep-v-cols {
    grid-template-columns: repeat(
      2,
      min(calc((100% - 14px) / 2), calc((100vh - 255px) * 0.7727))
    );
  }
}
.ep-v-close {
  min-width: 44px;
}
@media (max-width: 699px) {
  .ep-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ep-card {
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
  }
  .ep-car strong {
    font-size: 19px;
  }
  .ep-more .num {
    font-size: 28px;
  }
  .ep-v-in {
    padding: 0 12px 16px;
  }
  .ep-v-top {
    margin: 0 -12px;
    padding: 12px;
  }
  /* Phone: title and Close on top, Back / Page 1 of 2 / Next across the whole second row. */
  .ep-v-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .ep-v-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  /* one line for the longest car name ("2021 Tesla Model S Plaid") beside Close, down to 360px phones */
  .ep-v-title strong {
    font-size: clamp(16px, 4.6vw, 18px);
    white-space: nowrap;
  }
  .ep-v-close {
    grid-column: 2;
    grid-row: 1;
  }
  .ep-v-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 6px;
  }
  .ep-v-count {
    min-width: 0;
    font-size: 14px;
  }
  .ep-v-tabs {
    display: inline-flex;
  }
  .ep-v-cols {
    grid-template-columns: 1fr;
  }
  .ep-v-cols[data-side="first"] .ep-v-col--ours,
  .ep-v-cols[data-side="ours"] .ep-v-col--first {
    display: none;
  }
}
.stack-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ep-w24 {
  width: 23.5%;
}
.ep-w52 {
  width: 51.8%;
}
.ep-w34 {
  width: 34.2%;
}
.ep-w100 {
  width: 100%;
}
/* Money card: real car numbers (insurance wrote 3,864.36 of our 16,420.63). */
.mb-fill--real {
  width: 23.5%;
}
.money-link {
  align-self: flex-start;
  margin-top: -8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.money-link:hover {
  color: var(--text);
}
.ep-viewer .btn--line {
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
/* Title Case tag, not all caps. */
.money-tag {
  text-transform: none;
  letter-spacing: 0.02em;
}

/* 11-23 (mkt-1123): headline one phrase per line, one gold underline under the last line only. */
.ep-hl {
  display: block;
}
.ep-hl.ep-gain {
  width: fit-content;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--gold);
}
/* Viewer header: insurance in red with one thin straight red line under their price, ours the largest number in gold, then the difference. */
.ep-v-sum {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px 20px;
}
.ep-v-sum-i {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--steel);
}
.ep-v-sum-i .num {
  font-size: 20px;
  line-height: 1.15;
  color: var(--text);
}
.ep-v-sum-i--first,
.ep-v-col--first .ep-v-label span {
  color: #f0685c;
}
.ep-v-sum-i--first .num,
.ep-v-col--first .ep-v-label .num {
  padding-bottom: 2px;
  border-bottom: 1px solid #f0685c;
}
.ep-v-sum-i--ours {
  font-size: 18px;
  color: var(--gold);
}
.ep-v-sum-i--ours .num {
  font-size: 34px;
  color: var(--gold);
}
.ep-v-sum-i--diff .num {
  font-size: 24px;
  color: var(--gold);
}
.ep-v-col--ours .ep-v-label {
  font-size: 18px;
}
.ep-v-col--ours .ep-v-label .num {
  font-size: 22px;
}
@media (max-width: 720px) {
  .ep-v-sum {
    grid-row: 3;
    gap: 6px 8px;
  }
  .ep-v-sum-i {
    font-size: 12px;
  }
  .ep-v-sum-i--ours {
    font-size: 14px;
  }
  .ep-v-sum-i .num {
    font-size: 13px;
  }
  .ep-v-sum-i--ours .num {
    font-size: 17px;
  }
  .ep-v-sum-i--diff .num {
    font-size: 13px;
  }
}
