html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px;
}

#app-title {
  text-align: center;
  font-size: 28px;
  color: #1e293b;
  margin-bottom: 24px;
}

#calculator {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

#input-panel {
  flex: 1 1 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 14px;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 500;
}

.input-group input[type="number"] {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  color: #1e293b;
  box-sizing: border-box;
  transition: border-color 0.2s;
  outline: none;
}

.input-group input[type="number"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.toggle-group {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.toggle-btn {
  flex: 1;
  height: 40px;
  border: none;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.toggle-btn + .toggle-btn {
  border-left: 1px solid #cbd5e1;
}

.toggle-btn.active {
  background: #2563eb;
  color: #fff;
}

.toggle-btn:hover:not(.active) {
  background: #e2e8f0;
}

#btn-calculate {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

#btn-calculate:hover {
  background: #1d4ed8;
}

#btn-calculate:active {
  background: #1e40af;
}

#result-panel {
  flex: 1 1 500px;
  min-width: 0;
}

#result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.result-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 16px;
  text-align: center;
}

.result-label {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 6px;
}

.result-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.result-unit {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

#card-monthly .result-value {
  color: #2563eb;
}

#card-total-interest .result-value {
  color: #dc2626;
}

#card-total-payment .result-value {
  color: #16a34a;
}

#table-container {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#repayment-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

#repayment-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

#repayment-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 10px 8px;
  text-align: right;
  border-bottom: 2px solid #e2e8f0;
}

#repayment-table thead th:first-child {
  text-align: center;
}

#repayment-table tbody td {
  padding: 8px;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

#repayment-table tbody td:first-child {
  text-align: center;
  color: #64748b;
}

#repayment-table tbody tr:hover {
  background: #f8fafc;
}

.table-placeholder {
  text-align: center !important;
  color: #94a3b8 !important;
  padding: 32px 8px !important;
}

#__fork {
  text-align: center;
  margin: 24px 0;
}

#__fork button {
  height: 40px;
  padding: 0 24px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

#__fork button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

#features,
#scenarios,
#FAQ {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 20px;
}

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 20px;
  color: #1e293b;
  margin-bottom: 12px;
}

#features p {
  font-size: 14px;
  color: #475569;
  line-height: 1.8;
}

#scenarios ul {
  padding-left: 20px;
}

#scenarios li {
  font-size: 14px;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 6px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-top: 14px;
  margin-bottom: 4px;
}

#FAQ dd {
  font-size: 14px;
  color: #475569;
  line-height: 1.8;
  margin-left: 0;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  #calculator {
    flex-direction: column;
  }

  #app-title {
    font-size: 22px;
  }

  #result-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-value {
    font-size: 20px;
  }

  #table-container {
    max-height: 300px;
  }

  #repayment-table {
    font-size: 12px;
  }
}
