/* ============================================================
   깨알도구
   복리 계산기 전용 CSS

   공통:
   ../../css/tool-common.css
   ============================================================ */

/* ============================================================
   PAGE
   ============================================================ */

.tool-page {
  --tool-page-max-width: 960px;
}

/* ============================================================
   CALCULATOR
   ============================================================ */

.compound-calculator {
  grid-template-columns:
    minmax(0, 0.94fr)
    minmax(0, 1.06fr);

  align-items: start;
}

/* ============================================================
   INPUT GRID
   ============================================================ */

.rate-input-grid,
.period-input-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 8px;
}

/* ============================================================
   PERIOD HELP
   ============================================================ */

.period-help {
  display: flex;

  align-items: flex-start;

  gap: 6px;

  margin-top: 10px;

  padding: 9px 10px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.55;
}

/* ============================================================
   SUMMARY
   ============================================================ */

.compound-summary-grid {
  margin-top: 8px;
}

/* ============================================================
   RATE GAP
   ============================================================ */

.rate-gap-row {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-top: 9px;

  padding: 9px 11px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;
}

.rate-gap-row[hidden] {
  display: none;
}

.rate-gap-row strong {
  flex: 0 0 auto;

  color: var(--text);

  font-size: 12px;

  font-weight: 900;
}

/* ============================================================
   COMPARISON TITLE
   ============================================================ */

.comparison-title {
  margin-top: 17px;

  margin-bottom: 6px;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

/* ============================================================
   COMPARISON TABLE

   가로 스크롤을 사용하지 않는다.
   ============================================================ */

.comparison-table-wrap {
  width: 100%;

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 10px;

  background: #ffffff;
}

.comparison-table {
  width: 100%;

  min-width: 0;

  table-layout: fixed;

  border-collapse: collapse;
}

/* 방식 */

.comparison-table th:nth-child(1),
.comparison-table td:nth-child(1) {
  width: 16%;
}

/* 금리 A */

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  width: 30%;
}

/* 금리 B */

.comparison-table th:nth-child(3),
.comparison-table td:nth-child(3) {
  width: 30%;
}

/* 차이 */

.comparison-table th:nth-child(4),
.comparison-table td:nth-child(4) {
  width: 24%;
}

/* ============================================================
   TABLE CELLS
   ============================================================ */

.comparison-table th,
.comparison-table td {
  min-width: 0;

  padding: 8px 3px;

  border-bottom: 1px solid #efeee9;

  vertical-align: middle;
}

.comparison-table th {
  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;

  font-weight: 800;

  line-height: 1.25;

  text-align: right;

  word-break: keep-all;
}

.comparison-table th:first-child {
  text-align: left;
}

.comparison-table td {
  color: var(--text);

  font-size: 12px;

  line-height: 1.25;

  text-align: right;
}

.comparison-table td:first-child {
  font-size: 12px;

  font-weight: 800;

  text-align: left;

  word-break: keep-all;
}

.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ============================================================
   RESULT VALUE
   ============================================================ */

.comparison-value {
  min-width: 0;
}

.comparison-value strong {
  display: block;

  max-width: 100%;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;

  line-height: 1.25;

  letter-spacing: -0.35px;

  overflow-wrap: anywhere;
}

.comparison-value small {
  display: block;

  max-width: 100%;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.3;

  letter-spacing: -0.15px;

  overflow-wrap: anywhere;
}

/* ============================================================
   DIFFERENCE
   ============================================================ */

.compare-difference {
  min-width: 0;

  font-size: 12px;

  font-weight: 800;

  line-height: 1.25;

  letter-spacing: -0.35px;

  overflow-wrap: anywhere;
}

.compare-difference.positive {
  color: var(--brand);
}

.compare-difference.negative {
  color: #a24b3b;
}

/* ============================================================
   ONE RATE ONLY
   ============================================================ */

.comparison-table.single-rate th:nth-child(1),
.comparison-table.single-rate td:nth-child(1) {
  width: 28%;
}

.comparison-table.single-rate th:nth-child(2),
.comparison-table.single-rate td:nth-child(2) {
  width: 72%;
}

/* ============================================================
   FORMULA
   ============================================================ */

.compound-formula-box strong {
  font-size: 12px;

  line-height: 1.55;
}

/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 760px) {
  .compound-calculator {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {
  .comparison-table th,
  .comparison-table td {
    padding: 7px 2px;
  }

  .comparison-table th {
    font-size: 12px;
  }

  .comparison-table td:first-child {
    font-size: 12px;
  }

  .comparison-value strong,
  .compare-difference {
    font-size: 12px;

    letter-spacing: -0.45px;
  }

  .comparison-value small {
    font-size: 12px;
  }
}
