* {
  box-sizing: border-box;
}

/* 1. 눈에 띄는 청록색 커스텀 스크롤바 */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #0d9488;
  border: 2px solid #f1f5f9;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0f766e;
}

body {
  margin: 0;
  background: #f1f5f9;
  color: #1e293b;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans KR",
    sans-serif;
}

button,
input {
  font: inherit;
}

.container {
  width: min(760px, 100%);
  margin: auto;
  padding: 25px 15px 50px;
}

.header {
  text-align: center;
  padding: 10px 5px 25px;
}

h1 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: -1.5px;
  color: #0f172a;
  font-weight: 800;
}

.header p {
  margin: 0;
  color: #475569;
  font-size: 15px;
  font-weight: 500;
}

/* 2. 카드 테두리를 선명한 청록색으로 강조 */
.card {
  background: white;
  border: 3px solid #0d9488;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.1);
}

.card h2 {
  margin: 0 0 20px;
  font-size: 21px;
  color: #0f172a;
}

.form-group {
  margin-bottom: 20px;
}

.form-group > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #334155;
}

/* 3. 입력창 구조 복구 및 테두리 강조 */
.input-box {
  display: flex;
  align-items: center;
  border: 2px solid #0d9488;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: all 0.2s ease;
}

.input-box:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.input-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px;
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  background: transparent;
}

.input-box span {
  padding-right: 14px;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

/* 4. 2분할 레이아웃 정상 복구 */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.radio-group {
  display: flex;
  gap: 10px;
}

.radio-label {
  flex: 1;
  display: flex;
  align-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 13px;
  cursor: pointer;
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

.radio-label:has(input:checked) {
  border-color: #0d9488;
  background: #f0fdf4;
  color: #166534;
}

.radio-label input {
  margin-right: 8px;
  accent-color: #0d9488;
}

/* 5. 버튼 그룹 정렬 복구 */
.button-group {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
  margin-top: 25px;
}

button {
  border: 0;
  border-radius: 12px;
  min-height: 52px;
  cursor: pointer;
  font-weight: 800;
  transition: filter 0.2s ease;
}

button:hover {
  filter: brightness(0.95);
}

.calculate {
  background: #0d9488;
  color: white;
}

.reset {
  background: #e2e8f0;
  color: #334155;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-header h2 {
  margin-bottom: 0;
}

#status {
  font-size: 13px;
  font-weight: 800;
  color: #0d9488;
}

.main-result {
  text-align: center;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 15px;
  padding: 22px;
  margin: 20px 0;
}

.main-result p {
  margin: 0 0 5px;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
}

.main-result strong {
  display: block;
  font-size: clamp(32px, 8vw, 46px);
  letter-spacing: -1px;
  color: #14532d;
}

.main-result small {
  margin-top: 5px;
  color: #15803d;
  font-weight: 600;
}

.result-list {
  border-top: 2px solid #e2e8f0;
}

.result-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 2px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-weight: 500;
}

.result-list .total {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.result-list strong {
  text-align: right;
  color: #0f172a;
}

.message {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
  border: 2px solid #86efac;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 700;
}

.message.warning {
  background: #fefce8;
  color: #854d0e;
  border: 2px solid #fde047;
}

.formula {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px dashed #cbd5e1;
}

.formula h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #334155;
}

.formula p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 500;
}

/* 하단 텍스트 가이드 */
.simple-guide {
  padding: 15px 5px;
  margin-top: 15px;
}

.simple-guide h2 {
  font-size: 16px;
  color: #334155;
  margin-bottom: 10px;
  font-weight: 700;
}

.simple-guide ul {
  margin: 0;
  padding-left: 20px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.simple-guide li {
  margin-bottom: 6px;
}

.simple-guide .notice {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 12px;
}

footer {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  margin-top: 20px;
  font-weight: 600;
}

.hidden {
  display: none;
}

@media (max-width: 560px) {
  .container {
    padding: 12px 10px 35px;
  }

  .card {
    padding: 18px 16px;
    border-radius: 15px;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .radio-group {
    flex-direction: column;
  }

  .button-group {
    grid-template-columns: 1fr 90px;
  }
}