/* ===================================
   Home – 総額の内訳テーブル（プラン直後）
   =================================== */

.home-estimate {
  padding: var(--space-lg) 0;
  background-color: var(--color-white);
}

@media (min-width: 768px) {
  .home-estimate {
    padding: var(--space-xl) 0;
  }
}

.home-estimate .section-title {
  margin-bottom: var(--space-sm);
}

.home-estimate__lead {
  margin: 0 0 var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: 1.8;
  color: var(--color-text-sub);
  text-align: center;
}

.home-estimate__table-wrap {
  width: 100%;
  max-width: 960px;
  margin-right: auto;
  margin-left: auto;
  overflow-x: auto;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
}

.home-estimate__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-sans);
  font-size: var(--type-body);
}

.home-estimate__mobile {
  display: none;
}

.home-estimate__caption {
  padding: 18px 24px 14px;
  caption-side: top;
  text-align: left;
  font-size: var(--type-body);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  color: var(--color-text);
  background-color: var(--color-bg-sub);
  border-bottom: 1px solid var(--color-hairline);
}

.home-estimate__table th,
.home-estimate__table td {
  padding: 14px 24px;
  vertical-align: baseline;
  text-align: left;
  border-bottom: 1px solid var(--color-hairline);
  line-height: 1.55;
}

.home-estimate__table thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: var(--type-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text-sub);
  background-color: transparent;
  border-bottom: 1px solid var(--color-hairline);
  white-space: nowrap;
}

.home-estimate__table col.home-estimate__col-type {
  width: 16%;
}

.home-estimate__table col.home-estimate__col-detail {
  width: 50%;
}

.home-estimate__table col.home-estimate__col-amount {
  width: 34%;
}

.home-estimate__table tbody th[scope='row'] {
  font-weight: var(--font-weight-normal);
  color: var(--color-text);
  white-space: nowrap;
}

.home-estimate__table thead th:not(:last-child),
.home-estimate__table tbody th:not(:last-child),
.home-estimate__table tbody td:not(:last-child),
.home-estimate__table tfoot th:not(:last-child),
.home-estimate__table tfoot td:not(:last-child) {
  border-right: 1px solid var(--color-hairline);
}

.home-estimate__table tbody td {
  color: var(--color-text);
}

.home-estimate__note {
  display: inline;
  margin-left: 0.5em;
  font-size: var(--type-label);
  font-weight: 400;
  color: var(--color-text-sub);
}

.home-estimate__note::before {
  content: '（';
}

.home-estimate__note::after {
  content: '）';
}

.home-estimate__amount {
  text-align: right;
  font-family: var(--font-inter);
  font-size: 1.0625rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--color-text);
}

.home-estimate__table thead th:last-child,
.home-estimate__table tbody td:last-child,
.home-estimate__table tfoot td:last-child {
  text-align: right;
}

.home-estimate__table tfoot th,
.home-estimate__table tfoot td {
  border-bottom: 0;
  padding-top: 18px;
  padding-bottom: 18px;
  background-color: transparent;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.home-estimate__table tfoot tr {
  border-top: 1px solid var(--color-border);
}

.home-estimate__table .home-estimate__amount--total {
  font-size: clamp(1.25rem, 2.8vw, 1.5rem);
  font-weight: 600;
  color: var(--color-main);
  white-space: normal;
  line-height: 1.25;
}

.home-estimate__total-main,
.home-estimate__total-suffix {
  display: inline;
}

.home-estimate__total-suffix {
  margin-left: 0.15em;
  font-family: var(--font-sans);
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(var(--color-main-rgb), 0.72);
  vertical-align: 0.12em;
}

.home-estimate__guarantee {
  margin: var(--space-md) auto 0;
  width: 100%;
  max-width: 960px;
  padding: 16px 20px;
  background-color: var(--structure-tab-muted-bg);
  border: 1px solid rgba(var(--color-main-rgb), 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  font-weight: 500;
  line-height: 1.7;
  color: var(--color-main);
  text-align: center;
}

.home-estimate__more {
  margin: var(--space-md) 0 0;
  text-align: center;
}

.home-estimate__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background-color: var(--color-main);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition);
}

@media (hover: hover) {
  .home-estimate__cta:hover {
    background-color: var(--color-main-dark);
  }
}

.home-estimate__cta:focus-visible {
  outline: 2px solid var(--color-main);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .home-estimate__table-wrap {
    display: none;
  }

  .home-estimate__mobile {
    display: block;
    width: 100%;
    overflow: visible;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    background-color: var(--color-white);
  }

  .home-estimate__mobile-caption {
    margin: 0;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--color-hairline);
    background-color: var(--color-bg-sub);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--color-text);
  }

  .home-estimate__mobile-list {
    margin: 0;
  }

  .home-estimate__mobile-item {
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid var(--color-hairline);
  }

  .home-estimate__mobile-item:last-child {
    border-bottom: 0;
  }

  .home-estimate__mobile-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  .home-estimate__mobile-label,
  .home-estimate__mobile-amount,
  .home-estimate__mobile-detail {
    margin: 0;
  }

  .home-estimate__mobile-label {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
  }

  .home-estimate__mobile-amount {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-inter);
    font-size: 1.0625rem;
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .home-estimate__mobile-detail {
    padding-top: 0;
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--color-text-sub);
  }

  .home-estimate__mobile-item--total {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .home-estimate__mobile-amount--total {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-main);
  }

  .home-estimate__mobile-amount--total .home-estimate__total-suffix {
    font-size: 0.58em;
  }

  .home-estimate__guarantee {
    padding: 14px 16px;
    font-size: var(--font-size-sm);
  }
}
