body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  min-height: 100%;
  width: 100%;
}

.app-wrapper {
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  padding: 1rem;
}

.app-wrapper * { box-sizing: border-box; }

.calculator-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

h1 {
  color: #1a202c;
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.subtitle {
  color: #4a5568;
  text-align: center;
  margin: 0 0 1.25rem 0;
  font-size: 0.95rem;
  font-weight: 400;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 2px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: white;
  color: #1a202c;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #006e80;
  box-shadow: 0 0 0 3px rgba(0, 110, 128, 0.1);
}

.form-group input[type="number"]::placeholder { color: #a0aec0; }

.radio-wrapper {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.radio-group {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
  color: #2d3748;
  gap: 0.5rem;
  flex: 1;
}

.radio-group:hover { background: #edf2f7; border-color: #cbd5e0; }

.radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #006e80;
  flex-shrink: 0;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.button-group button {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-calculate { background: #006e80; color: white; }
.btn-calculate:hover { background: #008496; }

.btn-reset { background: #e2e8f0; color: #4a5568; border: 1px solid #cbd5e0; }
.btn-reset:hover { background: #cbd5e0; }

.result-section {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #006e80;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: none;
}

.result-section.show {
  display: block;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.result-label {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: white;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: white;
}

.info-box {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.warning-box {
  background: rgba(255, 255, 255, 0.95);
  color: #744210;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

.error-message {
  background: #fed7d7;
  color: #c53030;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid #feb2b2;
  margin-top: 0.75rem;
  display: none;
  font-size: 0.875rem;
}

.error-message.show { display: block; }

@media (max-width: 768px) {
  .app-wrapper { padding: 0.75rem 0.5rem; }
  .calculator-container { padding: 1.25rem 1rem; }
  h1 { font-size: 1.25rem; }
  .button-group { flex-direction: column; }
  .result-value { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .radio-wrapper { flex-direction: column; }
}
