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

.calculator-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
}

#calc-title {
  text-align: center;
  font-size: 28px;
  color: #1976D2;
  margin: 0 0 20px 0;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h2 {
  font-size: 18px;
  color: #333333;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e3f2fd;
}

.input-section {
  text-align: center;
}

#usage-label {
  font-size: 16px;
  color: #333333;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.input-row {
  margin-bottom: 14px;
}

#water-usage {
  width: 100%;
  max-width: 320px;
  height: 48px;
  font-size: 20px;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  padding: 0 12px;
}

#water-usage:focus {
  border-color: #2196F3;
}

.preset-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 8px 20px;
  font-size: 14px;
  border: 1px solid #2196F3;
  color: #2196F3;
  background: #ffffff;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #2196F3;
  color: #ffffff;
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.tier-header h2 {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.tier-toggle {
  font-size: 14px;
  color: #666666;
  transition: transform 0.3s;
}

.tier-toggle.collapsed {
  transform: rotate(-90deg);
}

.tier-body {
  margin-top: 16px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tier-body.collapsed {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.tier-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333333;
}

.tier-row:last-child {
  border-bottom: none;
}

.tier-label {
  font-weight: 600;
  color: #1976D2;
  min-width: 70px;
}

.tier-range-label {
  color: #666666;
}

.tier-end,
.tier-price {
  width: 70px;
  height: 36px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  padding: 0 4px;
}

.tier-end:focus,
.tier-price:focus {
  border-color: #2196F3;
}

.sewage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  font-size: 14px;
  color: #333333;
}

.sewage-row label {
  font-weight: 600;
  color: #1976D2;
  min-width: 160px;
}

#sewage-price,
#sewage-ratio {
  width: 80px;
  height: 36px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  padding: 0 4px;
}

#sewage-price:focus,
#sewage-ratio:focus {
  border-color: #2196F3;
}

.tier-detail-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

.tier-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tier-detail-table thead th {
  background: #e3f2fd;
  color: #1976D2;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.tier-detail-table tbody td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  color: #333333;
}

.tier-detail-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.sewage-fee-display {
  text-align: center;
  font-size: 16px;
  color: #333333;
  padding: 8px 0;
}

#sewage-fee-value {
  font-weight: 600;
  color: #1976D2;
  font-size: 18px;
}

.total-display {
  text-align: center;
  font-size: 18px;
  color: #333333;
  padding: 12px 0;
}

#total-value {
  font-weight: 700;
  color: #1976D2;
  font-size: 32px;
}

.summary-bar {
  text-align: center;
  font-size: 13px;
  color: #666666;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
}

#water-fee-ratio,
#sewage-fee-ratio {
  font-weight: 600;
  color: #333333;
}

.action-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.action-btn {
  padding: 10px 32px;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.reset-btn {
  background: #f5f5f5;
  color: #666666;
  border: 1px solid #e0e0e0;
}

.reset-btn:hover {
  background: #e0e0e0;
}

.copy-btn {
  background: #2196F3;
  color: #ffffff;
}

.copy-btn:hover {
  background: #1976D2;
}

@media (max-width: 480px) {
  .calculator-container {
    padding: 12px 8px;
  }

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

  .card {
    padding: 14px;
    margin-bottom: 12px;
  }

  .tier-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .sewage-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .sewage-row label {
    min-width: auto;
  }

  #total-value {
    font-size: 26px;
  }

  .preset-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}
