/* Readable mobile summary, placed between the original comparison artwork
   and the original green form banner. Desktop keeps the existing artwork. */
.comparison-readable,
.hero-form-banner {
  display: none;
}

@media (max-width: 1023px) {
  /* Keep the original comparison in exactly the same location while separating
     the form banner from the first-viewport artwork. */
  .hero .hero-artwork {
    aspect-ratio: 1280 / 1743;
  }

  .hero .hero-artwork .estimate-comparison {
    top: 68.1478%;
    height: 26.9384%;
  }

  .hero .comparison-readable {
    display: block;
    order: 1;
    width: 90%;
    margin: 10px auto 16px;
    padding: 13px 12px 12px;
    border: 1px solid #d6e6dd;
    border-radius: 8px;
    background: #fff;
    color: #173b2c;
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
  }

  .comparison-readable__title {
    margin: 0 0 9px;
    color: #244a37;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
  }

  .comparison-readable__prices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .comparison-readable__prices li {
    min-width: 0;
    padding: 6px 2px;
    border: 1px solid #d5dbd7;
    border-radius: 5px;
    background: #f6f7f6;
    color: #303a34;
    text-align: center;
  }

  .comparison-readable__prices li:first-child {
    border-color: #45a175;
    background: #edf8f1;
    color: #08713c;
  }

  .comparison-readable__company {
    display: block;
    font-size: 13px;
    font-weight: 700;
  }

  .comparison-readable__amount {
    display: block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
  }

  .comparison-readable__difference {
    margin: 9px 0 4px;
    color: #a94108;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
  }

  .comparison-readable__difference strong {
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
  }

  .comparison-readable__note {
    margin: 0;
    color: #4d5650;
    font-size: 12px;
    line-height: 1.6;
  }

  .hero .hero-form-banner {
    position: relative;
    display: block;
    order: 2;
    width: 100%;
    aspect-ratio: 1280 / 401;
    flex: none;
    background-image: url('../images/fv_sp.webp');
    background-repeat: no-repeat;
    background-size: 100% auto;
    /* 1743 / (3800 - 401) places the banner at the crop boundary. */
    background-position: center 51.28%;
  }

  /* Preserve the original photo in the side margins around the green banner. */
  .hero .hero-form-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url('../images/fv-sp-background-original.webp');
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: center 51.28%;
    clip-path: polygon(
      0 1.25%, 4.84375% 1.25%, 4.84375% 100%,
      95.15625% 100%, 95.15625% 1.25%, 100% 1.25%,
      100% 100%, 0 100%
    );
  }

  .hero #form_top {
    order: 3;
  }
}

/* Match the picture sources so the phone artwork and banner share one download. */
@media (max-width: 480px) and (max-resolution: 2dppx) {
  .hero .hero-form-banner {
    background-image: url('../images/fv-sp-960-q92.webp');
  }

  .hero .hero-form-banner::before {
    background-image: url('../images/fv-sp-background-original-960-q92.webp');
  }
}
